35 #ifndef __HAL_UART_H__ 36 #define __HAL_UART_H__ 38 #include "hal_platform.h" 40 #ifdef HAL_UART_MODULE_ENABLED 633 uint8_t escape_character);
706 #ifdef HAL_UART_FEATURE_VFIFO_DMA_TIMEOUT Defines UART baudrate as 9600 bps.
Definition: hal_uart.h:308
Defines UART baudrate as 921600 bps.
Definition: hal_uart.h:315
uint32_t hal_uart_get_char_unblocking(hal_uart_port_t uart_port)
This function gets one character from UART port in the unblocking polling mode.
hal_uart_baudrate_t baudrate
This field represents the baudrate of the UART frame.
Definition: hal_uart.h:374
uint32_t send_vfifo_threshold_size
This field represents the threshold of the transmitting VFIFO buffer.
Definition: hal_uart.h:385
hal_uart_status_t hal_uart_init(hal_uart_port_t uart_port, hal_uart_config_t *uart_config)
This function initializes the UART hardware with basic functionality.
Defines UART word length as 8 bits per frame.
Definition: hal_uart.h:325
Defines UART baudrate as 57600 bps.
Definition: hal_uart.h:311
Invalid user input parameter.
Definition: hal_uart.h:346
uint32_t hal_uart_receive_dma(hal_uart_port_t uart_port, uint8_t *buffer, uint32_t size)
This function receives user data in a VFIFO DMA mode.
Indicates if there is enough free space available in the TX buffer for the user to write into...
Definition: hal_uart.h:358
Defines UART baudrate as 4800 bps.
Definition: hal_uart.h:307
uint32_t hal_uart_get_available_receive_bytes(hal_uart_port_t uart_port)
This function queries available data in the VFIFO RX buffer.
Defines UART stop bit as 1 bit per frame.
Definition: hal_uart.h:331
hal_uart_status_t
This enum defines return status of the UART HAL public API.
Definition: hal_uart.h:345
hal_uart_word_length_t word_length
This field represents the word length of the UART frame.
Definition: hal_uart.h:375
Defines UART parity as none.
Definition: hal_uart.h:338
UART port has not been initialized.
Definition: hal_uart.h:348
UART driver detected a common error.
Definition: hal_uart.h:349
char hal_uart_get_char(hal_uart_port_t uart_port)
This function gets one character from UART port in a polling mode.
Defines UART word length as 6 bits per frame.
Definition: hal_uart.h:323
UART port is currently in use.
Definition: hal_uart.h:347
uint32_t send_vfifo_buffer_size
This field represents the size of the transmitting VFIFO buffer.
Definition: hal_uart.h:384
hal_uart_status_t hal_uart_set_software_flowcontrol(hal_uart_port_t uart_port, uint8_t xon, uint8_t xoff, uint8_t escape_character)
This function sets and enables software flow control of the UART.
uint32_t receive_vfifo_buffer_size
This field represents size of the receiving VFIFO buffer.
Definition: hal_uart.h:387
Indicates if there is a transaction error when receiving data.
Definition: hal_uart.h:356
hal_uart_baudrate_t
This enum defines baud rate of the UART frame.
Definition: hal_uart.h:302
hal_uart_status_t hal_uart_deinit(hal_uart_port_t uart_port)
This function deinitializes the UART hardware to its default status.
uint32_t hal_uart_send_polling(hal_uart_port_t uart_port, const uint8_t *data, uint32_t size)
This function sends user data byte by byte in a polling mode.
hal_uart_status_t hal_uart_disable_flowcontrol(hal_uart_port_t uart_port)
This function disables flow control of the UART.
Defines UART word length as 7 bits per frame.
Definition: hal_uart.h:324
Defines UART baudrate as 115200 bps.
Definition: hal_uart.h:312
hal_uart_status_t hal_uart_register_callback(hal_uart_port_t uart_port, hal_uart_callback_t user_callback, void *user_data)
This function registers user's callback in the UART driver.
hal_uart_callback_event_t
This enum defines the UART event when an interrupt occurs.
Definition: hal_uart.h:355
hal_uart_parity_t parity
This field represents the parity of the UART frame.
Definition: hal_uart.h:377
uint8_t * send_vfifo_buffer
This field represents the transmitting user allocated VFIFO buffer.
Definition: hal_uart.h:383
Defines UART baudrate as 300 bps.
Definition: hal_uart.h:304
Defines UART baudrate as 38400 bps.
Definition: hal_uart.h:310
void hal_uart_put_char(hal_uart_port_t uart_port, char byte)
This function places one character at a time to the UART port in a polling mode.
Indicates if there is enough data available in the RX buffer for the user to read from...
Definition: hal_uart.h:357
hal_uart_status_t hal_uart_set_format(hal_uart_port_t uart_port, const hal_uart_config_t *config)
This function sets the UART's frame parameter.
Defines UART baudrate as 110 bps.
Definition: hal_uart.h:303
hal_uart_status_t hal_uart_set_hardware_flowcontrol(hal_uart_port_t uart_port)
This function sets and enables hardware flow control of the UART.
uint32_t hal_uart_send_dma(hal_uart_port_t uart_port, const uint8_t *data, uint32_t size)
This function sends user data in a VFIFO DMA mode.
Defines UART baudrate as 19200 bps.
Definition: hal_uart.h:309
hal_uart_status_t hal_uart_set_baudrate(hal_uart_port_t uart_port, hal_uart_baudrate_t baudrate)
This function sets a baud rate for the UART frame.
This struct defines configuration parameters and TX/RX buffers for the VFIFO DMA associated with a sp...
Definition: hal_uart.h:382
Defines UART baudrate as 1200 bps.
Definition: hal_uart.h:305
hal_uart_word_length_t
This enum defines word length of the UART frame.
Definition: hal_uart.h:321
hal_uart_status_t hal_uart_set_dma(hal_uart_port_t uart_port, const hal_uart_dma_config_t *dma_config)
This function sets the VFIFO DMA hardware relative to the UART.
Defines UART baudrate as 2400 bps.
Definition: hal_uart.h:306
void(* hal_uart_callback_t)(hal_uart_callback_event_t event, void *user_data)
This typedef defines user's callback function prototype.
Definition: hal_uart.h:410
Defines UART parity as even.
Definition: hal_uart.h:340
uint32_t hal_uart_get_available_send_space(hal_uart_port_t uart_port)
This function queries available space in the VFIFO TX buffer.
hal_uart_parity_t
This enum defines parity of the UART frame.
Definition: hal_uart.h:337
hal_uart_stop_bit_t stop_bit
This field represents the stop bit of the UART frame.
Definition: hal_uart.h:376
Defines maximum enum value of UART baudrate.
Definition: hal_uart.h:316
Defines UART baudrate as 460800 bps.
Definition: hal_uart.h:314
Defines UART baudrate as 230400 bps.
Definition: hal_uart.h:313
Defines UART word length as 5 bits per frame.
Definition: hal_uart.h:322
Defines UART stop bit as 2 bits per frame.
Definition: hal_uart.h:332
UART function executed successfully.
Definition: hal_uart.h:350
Defines UART parity as odd.
Definition: hal_uart.h:339
hal_uart_port_t
UART port index There are total of four UART ports.
Definition: hal_platform.h:180
uint32_t receive_vfifo_alert_size
This field represents the threshold size of free space left in the VFIFO buffer that activates the UA...
Definition: hal_uart.h:389
uint8_t * receive_vfifo_buffer
This field represents the receiving user allocated VFIFO buffer.
Definition: hal_uart.h:386
uint32_t receive_vfifo_threshold_size
This field represents the threshold of the receiving VFIFO buffer.
Definition: hal_uart.h:388
hal_uart_stop_bit_t
This enum defines stop bit of the UART frame.
Definition: hal_uart.h:330
This struct defines UART configure parameters.
Definition: hal_uart.h:373
uint32_t hal_uart_receive_polling(hal_uart_port_t uart_port, uint8_t *buffer, uint32_t size)
This function receives data byte by byte in a polling mode.