APM:Libraries
Public Types | Public Member Functions | List of all members
AP_HAL::UARTDriver Class Referenceabstract

#include <UARTDriver.h>

Inheritance diagram for AP_HAL::UARTDriver:
[legend]
Collaboration diagram for AP_HAL::UARTDriver:
[legend]

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)
 
- Public Member Functions inherited from AP_HAL::BetterStream
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
 

Detailed Description

Definition at line 9 of file UARTDriver.h.

Member Enumeration Documentation

◆ flow_control

Enumerator
FLOW_CONTROL_DISABLE 
FLOW_CONTROL_ENABLE 
FLOW_CONTROL_AUTO 

Definition at line 47 of file UARTDriver.h.

Constructor & Destructor Documentation

◆ UARTDriver()

AP_HAL::UARTDriver::UARTDriver ( )
inline

Definition at line 11 of file UARTDriver.h.

Here is the call graph for this function:

Member Function Documentation

◆ _timer_tick()

virtual void AP_HAL::UARTDriver::_timer_tick ( void  )
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().

Here is the caller graph for this function:

◆ begin() [1/2]

virtual void AP_HAL::UARTDriver::begin ( uint32_t  baud)
pure virtual

◆ begin() [2/2]

virtual void AP_HAL::UARTDriver::begin ( uint32_t  baud,
uint16_t  rxSpace,
uint16_t  txSpace 
)
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.

Note
Buffer sizes greater than ::_max_buffer_size will be rounded down.
Parameters
baudSelects the speed that the port will be configured to. If zero, the port speed is left unchanged.
rxSpaceSets 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.
txSpaceSets 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.

◆ configure_parity()

virtual void AP_HAL::UARTDriver::configure_parity ( uint8_t  v)
inlinevirtual

◆ end()

virtual void AP_HAL::UARTDriver::end ( )
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().

Here is the caller graph for this function:

◆ flush()

virtual void AP_HAL::UARTDriver::flush ( )
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().

Here is the caller graph for this function:

◆ get_flow_control()

virtual enum flow_control AP_HAL::UARTDriver::get_flow_control ( void  )
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().

Here is the caller graph for this function:

◆ is_initialized()

virtual bool AP_HAL::UARTDriver::is_initialized ( )
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().

Here is the caller graph for this function:

◆ lock_port()

virtual bool AP_HAL::UARTDriver::lock_port ( uint32_t  key)
inlinevirtual

Reimplemented in ChibiOS::UARTDriver.

Definition at line 41 of file UARTDriver.h.

◆ receive_time_constraint_us()

virtual uint64_t AP_HAL::UARTDriver::receive_time_constraint_us ( uint16_t  nbytes)
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().

Here is the caller graph for this function:

◆ set_blocking_writes()

virtual void AP_HAL::UARTDriver::set_blocking_writes ( bool  blocking)
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().

Here is the caller graph for this function:

◆ set_flow_control()

virtual void AP_HAL::UARTDriver::set_flow_control ( enum flow_control  flow_control_setting)
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().

Here is the caller graph for this function:

◆ set_stop_bits()

virtual void AP_HAL::UARTDriver::set_stop_bits ( int  n)
inlinevirtual

◆ set_unbuffered_writes()

bool UARTDriver::set_unbuffered_writes ( bool  on)
inlinevirtual

◆ tx_pending()

virtual bool AP_HAL::UARTDriver::tx_pending ( )
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().

Here is the caller graph for this function:

◆ wait_timeout()

virtual bool AP_HAL::UARTDriver::wait_timeout ( uint16_t  n,
uint32_t  timeout_ms 
)
inlinevirtual

Reimplemented in ChibiOS::UARTDriver.

Definition at line 66 of file UARTDriver.h.

◆ write_locked()

virtual size_t AP_HAL::UARTDriver::write_locked ( const uint8_t *  buffer,
size_t  size,
uint32_t  key 
)
inlinevirtual

Reimplemented in ChibiOS::UARTDriver.

Definition at line 45 of file UARTDriver.h.


The documentation for this class was generated from the following files: