#include <uart.h>
Public Types | |
enum | uart_mode_t { MODE_8N1, MODE_8E2 } |
Public Types inherited from Serial | |
enum | { POLLING = 0x00, INTERRUPT = 0x01, DMA_TX = 0x02, DMA_RX = 0x04 } |
enum | { UART = 0, VCP = 1 } |
Public Member Functions | |
void | DMA_Rx_IRQ_callback () |
void | DMA_Tx_IRQ_callback () |
bool | flush () override |
void | init (const uart_hardware_struct_t *conf, uint32_t baudrate_, uart_mode_t mode=MODE_8N1) |
void | put_byte (uint8_t ch) override |
uint8_t | read_byte () override |
void | register_rx_callback (void(*cb)(uint8_t data)) override |
uint32_t | rx_bytes_waiting () override |
bool | set_mode (uint32_t baud, uart_mode_t mode) |
bool | tx_buffer_empty () override |
uint32_t | tx_bytes_free () override |
UART () | |
void | unregister_rx_callback () override |
void | USART_IRQ_callback () |
void | write (const uint8_t *ch, uint8_t len) override |
Public Member Functions inherited from Serial | |
Serial () | |
Private Member Functions | |
void | init_DMA () |
void | init_NVIC () |
void | init_UART (uint32_t baudrate_, uart_mode_t mode=MODE_8N1) |
void | startDMA () |
Private Attributes | |
uint32_t | baudrate_ |
const uart_hardware_struct_t * | c_ |
uint8_t | rx_buffer_ [RX_BUFFER_SIZE] |
uint16_t | rx_buffer_head_ |
uint16_t | rx_buffer_tail_ |
GPIO | rx_pin_ |
uint8_t | tx_buffer_ [TX_BUFFER_SIZE] |
uint16_t | tx_buffer_head_ |
uint16_t | tx_buffer_tail_ |
GPIO | tx_pin_ |
Additional Inherited Members | |
Protected Attributes inherited from Serial | |
uint8_t | mode_ |
std::function< void(uint8_t)> | receive_CB_ = nullptr |
GPIO | rx_pin_ |
GPIO | tx_pin_ |
enum UART::uart_mode_t |
void UART::init | ( | const uart_hardware_struct_t * | conf, |
uint32_t | baudrate_, | ||
uart_mode_t | mode = MODE_8N1 |
||
) |
|
private |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
bool UART::set_mode | ( | uint32_t | baud, |
uart_mode_t | mode | ||
) |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
void UART::USART_IRQ_callback | ( | ) |
|
overridevirtual |
|
private |
|
private |
|
private |