Macros | Typedefs | Enumerations | Functions | Variables
fsl_lpuart.c File Reference
#include "fsl_lpuart.h"
Include dependency graph for fsl_lpuart.c:

Go to the source code of this file.

Macros

#define FSL_COMPONENT_ID   "platform.drivers.lpuart"
 

Typedefs

typedef void(* lpuart_isr_t) (LPUART_Type *base, lpuart_handle_t *handle)
 

Enumerations

enum  { kLPUART_TxIdle, kLPUART_TxBusy, kLPUART_RxIdle, kLPUART_RxBusy }
 

Functions

status_t LPUART_ClearStatusFlags (LPUART_Type *base, uint32_t mask)
 Clears status flags with a provided mask. More...
 
void LPUART_Deinit (LPUART_Type *base)
 Deinitializes a LPUART instance. More...
 
void LPUART_DisableInterrupts (LPUART_Type *base, uint32_t mask)
 Disables LPUART interrupts according to a provided mask. More...
 
void LPUART_EnableInterrupts (LPUART_Type *base, uint32_t mask)
 Enables LPUART interrupts according to a provided mask. More...
 
void LPUART_GetDefaultConfig (lpuart_config_t *config)
 Gets the default configuration structure. More...
 
uint32_t LPUART_GetEnabledInterrupts (LPUART_Type *base)
 Gets enabled LPUART interrupts. More...
 
uint32_t LPUART_GetInstance (LPUART_Type *base)
 Get the LPUART instance from peripheral base address. More...
 
uint32_t LPUART_GetStatusFlags (LPUART_Type *base)
 Gets LPUART status flags. More...
 
status_t LPUART_Init (LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz)
 Initializes an LPUART instance with the user configuration structure and the peripheral clock. More...
 
status_t LPUART_ReadBlocking (LPUART_Type *base, uint8_t *data, size_t length)
 Reads the receiver data register using a blocking method. More...
 
static void LPUART_ReadNonBlocking (LPUART_Type *base, uint8_t *data, size_t length)
 Read RX register using non-blocking method. More...
 
status_t LPUART_SetBaudRate (LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
 Sets the LPUART instance baudrate. More...
 
void LPUART_TransferAbortReceive (LPUART_Type *base, lpuart_handle_t *handle)
 Aborts the interrupt-driven data receiving. More...
 
void LPUART_TransferAbortSend (LPUART_Type *base, lpuart_handle_t *handle)
 Aborts the interrupt-driven data transmit. More...
 
void LPUART_TransferCreateHandle (LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_callback_t callback, void *userData)
 Initializes the LPUART handle. More...
 
status_t LPUART_TransferGetReceiveCount (LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
 Gets the number of bytes that have been received. More...
 
size_t LPUART_TransferGetRxRingBufferLength (LPUART_Type *base, lpuart_handle_t *handle)
 Get the length of received data in RX ring buffer. More...
 
status_t LPUART_TransferGetSendCount (LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
 Gets the number of bytes that have been sent out to bus. More...
 
void LPUART_TransferHandleErrorIRQ (LPUART_Type *base, lpuart_handle_t *handle)
 LPUART Error IRQ handle function. More...
 
void LPUART_TransferHandleIRQ (LPUART_Type *base, lpuart_handle_t *handle)
 LPUART IRQ handle function. More...
 
static bool LPUART_TransferIsRxRingBufferFull (LPUART_Type *base, lpuart_handle_t *handle)
 Check whether the RX ring buffer is full. More...
 
status_t LPUART_TransferReceiveNonBlocking (LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer, size_t *receivedBytes)
 Receives a buffer of data using the interrupt method. More...
 
status_t LPUART_TransferSendNonBlocking (LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer)
 Transmits a buffer of data using the interrupt method. More...
 
void LPUART_TransferStartRingBuffer (LPUART_Type *base, lpuart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
 Sets up the RX ring buffer. More...
 
void LPUART_TransferStopRingBuffer (LPUART_Type *base, lpuart_handle_t *handle)
 Aborts the background transfer and uninstalls the ring buffer. More...
 
status_t LPUART_WriteBlocking (LPUART_Type *base, const uint8_t *data, size_t length)
 Writes to the transmitter register using a blocking method. More...
 
static void LPUART_WriteNonBlocking (LPUART_Type *base, const uint8_t *data, size_t length)
 Write to TX register using non-blocking method. More...
 

Variables

static LPUART_Type *const s_lpuartBases [] = LPUART_BASE_PTRS
 
static const clock_ip_name_t s_lpuartClock [] = LPUART_CLOCKS
 
static lpuart_handle_ts_lpuartHandle [ARRAY_SIZE(s_lpuartBases)]
 
static const IRQn_Type s_lpuartIRQ [] = LPUART_RX_TX_IRQS
 
static lpuart_isr_t s_lpuartIsr
 

Macro Definition Documentation

◆ FSL_COMPONENT_ID

#define FSL_COMPONENT_ID   "platform.drivers.lpuart"

Definition at line 17 of file fsl_lpuart.c.

Typedef Documentation

◆ lpuart_isr_t

typedef void(* lpuart_isr_t) (LPUART_Type *base, lpuart_handle_t *handle)

Definition at line 30 of file fsl_lpuart.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kLPUART_TxIdle 

TX idle.

kLPUART_TxBusy 

TX busy.

kLPUART_RxIdle 

RX idle.

kLPUART_RxBusy 

RX busy.

Definition at line 21 of file fsl_lpuart.c.

Function Documentation

◆ LPUART_ReadNonBlocking()

static void LPUART_ReadNonBlocking ( LPUART_Type base,
uint8_t *  data,
size_t  length 
)
static

Read RX register using non-blocking method.

This function reads data from the TX register directly, upper layer must make sure the RX register is full or TX FIFO has data before calling this function.

Parameters
baseLPUART peripheral base address.
dataStart address of the buffer to store the received data.
lengthSize of the buffer.

Definition at line 189 of file fsl_lpuart.c.

◆ LPUART_TransferIsRxRingBufferFull()

static bool LPUART_TransferIsRxRingBufferFull ( LPUART_Type base,
lpuart_handle_t handle 
)
static

Check whether the RX ring buffer is full.

@userData handle LPUART handle pointer.

Return values
trueRX ring buffer is full.
falseRX ring buffer is not full.

Definition at line 158 of file fsl_lpuart.c.

◆ LPUART_WriteNonBlocking()

static void LPUART_WriteNonBlocking ( LPUART_Type base,
const uint8_t *  data,
size_t  length 
)
static

Write to TX register using non-blocking method.

This function writes data to the TX register directly, upper layer must make sure the TX register is empty or TX FIFO has empty room before calling this function.

Note
This function does not check whether all the data has been sent out to bus, so before disable TX, check kLPUART_TransmissionCompleteFlag to ensure the TX is finished.
Parameters
baseLPUART peripheral base address.
dataStart address of the data to write.
lengthSize of the buffer to be sent.

Definition at line 175 of file fsl_lpuart.c.

Variable Documentation

◆ s_lpuartBases

LPUART_Type* const s_lpuartBases[] = LPUART_BASE_PTRS
static

Definition at line 76 of file fsl_lpuart.c.

◆ s_lpuartClock

const clock_ip_name_t s_lpuartClock[] = LPUART_CLOCKS
static

Definition at line 88 of file fsl_lpuart.c.

◆ s_lpuartHandle

lpuart_handle_t* s_lpuartHandle[ARRAY_SIZE(s_lpuartBases)]
static

Definition at line 78 of file fsl_lpuart.c.

◆ s_lpuartIRQ

const IRQn_Type s_lpuartIRQ[] = LPUART_RX_TX_IRQS
static

Definition at line 84 of file fsl_lpuart.c.

◆ s_lpuartIsr

lpuart_isr_t s_lpuartIsr
static

Definition at line 101 of file fsl_lpuart.c.



picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:57