APM:Libraries
|
#include <UARTDriver.h>
Public Types | |
enum | flow_control { FLOW_CONTROL_DISABLE =0, FLOW_CONTROL_ENABLE =1, FLOW_CONTROL_AUTO =2 } |
Public Member Functions | |
UARTDriver () | |
virtual void | begin (uint32_t baud)=0 |
virtual void | begin (uint32_t baud, uint16_t rxSpace, uint16_t txSpace)=0 |
virtual void | end ()=0 |
virtual void | flush ()=0 |
virtual bool | is_initialized ()=0 |
virtual void | set_blocking_writes (bool blocking)=0 |
virtual bool | tx_pending ()=0 |
virtual bool | lock_port (uint32_t key) |
virtual size_t | write_locked (const uint8_t *buffer, size_t size, uint32_t key) |
virtual void | set_flow_control (enum flow_control flow_control_setting) |
virtual enum flow_control | get_flow_control (void) |
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 | _timer_tick (void) |
virtual uint64_t | receive_time_constraint_us (uint16_t nbytes) |
![]() | |
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) |
virtual size_t | write (uint8_t)=0 |
virtual size_t | write (const uint8_t *buffer, size_t size) |
size_t | write (const char *str) |
virtual uint32_t | available ()=0 |
virtual int16_t | read ()=0 |
virtual uint32_t | txspace ()=0 |
Definition at line 9 of file UARTDriver.h.
Enumerator | |
---|---|
FLOW_CONTROL_DISABLE | |
FLOW_CONTROL_ENABLE | |
FLOW_CONTROL_AUTO |
Definition at line 47 of file UARTDriver.h.
|
inline |
|
inlinevirtual |
Reimplemented in HALSITL::UARTDriver, ChibiOS::UARTDriver, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Linux::SPIUARTDriver.
Definition at line 72 of file UARTDriver.h.
Referenced by HALSITL::Scheduler::_run_io_procs(), Linux::Scheduler::_run_uarts(), VRBRAIN::VRBRAINScheduler::_uart_thread(), and PX4::PX4Scheduler::_uart_thread().
|
pure virtual |
Implemented in ChibiOS::UARTDriver, F4Light::UARTDriver, HALSITL::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Empty::UARTDriver.
Referenced by AP_GPS_UBLOX::_parse_gps(), AP_Beacon_Marvelmind::AP_Beacon_Marvelmind(), AP_Beacon_Pozyx::AP_Beacon_Pozyx(), AP_Proximity_LightWareSF40C::AP_Proximity_LightWareSF40C(), AP_Proximity_RPLidarA2::AP_Proximity_RPLidarA2(), AP_Proximity_TeraRangerTower::AP_Proximity_TeraRangerTower(), AP_RangeFinder_Benewake::AP_RangeFinder_Benewake(), AP_RangeFinder_LeddarOne::AP_RangeFinder_LeddarOne(), AP_RangeFinder_LightWareSerial::AP_RangeFinder_LightWareSerial(), AP_RangeFinder_MaxsonarSerialLV::AP_RangeFinder_MaxsonarSerialLV(), AP_RangeFinder_NMEA::AP_RangeFinder_NMEA(), AP_RangeFinder_uLanding::AP_RangeFinder_uLanding(), AP_RangeFinder_Wasp::AP_RangeFinder_Wasp(), AP_GPS::detect_instance(), GCS_MAVLINK::handle_serial_control(), AP_DEVO_Telem::init(), main_loop(), HAL_Linux::run(), HAL_Empty::run(), HAL_SITL::run(), HAL_F4Light::run(), setup(), setup_uart(), GCS_MAVLINK::setup_uart(), THD_FUNCTION(), AP_Frsky_Telem::tick(), UARTDriver(), and AP_RangeFinder_Wasp::update().
|
pure 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. |
Implemented in F4Light::UARTDriver, ChibiOS::UARTDriver, HALSITL::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, Linux::SPIUARTDriver, and Empty::UARTDriver.
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver, HALSITL::UARTDriver, PX4::PX4UARTDriver, and VRBRAIN::VRBRAINUARTDriver.
Definition at line 53 of file UARTDriver.h.
|
pure virtual |
Implemented in F4Light::UARTDriver, ChibiOS::UARTDriver, HALSITL::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Empty::UARTDriver.
Referenced by AP_BoardConfig::px4_setup_px4io(), UARTDriver(), and AP_RangeFinder_Wasp::update().
|
pure virtual |
Implemented in F4Light::UARTDriver, ChibiOS::UARTDriver, HALSITL::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Empty::UARTDriver.
Referenced by UARTDriver().
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver, HALSITL::UARTDriver, Linux::UARTDriver, PX4::PX4UARTDriver, and VRBRAIN::VRBRAINUARTDriver.
Definition at line 51 of file UARTDriver.h.
Referenced by GCS_MAVLINK::have_flow_control(), and GCS_MAVLINK::setup_uart().
|
pure virtual |
Implemented in F4Light::UARTDriver, ChibiOS::UARTDriver, HALSITL::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Empty::UARTDriver.
Referenced by loop(), and UARTDriver().
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver.
Definition at line 41 of file UARTDriver.h.
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver, HALSITL::UARTDriver, Linux::UARTDriver, PX4::PX4UARTDriver, and F4Light::UARTDriver.
Definition at line 87 of file UARTDriver.h.
Referenced by GCS_MAVLINK::correct_offboard_timestamp_usec_to_ms(), and GCS_MAVLINK::timesync_receive_timestamp_ns().
|
pure virtual |
Implemented in F4Light::UARTDriver, ChibiOS::UARTDriver, HALSITL::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Empty::UARTDriver.
Referenced by setup(), and UARTDriver().
|
inlinevirtual |
Reimplemented in Linux::UARTDriver.
Definition at line 50 of file UARTDriver.h.
Referenced by AP_BoardConfig::board_setup_uart(), AP_GPS::detect_instance(), GCS_MAVLINK::handle_serial_control(), AP_DEVO_Telem::init(), AP_Frsky_Telem::init(), and GCS_MAVLINK::setup_uart().
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver, HALSITL::UARTDriver, PX4::PX4UARTDriver, and VRBRAIN::VRBRAINUARTDriver.
Definition at line 54 of file UARTDriver.h.
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver, HALSITL::UARTDriver, PX4::PX4UARTDriver, and VRBRAIN::VRBRAINUARTDriver.
Definition at line 59 of file UARTDriver.h.
|
pure virtual |
Implemented in HALSITL::UARTDriver, F4Light::UARTDriver, ChibiOS::UARTDriver, F4Light::USBDriver, F4Light::UART_PPM, F4Light::UART_OSD, Linux::UARTDriver, PX4::PX4UARTDriver, VRBRAIN::VRBRAINUARTDriver, and Empty::UARTDriver.
Referenced by AP_RangeFinder_Wasp::get_reading(), and UARTDriver().
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver.
Definition at line 66 of file UARTDriver.h.
|
inlinevirtual |
Reimplemented in ChibiOS::UARTDriver.
Definition at line 45 of file UARTDriver.h.