rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Data Structures
fsl_lpuart.h File Reference

Data Structures

struct  _lpuart_config
 LPUART configuration structure. More...
 
struct  _lpuart_transfer
 LPUART transfer structure. More...
 
struct  _lpuart_handle
 LPUART handle structure. More...
 

Functions

Software Reset
static void LPUART_SoftwareReset (LPUART_Type *base)
 Resets the LPUART using software.
 
Initialization and deinitialization
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.
 
void LPUART_Deinit (LPUART_Type *base)
 Deinitializes a LPUART instance.
 
void LPUART_GetDefaultConfig (lpuart_config_t *config)
 Gets the default configuration structure.
 
status_t LPUART_SetBaudRate (LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
 Sets the LPUART instance baudrate.
 
Status
uint32_t LPUART_GetStatusFlags (LPUART_Type *base)
 Gets LPUART status flags.
 
status_t LPUART_ClearStatusFlags (LPUART_Type *base, uint32_t mask)
 Clears status flags with a provided mask.
 
Interrupts
void LPUART_EnableInterrupts (LPUART_Type *base, uint32_t mask)
 Enables LPUART interrupts according to a provided mask.
 
void LPUART_DisableInterrupts (LPUART_Type *base, uint32_t mask)
 Disables LPUART interrupts according to a provided mask.
 
uint32_t LPUART_GetEnabledInterrupts (LPUART_Type *base)
 Gets enabled LPUART interrupts.
 
static uint32_t LPUART_GetDataRegisterAddress (LPUART_Type *base)
 Gets the LPUART data register address.
 
static void LPUART_EnableTxDMA (LPUART_Type *base, bool enable)
 Enables or disables the LPUART transmitter DMA request.
 
static void LPUART_EnableRxDMA (LPUART_Type *base, bool enable)
 Enables or disables the LPUART receiver DMA.
 
Bus Operations
uint32_t LPUART_GetInstance (LPUART_Type *base)
 Get the LPUART instance from peripheral base address.
 
static void LPUART_EnableTx (LPUART_Type *base, bool enable)
 Enables or disables the LPUART transmitter.
 
static void LPUART_EnableRx (LPUART_Type *base, bool enable)
 Enables or disables the LPUART receiver.
 
static void LPUART_WriteByte (LPUART_Type *base, uint8_t data)
 Writes to the transmitter register.
 
static uint8_t LPUART_ReadByte (LPUART_Type *base)
 Reads the receiver register.
 
void LPUART_WriteBlocking (LPUART_Type *base, const uint8_t *data, size_t length)
 Writes to the transmitter register using a blocking method.
 
status_t LPUART_ReadBlocking (LPUART_Type *base, uint8_t *data, size_t length)
 Reads the receiver data register using a blocking method.
 
Transactional
void LPUART_TransferCreateHandle (LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_callback_t callback, void *userData)
 Initializes the LPUART handle.
 
status_t LPUART_TransferSendNonBlocking (LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer)
 Transmits a buffer of data using the interrupt method.
 
void LPUART_TransferStartRingBuffer (LPUART_Type *base, lpuart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
 Sets up the RX ring buffer.
 
void LPUART_TransferStopRingBuffer (LPUART_Type *base, lpuart_handle_t *handle)
 Aborts the background transfer and uninstalls the ring buffer.
 
size_t LPUART_TransferGetRxRingBufferLength (LPUART_Type *base, lpuart_handle_t *handle)
 Get the length of received data in RX ring buffer.
 
void LPUART_TransferAbortSend (LPUART_Type *base, lpuart_handle_t *handle)
 Aborts the interrupt-driven data transmit.
 
status_t LPUART_TransferGetSendCount (LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
 Gets the number of bytes that have been written to the LPUART transmitter register.
 
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.
 
void LPUART_TransferAbortReceive (LPUART_Type *base, lpuart_handle_t *handle)
 Aborts the interrupt-driven data receiving.
 
status_t LPUART_TransferGetReceiveCount (LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
 Gets the number of bytes that have been received.
 
void LPUART_TransferHandleIRQ (LPUART_Type *base, lpuart_handle_t *handle)
 LPUART IRQ handle function.
 
void LPUART_TransferHandleErrorIRQ (LPUART_Type *base, lpuart_handle_t *handle)
 LPUART Error IRQ handle function.
 

Driver version

enum  _lpuart_status {
  kStatus_LPUART_TxBusy = MAKE_STATUS(kStatusGroup_LPUART, 0) , kStatus_LPUART_RxBusy = MAKE_STATUS(kStatusGroup_LPUART, 1) , kStatus_LPUART_TxIdle = MAKE_STATUS(kStatusGroup_LPUART, 2) , kStatus_LPUART_RxIdle = MAKE_STATUS(kStatusGroup_LPUART, 3) ,
  kStatus_LPUART_TxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 4) , kStatus_LPUART_RxWatermarkTooLarge = MAKE_STATUS(kStatusGroup_LPUART, 5) , kStatus_LPUART_FlagCannotClearManually = MAKE_STATUS(kStatusGroup_LPUART, 6) , kStatus_LPUART_Error = MAKE_STATUS(kStatusGroup_LPUART, 7) ,
  kStatus_LPUART_RxRingBufferOverrun , kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9) , kStatus_LPUART_NoiseError = MAKE_STATUS(kStatusGroup_LPUART, 10) , kStatus_LPUART_FramingError = MAKE_STATUS(kStatusGroup_LPUART, 11) ,
  kStatus_LPUART_ParityError = MAKE_STATUS(kStatusGroup_LPUART, 12) , kStatus_LPUART_BaudrateNotSupport , kStatus_LPUART_IdleLineDetected = MAKE_STATUS(kStatusGroup_LPUART, 14)
}
 Error codes for the LPUART driver. More...
 
enum  _lpuart_parity_mode { kLPUART_ParityDisabled = 0x0U , kLPUART_ParityEven = 0x2U , kLPUART_ParityOdd = 0x3U }
 LPUART parity mode. More...
 
enum  _lpuart_data_bits { kLPUART_EightDataBits = 0x0U , kLPUART_SevenDataBits = 0x1U }
 LPUART data bits count. More...
 
enum  _lpuart_stop_bit_count { kLPUART_OneStopBit = 0U , kLPUART_TwoStopBit = 1U }
 LPUART stop bit count. More...
 
enum  _lpuart_transmit_cts_source { kLPUART_CtsSourcePin = 0U , kLPUART_CtsSourceMatchResult = 1U }
 LPUART transmit CTS source. More...
 
enum  _lpuart_transmit_cts_config { kLPUART_CtsSampleAtStart = 0U , kLPUART_CtsSampleAtIdle = 1U }
 LPUART transmit CTS configure. More...
 
enum  _lpuart_idle_type_select { kLPUART_IdleTypeStartBit = 0U , kLPUART_IdleTypeStopBit = 1U }
 LPUART idle flag type defines when the receiver starts counting. More...
 
enum  _lpuart_idle_config {
  kLPUART_IdleCharacter1 = 0U , kLPUART_IdleCharacter2 = 1U , kLPUART_IdleCharacter4 = 2U , kLPUART_IdleCharacter8 = 3U ,
  kLPUART_IdleCharacter16 = 4U , kLPUART_IdleCharacter32 = 5U , kLPUART_IdleCharacter64 = 6U , kLPUART_IdleCharacter128 = 7U
}
 LPUART idle detected configuration. This structure defines the number of idle characters that must be received before the IDLE flag is set. More...
 
enum  _lpuart_interrupt_enable {
  kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8) , kLPUART_RxActiveEdgeInterruptEnable = (LPUART_BAUD_RXEDGIE_MASK >> 8) , kLPUART_TxDataRegEmptyInterruptEnable = (LPUART_CTRL_TIE_MASK) , kLPUART_TransmissionCompleteInterruptEnable = (LPUART_CTRL_TCIE_MASK) ,
  kLPUART_RxDataRegFullInterruptEnable = (LPUART_CTRL_RIE_MASK) , kLPUART_IdleLineInterruptEnable = (LPUART_CTRL_ILIE_MASK) , kLPUART_RxOverrunInterruptEnable = (LPUART_CTRL_ORIE_MASK) , kLPUART_NoiseErrorInterruptEnable = (LPUART_CTRL_NEIE_MASK) ,
  kLPUART_FramingErrorInterruptEnable = (LPUART_CTRL_FEIE_MASK) , kLPUART_ParityErrorInterruptEnable = (LPUART_CTRL_PEIE_MASK) , kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK >> 8) , kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK >> 8)
}
 LPUART interrupt configuration structure, default settings all disabled. More...
 
enum  _lpuart_flags {
  kLPUART_TxDataRegEmptyFlag , kLPUART_TransmissionCompleteFlag , kLPUART_RxDataRegFullFlag , kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK) ,
  kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK) , kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK) , kLPUART_FramingErrorFlag , kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK) ,
  kLPUART_LinBreakFlag , kLPUART_RxActiveEdgeFlag , kLPUART_RxActiveFlag , kLPUART_DataMatch1Flag = LPUART_STAT_MA1F_MASK ,
  kLPUART_DataMatch2Flag = LPUART_STAT_MA2F_MASK , kLPUART_NoiseErrorInRxDataRegFlag , kLPUART_ParityErrorInRxDataRegFlag , kLPUART_TxFifoEmptyFlag = (LPUART_FIFO_TXEMPT_MASK >> 16) ,
  kLPUART_RxFifoEmptyFlag = (LPUART_FIFO_RXEMPT_MASK >> 16) , kLPUART_TxFifoOverflowFlag , kLPUART_RxFifoUnderflowFlag
}
 LPUART status flags. More...
 
typedef enum _lpuart_parity_mode lpuart_parity_mode_t
 LPUART parity mode.
 
typedef enum _lpuart_data_bits lpuart_data_bits_t
 LPUART data bits count.
 
typedef enum _lpuart_stop_bit_count lpuart_stop_bit_count_t
 LPUART stop bit count.
 
typedef enum _lpuart_transmit_cts_source lpuart_transmit_cts_source_t
 LPUART transmit CTS source.
 
typedef enum _lpuart_transmit_cts_config lpuart_transmit_cts_config_t
 LPUART transmit CTS configure.
 
typedef enum _lpuart_idle_type_select lpuart_idle_type_select_t
 LPUART idle flag type defines when the receiver starts counting.
 
typedef enum _lpuart_idle_config lpuart_idle_config_t
 LPUART idle detected configuration. This structure defines the number of idle characters that must be received before the IDLE flag is set.
 
typedef struct _lpuart_config lpuart_config_t
 LPUART configuration structure.
 
typedef struct _lpuart_transfer lpuart_transfer_t
 LPUART transfer structure.
 
typedef struct _lpuart_handle lpuart_handle_t
 
typedef void(* lpuart_transfer_callback_t) (LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData)
 LPUART transfer callback function.
 

Go to the source code of this file.