MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

Data Structures

struct  lpsci_rtos_config_t
 LPSCI RTOS configuration structure. More...
 

LPSCI RTOS Operation

int LPSCI_RTOS_Init (lpsci_rtos_handle_t *handle, lpsci_handle_t *t_handle, const lpsci_rtos_config_t *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...
 

Data Structure Documentation

struct lpsci_rtos_config_t

Data Fields

UART0_Type * base
 LPSCI base address.
 
uint32_t srcclk
 LPSCI source clock in Hz.
 
uint32_t baudrate
 Desired communication speed.
 
lpsci_parity_mode_t parity
 Parity setting.
 
lpsci_stop_bit_count_t stopbits
 Number of stop bits to use.
 
uint8_t * buffer
 Buffer for background reception.
 
uint32_t buffer_size
 Size of buffer for background reception.
 

Function Documentation

int LPSCI_RTOS_Init ( lpsci_rtos_handle_t *  handle,
lpsci_handle_t *  t_handle,
const lpsci_rtos_config_t cfg 
)
Parameters
handleThe RTOS LPSCI handle, the pointer to allocated space for RTOS context.
t_handleThe pointer to allocated space where to store transactional layer internal state.
cfgThe 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
handleThe 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
handleThe RTOS LPSCI handle.
bufferThe pointer to buffer to send.
lengthThe 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
handleThe RTOS LPSCI handle.
bufferThe pointer to buffer where to write received data.
lengthThe number of bytes to receive.
receivedThe pointer to variable of size_t where the number of received data is filled.