fsl_lpsci.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_LPSCI_H_
#define _FSL_LPSCI_H_
#include "fsl_common.h"
/*******************************************************************************
* Definitions
******************************************************************************/
#define FSL_LPSCI_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
enum _lpsci_status
{
kStatus_LPSCI_TxBusy = MAKE_STATUS(kStatusGroup_LPSCI, 0),
kStatus_LPSCI_RxBusy = MAKE_STATUS(kStatusGroup_LPSCI, 1),
kStatus_LPSCI_TxIdle = MAKE_STATUS(kStatusGroup_LPSCI, 2),
kStatus_LPSCI_RxIdle = MAKE_STATUS(kStatusGroup_LPSCI, 3),
kStatus_LPSCI_FlagCannotClearManually =
MAKE_STATUS(kStatusGroup_LPSCI, 2),
kStatus_LPSCI_BaudrateNotSupport =
MAKE_STATUS(kStatusGroup_LPSCI, 3),
kStatus_LPSCI_Error = MAKE_STATUS(kStatusGroup_LPSCI, 4),
kStatus_LPSCI_RxRingBufferOverrun =
MAKE_STATUS(kStatusGroup_LPSCI, 8),
kStatus_LPSCI_RxHardwareOverrun = MAKE_STATUS(kStatusGroup_LPSCI, 9),
kStatus_LPSCI_NoiseError = MAKE_STATUS(kStatusGroup_LPSCI, 10),
kStatus_LPSCI_FramingError = MAKE_STATUS(kStatusGroup_LPSCI, 11),
kStatus_LPSCI_ParityError = MAKE_STATUS(kStatusGroup_LPSCI, 12),
};
typedef enum _lpsci_parity_mode
{
kLPSCI_ParityDisabled = 0x0U,
kLPSCI_ParityEven = 0x2U,
kLPSCI_ParityOdd = 0x3U,
} lpsci_parity_mode_t;
typedef enum _lpsci_stop_bit_count
{
kLPSCI_OneStopBit = 0U,
kLPSCI_TwoStopBit = 1U,
} lpsci_stop_bit_count_t;
enum _lpsci_interrupt_enable_t
{
#if defined(FSL_FEATURE_LPSCI_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPSCI_HAS_LIN_BREAK_DETECT
kLPSCI_LinBreakInterruptEnable = (UART0_BDH_LBKDIE_MASK),
#endif
kLPSCI_RxActiveEdgeInterruptEnable = (UART0_BDH_RXEDGIE_MASK),
kLPSCI_TxDataRegEmptyInterruptEnable = (UART0_C2_TIE_MASK << 8),
kLPSCI_TransmissionCompleteInterruptEnable = (UART0_C2_TCIE_MASK << 8),
kLPSCI_RxDataRegFullInterruptEnable = (UART0_C2_RIE_MASK << 8),
kLPSCI_IdleLineInterruptEnable = (UART0_C2_ILIE_MASK << 8),
kLPSCI_RxOverrunInterruptEnable = (UART0_C3_ORIE_MASK << 16),
kLPSCI_NoiseErrorInterruptEnable = (UART0_C3_NEIE_MASK << 16),
kLPSCI_FramingErrorInterruptEnable = (UART0_C3_FEIE_MASK << 16),
kLPSCI_ParityErrorInterruptEnable = (UART0_C3_PEIE_MASK << 16),
};
enum _lpsci_status_flag_t
{
kLPSCI_TxDataRegEmptyFlag = (UART0_S1_TDRE_MASK),
kLPSCI_TransmissionCompleteFlag =
(UART0_S1_TC_MASK),
kLPSCI_RxDataRegFullFlag =
(UART0_S1_RDRF_MASK),
kLPSCI_IdleLineFlag = (UART0_S1_IDLE_MASK),
kLPSCI_RxOverrunFlag =
(UART0_S1_OR_MASK),
kLPSCI_NoiseErrorFlag = (UART0_S1_NF_MASK),
kLPSCI_FramingErrorFlag =
(UART0_S1_FE_MASK),
kLPSCI_ParityErrorFlag = (UART0_S1_PF_MASK),
#if defined(FSL_FEATURE_LPSCI_HAS_LIN_BREAK_DETECT) && FSL_FEATURE_LPSCI_HAS_LIN_BREAK_DETECT
kLPSCI_LinBreakFlag =
(UART0_S2_LBKDIF_MASK
<< 8),
#endif
kLPSCI_RxActiveEdgeFlag =
(UART0_S2_RXEDGIF_MASK << 8),
kLPSCI_RxActiveFlag =
(UART0_S2_RAF_MASK << 8),
#if defined(FSL_FEATURE_LPSCI_HAS_EXTENDED_DATA_REGISTER_FLAGS) && FSL_FEATURE_LPSCI_HAS_EXTENDED_DATA_REGISTER_FLAGS
kLPSCI_NoiseErrorInRxDataRegFlag =
(UART0_ED_NOISY_MASK << 16),
kLPSCI_ParityErrorInRxDataRegFlag =
(UART0_ED_PARITYE_MASK << 16),
#endif
};
typedef struct _lpsci_config
{
uint32_t baudRate_Bps;
lpsci_parity_mode_t parityMode;
#if defined(FSL_FEATURE_LPSCI_HAS_STOP_BIT_CONFIG_SUPPORT) && FSL_FEATURE_LPSCI_HAS_STOP_BIT_CONFIG_SUPPORT
lpsci_stop_bit_count_t stopBitCount;
#endif
bool enableTx;
bool enableRx;
} lpsci_config_t;
typedef struct _lpsci_transfer
{
uint8_t *data;
size_t dataSize;
} lpsci_transfer_t;
/* Forward declaration of the handle typedef. */
typedef struct _lpsci_handle lpsci_handle_t;
typedef void (*lpsci_transfer_callback_t)(UART0_Type *base, lpsci_handle_t *handle, status_t status, void *userData);
/*<! @brief LPSCI handle used for storing the state among transactional APIs' calling. This structure is only used for
* transactional APIs. */
struct _lpsci_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;
lpsci_transfer_callback_t callback;
void *userData;
volatile uint8_t txState;
volatile uint8_t rxState;
};
/*******************************************************************************
* API
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif /* _cplusplus */
status_t LPSCI_Init(UART0_Type *base, const lpsci_config_t *config, uint32_t srcClock_Hz);
void LPSCI_Deinit(UART0_Type *base);
void LPSCI_GetDefaultConfig(lpsci_config_t *config);
status_t LPSCI_SetBaudRate(UART0_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz);
/* @} */
uint32_t LPSCI_GetStatusFlags(UART0_Type *base);
/* @brief Clears status flags with a provided mask.
*
* This function clears the LPSCI status flags with a provided mask. Automatically cleared flag
* can't be cleared by this function.
* Some flags can only be cleared or set by hardware. These flags are:
* kLPSCI_TxDataRegEmptyFlag,kLPSCI_TransmissionCompleteFlag,kLPSCI_RxDataRegFullFlag,kLPSCI_RxActiveFlag,kLPSCI_NoiseErrorInRxDataRegFlag
* kLPSCI_ParityErrorInRxDataRegFlag,kLPSCI_TxFifoEmptyFlag,kLPSCI_RxFifoEmptyFlag
* Note: This API should be called when the Tx/Rx is idle, otherwise it takes no effects.
*
* @param base LPSCI peripheral base address.
* @param mask The status flags to be cleared, it is logical OR value of @ref _LPSCI_flagss.
* @retval kStatus_LPSCI_FlagCannotClearManually can't be cleared by this function but it is cleared
* automatically by hardware.
* @retval kStatus_Success Status in the mask are cleared.
*/
status_t LPSCI_ClearStatusFlags(UART0_Type *base, uint32_t mask);
/* @} */
void LPSCI_EnableInterrupts(UART0_Type *base, uint32_t mask);
void LPSCI_DisableInterrupts(UART0_Type *base, uint32_t mask);
uint32_t LPSCI_GetEnabledInterrupts(UART0_Type *base);
/* @} */
#if defined(FSL_FEATURE_LPSCI_HAS_DMA_ENABLE) && FSL_FEATURE_LPSCI_HAS_DMA_ENABLE
static inline uint32_t LPSCI_GetDataRegisterAddress(UART0_Type *base)
{
return (uint32_t) & (base->D);
}
static inline void LPSCI_EnableTxDMA(UART0_Type *base, bool enable)
{
if (enable)
{
base->C5 |= UART0_C5_TDMAE_MASK;
base->C2 |= UART0_C2_TIE_MASK;
}
else
{
base->C5 &= ~UART0_C5_TDMAE_MASK;
base->C2 &= ~UART0_C2_TIE_MASK;
}
}
static inline void LPSCI_EnableRxDMA(UART0_Type *base, bool enable)
{
if (enable)
{
base->C5 |= UART0_C5_RDMAE_MASK;
base->C2 |= UART0_C2_RIE_MASK;
}
else
{
base->C5 &= ~UART0_C5_RDMAE_MASK;
base->C2 &= ~UART0_C2_RIE_MASK;
}
}
/* @} */
#endif /* defined(FSL_FEATURE_LPSCI_HAS_DMA_ENABLE) && FSL_FEATURE_LPSCI_HAS_DMA_ENABLE */
static inline void LPSCI_EnableTx(UART0_Type *base, bool enable)
{
if (enable)
{
base->C2 |= UART0_C2_TE_MASK;
}
else
{
base->C2 &= ~UART0_C2_TE_MASK;
}
}
static inline void LPSCI_EnableRx(UART0_Type *base, bool enable)
{
if (enable)
{
base->C2 |= UART0_C2_RE_MASK;
}
else
{
base->C2 &= ~UART0_C2_RE_MASK;
}
}
static inline void LPSCI_WriteByte(UART0_Type *base, uint8_t data)
{
base->D = data;
}
static inline uint8_t LPSCI_ReadByte(UART0_Type *base)
{
return base->D;
}
/* @} */
void LPSCI_TransferCreateHandle(UART0_Type *base,
lpsci_handle_t *handle,
lpsci_transfer_callback_t callback,
void *userData);
void LPSCI_TransferStartRingBuffer(UART0_Type *base,
lpsci_handle_t *handle,
uint8_t *ringBuffer,
size_t ringBufferSize);
void LPSCI_TransferStopRingBuffer(UART0_Type *base, lpsci_handle_t *handle);
void LPSCI_TransferSendBlocking(UART0_Type *base, const uint8_t *data, size_t length);
status_t LPSCI_TransferSendNonBlocking(UART0_Type *base, lpsci_handle_t *handle, lpsci_transfer_t *xfer);
void LPSCI_TransferAbortSend(UART0_Type *base, lpsci_handle_t *handle);
status_t LPSCI_TransferGetSendCount(UART0_Type *base, lpsci_handle_t *handle, uint32_t *count);
status_t LPSCI_TransferReceiveBlocking(UART0_Type *base, uint8_t *data, size_t length);
status_t LPSCI_TransferReceiveNonBlocking(UART0_Type *base,
lpsci_handle_t *handle,
lpsci_transfer_t *xfer,
size_t *receivedBytes);
void LPSCI_TransferAbortReceive(UART0_Type *base, lpsci_handle_t *handle);
status_t LPSCI_TransferGetReceiveCount(UART0_Type *base, lpsci_handle_t *handle, uint32_t *count);
void LPSCI_TransferHandleIRQ(UART0_Type *base, lpsci_handle_t *handle);
void LPSCI_TransferHandleErrorIRQ(UART0_Type *base, lpsci_handle_t *handle);
/* @} */
#if defined(__cplusplus)
}
#endif
#endif /* _FSL_LPSCI_H_ */
kLPSCI_NoiseErrorFlag
Definition: fsl_lpsci.h:118
LPSCI_DisableInterrupts
void LPSCI_DisableInterrupts(UART0_Type *base, uint32_t mask)
Disables the LPSCI interrupt according to a provided mask.
Definition: fsl_lpsci.c:413
LPSCI_EnableTxDMA
static void LPSCI_EnableTxDMA(UART0_Type *base, bool enable)
Enables or disable LPSCI transmitter DMA request.
Definition: fsl_lpsci.h:396
lpsci_config_t::enableTx
bool enableTx
Definition: fsl_lpsci.h:148
lpsci_transfer_callback_t
void(* lpsci_transfer_callback_t)(UART0_Type *base, lpsci_handle_t *handle, status_t status, void *userData)
LPSCI transfer callback function.
Definition: fsl_lpsci.h:163
_lpsci_handle::rxState
volatile uint8_t rxState
Definition: fsl_lpsci.h:185
kLPSCI_LinBreakFlag
Definition: fsl_lpsci.h:124
kLPSCI_TransmissionCompleteFlag
Definition: fsl_lpsci.h:111
kStatus_LPSCI_FramingError
Definition: fsl_lpsci.h:63
LPSCI_TransferStartRingBuffer
void LPSCI_TransferStartRingBuffer(UART0_Type *base, lpsci_handle_t *handle, uint8_t *ringBuffer, size_t ringBufferSize)
Sets up the RX ring buffer.
Definition: fsl_lpsci.c:573
kStatus_LPSCI_RxBusy
Definition: fsl_lpsci.h:51
kLPSCI_IdleLineInterruptEnable
Definition: fsl_lpsci.h:96
kLPSCI_LinBreakInterruptEnable
Definition: fsl_lpsci.h:90
_lpsci_handle::rxRingBuffer
uint8_t * rxRingBuffer
Definition: fsl_lpsci.h:176
LPSCI_TransferHandleErrorIRQ
void LPSCI_TransferHandleErrorIRQ(UART0_Type *base, lpsci_handle_t *handle)
LPSCI Error IRQ handle function.
Definition: fsl_lpsci.c:957
lpsci_config_t::baudRate_Bps
uint32_t baudRate_Bps
Definition: fsl_lpsci.h:143
LPSCI_TransferSendNonBlocking
status_t LPSCI_TransferSendNonBlocking(UART0_Type *base, lpsci_handle_t *handle, lpsci_transfer_t *xfer)
Transmits a buffer of data using the interrupt method.
Definition: fsl_lpsci.c:605
_lpsci_handle::rxRingBufferTail
volatile uint16_t rxRingBufferTail
Definition: fsl_lpsci.h:179
kLPSCI_RxActiveEdgeFlag
Definition: fsl_lpsci.h:128
lpsci_transfer_t::data
uint8_t * data
Definition: fsl_lpsci.h:155
LPSCI_WriteByte
static void LPSCI_WriteByte(UART0_Type *base, uint8_t data)
Writes to the TX register.
Definition: fsl_lpsci.h:489
LPSCI_TransferCreateHandle
void LPSCI_TransferCreateHandle(UART0_Type *base, lpsci_handle_t *handle, lpsci_transfer_callback_t callback, void *userData)
Initializes the LPSCI handle.
Definition: fsl_lpsci.c:541
_lpsci_interrupt_enable_t
_lpsci_interrupt_enable_t
LPSCI interrupt configuration structure, default settings all disabled.
Definition: fsl_lpsci.h:87
kStatus_LPSCI_FlagCannotClearManually
Definition: fsl_lpsci.h:54
kStatus_LPSCI_TxBusy
Definition: fsl_lpsci.h:50
kLPSCI_RxDataRegFullInterruptEnable
Definition: fsl_lpsci.h:95
LPSCI_EnableInterrupts
void LPSCI_EnableInterrupts(UART0_Type *base, uint32_t mask)
Enables an LPSCI interrupt according to a provided mask.
Definition: fsl_lpsci.c:404
LPSCI_EnableRx
static void LPSCI_EnableRx(UART0_Type *base, bool enable)
Enables or disables the LPSCI receiver.
Definition: fsl_lpsci.h:468
LPSCI_TransferAbortSend
void LPSCI_TransferAbortSend(UART0_Type *base, lpsci_handle_t *handle)
Aborts the interrupt-driven data transmit.
Definition: fsl_lpsci.c:636
kLPSCI_OneStopBit
Definition: fsl_lpsci.h:78
_lpsci_handle::txState
volatile uint8_t txState
Definition: fsl_lpsci.h:184
LPSCI_TransferReceiveBlocking
status_t LPSCI_TransferReceiveBlocking(UART0_Type *base, uint8_t *data, size_t length)
Reads the RX register using a non-blocking method.
Definition: fsl_lpsci.c:501
LPSCI_Deinit
void LPSCI_Deinit(UART0_Type *base)
Deinitializes an LPSCI instance.
Definition: fsl_lpsci.c:306
lpsci_config_t::stopBitCount
lpsci_stop_bit_count_t stopBitCount
Definition: fsl_lpsci.h:146
LPSCI_ReadByte
static uint8_t LPSCI_ReadByte(UART0_Type *base)
Reads the RX data register.
Definition: fsl_lpsci.h:503
LPSCI_SetBaudRate
status_t LPSCI_SetBaudRate(UART0_Type *base, uint32_t baudRate_Bps, uint32_t srcClock_Hz)
Sets the LPSCI instance baudrate.
Definition: fsl_lpsci.c:326
kLPSCI_TxDataRegEmptyFlag
Definition: fsl_lpsci.h:110
kLPSCI_RxOverrunFlag
Definition: fsl_lpsci.h:116
_lpsci_handle::rxDataSize
volatile size_t rxDataSize
Definition: fsl_lpsci.h:173
kLPSCI_NoiseErrorInRxDataRegFlag
Definition: fsl_lpsci.h:133
kLPSCI_RxDataRegFullFlag
Definition: fsl_lpsci.h:113
kLPSCI_RxActiveEdgeInterruptEnable
Definition: fsl_lpsci.h:92
_lpsci_handle::txData
uint8_t *volatile txData
Definition: fsl_lpsci.h:169
LPSCI_TransferGetReceiveCount
status_t LPSCI_TransferGetReceiveCount(UART0_Type *base, lpsci_handle_t *handle, uint32_t *count)
Get the number of bytes that have been received.
Definition: fsl_lpsci.c:792
LPSCI_Init
status_t LPSCI_Init(UART0_Type *base, const lpsci_config_t *config, uint32_t srcClock_Hz)
Initializes an LPSCI instance with the user configuration structure and the peripheral clock...
Definition: fsl_lpsci.c:197
kLPSCI_IdleLineFlag
Definition: fsl_lpsci.h:115
_lpsci_handle::rxData
uint8_t *volatile rxData
Definition: fsl_lpsci.h:172
kLPSCI_ParityDisabled
Definition: fsl_lpsci.h:70
kLPSCI_FramingErrorInterruptEnable
Definition: fsl_lpsci.h:99
LPSCI_GetStatusFlags
uint32_t LPSCI_GetStatusFlags(UART0_Type *base)
Gets LPSCI status flags.
Definition: fsl_lpsci.c:430
_lpsci_handle::txDataSizeAll
size_t txDataSizeAll
Definition: fsl_lpsci.h:171
LPSCI_TransferAbortReceive
void LPSCI_TransferAbortReceive(UART0_Type *base, lpsci_handle_t *handle)
Aborts interrupt driven data receiving.
Definition: fsl_lpsci.c:779
kStatusGroup_LPSCI
Definition: fsl_common.h:77
LPSCI_EnableTx
static void LPSCI_EnableTx(UART0_Type *base, bool enable)
Enables or disables the LPSCI transmitter.
Definition: fsl_lpsci.h:448
lpsci_config_t::parityMode
lpsci_parity_mode_t parityMode
Definition: fsl_lpsci.h:144
lpsci_transfer_t::dataSize
size_t dataSize
Definition: fsl_lpsci.h:156
LPSCI_EnableRxDMA
static void LPSCI_EnableRxDMA(UART0_Type *base, bool enable)
Enables or disables the LPSCI receiver DMA.
Definition: fsl_lpsci.h:418
kLPSCI_ParityErrorFlag
Definition: fsl_lpsci.h:122
LPSCI_GetDefaultConfig
void LPSCI_GetDefaultConfig(lpsci_config_t *config)
Gets the default configuration structure and saves the configuration to a user-provided pointer...
Definition: fsl_lpsci.c:317
_lpsci_handle::rxRingBufferSize
size_t rxRingBufferSize
Definition: fsl_lpsci.h:177
kStatus_LPSCI_RxIdle
Definition: fsl_lpsci.h:53
_lpsci_handle::txDataSize
volatile size_t txDataSize
Definition: fsl_lpsci.h:170
lpsci_stop_bit_count_t
lpsci_stop_bit_count_t
LPSCI stop bit count.
Definition: fsl_lpsci.h:76
LPSCI_TransferStopRingBuffer
void LPSCI_TransferStopRingBuffer(UART0_Type *base, lpsci_handle_t *handle)
Aborts the background transfer and uninstalls the ring buffer.
Definition: fsl_lpsci.c:590
kStatus_LPSCI_RxRingBufferOverrun
Definition: fsl_lpsci.h:59
kLPSCI_RxOverrunInterruptEnable
Definition: fsl_lpsci.h:97
lpsci_config_t
LPSCI configure structure.
Definition: fsl_lpsci.h:141
kLPSCI_TxDataRegEmptyInterruptEnable
Definition: fsl_lpsci.h:93
_lpsci_handle
Definition: fsl_lpsci.h:167
kLPSCI_ParityErrorInRxDataRegFlag
Definition: fsl_lpsci.h:135
kLPSCI_FramingErrorFlag
Definition: fsl_lpsci.h:120
kStatus_LPSCI_ParityError
Definition: fsl_lpsci.h:64
LPSCI_GetDataRegisterAddress
static uint32_t LPSCI_GetDataRegisterAddress(UART0_Type *base)
Gets the LPSCI data register address.
Definition: fsl_lpsci.h:383
kLPSCI_RxActiveFlag
Definition: fsl_lpsci.h:130
kStatus_LPSCI_TxIdle
Definition: fsl_lpsci.h:52
lpsci_parity_mode_t
lpsci_parity_mode_t
LPSCI parity mode.
Definition: fsl_lpsci.h:68
kLPSCI_NoiseErrorInterruptEnable
Definition: fsl_lpsci.h:98
kLPSCI_ParityEven
Definition: fsl_lpsci.h:71
_lpsci_handle::rxRingBufferHead
volatile uint16_t rxRingBufferHead
Definition: fsl_lpsci.h:178
kLPSCI_TwoStopBit
Definition: fsl_lpsci.h:79
LPSCI_TransferHandleIRQ
void LPSCI_TransferHandleIRQ(UART0_Type *base, lpsci_handle_t *handle)
LPSCI IRQ handle function.
Definition: fsl_lpsci.c:809
kLPSCI_ParityErrorInterruptEnable
Definition: fsl_lpsci.h:100
_lpsci_handle::userData
void * userData
Definition: fsl_lpsci.h:182
LPSCI_TransferGetSendCount
status_t LPSCI_TransferGetSendCount(UART0_Type *base, lpsci_handle_t *handle, uint32_t *count)
Get the number of bytes that have been written to LPSCI TX register.
Definition: fsl_lpsci.c:644
kLPSCI_ParityOdd
Definition: fsl_lpsci.h:72
LPSCI_TransferSendBlocking
void LPSCI_TransferSendBlocking(UART0_Type *base, const uint8_t *data, size_t length)
Writes to the TX register using a blocking method.
Definition: fsl_lpsci.c:488
LPSCI_TransferReceiveNonBlocking
status_t LPSCI_TransferReceiveNonBlocking(UART0_Type *base, lpsci_handle_t *handle, lpsci_transfer_t *xfer, size_t *receivedBytes)
Receives buffer of data using the interrupt method.
Definition: fsl_lpsci.c:661
lpsci_config_t::enableRx
bool enableRx
Definition: fsl_lpsci.h:149
status_t
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:121
kStatus_LPSCI_NoiseError
Definition: fsl_lpsci.h:62
_lpsci_handle::rxDataSizeAll
size_t rxDataSizeAll
Definition: fsl_lpsci.h:174
lpsci_transfer_t
LPSCI transfer structure.
Definition: fsl_lpsci.h:153
LPSCI_GetEnabledInterrupts
uint32_t LPSCI_GetEnabledInterrupts(UART0_Type *base)
Gets the enabled LPSCI interrupts.
Definition: fsl_lpsci.c:422
kLPSCI_TransmissionCompleteInterruptEnable
Definition: fsl_lpsci.h:94
_lpsci_status_flag_t
_lpsci_status_flag_t
LPSCI status flags.
Definition: fsl_lpsci.h:108
kStatus_LPSCI_BaudrateNotSupport
Definition: fsl_lpsci.h:56
_lpsci_handle::callback
lpsci_transfer_callback_t callback
Definition: fsl_lpsci.h:181
kStatus_LPSCI_RxHardwareOverrun
Definition: fsl_lpsci.h:61
kStatus_LPSCI_Error
Definition: fsl_lpsci.h:58