Trident IoT SDK
 
Loading...
Searching...
No Matches
tr_hal_uart.h
Go to the documentation of this file.
1
33
34#ifndef TR_HAL_UART_H_
35#define TR_HAL_UART_H_
36
37#include "tr_hal_platform.h"
38
39
40// ****************************************************************************
41// UART Driver API functions
42// ****************************************************************************
43
44
50
51
52// ***************************************************************************
53// ---- UART init/uninit APIs ----
54// ***************************************************************************
55
62 tr_hal_uart_settings_t* uart_settings);
63
67
73 tr_hal_power_mode_t power_mode);
74
75
76// ***************************************************************************
77// ---- UART receive APIs ----
78// ***************************************************************************
79
83 char* byte);
84
88 char* bytes,
89 uint16_t buffer_size,
90 uint16_t* num_returned_bytes);
91
92// ***************************************************************************
93// ---- UART transmit APIs ----
94// ***************************************************************************
95
99 const char byte_to_send);
100
104 const char* bytes_to_send,
105 uint16_t num_bytes_to_send);
106
107// returns true if a transmit is in progress
108// returns false if all transmits have been completed (no tx in progress)
110 bool* tx_active);
111
112// ***************************************************************************
113// ---- UART DMA transmit ----
114// ***************************************************************************
115
119 char* bytes_to_send,
120 uint16_t num_bytes_to_send);
121
122// ***************************************************************************
123// ---- UART DMA receive ----
124// to receive bytes with UART, the app should check the receive buffer passed in
125// ***************************************************************************
126
130 uint32_t* bytes_left);
131
135 uint8_t* new_receive_buffer,
136 uint16_t new_buffer_length);
137
138
139// ***************************************************************************
140// ---- UART functions to convert int value to enum ----
141// these can be used by the app to convert user input (like from CLI) to enum values
142// ***************************************************************************
143
147
151
155
156
157// ***************************************************************************
158// ---- UART power on/off - these are called from init and uninit - the app should not need to call these
159// ***************************************************************************
160
164
168
169
170// ***************************************************************************
171// ---- setting pin mode and checking valid pin settings ----
172// ***************************************************************************
173
177 tr_hal_gpio_pin_t tx_pin,
178 tr_hal_gpio_pin_t rx_pin);
179
183 tr_hal_gpio_pin_t rts_pin,
184 tr_hal_gpio_pin_t cts_pin);
185
189 tr_hal_gpio_pin_t new_tx_pin,
190 tr_hal_gpio_pin_t new_rx_pin);
191
192
196
197
198#endif //TR_HAL_UART_H_
tr_hal_status_t
Definition tr_hal_common.h:25
tr_hal_power_mode_t
enum for the different power modes that the chip can be in
Definition T32CM11_power.h:30
tr_hal_data_bits_t
Definition T32CM11_uart.h:311
tr_hal_baud_rate_t
Definition T32CM11_uart.h:409
tr_hal_stop_bits_t
Definition T32CM11_uart.h:324
tr_hal_uart_id_t
Definition T32CM11_uart.h:78
tr_hal_status_t tr_hal_uart_init(tr_hal_uart_id_t uart_id, tr_hal_uart_settings_t *uart_settings)
tr_hal_status_t tr_hal_uart_raw_rx_available_bytes(tr_hal_uart_id_t uart_id, char *bytes, uint16_t buffer_size, uint16_t *num_returned_bytes)
tr_hal_status_t tr_hal_uart_power_off(tr_hal_uart_id_t uart_id)
bool tr_hal_uart_check_pins_valid(tr_hal_uart_id_t uart_id, tr_hal_gpio_pin_t new_tx_pin, tr_hal_gpio_pin_t new_rx_pin)
tr_hal_status_t tr_hal_uart_set_tx_rx_pins(tr_hal_uart_id_t uart_id, tr_hal_gpio_pin_t tx_pin, tr_hal_gpio_pin_t rx_pin)
tr_hal_data_bits_t tr_hal_get_data_bits_enum_from_value(uint8_t data_bits_value)
tr_hal_status_t tr_hal_uart_dma_receive_buffer_num_bytes_left(tr_hal_uart_id_t uart_id, uint32_t *bytes_left)
tr_hal_status_t tr_hal_uart_raw_tx_one_byte(tr_hal_uart_id_t uart_id, const char byte_to_send)
tr_hal_status_t tr_hal_uart_raw_rx_one_byte(tr_hal_uart_id_t uart_id, char *byte)
tr_hal_baud_rate_t tr_hal_get_baud_rate_enum_from_value(uint32_t baud_rate_value)
tr_hal_stop_bits_t tr_hal_get_stop_bits_enum_from_value(uint8_t stop_bits_value)
tr_hal_status_t tr_hal_uart_raw_tx_buffer(tr_hal_uart_id_t uart_id, const char *bytes_to_send, uint16_t num_bytes_to_send)
tr_hal_status_t tr_hal_uart_tx_active(tr_hal_uart_id_t uart_id, bool *tx_active)
tr_hal_status_t tr_hal_uart_dma_change_rx_buffer(tr_hal_uart_id_t uart_id, uint8_t *new_receive_buffer, uint16_t new_buffer_length)
tr_hal_status_t tr_hal_uart_dma_tx_bytes_in_buffer(tr_hal_uart_id_t uart_id, char *bytes_to_send, uint16_t num_bytes_to_send)
tr_hal_status_t tr_hal_uart_uninit(tr_hal_uart_id_t uart_id)
tr_hal_status_t tr_hal_uart_set_rts_cts_pins(tr_hal_uart_id_t uart_id, tr_hal_gpio_pin_t rts_pin, tr_hal_gpio_pin_t cts_pin)
tr_hal_status_t tr_hal_uart_power_on(tr_hal_uart_id_t uart_id)
tr_hal_status_t tr_hal_uart_set_power_mode(tr_hal_uart_id_t uart_id, tr_hal_power_mode_t power_mode)
pin type
Definition tr_hal_platform.h:23
Definition T32CM11_uart.h:470