Platform drivers for Mbed.

Dependents:   EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more

Embed: (wiki syntax)

« Back to documentation index

uart.cpp File Reference

uart.cpp File Reference

Implementation of UART Mbed platform driver interfaces. More...

Go to the source code of this file.

Functions

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

Detailed Description

Implementation of UART Mbed platform driver interfaces.

Copyright (c) 2021 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Definition in file uart.cpp.


Function Documentation

uint32_t uart_get_errors ( struct uart_desc *  desc )

Get number of UART errors.

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

Definition at line 428 of file uart.cpp.

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.

Definition at line 311 of file uart.cpp.

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

Read data from UART device.

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.

Definition at line 148 of file uart.cpp.

int32_t uart_read_nonblocking ( struct 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.

Parameters:
desc,:Descriptor of the UART device
data,:Buffer where data will be read
bytes_number,:Number of bytes to be read.
Returns:
SUCCESS in case of success, FAILURE otherwise.

Definition at line 246 of file uart.cpp.

int32_t uart_remove ( struct uart_desc *  desc )

Free the resources allocated by uart_init().

Parameters:
desc- The UART descriptor.
Returns:
SUCCESS in case of success, FAILURE otherwise.

Definition at line 394 of file uart.cpp.

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

Write data to UART device.

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.

Definition at line 192 of file uart.cpp.

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

Submit writting buffer to the UART driver.

Data from the buffer is sent over the UART, the function returns imediatly.

Parameters:
desc,:Descriptor of the UART device
data,:Buffer where data will be written
bytes_number,:Number of bytes to be written.
Returns:
SUCCESS in case of success, FAILURE otherwise.

Definition at line 281 of file uart.cpp.