APM:Libraries
UARTDriver.cpp
Go to the documentation of this file.
1 
2 #include "UARTDriver.h"
3 
4 using namespace Empty;
5 
7 
8 void UARTDriver::begin(uint32_t b) {}
9 void UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS) {}
10 void UARTDriver::end() {}
12 bool UARTDriver::is_initialized() { return false; }
13 void UARTDriver::set_blocking_writes(bool blocking) {}
14 bool UARTDriver::tx_pending() { return false; }
15 
16 /* Empty implementations of Stream virtual methods */
17 uint32_t UARTDriver::available() { return 0; }
18 uint32_t UARTDriver::txspace() { return 1; }
19 int16_t UARTDriver::read() { return -1; }
20 
21 /* Empty implementations of Print virtual methods */
22 size_t UARTDriver::write(uint8_t c) { return 0; }
23 
24 size_t UARTDriver::write(const uint8_t *buffer, size_t size)
25 {
26  size_t n = 0;
27  while (size--) {
28  n += write(*buffer++);
29  }
30  return n;
31 }
static uint8_t buffer[SRXL_FRAMELEN_MAX]
Definition: srxl.cpp:56
size_t write(uint8_t c)
Definition: UARTDriver.cpp:22
void set_blocking_writes(bool blocking)
Definition: UARTDriver.cpp:13
int16_t read() override
Definition: UARTDriver.cpp:19
void begin(uint32_t b)
Definition: UARTDriver.cpp:8
uint32_t txspace() override
Definition: UARTDriver.cpp:18
uint32_t available() override
Definition: UARTDriver.cpp:17