Go to the documentation of this file.
56 #include "ring_buffer.h"
65 #ifdef HAL_UART_MODULE_ENABLED
71 #define TX_ONCE_MAX_SIZE 128
86 #if ((APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5525X) || (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5526X))
90 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5526X)
115 #ifdef APP_DRIVER_WAKEUP_CALL_FUN
app_uart_pin_t rx
Set the configuration of UART RX pin.
app_uart_dma_state_t uart_dma_state
App uart dma state types.
app_uart_pin_cfg_t pin_cfg
the pin configuration information for the specified UART module.
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
app_uart_evt_handler_t evt_handler
UART event callback.
uart_init_t init
UART communication parameters.
@ APP_UART_EVT_ABORT_RX
Requested RX abort completed.
app_uart_evt_type_t
UART event Enumerations definition.
app_uart_dma_state_t
App uart dma state types.
uint16_t app_uart_transmit_sync(app_uart_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
Send an amount of data in blocking mode.
bool is_dma_tx_mode
dma tx mode.
app_uart_id_t id
specified UART module ID.
ring_buffer_t tx_ring_buffer
RING_BUFFER_STRUCT Structures.
app_uart_pin_t cts
Set the configuration of UART CTS pin.
dma_channel_t tx_dma_channel
Specifies the dma channel of UART TX.
app_uart_state_t uart_state
App uart state types.
uint16_t app_uart_deinit(app_uart_id_t id)
De-initialize the APP UART DRIVER peripheral.
uint16_t app_uart_abort(app_uart_id_t id)
Abort transmit and receive process and generate abort callback.
uint16_t app_uart_init(app_uart_params_t *p_params, app_uart_evt_handler_t evt_handler, app_uart_tx_buf_t *tx_buffer)
Initialize the APP UART DRIVER according to the specified parameters in the app_uart_params_t and app...
app_io_pull_t
GPIO pull Enumerations definition.
app_uart_state_t
App uart state types.
app_io_type_t
GPIO type Enumerations definition.
dma_channel_t rx_dma_channel
Specifies the dma channel of UART RX.
@ APP_UART_EVT_ABORT_TX
Requested TX abort completed.
volatile bool start_flush_flag
start flush flag.
bool tx_abort_flag
tx abort flag.
UART handle Structure definition.
UART parameters structure definition.
UART buffer structure definition.
uint32_t tx_buf_size
Size of the TX buffer.
app_uart_pin_t tx
Set the configuration of UART TX pin.
UART init structure definition.
dma_regs_t * rx_dma_instance
Specifies the RX DMA instance.
@ APP_UART_ID_0
UART module 0.
Header file containing functions prototypes of GPIO app library.
uint16_t app_uart_abort_receive(app_uart_id_t id)
Abort receive process and generate abort receive callback.
uint8_t * tx_buf
Pointer to the TX buffer.
@ APP_UART_EVT_ABORT_TXRX
Requested TX, RX abort completed.
app_uart_evt_type_t type
Type of event.
@ APP_UART_EVT_RX_DATA
Requested RX transfer completed.
uint16_t app_uart_receive_sync(app_uart_id_t id, uint8_t *p_data, uint16_t size, uint32_t timeout)
Receive an amount of data in blocking mode.
uart_env_t uart_dev
UART event data.
This file contains all the functions prototypes for the HAL module driver.
void(* app_uart_evt_handler_t)(app_uart_evt_t *p_evt)
UART event callback definition.
UART device structure definition.
dma_regs_t * tx_dma_instance
Specifies the TX DMA instance.
app_uart_pin_cfg_t * p_pin_cfg
UART pins config Structures.
UART event structure definition.
uint16_t size
UART transmitted/received counter.
uint16_t app_uart_receive_async(app_uart_id_t id, uint8_t *p_data, uint16_t size)
Receive an amount of data in interrupt mode.
@ APP_UART_ID_MAX
Only for check parameter, not used as input parameters.
Header file containing functions prototypes of DMA app library.
UART DMA configuration structure definition.
uint16_t app_uart_transmit_async(app_uart_id_t id, uint8_t *p_data, uint16_t size)
Send an amount of data in interrupt mode.
uart_handle_t * app_uart_get_handle(app_uart_id_t id)
Return the UART handle.
app_uart_dma_cfg_t dma_cfg
UART DMA configuration.
app_io_mux_t mux
Specifies the Peripheral to be connected to the selected pins.
bool rx_abort_flag
rx abort flag.
uart_handle_t handle
UART handle Structure.
app_uart_id_t
UART module Enumerations definition.
app_io_mux_t
GPIO mux Enumerations definition.
app_uart_pin_t rts
Set the configuration of UART RTS pin.
uint32_t pin
Specifies the IO pins to be configured.
UART pins config Structures.
uint32_t error_code
UART Error code .
@ APP_UART_EVT_ERROR
Error reported by UART peripheral.
Header file of app driver config code.
volatile bool start_tx_flag
start tx flag.
void app_uart_flush(app_uart_id_t id)
Flush all log entries from the buffer.
@ APP_UART_ID_1
UART module 1.
app_io_type_t type
Specifies the type of UART IO.
#define TX_ONCE_MAX_SIZE
UART max bytes size transmitted at one time.
int16_t dma_id_t
DMA id definition.
dma_channel_t
HAL DMA Channel Enumerations definition.
@ APP_UART_EVT_TX_CPLT
Requested TX transfer completed.
uint16_t app_uart_abort_transmit(app_uart_id_t id)
Abort transmit process and generate abort transmit callback.