no-OS
|
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"
Functions | |
int32_t | no_os_uart_init (struct no_os_uart_desc **desc, struct no_os_uart_init_param *param) |
Initialize the UART communication peripheral. More... | |
int32_t | no_os_uart_remove (struct no_os_uart_desc *desc) |
Free the resources allocated by no_os_uart_init(). More... | |
uint32_t | no_os_uart_get_errors (struct no_os_uart_desc *desc) |
Check if errors occurred on UART. More... | |
int32_t | no_os_uart_read (struct no_os_uart_desc *desc, uint8_t *data, uint32_t bytes_number) |
Read data from UART. More... | |
int32_t | no_os_uart_write (struct no_os_uart_desc *desc, const uint8_t *data, uint32_t bytes_number) |
Write to UART. More... | |
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. More... | |
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. More... | |
void | no_os_uart_stdio (struct no_os_uart_desc *desc) |
Implementation of the UART Interface.
Copyright 2022(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
uint32_t no_os_uart_get_errors | ( | struct no_os_uart_desc * | desc | ) |
Check if errors occurred on UART.
desc | - The UART descriptor. |
int32_t no_os_uart_init | ( | struct no_os_uart_desc ** | desc, |
struct no_os_uart_init_param * | param | ||
) |
Initialize the UART communication peripheral.
desc | - The UART descriptor. |
param | - The structure that contains the UART parameters. |
int32_t no_os_uart_read | ( | struct no_os_uart_desc * | desc, |
uint8_t * | data, | ||
uint32_t | bytes_number | ||
) |
Read data from UART.
desc | - The UART descriptor. |
data | - The buffer with the received data. |
bytes_number | - Number of bytes to read. |
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.
desc | - The UART descriptor. |
data | - The buffer with the received data. |
bytes_number | - Number of bytes to read. |
int32_t no_os_uart_remove | ( | struct no_os_uart_desc * | desc | ) |
Free the resources allocated by no_os_uart_init().
desc | - The UART descriptor. |
void no_os_uart_stdio | ( | struct no_os_uart_desc * | desc | ) |
int32_t no_os_uart_write | ( | struct no_os_uart_desc * | desc, |
const uint8_t * | data, | ||
uint32_t | bytes_number | ||
) |
Write to UART.
desc | - The UART descriptor. |
data | - The buffer with the transmitted data. |
bytes_number | - Number of bytes to write. |
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.
desc | - The UART descriptor. |
data | - The buffer with the transmitted data. |
bytes_number | - Number of bytes to write. |