All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
LPSCI µCOS/II Driver
LPSCI: Universal Asynchronous Receiver/Transmitter

## Overview

## LPSCI RTOS Operation

int | LPSCI_RTOS_Init (lpsci_rtos_handle_t *handle, lpsci_handle_t *t_handle, const struct rtos_lpsci_config *cfg)
| Initializes an LPSCI instance for operation in RTOS. More...
int | LPSCI_RTOS_Deinit (lpsci_rtos_handle_t *handle)
| Deinitializes an LPSCI instance for operation. More...

## LPSCI transactional Operation

int | LPSCI_RTOS_Send (lpsci_rtos_handle_t *handle, const uint8_t *buffer, uint32_t length)
| Send data in background. More...
int | LPSCI_RTOS_Receive (lpsci_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received)
| Receives data. More...

## Function Documentation

int LPSCI_RTOS_Init | ( | lpsci_rtos_handle_t * | handle,
|  | lpsci_handle_t * | t_handle,
|  | const struct rtos_lpsci_config * | cfg
| ) |  |

Parameters

  handle | The RTOS LPSCI handle, the pointer to allocated space for RTOS context.
  lpsci_t_handle | The pointer to allocated space where to store transactional layer internal state.
  cfg | The pointer to the parameters required to configure the LPSCI after initialization.

Returns
  0 succeed, others failed

int LPSCI_RTOS_Deinit | ( | lpsci_rtos_handle_t * | handle | ) |

This function deinitializes the LPSCI modulem, set all register value to reset value and releases the resources.

Parameters

  handle | The RTOS LPSCI handle.

int LPSCI_RTOS_Send | ( | lpsci_rtos_handle_t * | handle,
|  | const uint8_t * | buffer,
|  | uint32_t | length
| ) |  |

This function sends data. It is synchronous API. If the HW buffer is full, the task is in the blocked state.

Parameters

  handle | The RTOS LPSCI handle.
  buffer | The pointer to buffer to send.
  length | The number of bytes to send.

int LPSCI_RTOS_Receive | ( | lpsci_rtos_handle_t * | handle,
|  | uint8_t * | buffer,
|  | uint32_t | length,
|  | size_t * | received
| ) |  |

It is synchronous API.

This function receives data from LPSCI. If any data is immediately available it is returned immediately and the number of bytes received.

Parameters

  handle | The RTOS LPSCI handle.
  buffer | The pointer to buffer where to write received data.
  length | The number of bytes to receive.
  received | The pointer to variable of size_t where the number of received data is filled.