err_t hal_uart_close(handle_t *handle)
Close UART HAL layer object.
err_t hal_uart_set_data_bits(handle_t *handle, hal_uart_config_t *config)
Set the number of UART data bits.
size_t hal_uart_println(handle_t *handle, char *text)
Print the string to UART and append new line.
err_t hal_uart_set_stop_bits(handle_t *handle, hal_uart_config_t *config)
Set the number of UART stop bits.
size_t hal_uart_bytes_available(hal_uart_t *hal_obj)
Check number of data available to read.
void hal_uart_clear(hal_uart_t *hal_obj)
Discard all characters from UART buffers.
size_t hal_uart_write(handle_t *handle, uint8_t *buffer, size_t size)
Write data to UART.
err_t hal_uart_open(handle_t *handle, bool hal_obj_open_state)
Open the UART HAL layer object on selected pins.
err_t hal_uart_set_baud(handle_t *handle, hal_uart_config_t *config)
Set the UART baud rate.
err_t hal_uart_set_parity(handle_t *handle, hal_uart_config_t *config)
Set the UART parity.
void hal_uart_set_blocking(handle_t *handle, bool blocking)
Set UART HAL in blocking/non-blocking mode.
void hal_uart_configure_default(hal_uart_config_t *config)
Configure UART configuration structure with default values.
size_t hal_uart_read(handle_t *handle, uint8_t *buffer, size_t size)
Read data from UART.
size_t hal_uart_print(handle_t *handle, char *text)
Print the string to UART.
HAL target macros and typedefs.
int32_t err_t
Definition hal_target.h:64
hal_ll_pin_name_t hal_pin_name_t
Definition hal_target.h:60
hal_uart_data_bits_t
Predefined enum values for data bit selection.
Definition hal_uart.h:93
@ HAL_UART_DATA_BITS_8
Definition hal_uart.h:95
@ HAL_UART_DATA_BITS_9
Definition hal_uart.h:96
@ HAL_UART_DATA_BITS_DEFAULT
Definition hal_uart.h:98
@ HAL_UART_DATA_BITS_7
Definition hal_uart.h:94
hal_uart_parity_t
Predefined enum values for parity selection.
Definition hal_uart.h:105
@ HAL_UART_PARITY_NONE
Definition hal_uart.h:106
@ HAL_UART_PARITY_ODD
Definition hal_uart.h:108
@ HAL_UART_PARITY_DEFAULT
Definition hal_uart.h:110
@ HAL_UART_PARITY_EVEN
Definition hal_uart.h:107
hal_uart_err_t
Definition hal_uart.h:72
@ HAL_UART_ERROR
Definition hal_uart.h:77
@ HAL_UART_SUCCESS
Definition hal_uart.h:73
@ HAL_UART_MODULE_ERROR
Definition hal_uart.h:75
@ HAL_UART_WRONG_PINS
Definition hal_uart.h:74
hal_uart_irq_t
Predefined enum values for interrupt request type.
Definition hal_uart.h:84
@ HAL_UART_IRQ_TX
Definition hal_uart.h:86
@ HAL_UART_IRQ_RX
Definition hal_uart.h:85
hal_uart_stop_bits_t
Predefined enum values for stop bit selection.
Definition hal_uart.h:117
@ HAL_UART_STOP_BITS_TWO
Definition hal_uart.h:121
@ HAL_UART_STOP_BITS_HALF
Definition hal_uart.h:118
@ HAL_UART_STOP_BITS_ONE
Definition hal_uart.h:119
@ HAL_UART_STOP_BITS_ONE_AND_A_HALF
Definition hal_uart.h:120
@ HAL_UART_STOP_BITS_DEFAULT
Definition hal_uart.h:123
UART HAL init configuration structure, consisted of the following fields :
Definition hal_uart.h:159
uint32_t baud
Definition hal_uart.h:163
ring_buf8_t tx_buf
Definition hal_uart.h:168
ring_buf8_t rx_buf
Definition hal_uart.h:169
size_t rx_ring_size
Definition hal_uart.h:172
hal_uart_data_bits_t data_bits
Definition hal_uart.h:164
hal_uart_stop_bits_t stop_bits
Definition hal_uart.h:166
size_t tx_ring_size
Definition hal_uart.h:171
hal_pin_name_t rx_pin
Definition hal_uart.h:161
hal_uart_parity_t parity
Definition hal_uart.h:165
hal_pin_name_t tx_pin
Definition hal_uart.h:160
handle_t * drv_uart_handle
Definition hal_uart.h:64
bool init_state
Definition hal_uart.h:65
handle_t * hal_uart_handle
Definition hal_uart.h:63
UART HAL context structure, consisted of the following fields :
Definition hal_uart.h:186
uint8_t * rx_ring_buffer
Definition hal_uart.h:192
bool is_blocking
Definition hal_uart.h:197
uint8_t * tx_ring_buffer
Definition hal_uart.h:191
handle_t handle
Definition hal_uart.h:187
bool is_tx_irq_enabled
Definition hal_uart.h:194
hal_uart_config_t config
Definition hal_uart.h:189
bool is_rx_irq_enabled
Definition hal_uart.h:195