Public Types | Public Member Functions | Protected Attributes | List of all members
Serial Class Referenceabstract

#include <serial.h>

Inheritance diagram for Serial:
Inheritance graph
[legend]

Public Types

enum  { POLLING = 0x00, INTERRUPT = 0x01, DMA_TX = 0x02, DMA_RX = 0x04 }
 
enum  { UART = 0, VCP = 1 }
 

Public Member Functions

virtual bool flush ()=0
 
virtual void put_byte (uint8_t ch)=0
 
virtual uint8_t read_byte ()=0
 
virtual void register_rx_callback (void(*cb)(uint8_t data))=0
 
virtual uint32_t rx_bytes_waiting ()=0
 
 Serial ()
 
virtual bool tx_buffer_empty ()=0
 
virtual uint32_t tx_bytes_free ()=0
 
virtual void unregister_rx_callback ()=0
 
virtual void write (const uint8_t *ch, uint8_t len)=0
 

Protected Attributes

uint8_t mode_
 
std::function< void(uint8_t)> receive_CB_ = nullptr
 
GPIO rx_pin_
 
GPIO tx_pin_
 

Detailed Description

Definition at line 43 of file serial.h.

Member Enumeration Documentation

anonymous enum
Enumerator
POLLING 
INTERRUPT 
DMA_TX 
DMA_RX 

Definition at line 46 of file serial.h.

anonymous enum
Enumerator
UART 
VCP 

Definition at line 54 of file serial.h.

Constructor & Destructor Documentation

Serial::Serial ( )
inline

Definition at line 59 of file serial.h.

Member Function Documentation

virtual bool Serial::flush ( )
pure virtual

Implemented in UART, and VCP.

virtual void Serial::put_byte ( uint8_t  ch)
pure virtual

Implemented in UART, and VCP.

virtual uint8_t Serial::read_byte ( )
pure virtual

Implemented in UART, and VCP.

virtual void Serial::register_rx_callback ( void(*)(uint8_t data)  cb)
pure virtual

Implemented in UART, and VCP.

virtual uint32_t Serial::rx_bytes_waiting ( )
pure virtual

Implemented in UART, and VCP.

virtual bool Serial::tx_buffer_empty ( )
pure virtual

Implemented in UART, and VCP.

virtual uint32_t Serial::tx_bytes_free ( )
pure virtual

Implemented in UART, and VCP.

virtual void Serial::unregister_rx_callback ( )
pure virtual

Implemented in UART, and VCP.

virtual void Serial::write ( const uint8_t *  ch,
uint8_t  len 
)
pure virtual

Implemented in UART, and VCP.

Member Data Documentation

uint8_t Serial::mode_
protected

Definition at line 74 of file serial.h.

std::function<void(uint8_t)> Serial::receive_CB_ = nullptr
protected

Definition at line 76 of file serial.h.

GPIO Serial::rx_pin_
protected

Definition at line 72 of file serial.h.

GPIO Serial::tx_pin_
protected

Definition at line 71 of file serial.h.


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


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:31