fsl_lpuart.h
/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _FSL_LPUART_H_
#define _FSL_LPUART_H_
#include "fsl_common.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define FSL_LPUART_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
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 =
MAKE_STATUS(kStatusGroup_LPUART, 8),
kStatus_LPUART_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPUART, 9)
};
typedef enum _lpuart_parity_mode
{
kLPUART_ParityDisabled = 0x0U,
kLPUART_ParityEven = 0x2U,
kLPUART_ParityOdd = 0x3U,
} lpuart_parity_mode_t;
typedef enum _lpuart_stop_bit_count
{
kLPUART_OneStopBit = 0U,
kLPUART_TwoStopBit = 1U,
} lpuart_stop_bit_count_t;
enum _lpuart_interrupt_enable
{
#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
kLPUART_LinBreakInterruptEnable = (LPUART_BAUD_LBKDIE_MASK >> 8),
#endif
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),
#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
kLPUART_TxFifoOverflowInterruptEnable = (LPUART_FIFO_TXOFE_MASK >> 8),
kLPUART_RxFifoUnderflowInterruptEnable = (LPUART_FIFO_RXUFE_MASK >> 8),
#endif
};
enum _lpuart_flags
{
kLPUART_TxDataRegEmptyFlag =
(LPUART_STAT_TDRE_MASK),
kLPUART_TransmissionCompleteFlag =
(LPUART_STAT_TC_MASK),
kLPUART_RxDataRegFullFlag =
(LPUART_STAT_RDRF_MASK),
kLPUART_IdleLineFlag = (LPUART_STAT_IDLE_MASK),
kLPUART_RxOverrunFlag = (LPUART_STAT_OR_MASK),
kLPUART_NoiseErrorFlag = (LPUART_STAT_NF_MASK),
kLPUART_FramingErrorFlag =
(LPUART_STAT_FE_MASK),
kLPUART_ParityErrorFlag = (LPUART_STAT_PF_MASK),
#if defined(FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPUART_HAS_LIN_BREAK_DETECT
kLPUART_LinBreakFlag = (LPUART_STAT_LBKDIF_MASK),
#endif
kLPUART_RxActiveEdgeFlag =
(LPUART_STAT_RXEDGIF_MASK),
kLPUART_RxActiveFlag =
(LPUART_STAT_RAF_MASK),
#if defined(FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING) && FSL_FEATURE_LPUART_HAS_ADDRESS_MATCHING
kLPUART_DataMatch1Flag = LPUART_STAT_MA1F_MASK,
kLPUART_DataMatch2Flag = LPUART_STAT_MA2F_MASK,
#endif
#if defined(FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS) && FSL_FEATURE_LPUART_HAS_EXTENDED_DATA_REGISTER_FLAGS
kLPUART_NoiseErrorInRxDataRegFlag =
(LPUART_DATA_NOISY_MASK >> 10),
kLPUART_ParityErrorInRxDataRegFlag =
(LPUART_DATA_PARITYE_MASK >> 10),
#endif
#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
kLPUART_TxFifoEmptyFlag = (LPUART_FIFO_TXEMPT_MASK >> 16),
kLPUART_RxFifoEmptyFlag = (LPUART_FIFO_RXEMPT_MASK >> 16),
kLPUART_TxFifoOverflowFlag =
(LPUART_FIFO_TXOF_MASK >> 16),
kLPUART_RxFifoUnderflowFlag =
(LPUART_FIFO_RXUF_MASK >> 16),
#endif
};
typedef struct _lpuart_config
{
uint32_t baudRate_Bps;
lpuart_parity_mode_t parityMode;
#if defined(FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPUART_HAS_STOP_BIT_CONFIG_SUPPORT
lpuart_stop_bit_count_t stopBitCount;
#endif
#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
uint8_t txFifoWatermark;
uint8_t rxFifoWatermark;
#endif
bool enableTx;
bool enableRx;
} lpuart_config_t;
typedef struct _lpuart_transfer
{
uint8_t *data;
size_t dataSize;
} lpuart_transfer_t;
/* Forward declaration of the handle typedef. */
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);
struct _lpuart_handle
{
uint8_t *volatile txData;
volatile size_t txDataSize;
size_t txDataSizeAll;
uint8_t *volatile rxData;
volatile size_t rxDataSize;
size_t rxDataSizeAll;
uint8_t *rxRingBuffer;
size_t rxRingBufferSize;
volatile uint16_t rxRingBufferHead;
volatile uint16_t rxRingBufferTail;
lpuart_transfer_callback_t callback;
void *userData;
volatile uint8_t txState;
volatile uint8_t rxState;
};
/*******************************************************************************
* API
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif /* _cplusplus */
void LPUART_Init(LPUART_Type *base, const lpuart_config_t *config, uint32_t srcClock_Hz);
void LPUART_Deinit(LPUART_Type *base);
void LPUART_GetDefaultConfig(lpuart_config_t *config);
void LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz);
/* @} */
uint32_t LPUART_GetStatusFlags(LPUART_Type *base);
status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask);
/* @} */
void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask);
void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask);
uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base);
#if defined(FSL_FEATURE_LPUART_HAS_DMA_ENABLE) && FSL_FEATURE_LPUART_HAS_DMA_ENABLE
static inline uint32_t LPUART_GetDataRegisterAddress(LPUART_Type *base)
{
return (uint32_t) & (base->DATA);
}
static inline void LPUART_EnableTxDMA(LPUART_Type *base, bool enable)
{
if (enable)
{
base->BAUD |= LPUART_BAUD_TDMAE_MASK;
base->CTRL |= LPUART_CTRL_TIE_MASK;
}
else
{
base->BAUD &= ~LPUART_BAUD_TDMAE_MASK;
base->CTRL &= ~LPUART_CTRL_TIE_MASK;
}
}
static inline void LPUART_EnableRxDMA(LPUART_Type *base, bool enable)
{
if (enable)
{
base->BAUD |= LPUART_BAUD_RDMAE_MASK;
base->CTRL |= LPUART_CTRL_RIE_MASK;
}
else
{
base->BAUD &= ~LPUART_BAUD_RDMAE_MASK;
base->CTRL &= ~LPUART_CTRL_RIE_MASK;
}
}
/* @} */
#endif /* FSL_FEATURE_LPUART_HAS_DMA_ENABLE */
static inline void LPUART_EnableTx(LPUART_Type *base, bool enable)
{
if (enable)
{
base->CTRL |= LPUART_CTRL_TE_MASK;
}
else
{
base->CTRL &= ~LPUART_CTRL_TE_MASK;
}
}
static inline void LPUART_EnableRx(LPUART_Type *base, bool enable)
{
if (enable)
{
base->CTRL |= LPUART_CTRL_RE_MASK;
}
else
{
base->CTRL &= ~LPUART_CTRL_RE_MASK;
}
}
void LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length);
static inline void LPUART_WriteByte(LPUART_Type *base, uint8_t data)
{
base->DATA = data;
}
void LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length);
static inline uint8_t LPUART_ReadByte(LPUART_Type *base)
{
return base->DATA;
}
/* @} */
void LPUART_CreateHandle(LPUART_Type *base,
lpuart_handle_t *handle,
lpuart_transfer_callback_t callback,
void *userData);
status_t LPUART_SendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer);
void LPUART_StartRingBuffer(LPUART_Type *base, lpuart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize);
void LPUART_StopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle);
void LPUART_AbortSend(LPUART_Type *base, lpuart_handle_t *handle);
status_t LPUART_GetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count);
status_t LPUART_ReceiveNonBlocking(LPUART_Type *base,
lpuart_handle_t *handle,
lpuart_transfer_t *xfer,
size_t *receivedBytes);
void LPUART_AbortReceive(LPUART_Type *base, lpuart_handle_t *handle);
status_t LPUART_GetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count);
void LPUART_HandleIRQ(LPUART_Type *base, lpuart_handle_t *handle);
void LPUART_HandleErrorIRQ(LPUART_Type *base, lpuart_handle_t *handle);
/* @} */
#if defined(__cplusplus)
}
#endif
#endif /* _FSL_LPUART_H_ */
kLPUART_OneStopBit
Definition: fsl_lpuart.h:76
LPUART_StartRingBuffer
void LPUART_StartRingBuffer(LPUART_Type *base, lpuart_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
Sets up the RX ring buffer.
Definition: fsl_lpuart.c:568
kLPUART_ParityErrorInRxDataRegFlag
Definition: fsl_lpuart.h:141
lpuart_transfer_t::data
uint8_t * data
Definition: fsl_lpuart.h:173
kLPUART_FramingErrorInterruptEnable
Definition: fsl_lpuart.h:97
kLPUART_RxActiveEdgeInterruptEnable
Definition: fsl_lpuart.h:90
kLPUART_TwoStopBit
Definition: fsl_lpuart.h:77
kLPUART_TxDataRegEmptyFlag
Definition: fsl_lpuart.h:112
_lpuart_handle::rxDataSize
volatile size_t rxDataSize
Definition: fsl_lpuart.h:190
LPUART_GetReceiveCount
status_t LPUART_GetReceiveCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
Get the number of bytes that have been received.
Definition: fsl_lpuart.c:766
_lpuart_handle::rxState
volatile uint8_t rxState
Definition: fsl_lpuart.h:202
LPUART_ClearStatusFlags
status_t LPUART_ClearStatusFlags(LPUART_Type *base, uint32_t mask)
Clears status flags with a provided mask.
Definition: fsl_lpuart.c:457
kStatus_LPUART_RxBusy
Definition: fsl_lpuart.h:52
_lpuart_handle::rxData
uint8_t *volatile rxData
Definition: fsl_lpuart.h:189
LPUART_StopRingBuffer
void LPUART_StopRingBuffer(LPUART_Type *base, lpuart_handle_t *handle)
Abort the background transfer and uninstall the ring buffer.
Definition: fsl_lpuart.c:585
LPUART_EnableInterrupts
void LPUART_EnableInterrupts(LPUART_Type *base, uint32_t mask)
Enables LPUART interrupts according to a provided mask.
Definition: fsl_lpuart.c:413
LPUART_GetStatusFlags
uint32_t LPUART_GetStatusFlags(LPUART_Type *base)
Gets LPUART status flags.
Definition: fsl_lpuart.c:445
LPUART_EnableRxDMA
static void LPUART_EnableRxDMA(LPUART_Type *base, bool enable)
Enables or disables the LPUART receiver DMA.
Definition: fsl_lpuart.h:430
LPUART_GetSendCount
status_t LPUART_GetSendCount(LPUART_Type *base, lpuart_handle_t *handle, uint32_t *count)
Get the number of bytes that have been written to LPUART TX register.
Definition: fsl_lpuart.c:633
LPUART_HandleErrorIRQ
void LPUART_HandleErrorIRQ(LPUART_Type *base, lpuart_handle_t *handle)
LPUART Error IRQ handle function.
Definition: fsl_lpuart.c:935
LPUART_CreateHandle
void LPUART_CreateHandle(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_callback_t callback, void *userData)
Initializes the LPUART handle.
Definition: fsl_lpuart.c:526
kStatusGroup_LPUART
Definition: fsl_common.h:78
lpuart_config_t::rxFifoWatermark
uint8_t rxFifoWatermark
Definition: fsl_lpuart.h:164
LPUART_GetEnabledInterrupts
uint32_t LPUART_GetEnabledInterrupts(LPUART_Type *base)
Gets enabled LPUART interrupts.
Definition: fsl_lpuart.c:433
kLPUART_RxOverrunInterruptEnable
Definition: fsl_lpuart.h:95
kLPUART_RxActiveEdgeFlag
Definition: fsl_lpuart.h:130
kLPUART_TransmissionCompleteInterruptEnable
Definition: fsl_lpuart.h:92
lpuart_parity_mode_t
lpuart_parity_mode_t
LPUART parity mode.
Definition: fsl_lpuart.h:66
kLPUART_TxDataRegEmptyInterruptEnable
Definition: fsl_lpuart.h:91
kStatus_LPUART_TxBusy
Definition: fsl_lpuart.h:51
_lpuart_handle::userData
void * userData
Definition: fsl_lpuart.h:199
kStatus_LPUART_TxIdle
Definition: fsl_lpuart.h:53
kLPUART_NoiseErrorFlag
Definition: fsl_lpuart.h:121
kStatus_LPUART_TxWatermarkTooLarge
Definition: fsl_lpuart.h:55
kStatus_LPUART_FlagCannotClearManually
Definition: fsl_lpuart.h:57
kLPUART_DataMatch2Flag
Definition: fsl_lpuart.h:136
kStatus_LPUART_RxRingBufferOverrun
Definition: fsl_lpuart.h:60
LPUART_ReceiveNonBlocking
status_t LPUART_ReceiveNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer, size_t *receivedBytes)
Receives a buffer of data using the interrupt method.
Definition: fsl_lpuart.c:650
kLPUART_RxFifoEmptyFlag
Definition: fsl_lpuart.h:146
kLPUART_ParityDisabled
Definition: fsl_lpuart.h:68
LPUART_EnableRx
static void LPUART_EnableRx(LPUART_Type *base, bool enable)
Enables or disables the LPUART receiver.
Definition: fsl_lpuart.h:480
kLPUART_LinBreakInterruptEnable
Definition: fsl_lpuart.h:88
kLPUART_TxFifoOverflowInterruptEnable
Definition: fsl_lpuart.h:100
kLPUART_IdleLineFlag
Definition: fsl_lpuart.h:118
kStatus_LPUART_RxHardwareOverrun
Definition: fsl_lpuart.h:62
kLPUART_RxOverrunFlag
Definition: fsl_lpuart.h:119
_lpuart_handle::callback
lpuart_transfer_callback_t callback
Definition: fsl_lpuart.h:198
lpuart_config_t::baudRate_Bps
uint32_t baudRate_Bps
Definition: fsl_lpuart.h:157
LPUART_DisableInterrupts
void LPUART_DisableInterrupts(LPUART_Type *base, uint32_t mask)
Disables LPUART interrupts according to a provided mask.
Definition: fsl_lpuart.c:423
lpuart_transfer_t
LPUART transfer structure.
Definition: fsl_lpuart.h:171
lpuart_config_t
LPUART configure structure.
Definition: fsl_lpuart.h:155
kLPUART_RxFifoUnderflowFlag
Definition: fsl_lpuart.h:149
_lpuart_interrupt_enable
_lpuart_interrupt_enable
LPUART interrupt configuration structure, default settings all disabled.
Definition: fsl_lpuart.h:85
_lpuart_handle::txDataSizeAll
size_t txDataSizeAll
Definition: fsl_lpuart.h:188
LPUART_GetDefaultConfig
void LPUART_GetDefaultConfig(lpuart_config_t *config)
Gets the default configuration structure.
Definition: fsl_lpuart.c:321
kLPUART_LinBreakFlag
Definition: fsl_lpuart.h:127
lpuart_config_t::stopBitCount
lpuart_stop_bit_count_t stopBitCount
Definition: fsl_lpuart.h:160
kLPUART_ParityErrorInterruptEnable
Definition: fsl_lpuart.h:98
lpuart_config_t::parityMode
lpuart_parity_mode_t parityMode
Definition: fsl_lpuart.h:158
LPUART_Deinit
void LPUART_Deinit(LPUART_Type *base)
Deinitializes a LPUART instance.
Definition: fsl_lpuart.c:301
LPUART_ReadBlocking
void LPUART_ReadBlocking(LPUART_Type *base, uint8_t *data, size_t length)
Reads the RX data register using a blocking method.
Definition: fsl_lpuart.c:511
kLPUART_TxFifoOverflowFlag
Definition: fsl_lpuart.h:147
_lpuart_handle::txState
volatile uint8_t txState
Definition: fsl_lpuart.h:201
kStatus_LPUART_RxWatermarkTooLarge
Definition: fsl_lpuart.h:56
LPUART_HandleIRQ
void LPUART_HandleIRQ(LPUART_Type *base, lpuart_handle_t *handle)
LPUART IRQ handle function.
Definition: fsl_lpuart.c:783
kLPUART_IdleLineInterruptEnable
Definition: fsl_lpuart.h:94
kLPUART_RxDataRegFullInterruptEnable
Definition: fsl_lpuart.h:93
lpuart_transfer_callback_t
void(* lpuart_transfer_callback_t)(LPUART_Type *base, lpuart_handle_t *handle, status_t status, void *userData)
LPUART transfer callback function.
Definition: fsl_lpuart.h:181
_lpuart_handle::txDataSize
volatile size_t txDataSize
Definition: fsl_lpuart.h:187
kLPUART_RxDataRegFullFlag
Definition: fsl_lpuart.h:116
kLPUART_TxFifoEmptyFlag
Definition: fsl_lpuart.h:145
LPUART_AbortReceive
void LPUART_AbortReceive(LPUART_Type *base, lpuart_handle_t *handle)
Aborts the interrupt-driven data receiving.
Definition: fsl_lpuart.c:753
LPUART_GetDataRegisterAddress
static uint32_t LPUART_GetDataRegisterAddress(LPUART_Type *base)
Gets the LPUART data register address.
Definition: fsl_lpuart.h:395
lpuart_stop_bit_count_t
lpuart_stop_bit_count_t
LPUART stop bit count.
Definition: fsl_lpuart.h:74
kLPUART_TransmissionCompleteFlag
Definition: fsl_lpuart.h:114
kLPUART_NoiseErrorInterruptEnable
Definition: fsl_lpuart.h:96
LPUART_SetBaudRate
void LPUART_SetBaudRate(LPUART_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
Sets the LPUART instance baudrate.
Definition: fsl_lpuart.c:337
kLPUART_ParityEven
Definition: fsl_lpuart.h:69
_lpuart_handle::rxDataSizeAll
size_t rxDataSizeAll
Definition: fsl_lpuart.h:191
_lpuart_flags
_lpuart_flags
LPUART status flags.
Definition: fsl_lpuart.h:110
LPUART_WriteByte
static void LPUART_WriteByte(LPUART_Type *base, uint8_t data)
Writes to the transmitter register.
Definition: fsl_lpuart.h:517
kStatus_LPUART_Error
Definition: fsl_lpuart.h:59
LPUART_ReadByte
static uint8_t LPUART_ReadByte(LPUART_Type *base)
Reads the RX register.
Definition: fsl_lpuart.h:543
lpuart_config_t::enableTx
bool enableTx
Definition: fsl_lpuart.h:166
LPUART_EnableTxDMA
static void LPUART_EnableTxDMA(LPUART_Type *base, bool enable)
Enables or disables the LPUART transmitter DMA request.
Definition: fsl_lpuart.h:408
kLPUART_RxActiveFlag
Definition: fsl_lpuart.h:132
lpuart_config_t::txFifoWatermark
uint8_t txFifoWatermark
Definition: fsl_lpuart.h:163
_lpuart_handle
LPUART handle structure.
Definition: fsl_lpuart.h:184
kLPUART_FramingErrorFlag
Definition: fsl_lpuart.h:123
_lpuart_handle::txData
uint8_t *volatile txData
Definition: fsl_lpuart.h:186
LPUART_WriteBlocking
void LPUART_WriteBlocking(LPUART_Type *base, const uint8_t *data, size_t length)
Writes to transmitter register using a blocking method.
Definition: fsl_lpuart.c:498
_lpuart_handle::rxRingBufferTail
volatile uint16_t rxRingBufferTail
Definition: fsl_lpuart.h:196
LPUART_EnableTx
static void LPUART_EnableTx(LPUART_Type *base, bool enable)
Enables or disables the LPUART transmitter.
Definition: fsl_lpuart.h:460
kStatus_LPUART_RxIdle
Definition: fsl_lpuart.h:54
_lpuart_handle::rxRingBuffer
uint8_t * rxRingBuffer
Definition: fsl_lpuart.h:193
kLPUART_ParityOdd
Definition: fsl_lpuart.h:70
kLPUART_DataMatch1Flag
Definition: fsl_lpuart.h:135
lpuart_transfer_t::dataSize
size_t dataSize
Definition: fsl_lpuart.h:174
kLPUART_RxFifoUnderflowInterruptEnable
Definition: fsl_lpuart.h:101
_lpuart_handle::rxRingBufferHead
volatile uint16_t rxRingBufferHead
Definition: fsl_lpuart.h:195
kLPUART_ParityErrorFlag
Definition: fsl_lpuart.h:125
kLPUART_NoiseErrorInRxDataRegFlag
Definition: fsl_lpuart.h:139
lpuart_config_t::enableRx
bool enableRx
Definition: fsl_lpuart.h:167
LPUART_SendNonBlocking
status_t LPUART_SendNonBlocking(LPUART_Type *base, lpuart_handle_t *handle, lpuart_transfer_t *xfer)
Transmits a buffer of data using the interrupt method.
Definition: fsl_lpuart.c:600
status_t
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:121
LPUART_Init
void 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...
Definition: fsl_lpuart.c:185
_lpuart_handle::rxRingBufferSize
size_t rxRingBufferSize
Definition: fsl_lpuart.h:194
LPUART_AbortSend
void LPUART_AbortSend(LPUART_Type *base, lpuart_handle_t *handle)
Aborts the interrupt-driven data transmit.
Definition: fsl_lpuart.c:625