All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
LPUART FreeRTOS Driver
LPUART: Low Power UART Driver

## Overview

## LPUART RTOS Operation

int | LPUART_RTOS_Init (lpuart_rtos_handle_t *handle, lpuart_handle_t *t_handle, const struct rtos_lpuart_config *cfg)
| Initializes an LPUART instance for operation in RTOS. More...
int | LPUART_RTOS_Deinit (lpuart_rtos_handle_t *handle)
| Deinitializes an LPUART instance for operation. More...

## LPUART transactional Operation

int | LPUART_RTOS_Send (lpuart_rtos_handle_t *handle, const uint8_t *buffer, uint32_t length)
| Sends data in background. More...
int | LPUART_RTOS_Receive (lpuart_rtos_handle_t *handle, uint8_t *buffer, uint32_t length, size_t *received)
| Receives data. More...

## Function Documentation

int LPUART_RTOS_Init | ( | lpuart_rtos_handle_t * | handle,
|  | lpuart_handle_t * | t_handle,
|  | const struct rtos_lpuart_config * | cfg
| ) |  |

Parameters

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

Returns
  0 succeed, others failed

int LPUART_RTOS_Deinit | ( | lpuart_rtos_handle_t * | handle | ) |

This function deinitializes the LPUART module, sets all register value to the reset value, and releases the resources.

Parameters

  handle | The RTOS LPUART handle.

int LPUART_RTOS_Send | ( | lpuart_rtos_handle_t * | handle,
|  | const uint8_t * | buffer,
|  | uint32_t | length
| ) |  |

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

Parameters

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

int LPUART_RTOS_Receive | ( | lpuart_rtos_handle_t * | handle,
|  | uint8_t * | buffer,
|  | uint32_t | length,
|  | size_t * | received
| ) |  |

This function receives data from LPUART. It is an synchronous API. If any data is immediately available it is returned immediately and the number of bytes received.

Parameters

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