uart.h File Reference
#include <esp_systemapi.h>
Include dependency graph for uart.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Classes | |
struct | uart_ |
struct | uart_config |
Typedefs | |
typedef enum uart_mode_ | uart_mode_t |
typedef uint8_t | uart_options_t |
typedef struct uart_ | uart_t |
typedef void(* | uart_callback_t) (uart_t *uart, uint32_t status) |
callback invoked directly from ISR More... | |
typedef void(* | uart_notify_callback_t) (uart_t *uart, uart_notify_code_t code) |
Port notification callback function type. More... | |
Enumerations | |
enum | uart_mode_ { UART_FULL, UART_RX_ONLY, UART_TX_ONLY } |
values for mode argument of uart_init More... | |
enum | uart_option_bits_t { UART_OPT_TXWAIT, UART_OPT_CALLBACK_RAW } |
bit values for options argument of uart_init More... | |
enum | uart_notify_code_t { UART_NOTIFY_AFTER_OPEN, UART_NOTIFY_BEFORE_CLOSE, UART_NOTIFY_AFTER_WRITE, UART_NOTIFY_BEFORE_READ, UART_NOTIFY_WAIT_TX } |
Indicates notification, parameters refer to uart_notify_info_t structure. More... | |
Functions | |
bool | uart_set_notify (unsigned uart_nr, uart_notify_callback_t callback) |
Set the notification callback function. More... | |
uart_t * | uart_init (uint8_t uart_nr, uint32_t baudrate, uint32_t config, uart_mode_t mode, uint8_t tx_pin, size_t rx_size, size_t tx_size=0) |
uart_t * | uart_init_ex (const uart_config &cfg) |
void | uart_uninit (uart_t *uart) |
int | uart_get_nr (uart_t *uart) |
uart_t * | uart_get_uart (uint8_t uart_nr) |
Get the uart structure for the given number. More... | |
void | uart_set_callback (uart_t *uart, uart_callback_t callback, void *param) |
Set callback handler for serial port. More... | |
void * | uart_get_callback_param (uart_t *uart) |
Get the callback parameter specified by uart_set_callback() More... | |
static void | uart_set_options (uart_t *uart, uart_options_t options) |
Set option flags. More... | |
uint8_t | uart_get_status (uart_t *uart) |
Get error flags and clear them. More... | |
static uart_options_t | uart_get_options (uart_t *uart) |
void | uart_swap (uart_t *uart, int tx_pin) |
void | uart_set_tx (uart_t *uart, int tx_pin) |
void | uart_set_pins (uart_t *uart, int tx, int rx) |
bool | uart_tx_enabled (uart_t *uart) |
bool | uart_rx_enabled (uart_t *uart) |
uint32_t | uart_set_baudrate_reg (int uart_nr, uint32_t baud_rate) |
set UART baud rate, given the UART number More... | |
uint32_t | uart_set_baudrate (uart_t *uart, uint32_t baud_rate) |
set UART baud rate More... | |
uint32_t | uart_get_baudrate (uart_t *uart) |
get the actual baud rate in use More... | |
size_t | uart_resize_rx_buffer (uart_t *uart, size_t new_size) |
size_t | uart_rx_buffer_size (uart_t *uart) |
size_t | uart_resize_tx_buffer (uart_t *uart, size_t new_size) |
size_t | uart_tx_buffer_size (uart_t *uart) |
size_t | uart_write (uart_t *uart, const void *buffer, size_t size) |
write a block of data More... | |
static size_t | uart_write_char (uart_t *uart, char c) |
queue a single character for output More... | |
size_t | uart_read (uart_t *uart, void *buffer, size_t size) |
read a block of data More... | |
static int | uart_read_char (uart_t *uart) |
read a received character More... | |
int | uart_peek_char (uart_t *uart) |
see what the next character in the rx buffer is More... | |
int | uart_peek_last_char (uart_t *uart) |
fetch last character read out of FIFO More... | |
int | uart_rx_find (uart_t *uart, char c) |
size_t | uart_rx_available (uart_t *uart) |
determine available data which can be read More... | |
size_t | uart_tx_free (uart_t *uart) |
return free space in transmit buffer More... | |
void | uart_wait_tx_empty (uart_t *uart) |
void | uart_set_break (uart_t *uart, bool state) |
Set or clear a break condition on the TX line. More... | |
void | uart_flush (uart_t *uart, uart_mode_t mode=UART_FULL) |
discard any buffered data and reset hardware FIFOs More... | |
void | uart_set_debug (int uart_nr) |
int | uart_get_debug () |
void | uart_start_isr (uart_t *uart) |
enable interrupts for a UART More... | |
void | uart_stop_isr (uart_t *uart) |
disable interrupts for a UART More... | |
void | uart_detach (int uart_nr) |
detach a UART interrupt service routine More... | |
void | uart_detach_all () |
detach all UART interrupt service routines More... | |
uint8_t | uart_disable_interrupts () |
disable interrupts and return current interrupt state More... | |
void | uart_restore_interrupts () |
re-enable interrupts after calling uart_disable_interrupts() More... | |