Implementation of the UART Interface.
More...
#include <inttypes.h>
#include "no_os_uart.h"
#include <stdlib.h>
#include "no_os_error.h"
#include "no_os_mutex.h"
#include "no_os_util.h"
Implementation of the UART Interface.
- Author
- Ramona Bolboaca (ramon.nosp@m.a.bo.nosp@m.lboac.nosp@m.a@an.nosp@m.alog..nosp@m.com)
Copyright 2022(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ __no_os_weak__()
| void __no_os_weak__ |
( |
(weak) | | ) |
|
◆ no_os_uart_get_errors()
Check if errors occurred on UART.
- Parameters
-
| desc | - The UART descriptor. |
- Returns
- number of errors in case of success, error code otherwise.
◆ no_os_uart_init()
Initialize the UART communication peripheral.
- Parameters
-
| desc | - The UART descriptor. |
| param | - The structure that contains the UART parameters. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_uart_read()
| int32_t no_os_uart_read |
( |
struct no_os_uart_desc * | desc, |
|
|
uint8_t * | data, |
|
|
uint32_t | bytes_number ) |
Read data from UART.
- Parameters
-
| desc | - The UART descriptor. |
| data | - The buffer with the received data. |
| bytes_number | - Number of bytes to read. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_uart_read_nonblocking()
| int32_t no_os_uart_read_nonblocking |
( |
struct no_os_uart_desc * | desc, |
|
|
uint8_t * | data, |
|
|
uint32_t | bytes_number ) |
Read data from UART non-blocking.
- Parameters
-
| desc | - The UART descriptor. |
| data | - The buffer with the received data. |
| bytes_number | - Number of bytes to read. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_uart_remove()
Free the resources allocated by no_os_uart_init().
- Parameters
-
| desc | - The UART descriptor. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_uart_write()
| int32_t no_os_uart_write |
( |
struct no_os_uart_desc * | desc, |
|
|
const uint8_t * | data, |
|
|
uint32_t | bytes_number ) |
Write to UART.
- Parameters
-
| desc | - The UART descriptor. |
| data | - The buffer with the transmitted data. |
| bytes_number | - Number of bytes to write. |
- Returns
- 0 in case of success, error code otherwise.
◆ no_os_uart_write_nonblocking()
| int32_t no_os_uart_write_nonblocking |
( |
struct no_os_uart_desc * | desc, |
|
|
const uint8_t * | data, |
|
|
uint32_t | bytes_number ) |
Write to UART non-blocking.
- Parameters
-
| desc | - The UART descriptor. |
| data | - The buffer with the transmitted data. |
| bytes_number | - Number of bytes to write. |
- Returns
- 0 in case of success, error code otherwise.