Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

The section describes the programming interface of the LPSCI HAL driver.

Files

file  fsl_lpsci_hal.h
 

Enumerations

enum  lpsci_status_t
 Error codes for the LPSCI driver. More...
 
enum  lpsci_stop_bit_count_t {
  kLpsciOneStopBit = 0U,
  kLpsciTwoStopBit = 1U
}
 LPSCI number of stop bits. More...
 
enum  lpsci_parity_mode_t {
  kLpsciParityDisabled = 0x0U,
  kLpsciParityEven = 0x2U,
  kLpsciParityOdd = 0x3U
}
 LPSCI parity mode. More...
 
enum  lpsci_bit_count_per_char_t {
  kLpsci8BitsPerChar = 0U,
  kLpsci9BitsPerChar = 1U
}
 LPSCI number of bits in a character. More...
 
enum  lpsci_operation_config_t {
  kLpsciOperates = 0U,
  kLpsciStops = 1U
}
 LPSCI operation configuration constants. More...
 
enum  lpsci_receiver_source_t {
  kLpsciLoopBack = 0U,
  kLpsciSingleWire = 1U
}
 LPSCI receiver source select mode. More...
 
enum  lpsci_wakeup_method_t {
  kLpsciIdleLineWake = 0U,
  kLpsciAddrMarkWake = 1U
}
 LPSCI wakeup from standby method constants. More...
 
enum  lpsci_idle_line_select_t {
  kLpsciIdleLineAfterStartBit = 0U,
  kLpsciIdleLineAfterStopBit = 1U
}
 LPSCI idle-line detect selection types. More...
 
enum  lpsci_break_char_length_t {
  kLpsciBreakChar10BitMinimum = 0U,
  kLpsciBreakChar13BitMinimum = 1U
}
 LPSCI break character length settings for transmit/detect. More...
 
enum  lpsci_singlewire_txdir_t {
  kLpsciSinglewireTxdirIn = 0U,
  kLpsciSinglewireTxdirOut = 1U
}
 LPSCI single-wire mode transmit direction. More...
 
enum  lpsci_ir_tx_pulsewidth_t {
  kLpsciIrThreeSixteenthsWidth = 0U,
  kLpsciIrOneSixteenthWidth = 1U,
  kLpsciIrOneThirtysecondsWidth = 2U,
  kLpsciIrOneFourthWidth = 3U
}
 LPSCI infrared transmitter pulse width options. More...
 
enum  lpsci_status_flag_t {
  kLpsciTxDataRegEmpty = 0U << LPSCI_SHIFT | UART0_S1_TDRE_SHIFT,
  kLpsciTxComplete = 0U << LPSCI_SHIFT | UART0_S1_TC_SHIFT,
  kLpsciRxDataRegFull = 0U << LPSCI_SHIFT | UART0_S1_RDRF_SHIFT,
  kLpsciIdleLineDetect = 0U << LPSCI_SHIFT | UART0_S1_IDLE_SHIFT,
  kLpsciRxOverrun = 0U << LPSCI_SHIFT | UART0_S1_OR_SHIFT,
  kLpsciNoiseDetect = 0U << LPSCI_SHIFT | UART0_S1_NF_SHIFT,
  kLpsciFrameErr = 0U << LPSCI_SHIFT | UART0_S1_FE_SHIFT,
  kLpsciParityErr = 0U << LPSCI_SHIFT | UART0_S1_PF_SHIFT,
  kLpsciLineBreakDetect = 1U << LPSCI_SHIFT | UART0_S2_LBKDIF_SHIFT,
  kLpsciRxActiveEdgeDetect = 1U << LPSCI_SHIFT | UART0_S2_RXEDGIF_SHIFT,
  kLpsciRxActive = 1U << LPSCI_SHIFT | UART0_S2_RAF_SHIFT
}
 LPSCI status flags. More...
 
enum  lpsci_interrupt_t {
  kLpsciIntLinBreakDetect = 0U << LPSCI_SHIFT | UART0_BDH_LBKDIE_SHIFT,
  kLpsciIntRxActiveEdge = 0U << LPSCI_SHIFT | UART0_BDH_RXEDGIE_SHIFT,
  kLpsciIntTxDataRegEmpty = 1U << LPSCI_SHIFT | UART0_C2_TIE_SHIFT,
  kLpsciIntTxComplete = 1U << LPSCI_SHIFT | UART0_C2_TCIE_SHIFT,
  kLpsciIntRxDataRegFull = 1U << LPSCI_SHIFT | UART0_C2_RIE_SHIFT,
  kLpsciIntIdleLine = 1U << LPSCI_SHIFT | UART0_C2_ILIE_SHIFT,
  kLpsciIntRxOverrun = 2U << LPSCI_SHIFT | UART0_C3_ORIE_SHIFT,
  kLpsciIntNoiseErrFlag = 2U << LPSCI_SHIFT | UART0_C3_NEIE_SHIFT,
  kLpsciIntFrameErrFlag = 2U << LPSCI_SHIFT | UART0_C3_FEIE_SHIFT,
  kLpsciIntParityErrFlag = 2U << LPSCI_SHIFT | UART0_C3_PEIE_SHIFT
}
 LPSCI interrupt configuration structure; default settings are 0 (disabled). More...
 

LPSCI Common Configurations

void LPSCI_HAL_Init (UART0_Type *base)
 Initializes the LPSCI controller. More...
 
static void LPSCI_HAL_EnableTransmitter (UART0_Type *base)
 Enables the LPSCI transmitter. More...
 
static void LPSCI_HAL_DisableTransmitter (UART0_Type *base)
 Disables the LPSCI transmitter. More...
 
static bool LPSCI_HAL_IsTransmitterEnabled (UART0_Type *base)
 Gets the LPSCI transmitter enabled/disabled configuration setting. More...
 
static void LPSCI_HAL_EnableReceiver (UART0_Type *base)
 Enables the LPSCI receiver. More...
 
static void LPSCI_HAL_DisableReceiver (UART0_Type *base)
 Disables the LPSCI receiver. More...
 
static bool LPSCI_HAL_IsReceiverEnabled (UART0_Type *base)
 Gets the LPSCI receiver enabled/disabled configuration setting. More...
 
lpsci_status_t LPSCI_HAL_SetBaudRate (UART0_Type *base, uint32_t sourceClockInHz, uint32_t baudRate)
 Configures the LPSCI baud rate. More...
 
void LPSCI_HAL_SetBaudRateDivisor (UART0_Type *base, uint16_t baudRateDivisor)
 Sets the LPSCI baud rate modulo divisor value. More...
 
static void LPSCI_HAL_SetBitCountPerChar (UART0_Type *base, lpsci_bit_count_per_char_t bitCountPerChar)
 Configures the number of bits per character in the LPSCI controller. More...
 
void LPSCI_HAL_SetParityMode (UART0_Type *base, lpsci_parity_mode_t parityMode)
 Configures the parity mode in the LPSCI controller. More...
 

LPSCI Interrupts and DMA

void LPSCI_HAL_SetIntMode (UART0_Type *base, lpsci_interrupt_t interrupt, bool enable)
 Configures the LPSCI module interrupts to enable/disable various interrupt sources. More...
 
bool LPSCI_HAL_GetIntMode (UART0_Type *base, lpsci_interrupt_t interrupt)
 Returns whether the LPSCI module interrupts are enabled/disabled. More...
 
static uint32_t LPSCI_HAL_GetDataRegAddr (UART0_Type *base)
 Gets the LPSCI transmit/receive data register address. More...
 

LPSCI Transfer Functions

static void LPSCI_HAL_Putchar (UART0_Type *base, uint8_t data)
 This function allows the user to send an 8-bit character from the LPSCI data register. More...
 
void LPSCI_HAL_Putchar9 (UART0_Type *base, uint16_t data)
 This function allows the user to send a 9-bit character from the LPSCI data register. More...
 
void LPSCI_HAL_Putchar10 (UART0_Type *base, uint16_t data)
 This function allows the user to send a 10-bit character from the LPSCI data register. More...
 
static void LPSCI_HAL_Getchar (UART0_Type *base, uint8_t *readData)
 This function gets a received 8-bit character from the LPSCI data register. More...
 
void LPSCI_HAL_Getchar9 (UART0_Type *base, uint16_t *readData)
 This function gets a received 9-bit character from the LPSCI data register. More...
 
void LPSCI_HAL_Getchar10 (UART0_Type *base, uint16_t *readData)
 This function gets a received 10-bit character from the LPSCI data register. More...
 
void LPSCI_HAL_SendDataPolling (UART0_Type *base, const uint8_t *txBuff, uint32_t txSize)
 Sends out multiple bytes of data using the polling method. More...
 
lpsci_status_t LPSCI_HAL_ReceiveDataPolling (UART0_Type *base, uint8_t *rxBuff, uint32_t rxSize)
 Receives multiple bytes of data using the polling method. More...
 

LPSCI Status Flags

bool LPSCI_HAL_GetStatusFlag (UART0_Type *base, lpsci_status_flag_t statusFlag)
 Gets all LPSCI status flag states. More...
 
lpsci_status_t LPSCI_HAL_ClearStatusFlag (UART0_Type *base, lpsci_status_flag_t statusFlag)
 Clears an individual and specific LPSCI status flag. More...
 

LPSCI Special Feature Configurations

static void LPSCI_HAL_SetWaitModeOperation (UART0_Type *base, lpsci_operation_config_t mode)
 Configures the LPSCI to either operate or cease to operate in wait mode. More...
 
static lpsci_operation_config_t LPSCI_HAL_GetWaitModeOperation (UART0_Type *base)
 Determines if the LPSCI operates or ceases to operate in wait mode. More...
 
static void LPSCI_HAL_SetLoopCmd (UART0_Type *base, bool enable)
 Configures the LPSCI loopback operation. More...
 
static void LPSCI_HAL_SetReceiverSource (UART0_Type *base, lpsci_receiver_source_t source)
 Configures the LPSCI single-wire operation. More...
 
static void LPSCI_HAL_SetTransmitterDir (UART0_Type *base, lpsci_singlewire_txdir_t direction)
 Configures the LPSCI transmit direction while in single-wire mode. More...
 
lpsci_status_t LPSCI_HAL_PutReceiverInStandbyMode (UART0_Type *base)
 Places the LPSCI receiver in standby mode. More...
 
static void LPSCI_HAL_PutReceiverInNormalMode (UART0_Type *base)
 Places the LPSCI receiver in normal mode (disable standby mode operation). More...
 
static bool LPSCI_HAL_IsReceiverInStandby (UART0_Type *base)
 Determines if the LPSCI receiver is currently in standby mode. More...
 
static void LPSCI_HAL_SetReceiverWakeupMethod (UART0_Type *base, lpsci_wakeup_method_t method)
 Selects the LPSCI receiver wakeup method (idle-line or address-mark) from standby mode. More...
 
static lpsci_wakeup_method_t LPSCI_HAL_GetReceiverWakeupMethod (UART0_Type *base)
 Gets the LPSCI receiver wakeup method (idle-line or address-mark) from standby mode. More...
 
void LPSCI_HAL_ConfigIdleLineDetect (UART0_Type *base, uint8_t idleLine, uint8_t rxWakeIdleDetect)
 Configures the operation options of the LPSCI idle line detect. More...
 
static void LPSCI_HAL_SetBreakCharTransmitLength (UART0_Type *base, lpsci_break_char_length_t length)
 Configures the LPSCI break character transmit length. More...
 
static void LPSCI_HAL_SetBreakCharDetectLength (UART0_Type *base, lpsci_break_char_length_t length)
 Configures the LPSCI break character detect length. More...
 
static void LPSCI_HAL_SetBreakCharCmd (UART0_Type *base, bool enable)
 Configures the LPSCI transmit send break character operation. More...
 
void LPSCI_HAL_SetMatchAddress (UART0_Type *base, bool matchAddrMode1, bool matchAddrMode2, uint8_t matchAddrValue1, uint8_t matchAddrValue2)
 Configures the LPSCI match address mode control operation. More...
 

Enumeration Type Documentation

These constants define the number of allowable stop bits to configure in a LPSCI base.

Enumerator
kLpsciOneStopBit 

one stop bit

kLpsciTwoStopBit 

two stop bits

These constants define the LPSCI parity mode options: disabled or enabled of type even or odd.

Enumerator
kLpsciParityDisabled 

parity disabled

kLpsciParityEven 

parity enabled, type even, bit setting: PE|PT = 10

kLpsciParityOdd 

parity enabled, type odd, bit setting: PE|PT = 11

These constants define the number of allowable data bits per LPSCI character. Note, check the LPSCI documentation to determine if the desired LPSCI base supports the desired number of data bits per LPSCI character.

Enumerator
kLpsci8BitsPerChar 

8-bit data characters

kLpsci9BitsPerChar 

9-bit data characters

This provides constants for LPSCI operational states: "operates normally" or "stops/ceases operation"

Enumerator
kLpsciOperates 

LPSCI continues to operate normally.

kLpsciStops 

LPSCI ceases operation.

Enumerator
kLpsciLoopBack 

Internal loop back mode.

kLpsciSingleWire 

Single wire mode.

This provides constants for the two LPSCI wakeup methods: idle-line or address-mark.

Enumerator
kLpsciIdleLineWake 

The idle-line wakes LPSCI receiver from standby.

kLpsciAddrMarkWake 

The address-mark wakes LPSCI receiver from standby.

This provides constants for the LPSCI idle character bit-count start: either after start or stop bit.

Enumerator
kLpsciIdleLineAfterStartBit 

LPSCI idle character bit count start after start bit.

kLpsciIdleLineAfterStopBit 

LPSCI idle character bit count start after stop bit.

This provides constants for the LPSCI break character length for both transmission and detection purposes. Note that the actual maximum bit times may vary depending on the LPSCI base.

Enumerator
kLpsciBreakChar10BitMinimum 

LPSCI break char length 10 bit times (if M = 0, SBNS = 0) or 11 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 12 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 13 (if M10 = 1, SNBS = 1)

kLpsciBreakChar13BitMinimum 

LPSCI break char length 13 bit times (if M = 0, SBNS = 0) or 14 (if M = 1, SBNS = 0 or M = 0, SBNS = 1) or 15 (if M = 1, SBNS = 1 or M10 = 1, SNBS = 0) or 16 (if M10 = 1, SNBS = 1)

This provides constants for the LPSCI transmit direction when configured for single-wire mode. The transmit line TXDIR is either an input or output.

Enumerator
kLpsciSinglewireTxdirIn 

LPSCI Single-Wire mode TXDIR input.

kLpsciSinglewireTxdirOut 

LPSCI Single-Wire mode TXDIR output.

This provides constants for the LPSCI infrared (IR) pulse widths. Options include 3/16, 1/16 1/32, and 1/4 pulse widths.

Enumerator
kLpsciIrThreeSixteenthsWidth 

3/16 pulse

kLpsciIrOneSixteenthWidth 

1/16 pulse

kLpsciIrOneThirtysecondsWidth 

1/32 pulse

kLpsciIrOneFourthWidth 

1/4 pulse

This provides constants for the LPSCI status flags for use in the LPSCI functions.

Enumerator
kLpsciTxDataRegEmpty 

Transmit data register empty flag, sets when Tx buffer is empty.

kLpsciTxComplete 

Transmission complete flag, sets when transmission activity complete.

kLpsciRxDataRegFull 

Receive data register full flag, sets when the receive data buffer is full.

kLpsciIdleLineDetect 

Idle line detect flag, sets when idle line detected.

kLpsciRxOverrun 

Rxr Overrun, sets when new data is received before data is read from receive register.

kLpsciNoiseDetect 

Rxr takes 3 samples of each received bit.

If any of these samples differ, noise flag sets

kLpsciFrameErr 

Frame error flag, sets if logic 0 was detected where stop bit expected.

kLpsciParityErr 

If parity enabled, sets upon parity error detection.

kLpsciLineBreakDetect 

LIN break detect interrupt flag, sets when LIN break char detected and LIN circuit enabled.

kLpsciRxActiveEdgeDetect 

Receive pin active edge interrupt flag, sets when active edge detected.

kLpsciRxActive 

Receiver Active Flag (RAF), sets at beginning of valid start bit.

This structure contains the settings for all LPSCI interrupt configurations.

Enumerator
kLpsciIntLinBreakDetect 

LIN break detect.

kLpsciIntRxActiveEdge 

Receive Active Edge.

kLpsciIntTxDataRegEmpty 

Transmit data register empty.

kLpsciIntTxComplete 

Transmission complete.

kLpsciIntRxDataRegFull 

Receiver data register full.

kLpsciIntIdleLine 

Idle line.

kLpsciIntRxOverrun 

Receiver Overrun.

kLpsciIntNoiseErrFlag 

Noise error flag.

kLpsciIntFrameErrFlag 

Framing error flag.

kLpsciIntParityErrFlag 

Parity error flag.

Function Documentation

void LPSCI_HAL_Init ( UART0_Type *  base)

This function initializes the module to a known state.

Parameters
baseLPSCI module base pointer.
static void LPSCI_HAL_EnableTransmitter ( UART0_Type *  base)
inlinestatic

This function allows the user to enable the LPSCI transmitter.

Parameters
baseLPSCI module base pointer.
static void LPSCI_HAL_DisableTransmitter ( UART0_Type *  base)
inlinestatic

This function allows the user to disable the LPSCI transmitter.

Parameters
baseLPSCI module base pointer.
static bool LPSCI_HAL_IsTransmitterEnabled ( UART0_Type *  base)
inlinestatic

This function allows the user to get the setting of the LPSCI transmitter.

Parameters
baseLPSCI module base pointer.
Returns
The state of LPSCI transmitter enable(true)/disable(false) setting.
static void LPSCI_HAL_EnableReceiver ( UART0_Type *  base)
inlinestatic

This function allows the user to enable the LPSCI receiver.

Parameters
baseLPSCI module base pointer.
static void LPSCI_HAL_DisableReceiver ( UART0_Type *  base)
inlinestatic

This function allows the user to disable the LPSCI receiver.

Parameters
baseLPSCI module base pointer.
static bool LPSCI_HAL_IsReceiverEnabled ( UART0_Type *  base)
inlinestatic

This function allows the user to get the setting of the LPSCI receiver.

Parameters
baseLPSCI module base pointer.
Returns
The state of LPSCI receiver enable(true)/disable(false) setting.
lpsci_status_t LPSCI_HAL_SetBaudRate ( UART0_Type *  base,
uint32_t  sourceClockInHz,
uint32_t  baudRate 
)

This function programs the LPSCI baud rate to the desired value passed in by the user. The user must also pass in the module source clock so that the function can calculate the baud rate divisors to their appropriate values. In some LPSCI bases it is required that the transmitter/receiver be disabled before calling this function. Generally this is applied to all LPSCIs to ensure safe operation.

Parameters
baseLPSCI module base pointer.
sourceClockInHzLPSCI source input clock in Hz.
baudRateLPSCI desired baud rate.
Returns
An error code or kStatus_LPSCI_Success
void LPSCI_HAL_SetBaudRateDivisor ( UART0_Type *  base,
uint16_t  baudRateDivisor 
)

This function allows the user to program the baud rate divisor directly in situations where the divisor value is known. In this case, the user may not want to call the LPSCI_HAL_SetBaudRate() function because the divisor is already known.

Parameters
baseLPSCI module base pointer.
baudRateDivisorThe baud rate modulo division "SBR" value.
static void LPSCI_HAL_SetBitCountPerChar ( UART0_Type *  base,
lpsci_bit_count_per_char_t  bitCountPerChar 
)
inlinestatic

This function allows the user to configure the number of bits per character according to the typedef lpsci_bit_count_per_char_t.

Parameters
baseLPSCI module base pointer.
bitCountPerCharNumber of bits per char (8, 9, or 10, depending on the LPSCI base).
void LPSCI_HAL_SetParityMode ( UART0_Type *  base,
lpsci_parity_mode_t  parityMode 
)

This function allows the user to configure the parity mode of the LPSCI controller to disable or enable it for even parity or odd parity.

Parameters
baseLPSCI module base pointer.
parityModeParity mode setting (enabled, disable, odd, even - see parity_mode_t struct).
void LPSCI_HAL_SetIntMode ( UART0_Type *  base,
lpsci_interrupt_t  interrupt,
bool  enable 
)
Parameters
baseLPSCI module base pointer.
interruptLPSCI interrupt configuration data.
enabletrue: enable, false: disable.
bool LPSCI_HAL_GetIntMode ( UART0_Type *  base,
lpsci_interrupt_t  interrupt 
)
Parameters
baseLPSCI module base pointer.
interruptLPSCI interrupt configuration data.
Returns
true: enable, false: disable.
static uint32_t LPSCI_HAL_GetDataRegAddr ( UART0_Type *  base)
inlinestatic

This function is used for DMA transfer.

Parameters
baseLPSCI module base address.
Returns
LPSCI tx/rx data register address.
static void LPSCI_HAL_Putchar ( UART0_Type *  base,
uint8_t  data 
)
inlinestatic
Parameters
baseLPSCI module base pointer.
dataThe data to send of size 8-bit.
void LPSCI_HAL_Putchar9 ( UART0_Type *  base,
uint16_t  data 
)
Parameters
baseLPSCI module base pointer.
dataThe data to send of size 9-bit.
void LPSCI_HAL_Putchar10 ( UART0_Type *  base,
uint16_t  data 
)
Parameters
baseLPSCI module base pointer.
dataThe data to send of size 10-bit.
static void LPSCI_HAL_Getchar ( UART0_Type *  base,
uint8_t *  readData 
)
inlinestatic
Parameters
baseLPSCI module base pointer.
readDataThe received data read from data register of size 8-bit.
void LPSCI_HAL_Getchar9 ( UART0_Type *  base,
uint16_t *  readData 
)
Parameters
baseLPSCI module base pointer.
readDataThe received data read from data register of size 9-bit.
void LPSCI_HAL_Getchar10 ( UART0_Type *  base,
uint16_t *  readData 
)
Parameters
baseLPSCI module base pointer.
readDataThe received data read from data register of size 10-bit.
void LPSCI_HAL_SendDataPolling ( UART0_Type *  base,
const uint8_t *  txBuff,
uint32_t  txSize 
)

This function only supports 8-bit transaction.

Parameters
baseLPSCI module base pointer.
txBuffThe buffer pointer which saves the data to be sent.
txSizeSize of data to be sent in unit of byte.
lpsci_status_t LPSCI_HAL_ReceiveDataPolling ( UART0_Type *  base,
uint8_t *  rxBuff,
uint32_t  rxSize 
)

This function only supports 8-bit transaction.

Parameters
baseLPSCI module base pointer.
rxBuffThe buffer pointer which saves the data to be received.
rxSizeSize of data need to be received in unit of byte.
Returns
Whether the transaction is success or receive overrun.
bool LPSCI_HAL_GetStatusFlag ( UART0_Type *  base,
lpsci_status_flag_t  statusFlag 
)
Parameters
baseLPSCI module base pointer.
statusFlagStatus flag name.
Returns
The status flag states.
lpsci_status_t LPSCI_HAL_ClearStatusFlag ( UART0_Type *  base,
lpsci_status_flag_t  statusFlag 
)

This function allows the user to clear an individual and specific LPSCI status flag. Refer to structure definition lpsci_status_flag_t for list of status bits.

Parameters
baseLPSCI module base pointer.
statusFlagThe desired LPSCI status flag to clear.
Returns
An error code or kStatus_LPSCI_Success.
static void LPSCI_HAL_SetWaitModeOperation ( UART0_Type *  base,
lpsci_operation_config_t  mode 
)
inlinestatic

The function configures the LPSCI to either operate or cease to operate when wait mode is entered.

Parameters
baseLPSCI module base pointer.
modeThe LPSCI wait mode operation - operates or ceases to operate in wait mode.
static lpsci_operation_config_t LPSCI_HAL_GetWaitModeOperation ( UART0_Type *  base)
inlinestatic

This function returns kLpsciOperates if the LPSCI has been configured to operate in wait mode. Else it returns KLpsciStops if the LPSCI has been configured to cease-to-operate in wait mode.

Parameters
baseLPSCI module base pointer.
Returns
The LPSCI WAIT mode operation configuration, returns either kLpsciOperates or KLpsciStops.
static void LPSCI_HAL_SetLoopCmd ( UART0_Type *  base,
bool  enable 
)
inlinestatic

This function enables or disables the LPSCI loopback operation.

Parameters
baseLPSCI module base pointer.
enableThe LPSCI loopback mode configuration, either disabled (false) or enabled (true).
static void LPSCI_HAL_SetReceiverSource ( UART0_Type *  base,
lpsci_receiver_source_t  source 
)
inlinestatic

This function enables or disables the LPSCI single-wire operation. In some LPSCI bases it is required that the transmitter/receiver be disabled before calling this function. This may be applied to all LPSCIs to ensure safe operation.

Parameters
baseLPSCI module base pointer.
sourceThe LPSCI single-wire mode configuration, either disabled (false) or enabled (true).
static void LPSCI_HAL_SetTransmitterDir ( UART0_Type *  base,
lpsci_singlewire_txdir_t  direction 
)
inlinestatic

This function configures the transmitter direction when the LPSCI is configured for single-wire operation.

Parameters
baseLPSCI module base pointer.
directionThe LPSCI single-wire mode transmit direction configuration of type lpsci_singlewire_txdir_t (either kLpsciSinglewireTxdirIn or kLpsciSinglewireTxdirOut.
lpsci_status_t LPSCI_HAL_PutReceiverInStandbyMode ( UART0_Type *  base)

This function, when called, places the LPSCI receiver into standby mode. In some LPSCI bases, there are conditions that must be met before placing the receive in standby mode. Before placing LPSCI in standby, determine if receiver is set to wake on idle, and if receiver is already in idle state. NOTE: RWU should only be set with C1[WAKE] = 0 (wakeup on idle) if the channel is currently not idle. This can be determined by the S2[RAF] flag. If set to wake up FROM an IDLE event and the channel is already idle, it is possible that the LPSCI discards data because data must be received (or a LIN break detect) after an IDLE is detected before IDLE is allowed to be reasserted.

Parameters
baseLPSCI module base pointer.
Returns
Error code or kStatus_LPSCI_Success.
static void LPSCI_HAL_PutReceiverInNormalMode ( UART0_Type *  base)
inlinestatic

This function, when called, places the LPSCI receiver into normal mode and out of standby mode.

Parameters
baseLPSCI module base pointer.
static bool LPSCI_HAL_IsReceiverInStandby ( UART0_Type *  base)
inlinestatic

This function determines the state of the LPSCI receiver. If it returns true, the LPSCI receiver is in standby mode. If it returns false, the LPSCI receiver is in normal mode.

Parameters
baseLPSCI module base pointer.
Returns
The LPSCI receiver is in normal mode (false) or standby mode (true).
static void LPSCI_HAL_SetReceiverWakeupMethod ( UART0_Type *  base,
lpsci_wakeup_method_t  method 
)
inlinestatic

This function configures the wakeup method of the LPSCI receiver from standby mode. The options are idle-line wake or address-mark wake.

Parameters
baseLPSCI module base pointer.
methodThe LPSCI receiver wakeup method options: kLpsciIdleLineWake - Idle-line wake or kLpsciAddrMarkWake - address-mark wake.
static lpsci_wakeup_method_t LPSCI_HAL_GetReceiverWakeupMethod ( UART0_Type *  base)
inlinestatic

This function returns how the LPSCI receiver is configured to wake from standby mode. The wake method options that can be returned are kLpsciIdleLineWake or kLpsciAddrMarkWake.

Parameters
baseLPSCI module base pointer.
Returns
The LPSCI receiver wakeup from standby method, false: kLpsciIdleLineWake (idle-line wake) or true: kLpsciAddrMarkWake (address-mark wake).
void LPSCI_HAL_ConfigIdleLineDetect ( UART0_Type *  base,
uint8_t  idleLine,
uint8_t  rxWakeIdleDetect 
)

This function allows the user to configure the LPSCI idle-line detect operation. There are two separate operations for the user to configure, the idle line bit-count start and the receive wake up affect on IDLE status bit. The user passes in a structure of type lpsci_idle_line_config_t.

Parameters
baseLPSCI module base pointer.
idleLineIdle bit count start: 0 - after start bit (default), 1 - after stop bit
rxWakeIdleDetectReceiver Wake Up Idle Detect. IDLE status bit operation during receive standby. Controls whether idle character that wakes up receiver will also set IDLE status bit. 0 - IDLE status bit doesn't get set (default), 1 - IDLE status bit gets set
static void LPSCI_HAL_SetBreakCharTransmitLength ( UART0_Type *  base,
lpsci_break_char_length_t  length 
)
inlinestatic

This function allows the user to configure the LPSCI break character transmit length. See the typedef lpsci_break_char_length_t for setting options. In some LPSCI bases it is required that the transmitter be disabled before calling this function. This may be applied to all LPSCIs to ensure safe operation.

Parameters
baseLPSCI module base pointer.
lengthThe LPSCI break character length setting of type lpsci_break_char_length_t, either a minimum 10-bit times or a minimum 13-bit times.
static void LPSCI_HAL_SetBreakCharDetectLength ( UART0_Type *  base,
lpsci_break_char_length_t  length 
)
inlinestatic

This function allows the user to configure the LPSCI break character detect length. See the typedef lpsci_break_char_length_t for setting options.

Parameters
baseLPSCI module base pointer.
lengthThe LPSCI break character length setting of type lpsci_break_char_length_t, either a minimum 10-bit times or a minimum 13-bit times.
static void LPSCI_HAL_SetBreakCharCmd ( UART0_Type *  base,
bool  enable 
)
inlinestatic

This function allows the user to queue a LPSCI break character to send. If true is passed into the function, a break character is queued for transmission. A break character is continuously be queued until this function is called again when a false is passed into this function.

Parameters
baseLPSCI module base pointer.
enableIf false, the LPSCI normal/queue break character setting is disabled, which configures the LPSCI for normal transmitter operation. If true, a break character is queued for transmission.
void LPSCI_HAL_SetMatchAddress ( UART0_Type *  base,
bool  matchAddrMode1,
bool  matchAddrMode2,
uint8_t  matchAddrValue1,
uint8_t  matchAddrValue2 
)

Note that this feature is available on select LPSCI bases.

The function allows the user to configure the LPSCI match address control operation. The user has the option to enable the match address mode and to program the match address value. There are two match address modes, each with its own enable and programmable match address value.

Parameters
baseLPSCI module base pointer.
matchAddrMode1If true, this enables match address mode 1 (MAEN1), where false disables.
matchAddrMode2If true, this enables match address mode 2 (MAEN2), where false disables.
matchAddrValue1The match address value to program for match address mode 1.
matchAddrValue2The match address value to program for match address mode 2.