no-OS
|
#include <xparameters.h>
#include <stdio.h>
#include <stdlib.h>
#include "no_os_error.h"
#include "no_os_uart.h"
#include "uart_extra.h"
Macros | |
#define | WRITE_SIZE 255 |
Functions | |
int32_t | no_os_uart_read (struct no_os_uart_desc *desc, uint8_t *data, uint32_t bytes_number) |
Read data from UART device. More... | |
int32_t | no_os_uart_write (struct no_os_uart_desc *desc, const uint8_t *data, uint32_t bytes_number) |
Write data to UART device. More... | |
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) |
Get number of UART errors. More... | |
int32_t | no_os_uart_read_nonblocking (struct no_os_uart_desc *desc, uint8_t *data, uint32_t bytes_number) |
Submit reading buffer to the UART driver. More... | |
#define WRITE_SIZE 255 |
uint32_t no_os_uart_get_errors | ( | struct no_os_uart_desc * | desc | ) |
Get number of UART errors.
Free the resources allocated by no_os_uart_init().
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 device.
Read data from UART. Blocking function.
desc | - Instance of UART. |
data | - Pointer to buffer containing 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 | ||
) |
Submit reading buffer to the UART driver.
Buffer is used until bytes_number bytes are read.
desc | Descriptor of the UART device |
data | Buffer where data will be read |
bytes_number | Number of bytes to be read |
Buffer is used until bytes_number bytes are read.
desc | Descriptor of the UART device |
data | Buffer where data will be read |
bytes_number | Number of bytes to be read. |
Submit reading buffer to the UART driver.
desc | - Instance of UART. |
data | - Pointer to buffer containing 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().
Free the resources allocated by no_os_uart_init().
desc | - The UART descriptor. |
Unregistering the callback is necessary only for this target because this operation is not done by the driver on init.
int32_t no_os_uart_write | ( | struct no_os_uart_desc * | desc, |
const uint8_t * | data, | ||
uint32_t | bytes_number | ||
) |
Write data to UART device.
Write data to UART. Blocking function.
desc | - Instance of UART. |
data | - Pointer to buffer containing data. |
bytes_number | - Number of bytes to read. |