APM:Libraries
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Linux::SPIUARTDriver Class Reference

#include <SPIUARTDriver.h>

Inheritance diagram for Linux::SPIUARTDriver:
[legend]
Collaboration diagram for Linux::SPIUARTDriver:
[legend]

Public Member Functions

 SPIUARTDriver ()
 
void begin (uint32_t b, uint16_t rxS, uint16_t txS)
 
void _timer_tick (void)
 
- Public Member Functions inherited from Linux::UARTDriver
 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 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
 
- Public Member Functions inherited from AP_HAL::UARTDriver
 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)
 
- 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)
 
size_t write (const char *str)
 

Protected Member Functions

int _write_fd (const uint8_t *buf, uint16_t n)
 
int _read_fd (uint8_t *buf, uint16_t n)
 

Protected Attributes

AP_HAL::OwnPtr< AP_HAL::SPIDevice_dev
 
uint8_t * _buffer
 
uint32_t _last_update_timestamp
 
bool _external
 
- Protected Attributes inherited from Linux::UARTDriver
const char * device_path
 
volatile bool _initialised
 
ByteBuffer _readbuf {0}
 
ByteBuffer _writebuf {0}
 

Additional Inherited Members

- Public Types inherited from AP_HAL::UARTDriver
enum  flow_control { FLOW_CONTROL_DISABLE =0, FLOW_CONTROL_ENABLE =1, FLOW_CONTROL_AUTO =2 }
 
- Static Public Member Functions inherited from Linux::UARTDriver
static UARTDriverfrom (AP_HAL::UARTDriver *uart)
 

Detailed Description

Definition at line 9 of file SPIUARTDriver.h.

Constructor & Destructor Documentation

◆ SPIUARTDriver()

SPIUARTDriver::SPIUARTDriver ( )

Definition at line 23 of file SPIUARTDriver.cpp.

Member Function Documentation

◆ _read_fd()

int SPIUARTDriver::_read_fd ( uint8_t *  buf,
uint16_t  n 
)
protectedvirtual

Reimplemented from Linux::UARTDriver.

Definition at line 114 of file SPIUARTDriver.cpp.

Here is the call graph for this function:

◆ _timer_tick()

void SPIUARTDriver::_timer_tick ( void  )
virtual

Reimplemented from Linux::UARTDriver.

Definition at line 139 of file SPIUARTDriver.cpp.

Here is the call graph for this function:

◆ _write_fd()

int SPIUARTDriver::_write_fd ( const uint8_t *  buf,
uint16_t  n 
)
protectedvirtual

Reimplemented from Linux::UARTDriver.

Definition at line 88 of file SPIUARTDriver.cpp.

Here is the call graph for this function:

◆ begin()

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

Implements AP_HAL::UARTDriver.

Definition at line 28 of file SPIUARTDriver.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _buffer

uint8_t* Linux::SPIUARTDriver::_buffer
protected

Definition at line 21 of file SPIUARTDriver.h.

Referenced by _write_fd(), and begin().

◆ _dev

AP_HAL::OwnPtr<AP_HAL::SPIDevice> Linux::SPIUARTDriver::_dev
protected

Definition at line 19 of file SPIUARTDriver.h.

Referenced by _read_fd(), _write_fd(), and begin().

◆ _external

bool Linux::SPIUARTDriver::_external
protected

Definition at line 25 of file SPIUARTDriver.h.

Referenced by _read_fd(), _timer_tick(), _write_fd(), and begin().

◆ _last_update_timestamp

uint32_t Linux::SPIUARTDriver::_last_update_timestamp
protected

Definition at line 23 of file SPIUARTDriver.h.

Referenced by _timer_tick().


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