AliOS Things API HAL SOC UART Guide - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki
int32_t hal_uart_init(uart_dev_t *uart)
-
Description
Initialises a UART interface
-
Parameters
IN/OUT NAME DESC [in] uart the interface which should be initialised -
Returns
0 : on success, EIO : if an error occurred with any step
int32_t hal_uart_send(uart_dev_t *uart, const void *data, uint32_t size, uint32_t timeout)
-
Description
Transmit data on a UART interface
-
Parameters
IN/OUT NAME DESC [in] uart the UART interface [in] data pointer to the start of data [in] size number of bytes to transmit -
Returns
0 : on success, EIO : if an error occurred with any step
int32_t hal_uart_recv(uart_dev_t *uart, void *data, uint32_t expect_size,
uint32_t *recv_size, uint32_t timeout)
-
Description
Receive data on a UART interface
-
Parameters
IN/OUT NAME DESC [in] uart the UART interface [out] data pointer to the buffer which will store incoming data [in] expect_size number of bytes to receive [out] recv_size number of bytes received [in] timeout timeout in milisecond -
Returns
0 : on success, EIO : if an error occurred with any step
int32_t hal_uart_finalize(uart_dev_t *uart)
-
Description
Deinitialises a UART interface
-
Parameters
IN/OUT NAME DESC [in] uart the interface which should be deinitialised -
Returns
0 : on success, EIO : if an error occurred with any step