no-OS
Macros | Functions
uart.c File Reference
#include <xparameters.h>
#include <stdio.h>
#include <stdlib.h>
#include "error.h"
#include "uart.h"
#include "uart_extra.h"
Include dependency graph for uart.c:

Macros

#define WRITE_SIZE   255
 

Functions

int32_t uart_read (struct uart_desc *desc, uint8_t *data, uint32_t bytes_number)
 Read data from UART device. More...
 
int32_t uart_write (struct uart_desc *desc, const uint8_t *data, uint32_t bytes_number)
 Write data to UART device. More...
 
int32_t uart_init (struct uart_desc **desc, struct uart_init_param *param)
 Initialize the UART communication peripheral. More...
 
int32_t uart_remove (struct uart_desc *desc)
 Free the resources allocated by uart_init(). More...
 
uint32_t uart_get_errors (struct uart_desc *desc)
 Get number of UART errors. More...
 

Macro Definition Documentation

◆ WRITE_SIZE

#define WRITE_SIZE   255

Function Documentation

◆ uart_get_errors()

uint32_t uart_get_errors ( struct uart_desc desc)

Get number of UART errors.

Free the resources allocated by uart_init()

Parameters
desc- The UART descriptor.
Returns
number of errors.

◆ uart_init()

int32_t uart_init ( struct uart_desc **  desc,
struct uart_init_param param 
)

Initialize the UART communication peripheral.

Parameters
desc- The UART descriptor.
param- The structure that contains the UART parameters.
Returns
SUCCESS in case of success, FAILURE otherwise.
Here is the caller graph for this function:

◆ uart_read()

int32_t uart_read ( struct uart_desc desc,
uint8_t *  data,
uint32_t  bytes_number 
)

Read data from UART device.

Read data from UART. Blocking function.

Parameters
desc- Instance of UART.
data- Pointer to buffer containing data.
bytes_number- Number of bytes to read.
Returns
SUCCESS in case of success, FAILURE otherwise.

◆ uart_remove()

int32_t uart_remove ( struct uart_desc desc)

Free the resources allocated by uart_init().

Free the resources allocated by uart_init()

Parameters
desc- The UART descriptor.
Returns
SUCCESS in case of success, FAILURE otherwise.
Here is the caller graph for this function:

◆ uart_write()

int32_t uart_write ( struct uart_desc desc,
const uint8_t *  data,
uint32_t  bytes_number 
)

Write data to UART device.

Write data to UART. Blocking function.

Parameters
desc- Instance of UART.
data- Pointer to buffer containing data.
bytes_number- Number of bytes to read.
Returns
SUCCESS in case of success, FAILURE otherwise.