APM:Libraries
|
#include <UARTDriver.h>
Public Member Functions | |
UARTDriver (bool default_console) | |
void | begin (uint32_t b) |
void | begin (uint32_t b, uint16_t rxS, uint16_t txS) |
void | end () |
void | flush () |
bool | is_initialized () |
void | set_blocking_writes (bool blocking) |
bool | tx_pending () |
uint32_t | available () override |
uint32_t | txspace () override |
int16_t | read () override |
size_t | write (uint8_t c) |
size_t | write (const uint8_t *buffer, size_t size) |
void | set_device_path (const char *path) |
bool | _write_pending_bytes (void) |
virtual void | _timer_tick (void) override |
virtual enum flow_control | get_flow_control (void) override |
virtual void | set_flow_control (enum flow_control flow_control_setting) override |
uint64_t | receive_time_constraint_us (uint16_t nbytes) override |
![]() | |
UARTDriver () | |
virtual bool | lock_port (uint32_t key) |
virtual size_t | write_locked (const uint8_t *buffer, size_t size, uint32_t key) |
virtual void | configure_parity (uint8_t v) |
virtual void | set_stop_bits (int n) |
virtual bool | set_unbuffered_writes (bool on) |
virtual bool | wait_timeout (uint16_t n, uint32_t timeout_ms) |
![]() | |
virtual void | printf (const char *,...) FMT_PRINTF(2 |
virtual void virtual void | vprintf (const char *, va_list) |
void | print (const char *str) |
void | println (const char *str) |
size_t | write (const char *str) |
Static Public Member Functions | |
static UARTDriver * | from (AP_HAL::UARTDriver *uart) |
Protected Member Functions | |
virtual int | _write_fd (const uint8_t *buf, uint16_t n) |
virtual int | _read_fd (uint8_t *buf, uint16_t n) |
Protected Attributes | |
const char * | device_path |
volatile bool | _initialised |
ByteBuffer | _readbuf {0} |
ByteBuffer | _writebuf {0} |
Private Member Functions | |
void | _allocate_buffers (uint16_t rxS, uint16_t txS) |
void | _deallocate_buffers () |
AP_HAL::OwnPtr< SerialDevice > | _parseDevicePath (const char *arg) |
Private Attributes | |
AP_HAL::OwnPtr< SerialDevice > | _device |
bool | _nonblocking_writes |
bool | _console |
volatile bool | _in_timer |
uint16_t | _base_port |
uint32_t | _baudrate |
char * | _ip |
char * | _flag |
bool | _connected |
bool | _packetise |
uint64_t | _last_write_time |
uint64_t | _receive_timestamp [2] |
uint8_t | _receive_timestamp_idx |
Additional Inherited Members | |
![]() | |
enum | flow_control { FLOW_CONTROL_DISABLE =0, FLOW_CONTROL_ENABLE =1, FLOW_CONTROL_AUTO =2 } |
Definition at line 11 of file UARTDriver.h.
UARTDriver::UARTDriver | ( | bool | default_console | ) |
Definition at line 33 of file UARTDriver.cpp.
|
private |
Definition at line 94 of file UARTDriver.cpp.
Referenced by set_device_path().
|
private |
Definition at line 113 of file UARTDriver.cpp.
Referenced by _parseDevicePath().
|
private |
Definition at line 125 of file UARTDriver.cpp.
Referenced by set_device_path().
|
protectedvirtual |
Reimplemented in Linux::SPIUARTDriver.
Definition at line 343 of file UARTDriver.cpp.
Referenced by Linux::SPIUARTDriver::_read_fd(), and HALSITL::UARTDriver::_timer_tick().
|
overridevirtual |
Reimplemented from AP_HAL::UARTDriver.
Reimplemented in Linux::SPIUARTDriver.
Referenced by Linux::SPIUARTDriver::_timer_tick(), and from().
|
protectedvirtual |
Reimplemented in Linux::SPIUARTDriver.
Definition at line 324 of file UARTDriver.cpp.
Referenced by Linux::SPIUARTDriver::_write_fd(), and _write_pending_bytes().
bool UARTDriver::_write_pending_bytes | ( | void | ) |
Definition at line 353 of file UARTDriver.cpp.
Referenced by HALSITL::UARTDriver::_timer_tick(), and from().
|
overridevirtual |
Implements AP_HAL::BetterStream.
Referenced by _parseDevicePath(), HALSITL::UARTDriver::_timer_tick(), and from().
|
virtual |
Implements AP_HAL::UARTDriver.
Referenced by Linux::SPIUARTDriver::begin(), from(), and set_device_path().
|
virtual |
Extended port open method
Allows for both opening with specified buffer sizes, and re-opening to adjust a subset of the port's settings.
baud | Selects the speed that the port will be configured to. If zero, the port speed is left unchanged. |
rxSpace | Sets the receive buffer size for the port. If zero then the buffer size is left unchanged if the port is open, or set to ::_default_rx_buffer_size if it is currently closed. |
txSpace | Sets the transmit buffer size for the port. If zero then the buffer size is left unchanged if the port is open, or set to ::_default_tx_buffer_size if it is currently closed. |
Implements AP_HAL::UARTDriver.
|
virtual |
Implements AP_HAL::UARTDriver.
Referenced by _parseDevicePath(), and from().
|
virtual |
Implements AP_HAL::UARTDriver.
Referenced by _parseDevicePath(), and from().
|
inlinestatic |
|
inlineoverridevirtual |
Reimplemented from AP_HAL::UARTDriver.
Definition at line 42 of file UARTDriver.h.
|
virtual |
Implements AP_HAL::UARTDriver.
Referenced by _parseDevicePath(), Linux::SPIUARTDriver::begin(), and from().
|
overridevirtual |
Implements AP_HAL::BetterStream.
Referenced by _parseDevicePath(), and from().
|
overridevirtual |
Reimplemented from AP_HAL::UARTDriver.
Referenced by HALSITL::UARTDriver::_timer_tick(), and set_flow_control().
|
virtual |
Implements AP_HAL::UARTDriver.
Referenced by _parseDevicePath(), and from().
void UARTDriver::set_device_path | ( | const char * | path | ) |
Definition at line 46 of file UARTDriver.cpp.
Referenced by from(), and HAL_Linux::run().
|
inlineoverridevirtual |
Reimplemented from AP_HAL::UARTDriver.
Definition at line 47 of file UARTDriver.h.
|
virtual |
Implements AP_HAL::UARTDriver.
Referenced by _parseDevicePath(), and from().
|
overridevirtual |
Implements AP_HAL::BetterStream.
Referenced by _parseDevicePath(), and from().
|
virtual |
Implements AP_HAL::BetterStream.
Referenced by _parseDevicePath(), and from().
|
virtual |
Reimplemented from AP_HAL::BetterStream.
|
private |
Definition at line 72 of file UARTDriver.h.
Referenced by _parseDevicePath().
|
private |
Definition at line 73 of file UARTDriver.h.
Referenced by HALSITL::UARTDriver::_timer_tick(), and set_device_path().
|
private |
Definition at line 76 of file UARTDriver.h.
Referenced by _parseDevicePath(), _write_fd(), and set_device_path().
|
private |
Definition at line 70 of file UARTDriver.h.
Referenced by set_device_path(), and UARTDriver().
|
private |
Definition at line 68 of file UARTDriver.h.
Referenced by _parseDevicePath(), _read_fd(), _write_fd(), get_flow_control(), set_device_path(), and set_flow_control().
|
private |
Definition at line 75 of file UARTDriver.h.
Referenced by _parseDevicePath().
|
private |
Definition at line 71 of file UARTDriver.h.
Referenced by _parseDevicePath(), HALSITL::UARTDriver::_timer_tick(), and set_device_path().
|
protected |
Definition at line 91 of file UARTDriver.h.
Referenced by _allocate_buffers(), _parseDevicePath(), HALSITL::UARTDriver::_timer_tick(), Linux::SPIUARTDriver::begin(), and set_device_path().
|
private |
Definition at line 74 of file UARTDriver.h.
Referenced by _parseDevicePath().
|
private |
Definition at line 83 of file UARTDriver.h.
|
private |
Definition at line 69 of file UARTDriver.h.
Referenced by _parseDevicePath().
|
private |
Definition at line 77 of file UARTDriver.h.
Referenced by _parseDevicePath(), and _write_pending_bytes().
|
protected |
Definition at line 95 of file UARTDriver.h.
Referenced by _allocate_buffers(), _deallocate_buffers(), _parseDevicePath(), HALSITL::UARTDriver::_timer_tick(), Linux::SPIUARTDriver::_write_fd(), and Linux::SPIUARTDriver::begin().
|
private |
Definition at line 86 of file UARTDriver.h.
Referenced by HALSITL::UARTDriver::_timer_tick().
|
private |
Definition at line 87 of file UARTDriver.h.
Referenced by HALSITL::UARTDriver::_timer_tick().
|
protected |
Definition at line 96 of file UARTDriver.h.
Referenced by _allocate_buffers(), _deallocate_buffers(), _parseDevicePath(), _write_pending_bytes(), and Linux::SPIUARTDriver::begin().
|
protected |
Definition at line 90 of file UARTDriver.h.
Referenced by Linux::SPIUARTDriver::begin(), and set_device_path().