InPlay API
|
HAL_UART. More...
Functions | |
void * | hal_uart_open (int id, uart_init_t *init) |
Open the uart driver. More... | |
void | hal_uart_close (void *hdl) |
Close the uart driver. More... | |
void | hal_uart_putc (void *hdl, char c) |
Output 1 char. More... | |
int | hal_uart_xmit_poll (void *hdl, uint8_t *buffer, uint32_t buffer_len) |
Uart TX by polling. More... | |
int | hal_uart_rcvd_poll (void *hdl, uint8_t *buffer, uint32_t buffer_len) |
Uart RX by polling. More... | |
int | hal_uart_xmit_intr (void *hdl, uint8_t *buffer, uint32_t buffer_len) |
Uart TX by interrupt. More... | |
int | hal_uart_xmit_intr_hci (void *hdl, uint8_t *buffer, uint32_t buffer_len, void *cb_arg, void(*callback)(void *arg, int length, int error)) |
HCI Uart TX by interrupt. More... | |
int | hal_uart_rcvd_intr (void *hdl, uint8_t *buffer, uint32_t buffer_len, uint32_t tmo, uint32_t *actual_rx_len) |
Uart RX by interrupt. More... | |
int | hal_uart_rcvd_intr_hci (void *hdl, uint8_t *buffer, uint32_t buffer_len, void *cb_arg, void(*callback)(void *arg, int length, int error)) |
HCI Uart RX by interrupt. More... | |
int | hal_uart_flow_on (void *hdl) |
Manually turn on RTS request. More... | |
int | hal_uart_flow_off (void *hdl) |
Manually turn off RTS request. More... | |
int | hal_uart_xmit_dma (void *hdl, uint8_t *buffer, uint32_t buffer_len) |
Uart TX by DMA. More... | |
int | hal_uart_rcvd_dma (void *hdl, uint8_t *buffer, uint32_t buffer_len, uint32_t tmo, uint32_t *actual_rx_len) |
Uart RX by DMA. More... | |
void | hal_uart_cancel (void *hdl) |
cancel uart rx More... | |
int | hal_uart_en_break (void *hdl, char en, void(*cb)(void *), void *arg) |
enable uart break feature. Use uart break signal to wake chip. More... | |
int | hal_uart_en_unbreak_int (void *hdl) |
enable uart break interrupt More... | |
Variables | |
int | baud_rate |
Uart baud rate. | |
int | data_len |
Uart char length,. More... | |
int | stop_bit |
Uart stop bits, 0: 1 stop bit, 1: 2 stop bits. | |
int | parity_en |
Uart parity enable, 0: disable, 1: enable. | |
int | even_parity |
Uart even parity, 0: odd parity, 1: even parity. | |
int | fc |
Uart controller flow control enable, 1: enable, 0: disable. | |
int | no_intr |
Uart don't generate interrupt. | |
int | prio |
interrupt priority | |
void * | rx_arg |
rx callback argument | |
void(* | rx_cb )(void *arg, int length, int error) |
rx callback | |
void * | tx_arg |
tx callback argument | |
void(* | tx_cb )(void *arg, int length, int error) |
tx callback | |
HAL_UART.
void hal_uart_cancel | ( | void * | hdl | ) |
cancel uart rx
[in] | hdl |
void hal_uart_close | ( | void * | hdl | ) |
Close the uart driver.
[in] | hdl | Uart handle from the open API |
int hal_uart_en_break | ( | void * | hdl, |
char | en, | ||
void(*)(void *) | cb, | ||
void * | arg | ||
) |
enable uart break feature. Use uart break signal to wake chip.
[in] | hdl | |
[in] | en | 1: enable, 0: disable |
[in] | cb | callback function |
[in] | arg | callback function argument |
int hal_uart_en_unbreak_int | ( | void * | hdl | ) |
enable uart break interrupt
[in] | hdl |
int hal_uart_flow_off | ( | void * | hdl | ) |
Manually turn off RTS request.
[in] | hdl | Uart handle from the open API |
int hal_uart_flow_on | ( | void * | hdl | ) |
Manually turn on RTS request.
[in] | hdl | Uart handle from the open API |
void* hal_uart_open | ( | int | id, |
uart_init_t * | init | ||
) |
Open the uart driver.
[in] | id | Uart Id, |
[in] | init | init parameter, |
void hal_uart_putc | ( | void * | hdl, |
char | c | ||
) |
Output 1 char.
[in] | hdl | Uart handle from the open API |
[in] | c | Character code |
int hal_uart_rcvd_dma | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len, | ||
uint32_t | tmo, | ||
uint32_t * | actual_rx_len | ||
) |
Uart RX by DMA.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer pointer for RX |
[in] | buffer_len | Data buffer length. Max 2047 for dma transmission. |
[in] | tmo | Timeout for block call, 0: means wait forever |
[out] | actual_rx_len | Blocking call return the exact RX bytes |
int hal_uart_rcvd_intr | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len, | ||
uint32_t | tmo, | ||
uint32_t * | actual_rx_len | ||
) |
Uart RX by interrupt.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to RX |
[in] | buffer_len | Data buffer length |
[in] | tmo | Timeout for block call, 0: means wait forever |
[out] | actual_rx_len | Blocking call return the exact RX bytes |
int hal_uart_rcvd_intr_hci | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len, | ||
void * | cb_arg, | ||
void(*)(void *arg, int length, int error) | callback | ||
) |
HCI Uart RX by interrupt.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to RX |
[in] | buffer_len | Data buffer length |
[in] | cb_arg | Argument that user wants to pass to the RX completion call back function |
[in] | callback | RX completion call back function provided by the user |
int hal_uart_rcvd_poll | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len | ||
) |
Uart RX by polling.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to RX |
[in] | buffer_len | Data buffer length |
int hal_uart_xmit_dma | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len | ||
) |
Uart TX by DMA.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to TX |
[in] | buffer_len | Data buffer length |
int hal_uart_xmit_intr | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len | ||
) |
Uart TX by interrupt.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to TX |
[in] | buffer_len | Data buffer length |
[in] | cb_arg | Argument that user wants to pass to the TX completion call back function |
[in] | callback | TX completion call back function provided by the user |
int hal_uart_xmit_intr_hci | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len, | ||
void * | cb_arg, | ||
void(*)(void *arg, int length, int error) | callback | ||
) |
HCI Uart TX by interrupt.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to TX |
[in] | buffer_len | Data buffer length |
[in] | cb_arg | Argument that user wants to pass to the TX completion call back function |
[in] | callback | TX completion call back function provided by the user |
int hal_uart_xmit_poll | ( | void * | hdl, |
uint8_t * | buffer, | ||
uint32_t | buffer_len | ||
) |
Uart TX by polling.
[in] | hdl | Uart handle from the open API |
[in] | buffer | Data buffer to TX |
[in] | buffer_len | Data buffer length |
int data_len |
Uart char length,.