Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Header: #include <applibs/uart.h>
Opens and configures a UART, and returns a file descriptor to use for subsequent calls.
int UART_Open(UART_Id uartId, const UART_Config * uartConfig);
Parameters
uartIdThe ID of the UART to open.uartConfigA pointer to a UART_Config struct that defines the configuration of the UART. Call UART_InitConfig to get a UART_Config with default settings.
Errors
Returns -1 if an error is encountered and sets errno to the error value.
EACCES: access to UART_Id is not permitted as the
uartIdis not listed in the Uart field of the application manifest.ENODEV: the
uartIdis invalid.EINVAL: the
uartConfigrepresents an invalid configuration.EBUSY: the
uartIdis already open.EFAULT: the
uartConfigis NULL.
Any other errno may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.
Return value
Returns the file descriptor of the UART if it was opened successfully, or -1 for failure, in which case errno is set to the error value.
Application manifest requirements
To access individual UARTs, your application must identify them in the Uart field of the application manifest.