S32 SDK

Detailed Description

This module covers the functionality of the Low Power Universal Asynchronous Receiver-Transmitter (LPUART) hardware abstraction layer.

LPUART HAL provides the API for reading and writing register bit-fields belonging to the LPUART module. It also provides an initialization function for bringing the module to the reset state.

The LPUART HAL functions are used by LPUART and LIN drivers. Besides register access, the LPUART HAL also provide a function to set the communication baud-rate (needed by both drivers using LPUART module). Also, it provides basic serial communication functionality - send/receive functions based on polling method (writing/reading data to/from the buffer register when tx/rx flags are cleared).

For higher-level functionality, use the LPUART/LIN driver.

Data Structures

struct  lpuart_idle_line_config_t
 Structure for idle line configuration settings. More...
 

Macros

#define LPUART_SHIFT   (16U)
 
#define LPUART_BAUD_REG_ID   (1U)
 
#define LPUART_STAT_REG_ID   (2U)
 
#define LPUART_CTRL_REG_ID   (3U)
 
#define LPUART_DATA_REG_ID   (4U)
 
#define LPUART_MATCH_REG_ID   (5U)
 
#define LPUART_MODIR_REG_ID   (6U)
 
#define LPUART_FIFO_REG_ID   (7U)
 
#define LPUART_WATER_REG_ID   (8U)
 

Enumerations

enum  lpuart_stop_bit_count_t { LPUART_ONE_STOP_BIT = 0x0U, LPUART_TWO_STOP_BIT = 0x1U }
 LPUART number of stop bits. More...
 
enum  lpuart_parity_mode_t { LPUART_PARITY_DISABLED = 0x0U, LPUART_PARITY_EVEN = 0x2U, LPUART_PARITY_ODD = 0x3U }
 LPUART parity mode. More...
 
enum  lpuart_bit_count_per_char_t { LPUART_8_BITS_PER_CHAR = 0x0U, LPUART_9_BITS_PER_CHAR = 0x1U, LPUART_10_BITS_PER_CHAR = 0x2U }
 LPUART number of bits in a character. More...
 
enum  lpuart_operation_config_t { LPUART_OPERATES = 0x0U, LPUART_STOPS = 0x1U }
 LPUART operation configuration constants. More...
 
enum  lpuart_wakeup_method_t { LPUART_IDLE_LINE_WAKE = 0x0U, LPUART_ADDR_MARK_WAKE = 0x1U }
 LPUART wakeup from standby method constants. More...
 
enum  lpuart_break_char_length_t { LPUART_BREAK_CHAR_10_BIT_MINIMUM = 0x0U, LPUART_BREAK_CHAR_13_BIT_MINIMUM = 0x1U }
 LPUART break character length settings for transmit/detect. More...
 
enum  lpuart_singlewire_txdir_t { LPUART_SINGLE_WIRE_TX_DIR_IN = 0x0U, LPUART_SINGLE_WIRE_TX_DIR_OUT = 0x1U }
 LPUART single-wire mode TX direction. More...
 
enum  lpuart_match_config_t { LPUART_ADDRESS_MATCH_WAKEUP = 0x0U, LPUART_IDLE_MATCH_WAKEUP = 0x1U, LPUART_MATCH_ON_AND_MATCH_OFF = 0x2U, LPUART_ENABLE_RWU_ON_DATA_MATCH = 0x3U }
 LPUART Configures the match addressing mode used. More...
 
enum  lpuart_ir_tx_pulsewidth_t { LPUART_IR_THREE_SIXTEENTH_WIDTH = 0x0U, LPUART_IR_ONE_SIXTEENTH_WIDTH = 0x1U, LPUART_IR_ONE_THIRTYSECOND_WIDTH = 0x2U, LPUART_IR_ONE_FOURTH_WIDTH = 0x3U }
 LPUART infra-red transmitter pulse width options. More...
 
enum  lpuart_idle_char_t {
  LPUART_1_IDLE_CHAR = 0x0U, LPUART_2_IDLE_CHAR = 0x1U, LPUART_4_IDLE_CHAR = 0x2U, LPUART_8_IDLE_CHAR = 0x3U,
  LPUART_16_IDLE_CHAR = 0x4U, LPUART_32_IDLE_CHAR = 0x5U, LPUART_64_IDLE_CHAR = 0x6U, LPUART_128_IDLE_CHAR = 0x7U
}
 LPUART Configures the number of idle characters that must be received before the IDLE flag is set. More...
 
enum  lpuart_cts_source_t { LPUART_CTS_SOURCE_PIN = 0x0U, LPUART_CTS_SOURCE_INVERTED_RECEIVER_MATCH = 0x1U }
 LPUART Transmits the CTS Configuration. Configures the source of the CTS input. More...
 
enum  lpuart_cts_config_t { LPUART_CTS_SAMPLED_ON_EACH_CHAR = 0x0U, LPUART_CTS_SAMPLED_ON_IDLE = 0x1U }
 LPUART Transmits CTS Source.Configures if the CTS state is checked at the start of each character or only when the transmitter is idle. More...
 
enum  lpuart_status_flag_t {
  LPUART_TX_DATA_REG_EMPTY, LPUART_TX_COMPLETE, LPUART_RX_DATA_REG_FULL, LPUART_IDLE_LINE_DETECT,
  LPUART_RX_OVERRUN, LPUART_NOISE_DETECT, LPUART_FRAME_ERR, LPUART_PARITY_ERR,
  LPUART_LIN_BREAK_DETECT, LPUART_RX_ACTIVE_EDGE_DETECT, LPUART_RX_ACTIVE, LPUART_NOISE_IN_CURRENT_WORD,
  LPUART_PARITY_ERR_IN_CURRENT_WORD, LPUART_MATCH_ADDR_ONE, LPUART_MATCH_ADDR_TWO, LPUART_FIFO_TX_OF,
  LPUART_FIFO_RX_UF
}
 LPUART status flags. More...
 
enum  lpuart_interrupt_t {
  LPUART_INT_LIN_BREAK_DETECT, LPUART_INT_RX_ACTIVE_EDGE, LPUART_INT_TX_DATA_REG_EMPTY, LPUART_INT_TX_COMPLETE,
  LPUART_INT_RX_DATA_REG_FULL, LPUART_INT_IDLE_LINE, LPUART_INT_RX_OVERRUN, LPUART_INT_NOISE_ERR_FLAG,
  LPUART_INT_FRAME_ERR_FLAG, LPUART_INT_PARITY_ERR_FLAG, LPUART_INT_MATCH_ADDR_ONE, LPUART_INT_MATCH_ADDR_TWO,
  LPUART_INT_FIFO_TXOF, LPUART_INT_FIFO_RXUF
}
 LPUART interrupt configuration structure, default settings are 0 (disabled) More...
 

LPUART Common Configurations

void LPUART_HAL_Init (LPUART_Type *base)
 Initializes the LPUART controller. More...
 
static void LPUART_HAL_SetTransmitterCmd (LPUART_Type *base, bool enable)
 Enable/Disable the LPUART transmitter. More...
 
static bool LPUART_HAL_GetTransmitterCmd (const LPUART_Type *base)
 Gets the LPUART transmitter enabled/disabled configuration. More...
 
static void LPUART_HAL_SetReceiverCmd (LPUART_Type *base, bool enable)
 Enable/Disable the LPUART receiver. More...
 
static bool LPUART_HAL_GetReceiverCmd (const LPUART_Type *base)
 Gets the LPUART receiver enabled/disabled configuration. More...
 
status_t LPUART_HAL_SetBaudRate (LPUART_Type *base, uint32_t sourceClockInHz, uint32_t desiredBaudRate)
 Configures the LPUART baud rate. More...
 
static void LPUART_HAL_SetBaudRateDivisor (LPUART_Type *base, uint32_t baudRateDivisor)
 Sets the LPUART baud rate modulo divisor. More...
 
static void LPUART_HAL_SetOversamplingRatio (LPUART_Type *base, uint32_t overSamplingRatio)
 Sets the LPUART baud rate oversampling ratio. More...
 
static void LPUART_HAL_SetBothEdgeSamplingCmd (LPUART_Type *base, bool enable)
 Configures the LPUART baud rate both edge sampling. More...
 
static bool LPUART_HAL_GetRxDataPolarity (const LPUART_Type *base)
 Returns whether the receive data is inverted or not. More...
 
static void LPUART_HAL_SetRxDataPolarity (LPUART_Type *base, bool polarity)
 Sets whether the recevie data is inverted or not. More...
 
void LPUART_HAL_SetBitCountPerChar (LPUART_Type *base, lpuart_bit_count_per_char_t bitCountPerChar)
 Configures the number of bits per character in the LPUART controller. More...
 
void LPUART_HAL_SetParityMode (LPUART_Type *base, lpuart_parity_mode_t parityModeType)
 Configures parity mode in the LPUART controller. More...
 
static void LPUART_HAL_SetStopBitCount (LPUART_Type *base, lpuart_stop_bit_count_t stopBitCount)
 Configures the number of stop bits in the LPUART controller. More...
 
static const volatile void * LPUART_HAL_GetDataRegAddr (const LPUART_Type *base)
 Get LPUART tx/rx data register address. More...
 

LPUART Interrupts and DMA

void LPUART_HAL_SetIntMode (LPUART_Type *base, lpuart_interrupt_t intSrc, bool enable)
 Configures the LPUART module interrupts. More...
 
bool LPUART_HAL_GetIntMode (const LPUART_Type *base, lpuart_interrupt_t intSrc)
 Returns LPUART module interrupts state. More...
 
static void LPUART_HAL_SetTxDmaCmd (LPUART_Type *base, bool enable)
 Configures DMA requests. More...
 
static void LPUART_HAL_SetRxDmaCmd (LPUART_Type *base, bool enable)
 Configures DMA requests. More...
 
static bool LPUART_HAL_IsTxDmaEnabled (const LPUART_Type *base)
 Gets the LPUART DMA request configuration. More...
 
static bool LPUART_HAL_IsRxDmaEnabled (const LPUART_Type *base)
 Gets the LPUART DMA request configuration. More...
 

LPUART Transfer Functions

static void LPUART_HAL_Putchar (LPUART_Type *base, uint8_t data)
 Sends the LPUART 8-bit character. More...
 
void LPUART_HAL_Putchar9 (LPUART_Type *base, uint16_t data)
 Sends the LPUART 9-bit character. More...
 
void LPUART_HAL_Putchar10 (LPUART_Type *base, uint16_t data)
 Sends the LPUART 10-bit character (Note: Feature available on select LPUART instances). More...
 
static void LPUART_HAL_Getchar (const LPUART_Type *base, uint8_t *readData)
 Gets the LPUART 8-bit character. More...
 
void LPUART_HAL_Getchar9 (const LPUART_Type *base, uint16_t *readData)
 Gets the LPUART 9-bit character. More...
 
void LPUART_HAL_Getchar10 (const LPUART_Type *base, uint16_t *readData)
 Gets the LPUART 10-bit character. More...
 
void LPUART_HAL_SendDataPolling (LPUART_Type *base, const uint8_t *txBuff, uint32_t txSize)
 Send out multiple bytes of data using polling method. More...
 
status_t LPUART_HAL_ReceiveDataPolling (LPUART_Type *base, uint8_t *rxBuff, uint32_t rxSize)
 Receive multiple bytes of data using polling method. More...
 

LPUART Status Flags

bool LPUART_HAL_GetStatusFlag (const LPUART_Type *base, lpuart_status_flag_t statusFlag)
 LPUART get status flag. More...
 
status_t LPUART_HAL_ClearStatusFlag (LPUART_Type *base, lpuart_status_flag_t statusFlag)
 LPUART clears an individual status flag. More...
 

LPUART Special Feature Configurations

static void LPUART_HAL_SetIdleChar (LPUART_Type *base, lpuart_idle_char_t idleConfig)
 Configures the number of idle characters. More...
 
static lpuart_idle_char_t LPUART_HAL_GetIdleChar (const LPUART_Type *base)
 Gets the number of idle characters for IDLE flag. More...
 
static bool LPUART_HAL_IsCurrentDataWithNoise (const LPUART_Type *base)
 Checks whether the current data word was received with noise. More...
 
static bool LPUART_HAL_IsCurrentDataWithFrameError (const LPUART_Type *base)
 Checks whether the current data word was received with frame error. More...
 
static void LPUART_HAL_SetTxSpecialChar (LPUART_Type *base, uint8_t specialChar)
 Indicates a special character is to be transmitted. More...
 
static bool LPUART_HAL_IsCurrentDataWithParityError (const LPUART_Type *base)
 Checks whether the current data word was received with parity error. More...
 
static bool LPUART_HAL_IsReceiveBufferEmpty (const LPUART_Type *base)
 Checks whether the receive buffer is empty. More...
 
static bool LPUART_HAL_WasPreviousReceiverStateIdle (const LPUART_Type *base)
 Checks whether the previous BUS state was idle before this byte is received. More...
 
static void LPUART_HAL_SetWaitModeOperation (LPUART_Type *base, lpuart_operation_config_t mode)
 Configures the LPUART operation in wait mode (operates or stops operations in wait mode). More...
 
static lpuart_operation_config_t LPUART_HAL_GetWaitModeOperation (const LPUART_Type *base)
 Gets the LPUART operation in wait mode. More...
 
void LPUART_HAL_SetLoopbackCmd (LPUART_Type *base, bool enable)
 Configures the LPUART loopback operation (enable/disable loopback operation) More...
 
void LPUART_HAL_SetSingleWireCmd (LPUART_Type *base, bool enable)
 Configures the LPUART single-wire operation (enable/disable single-wire mode). More...
 
static void LPUART_HAL_SetTxdirInSinglewireMode (LPUART_Type *base, lpuart_singlewire_txdir_t direction)
 Configures the LPUART transmit direction while in single-wire mode. More...
 
status_t LPUART_HAL_SetReceiverInStandbyMode (LPUART_Type *base)
 Places the LPUART receiver in standby mode. More...
 
static void LPUART_HAL_PutReceiverInNormalMode (LPUART_Type *base)
 Places the LPUART receiver in a normal mode. More...
 
static bool LPUART_HAL_IsReceiverInStandby (const LPUART_Type *base)
 Checks whether the LPUART receiver is in a standby mode. More...
 
static void LPUART_HAL_SetReceiverWakeupMode (LPUART_Type *base, lpuart_wakeup_method_t method)
 Sets the LPUART receiver wakeup method from standby mode. More...
 
static lpuart_wakeup_method_t LPUART_HAL_GetReceiverWakeupMode (const LPUART_Type *base)
 Gets the LPUART receiver wakeup method from standby mode. More...
 
void LPUART_HAL_SetIdleLineDetect (LPUART_Type *base, const lpuart_idle_line_config_t *config)
 LPUART idle-line detect operation configuration. More...
 
static void LPUART_HAL_SetBreakCharTransmitLength (LPUART_Type *base, lpuart_break_char_length_t length)
 LPUART break character transmit length configuration. More...
 
static void LPUART_HAL_SetBreakCharDetectLength (LPUART_Type *base, lpuart_break_char_length_t length)
 LPUART break character detect length configuration. More...
 
static void LPUART_HAL_QueueBreakField (LPUART_Type *base)
 LPUART transmit sends break character configuration. More...
 
static void LPUART_HAL_SetMatchAddressMode (LPUART_Type *base, lpuart_match_config_t config)
 Configures match address mode control. More...
 
void LPUART_HAL_SetMatchAddressReg1 (LPUART_Type *base, bool enable, uint8_t value)
 Configures address match register 1. More...
 
void LPUART_HAL_SetMatchAddressReg2 (LPUART_Type *base, bool enable, uint8_t value)
 Configures address match register 2. More...
 
static void LPUART_HAL_SetSendMsbFirstCmd (LPUART_Type *base, bool enable)
 LPUART sends the MSB first configuration. More...
 
static void LPUART_HAL_SetReceiveResyncCmd (LPUART_Type *base, bool enable)
 LPUART enable/disable re-sync of received data configuration. More...
 
static void LPUART_HAL_SetCtsSource (LPUART_Type *base, lpuart_cts_source_t source)
 Transmits the CTS source configuration. More...
 
static void LPUART_HAL_SetCtsMode (LPUART_Type *base, lpuart_cts_config_t mode)
 Transmits the CTS configuration. More...
 
static void LPUART_HAL_SetTxCtsCmd (LPUART_Type *base, bool enable)
 Enable/Disable the transmitter clear-to-send. More...
 
static void LPUART_HAL_SetRxRtsCmd (LPUART_Type *base, bool enable)
 Enable/Disable the receiver request-to-send. More...
 
static void LPUART_HAL_SetTxRtsCmd (LPUART_Type *base, bool enable)
 Enable/Disable the transmitter request-to-send. More...
 
static void LPUART_HAL_SetTxRtsPolarityMode (LPUART_Type *base, bool polarity)
 Configures the transmitter RTS polarity. More...
 
static void LPUART_HAL_SetTxFIFOCmd (LPUART_Type *base, bool enable)
 Enable/Disable the transmitter FIFO. More...
 
static void LPUART_HAL_SetRxFIFOCmd (LPUART_Type *base, bool enable)
 Enable/Disable the receiver FIFO. More...
 
static void LPUART_HAL_SetRxIdleEmptyDuration (LPUART_Type *base, uint8_t duration)
 Enables the assertion of RDRF when the receiver is idle. More...
 
static void LPUART_HAL_FlushTxFifoBuffer (LPUART_Type *base)
 Flush tx FIFO buffer. More...
 
static void LPUART_HAL_FlushRxFifoBuffer (LPUART_Type *base)
 Flush rx FIFO buffer. More...
 
static void LPUART_HAL_SetTxWatermark (LPUART_Type *base, uint8_t txWater)
 Sets the tx watermark. More...
 
static void LPUART_HAL_SetRxWatermark (LPUART_Type *base, uint8_t rxWater)
 Sets the rx watermark. More...
 
void LPUART_HAL_SetInfrared (LPUART_Type *base, bool enable, lpuart_ir_tx_pulsewidth_t pulseWidth)
 Configures the LPUART infrared operation. More...
 

Macro Definition Documentation

#define LPUART_BAUD_REG_ID   (1U)

Definition at line 55 of file lpuart_hal.h.

#define LPUART_CTRL_REG_ID   (3U)

Definition at line 57 of file lpuart_hal.h.

#define LPUART_DATA_REG_ID   (4U)

Definition at line 58 of file lpuart_hal.h.

#define LPUART_FIFO_REG_ID   (7U)

Definition at line 61 of file lpuart_hal.h.

#define LPUART_MATCH_REG_ID   (5U)

Definition at line 59 of file lpuart_hal.h.

#define LPUART_MODIR_REG_ID   (6U)

Definition at line 60 of file lpuart_hal.h.

#define LPUART_SHIFT   (16U)

Definition at line 54 of file lpuart_hal.h.

#define LPUART_STAT_REG_ID   (2U)

Definition at line 56 of file lpuart_hal.h.

#define LPUART_WATER_REG_ID   (8U)

Definition at line 62 of file lpuart_hal.h.

Enumeration Type Documentation

LPUART number of bits in a character.

Implements : lpuart_bit_count_per_char_t_Class

Enumerator
LPUART_8_BITS_PER_CHAR 

8-bit data characters

LPUART_9_BITS_PER_CHAR 

9-bit data characters

LPUART_10_BITS_PER_CHAR 

10-bit data characters

Definition at line 89 of file lpuart_hal.h.

LPUART break character length settings for transmit/detect.

The actual maximum bit times may vary depending on the LPUART instance.

Implements : lpuart_break_char_length_t_Class

Enumerator
LPUART_BREAK_CHAR_10_BIT_MINIMUM 

LPUART 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)

LPUART_BREAK_CHAR_13_BIT_MINIMUM 

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

Definition at line 123 of file lpuart_hal.h.

LPUART Transmits CTS Source.Configures if the CTS state is checked at the start of each character or only when the transmitter is idle.

Implements : lpuart_cts_config_t_Class

Enumerator
LPUART_CTS_SAMPLED_ON_EACH_CHAR 

CTS input is sampled at the start of each character.

LPUART_CTS_SAMPLED_ON_IDLE 

CTS input is sampled when the transmitter is idle.

Definition at line 201 of file lpuart_hal.h.

LPUART Transmits the CTS Configuration. Configures the source of the CTS input.

Implements : lpuart_cts_source_t_Class

Enumerator
LPUART_CTS_SOURCE_PIN 

CTS input is the LPUART_CTS pin.

LPUART_CTS_SOURCE_INVERTED_RECEIVER_MATCH 

CTS input is the inverted Receiver Match result.

Definition at line 189 of file lpuart_hal.h.

LPUART Configures the number of idle characters that must be received before the IDLE flag is set.

Implements : lpuart_idle_char_t_Class

Enumerator
LPUART_1_IDLE_CHAR 

1 idle character

LPUART_2_IDLE_CHAR 

2 idle character

LPUART_4_IDLE_CHAR 

4 idle character

LPUART_8_IDLE_CHAR 

8 idle character

LPUART_16_IDLE_CHAR 

16 idle character

LPUART_32_IDLE_CHAR 

32 idle character

LPUART_64_IDLE_CHAR 

64 idle character

LPUART_128_IDLE_CHAR 

128 idle character

Definition at line 173 of file lpuart_hal.h.

LPUART interrupt configuration structure, default settings are 0 (disabled)

Implements : lpuart_interrupt_t_Class

Enumerator
LPUART_INT_LIN_BREAK_DETECT 

LIN break detect.

LPUART_INT_RX_ACTIVE_EDGE 

RX Active Edge.

LPUART_INT_TX_DATA_REG_EMPTY 

Transmit data register empty.

LPUART_INT_TX_COMPLETE 

Transmission complete.

LPUART_INT_RX_DATA_REG_FULL 

Receiver data register full.

LPUART_INT_IDLE_LINE 

Idle line.

LPUART_INT_RX_OVERRUN 

Receiver Overrun.

LPUART_INT_NOISE_ERR_FLAG 

Noise error flag.

LPUART_INT_FRAME_ERR_FLAG 

Framing error flag.

LPUART_INT_PARITY_ERR_FLAG 

Parity error flag.

LPUART_INT_MATCH_ADDR_ONE 

Match address one flag.

LPUART_INT_MATCH_ADDR_TWO 

Match address two flag.

LPUART_INT_FIFO_TXOF 

Transmitter FIFO buffer interrupt

LPUART_INT_FIFO_RXUF 

Receiver FIFO buffer interrupt

Definition at line 292 of file lpuart_hal.h.

LPUART infra-red transmitter pulse width options.

Implements : lpuart_ir_tx_pulsewidth_t_Class

Enumerator
LPUART_IR_THREE_SIXTEENTH_WIDTH 

3/16 pulse

LPUART_IR_ONE_SIXTEENTH_WIDTH 

1/16 pulse

LPUART_IR_ONE_THIRTYSECOND_WIDTH 

1/32 pulse

LPUART_IR_ONE_FOURTH_WIDTH 

1/4 pulse

Definition at line 159 of file lpuart_hal.h.

LPUART Configures the match addressing mode used.

Implements : lpuart_match_config_t_Class

Enumerator
LPUART_ADDRESS_MATCH_WAKEUP 

Address Match Wakeup

LPUART_IDLE_MATCH_WAKEUP 

Idle Match Wakeup

LPUART_MATCH_ON_AND_MATCH_OFF 

Match On and Match Off

LPUART_ENABLE_RWU_ON_DATA_MATCH 

Enables RWU on Data Match and Match On/Off for transmitter CTS input

Definition at line 147 of file lpuart_hal.h.

LPUART operation configuration constants.

Implements : lpuart_operation_config_t_Class

Enumerator
LPUART_OPERATES 

LPUART continues to operate normally.

LPUART_STOPS 

LPUART stops operation.

Definition at line 100 of file lpuart_hal.h.

LPUART parity mode.

Implements : lpuart_parity_mode_t_Class

Enumerator
LPUART_PARITY_DISABLED 

parity disabled

LPUART_PARITY_EVEN 

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

LPUART_PARITY_ODD 

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

Definition at line 78 of file lpuart_hal.h.

LPUART single-wire mode TX direction.

Implements : lpuart_singlewire_txdir_t_Class

Enumerator
LPUART_SINGLE_WIRE_TX_DIR_IN 

LPUART Single Wire mode TXDIR input

LPUART_SINGLE_WIRE_TX_DIR_OUT 

LPUART Single Wire mode TXDIR output

Definition at line 137 of file lpuart_hal.h.

LPUART status flags.

This provides constants for the LPUART status flags for use in the UART functions.

Implements : lpuart_status_flag_t_Class

Enumerator
LPUART_TX_DATA_REG_EMPTY 

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

LPUART_TX_COMPLETE 

Transmission complete flag, sets when transmission activity complete

LPUART_RX_DATA_REG_FULL 

Rx data register full flag, sets when the receive data buffer is full

LPUART_IDLE_LINE_DETECT 

Idle line detect flag, sets when idle line detected

LPUART_RX_OVERRUN 

Rx Overrun sets if new data is received before data is read

LPUART_NOISE_DETECT 

Rx takes 3 samples of each received bit. If these differ, the flag sets

LPUART_FRAME_ERR 

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

LPUART_PARITY_ERR 

If parity enabled, sets upon parity error detection

LPUART_LIN_BREAK_DETECT 

LIN break detect interrupt flag, sets when LIN break char detected

LPUART_RX_ACTIVE_EDGE_DETECT 

Rx pin active edge interrupt flag, sets when active edge detected

LPUART_RX_ACTIVE 

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

LPUART_NOISE_IN_CURRENT_WORD 

NOISY bit, sets if noise detected in current data word

LPUART_PARITY_ERR_IN_CURRENT_WORD 

PARITYE bit, sets if noise detected in current data word

LPUART_MATCH_ADDR_ONE 

Address one match flag

LPUART_MATCH_ADDR_TWO 

Address two match flag

LPUART_FIFO_TX_OF 

Transmitter FIFO buffer overflow

LPUART_FIFO_RX_UF 

Receiver FIFO buffer underflow

Definition at line 229 of file lpuart_hal.h.

LPUART number of stop bits.

Implements : lpuart_stop_bit_count_t_Class

Enumerator
LPUART_ONE_STOP_BIT 

one stop bit

LPUART_TWO_STOP_BIT 

two stop bits

Definition at line 68 of file lpuart_hal.h.

LPUART wakeup from standby method constants.

Implements : lpuart_wakeup_method_t_Class

Enumerator
LPUART_IDLE_LINE_WAKE 

Idle-line wakes the LPUART receiver from standby.

LPUART_ADDR_MARK_WAKE 

Addr-mark wakes LPUART receiver from standby.

Definition at line 110 of file lpuart_hal.h.

Function Documentation

status_t LPUART_HAL_ClearStatusFlag ( LPUART_Type base,
lpuart_status_flag_t  statusFlag 
)

LPUART clears an individual status flag.

This function clears an individual status flag (see lpuart_status_flag_t for list of status bits).

Parameters
baseLPUART base pointer
statusFlagDesired LPUART status flag to clear
Returns
STATUS_SUCCESS if successful or STATUS_ERROR if an error occured

Definition at line 684 of file lpuart_hal.c.

static void LPUART_HAL_FlushRxFifoBuffer ( LPUART_Type base)
inlinestatic

Flush rx FIFO buffer.

This function flushes the rx FIFO buffer. Note: This does not affect data that is in the receive shift register.

Parameters
baseLPUART base pointer Implements : LPUART_HAL_FlushRxFifoBuffer_Activity

Definition at line 1492 of file lpuart_hal.h.

static void LPUART_HAL_FlushTxFifoBuffer ( LPUART_Type base)
inlinestatic

Flush tx FIFO buffer.

This function flushes the tx FIFO buffer. Note: This does not affect data that is in the transmit shift register.

Parameters
baseLPUART base pointer Implements : LPUART_HAL_FlushTxFifoBuffer_Activity

Definition at line 1477 of file lpuart_hal.h.

static void LPUART_HAL_Getchar ( const LPUART_Type base,
uint8_t *  readData 
)
inlinestatic

Gets the LPUART 8-bit character.

This functions receives an 8-bit character.

Parameters
baseLPUART base pointer
readDataData read from receive (8-bit) Implements : LPUART_HAL_Getchar_Activity

Definition at line 748 of file lpuart_hal.h.

void LPUART_HAL_Getchar10 ( const LPUART_Type base,
uint16_t *  readData 
)

Gets the LPUART 10-bit character.

This functions receives a 10-bit character.

Parameters
baseLPUART base pointer
readDataData read from receive (10-bit)

Definition at line 293 of file lpuart_hal.c.

void LPUART_HAL_Getchar9 ( const LPUART_Type base,
uint16_t *  readData 
)

Gets the LPUART 9-bit character.

This functions receives a 9-bit character.

Parameters
baseLPUART base pointer
readDataData read from receive (9-bit)

Definition at line 274 of file lpuart_hal.c.

static const volatile void* LPUART_HAL_GetDataRegAddr ( const LPUART_Type base)
inlinestatic

Get LPUART tx/rx data register address.

This function returns LPUART tx/rx data register address.

Parameters
baseLPUART base pointer.
Returns
LPUART tx/rx data register address. Implements : LPUART_HAL_GetDataRegAddr_Activity

Definition at line 594 of file lpuart_hal.h.

static lpuart_idle_char_t LPUART_HAL_GetIdleChar ( const LPUART_Type base)
inlinestatic

Gets the number of idle characters for IDLE flag.

This function returns the number of idle characters that must be received before the IDLE flag is set.

Parameters
baseLPUART base pointer
Returns
idle characters configuration Implements : LPUART_HAL_GetIdleChar_Activity

Definition at line 870 of file lpuart_hal.h.

bool LPUART_HAL_GetIntMode ( const LPUART_Type base,
lpuart_interrupt_t  intSrc 
)

Returns LPUART module interrupts state.

This function returns whether a certain LPUART module interrupt is enabled or disabled.

Parameters
baseLPUART module base pointer.
intSrcLPUART interrupt configuration data.
Returns
true: enable, false: disable.

Definition at line 418 of file lpuart_hal.c.

static bool LPUART_HAL_GetReceiverCmd ( const LPUART_Type base)
inlinestatic

Gets the LPUART receiver enabled/disabled configuration.

This function returns true if the LPUART receiver is enabled, or false, when the transmitter is disabled.

Parameters
baseLPUART base pointer
Returns
State of LPUART receiver enable(true)/disable(false) Implements : LPUART_HAL_GetReceiverCmd_Activity

Definition at line 415 of file lpuart_hal.h.

static lpuart_wakeup_method_t LPUART_HAL_GetReceiverWakeupMode ( const LPUART_Type base)
inlinestatic

Gets the LPUART receiver wakeup method from standby mode.

This function returns the LPUART receiver wakeup method (idle line or addr-mark) from standby mode.

Parameters
baseLPUART base pointer
Returns
LPUART wakeup method: LPUART_IDLE_LINE_WAKE: 0 - Idle-line wake (default), LPUART_ADDR_MARK_WAKE: 1 - addr-mark wake Implements : LPUART_HAL_GetReceiverWakeupMode_Activity

Definition at line 1147 of file lpuart_hal.h.

static bool LPUART_HAL_GetRxDataPolarity ( const LPUART_Type base)
inlinestatic

Returns whether the receive data is inverted or not.

This function returns the polarity of the receive data.

Parameters
baseLPUART base pointer.
Returns
Rx data polarity; true: inverted, false: not inverted. Implements : LPUART_HAL_GetRxDataPolarity_Activity

Definition at line 521 of file lpuart_hal.h.

bool LPUART_HAL_GetStatusFlag ( const LPUART_Type base,
lpuart_status_flag_t  statusFlag 
)

LPUART get status flag.

This function returns the state of a status flag.

Parameters
baseLPUART base pointer
statusFlagThe status flag to query
Returns
Whether the current status flag is set(true) or not(false).

Definition at line 636 of file lpuart_hal.c.

static bool LPUART_HAL_GetTransmitterCmd ( const LPUART_Type base)
inlinestatic

Gets the LPUART transmitter enabled/disabled configuration.

This function returns true if the LPUART transmitter is enabled, or false, when the transmitter is disabled.

Parameters
baseLPUART base pointer
Returns
State of LPUART transmitter enable(true)/disable(false) Implements : LPUART_HAL_GetTransmitterCmd_Activity

Definition at line 381 of file lpuart_hal.h.

static lpuart_operation_config_t LPUART_HAL_GetWaitModeOperation ( const LPUART_Type base)
inlinestatic

Gets the LPUART operation in wait mode.

This function returns the LPUART operation in wait mode (operates or stops operations in wait mode).

Parameters
baseLPUART base pointer
Returns
LPUART wait mode operation configuration - LPUART_OPERATES or LPUART_STOPS in wait mode Implements : LPUART_HAL_GetWaitModeOperation_Activity

Definition at line 1030 of file lpuart_hal.h.

void LPUART_HAL_Init ( LPUART_Type base)

Initializes the LPUART controller.

This function Initializes the LPUART controller to known state.

Parameters
baseLPUART base pointer.

Definition at line 62 of file lpuart_hal.c.

static bool LPUART_HAL_IsCurrentDataWithFrameError ( const LPUART_Type base)
inlinestatic

Checks whether the current data word was received with frame error.

This function returns whether the current data word was received with frame error.

Parameters
baseLPUART base pointer
Returns
The status of the FRETSC bit in the LPUART extended data register Implements : LPUART_HAL_IsCurrentDataWithFrameError_Activity

Definition at line 935 of file lpuart_hal.h.

static bool LPUART_HAL_IsCurrentDataWithNoise ( const LPUART_Type base)
inlinestatic

Checks whether the current data word was received with noise.

This function returns whether the current data word was received with noise.

Parameters
baseLPUART base pointer.
Returns
The status of the NOISY bit in the LPUART extended data register Implements : LPUART_HAL_IsCurrentDataWithNoise_Activity

Definition at line 920 of file lpuart_hal.h.

static bool LPUART_HAL_IsCurrentDataWithParityError ( const LPUART_Type base)
inlinestatic

Checks whether the current data word was received with parity error.

This function returns whether the current data word was received with parity error.

Parameters
baseLPUART base pointer
Returns
The status of the PARITYE bit in the LPUART extended data register Implements : LPUART_HAL_IsCurrentDataWithParityError_Activity

Definition at line 966 of file lpuart_hal.h.

static bool LPUART_HAL_IsReceiveBufferEmpty ( const LPUART_Type base)
inlinestatic

Checks whether the receive buffer is empty.

This function returns whether the receive buffer is empty.

Parameters
baseLPUART base pointer
Returns
TRUE if the receive-buffer is empty, else FALSE. Implements : LPUART_HAL_IsReceiveBufferEmpty_Activity

Definition at line 981 of file lpuart_hal.h.

static bool LPUART_HAL_IsReceiverInStandby ( const LPUART_Type base)
inlinestatic

Checks whether the LPUART receiver is in a standby mode.

This function returns whether the LPUART receiver is in a standby mode.

Parameters
baseLPUART base pointer
Returns
LPUART in normal more (0) or standby (1) Implements : LPUART_HAL_IsReceiverInStandby_Activity

Definition at line 1113 of file lpuart_hal.h.

static bool LPUART_HAL_IsRxDmaEnabled ( const LPUART_Type base)
inlinestatic

Gets the LPUART DMA request configuration.

This function returns the LPUART Receive DMA request configuration.

Parameters
baseLPUART base pointer
Returns
Receives the DMA request configuration (enable: 1/disable: 0). Implements : LPUART_HAL_IsRxDmaEnabled_Activity

Definition at line 686 of file lpuart_hal.h.

static bool LPUART_HAL_IsTxDmaEnabled ( const LPUART_Type base)
inlinestatic

Gets the LPUART DMA request configuration.

This function returns the LPUART Transmit DMA request configuration.

Parameters
baseLPUART base pointer
Returns
Transmit DMA request configuration (enable: 1/disable: 0) Implements : LPUART_HAL_IsTxDmaEnabled_Activity

Definition at line 671 of file lpuart_hal.h.

static void LPUART_HAL_Putchar ( LPUART_Type base,
uint8_t  data 
)
inlinestatic

Sends the LPUART 8-bit character.

This functions sends an 8-bit character.

Parameters
baseLPUART Instance
datadata to send (8-bit) Implements : LPUART_HAL_Putchar_Activity

Definition at line 710 of file lpuart_hal.h.

void LPUART_HAL_Putchar10 ( LPUART_Type base,
uint16_t  data 
)

Sends the LPUART 10-bit character (Note: Feature available on select LPUART instances).

This functions sends a 10-bit character.

Parameters
baseLPUART Instance
datadata to send (10-bit)

Definition at line 248 of file lpuart_hal.c.

void LPUART_HAL_Putchar9 ( LPUART_Type base,
uint16_t  data 
)

Sends the LPUART 9-bit character.

This functions sends a 9-bit character.

Parameters
baseLPUART Instance
datadata to send (9-bit)

Definition at line 226 of file lpuart_hal.c.

static void LPUART_HAL_PutReceiverInNormalMode ( LPUART_Type base)
inlinestatic

Places the LPUART receiver in a normal mode.

This function places the LPUART receiver in a normal mode (disable standby mode operation).

Parameters
baseLPUART base pointer Implements : LPUART_HAL_PutReceiverInNormalMode_Activity

Definition at line 1098 of file lpuart_hal.h.

static void LPUART_HAL_QueueBreakField ( LPUART_Type base)
inlinestatic

LPUART transmit sends break character configuration.

This function sets break character transmission in queue mode.

Parameters
baseLPUART base pointer Implements : LPUART_HAL_QueueBreakField_Activity

Definition at line 1213 of file lpuart_hal.h.

status_t LPUART_HAL_ReceiveDataPolling ( LPUART_Type base,
uint8_t *  rxBuff,
uint32_t  rxSize 
)

Receive multiple bytes of data using polling method.

This function only supports 8-bit transaction.

Parameters
baseLPUART 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
STATUS_SUCCESS if the transaction is success or STATUS_UART_RX_OVERRUN if rx overrun.

Definition at line 337 of file lpuart_hal.c.

void LPUART_HAL_SendDataPolling ( LPUART_Type base,
const uint8_t *  txBuff,
uint32_t  txSize 
)

Send out multiple bytes of data using polling method.

This function only supports 8-bit transaction.

Parameters
baseLPUART module base pointer.
txBuffThe buffer pointer which saves the data to be sent.
txSizeSize of data to be sent in unit of byte.

Definition at line 314 of file lpuart_hal.c.

status_t LPUART_HAL_SetBaudRate ( LPUART_Type base,
uint32_t  sourceClockInHz,
uint32_t  desiredBaudRate 
)

Configures the LPUART baud rate.

This function configures the LPUART baud rate. In some LPUART instances the user must disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer.
sourceClockInHzLPUART source input clock in Hz.
desiredBaudRateLPUART desired baud rate.
Returns
STATUS_SUCCESS if successful or STATUS_ERROR if an error occured

Definition at line 95 of file lpuart_hal.c.

static void LPUART_HAL_SetBaudRateDivisor ( LPUART_Type base,
uint32_t  baudRateDivisor 
)
inlinestatic

Sets the LPUART baud rate modulo divisor.

This function sets the LPUART baud rate modulo divisor.

Parameters
baseLPUART base pointer.
baudRateDivisorThe baud rate modulo division "SBR" Implements : LPUART_HAL_SetBaudRateDivisor_Activity

Definition at line 447 of file lpuart_hal.h.

void LPUART_HAL_SetBitCountPerChar ( LPUART_Type base,
lpuart_bit_count_per_char_t  bitCountPerChar 
)

Configures the number of bits per character in the LPUART controller.

This function configures the number of bits per character in the LPUART controller. In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer.
bitCountPerCharNumber of bits per char (8, 9, or 10, depending on the LPUART instance)

Definition at line 187 of file lpuart_hal.c.

static void LPUART_HAL_SetBothEdgeSamplingCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Configures the LPUART baud rate both edge sampling.

This function configures the LPUART baud rate both edge sampling. (Note: Feature available on select LPUART instances used with baud rate programming) When enabled, the received data is sampled on both edges of the baud rate clock. This must be set when the oversampling ratio is between 4x and 7x. This function should only be called when the receiver is disabled.

Parameters
baseLPUART base pointer.
enableEnable (1) or Disable (0) Both Edge Sampling Implements : LPUART_HAL_SetBothEdgeSamplingCmd_Activity

Definition at line 506 of file lpuart_hal.h.

static void LPUART_HAL_SetBreakCharDetectLength ( LPUART_Type base,
lpuart_break_char_length_t  length 
)
inlinestatic

LPUART break character detect length configuration.

This function sets the LPUART detectable break character length.

Parameters
baseLPUART base pointer
lengthLPUART break character length setting: 0 - minimum 10-bit times (default), 1 - minimum 13-bit times Implements : LPUART_HAL_SetBreakCharDetectLength_Activity

Definition at line 1197 of file lpuart_hal.h.

static void LPUART_HAL_SetBreakCharTransmitLength ( LPUART_Type base,
lpuart_break_char_length_t  length 
)
inlinestatic

LPUART break character transmit length configuration.

This function configures the break char length. In some LPUART instances, the user should disable the transmitter before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer
lengthLPUART break character length setting: 0 - minimum 10-bit times (default), 1 - minimum 13-bit times Implements : LPUART_HAL_SetBreakCharTransmitLength_Activity

Definition at line 1179 of file lpuart_hal.h.

static void LPUART_HAL_SetCtsMode ( LPUART_Type base,
lpuart_cts_config_t  mode 
)
inlinestatic

Transmits the CTS configuration.

This function transmits the CTS configuration. Note: configures if the CTS state is checked at the start of each character or only when the transmitter is idle.

Parameters
baseLPUART base pointer
modeLPUART CTS configuration Implements : LPUART_HAL_SetCtsMode_Activity

Definition at line 1332 of file lpuart_hal.h.

static void LPUART_HAL_SetCtsSource ( LPUART_Type base,
lpuart_cts_source_t  source 
)
inlinestatic

Transmits the CTS source configuration.

This function transmits the CTS source configuration.

Parameters
baseLPUART base pointer
sourceLPUART CTS source Implements : LPUART_HAL_SetCtsSource_Activity

Definition at line 1314 of file lpuart_hal.h.

static void LPUART_HAL_SetIdleChar ( LPUART_Type base,
lpuart_idle_char_t  idleConfig 
)
inlinestatic

Configures the number of idle characters.

This function Configures the number of idle characters that must be received before the IDLE flag is set.

Parameters
baseLPUART base pointer
idleConfigIdle characters configuration Implements : LPUART_HAL_SetIdleChar_Activity

Definition at line 849 of file lpuart_hal.h.

void LPUART_HAL_SetIdleLineDetect ( LPUART_Type base,
const lpuart_idle_line_config_t config 
)

LPUART idle-line detect operation configuration.

This function configures idle-line detect operation configuration (idle line bit-count start and wake up affect on IDLE status bit). In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer
configLPUART configuration data for idle line detect operation

Definition at line 543 of file lpuart_hal.c.

void LPUART_HAL_SetInfrared ( LPUART_Type base,
bool  enable,
lpuart_ir_tx_pulsewidth_t  pulseWidth 
)

Configures the LPUART infrared operation.

This function configures the LPUART infrared operation.

Parameters
baseLPUART base pointer
enableEnable (1) or disable (0) the infrared operation
pulseWidthThe transmit narrow pulse width of type lpuart_ir_tx_pulsewidth_t
void LPUART_HAL_SetIntMode ( LPUART_Type base,
lpuart_interrupt_t  intSrc,
bool  enable 
)

Configures the LPUART module interrupts.

This function configures the LPUART module interrupts to enable/disable various interrupt sources.

Parameters
baseLPUART module base pointer.
intSrcLPUART interrupt configuration data.
enabletrue: enable, false: disable.

Definition at line 371 of file lpuart_hal.c.

void LPUART_HAL_SetLoopbackCmd ( LPUART_Type base,
bool  enable 
)

Configures the LPUART loopback operation (enable/disable loopback operation)

This function configures the LPUART loopback operation (enable/disable loopback operation). In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer
enableLPUART loopback mode - disabled (0) or enabled (1)

Definition at line 469 of file lpuart_hal.c.

static void LPUART_HAL_SetMatchAddressMode ( LPUART_Type base,
lpuart_match_config_t  config 
)
inlinestatic

Configures match address mode control.

This function configures match address mode control.

Parameters
baseLPUART base pointer
configMATCFG: Configures the match addressing mode used. Implements : LPUART_HAL_SetMatchAddressMode_Activity

Definition at line 1228 of file lpuart_hal.h.

void LPUART_HAL_SetMatchAddressReg1 ( LPUART_Type base,
bool  enable,
uint8_t  value 
)

Configures address match register 1.

This function configures address match register 1. The MAEN bit must be cleared before configuring MA value, so the enable/disable and set value must be included inside one function.

Parameters
baseLPUART base pointer
enableMatch address model enable (true)/disable (false)
valueMatch address value to program into match address register 1

Definition at line 564 of file lpuart_hal.c.

void LPUART_HAL_SetMatchAddressReg2 ( LPUART_Type base,
bool  enable,
uint8_t  value 
)

Configures address match register 2.

This function configures address match register 2. The MAEN bit must be cleared before configuring MA value, so the enable/disable and set value must be included inside one function.

Parameters
baseLPUART base pointer
enableMatch address model enable (true)/disable (false)
valueMatch address value to program into match address register 2

Definition at line 588 of file lpuart_hal.c.

static void LPUART_HAL_SetOversamplingRatio ( LPUART_Type base,
uint32_t  overSamplingRatio 
)
inlinestatic

Sets the LPUART baud rate oversampling ratio.

This function sets the LPUART baud rate oversampling ratio. (Note: Feature available on select LPUART instances used together with baud rate programming) The oversampling ratio should be set between 4x (00011) and 32x (11111). Writing an invalid oversampling ratio results in an error and is set to a default 16x (01111) oversampling ratio. Disable the transmitter/receiver before calling this function.

Parameters
baseLPUART base pointer.
overSamplingRatioThe oversampling ratio "OSR" Implements : LPUART_HAL_SetOversamplingRatio_Activity

Definition at line 477 of file lpuart_hal.h.

void LPUART_HAL_SetParityMode ( LPUART_Type base,
lpuart_parity_mode_t  parityModeType 
)

Configures parity mode in the LPUART controller.

This function configures parity mode in the LPUART controller. In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer.
parityModeTypeParity mode (enabled, disable, odd, even - see parity_mode_t struct)

Definition at line 213 of file lpuart_hal.c.

static void LPUART_HAL_SetReceiverCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the LPUART receiver.

This function enables or disables the LPUART receiver, based on the parameter received.

Parameters
baseLPUART base pointer
enableEnable(true) or disable(false) receiver. Implements : LPUART_HAL_SetReceiverCmd_Activity

Definition at line 397 of file lpuart_hal.h.

static void LPUART_HAL_SetReceiveResyncCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

LPUART enable/disable re-sync of received data configuration.

This function enables or disables re-sync of received data, based on the parameter received.

Parameters
baseLPUART base pointer
enablere-sync of received data word configuration: true - re-sync of received data word (default) false - disable the re-sync Implements : LPUART_HAL_SetReceiveResyncCmd_Activity

Definition at line 1295 of file lpuart_hal.h.

status_t LPUART_HAL_SetReceiverInStandbyMode ( LPUART_Type base)

Places the LPUART receiver in standby mode.

This function places the LPUART receiver in standby mode.

Parameters
baseLPUART base pointer
Returns
STATUS_SUCCESS if successful or STATUS_ERROR if an error occured

Definition at line 510 of file lpuart_hal.c.

static void LPUART_HAL_SetReceiverWakeupMode ( LPUART_Type base,
lpuart_wakeup_method_t  method 
)
inlinestatic

Sets the LPUART receiver wakeup method from standby mode.

This function sets the LPUART receiver wakeup method (idle line or addr-mark) from standby mode.

Parameters
baseLPUART base pointer
methodLPUART wakeup method: 0 - Idle-line wake (default), 1 - addr-mark wake Implements : LPUART_HAL_SetReceiverWakeupMode_Activity

Definition at line 1129 of file lpuart_hal.h.

static void LPUART_HAL_SetRxDataPolarity ( LPUART_Type base,
bool  polarity 
)
inlinestatic

Sets whether the recevie data is inverted or not.

This function sets the polarity of the receive data.

Parameters
baseLPUART base pointer.
polarityRx Data polarity; true: inverted, false: not inverted. Implements : LPUART_HAL_SetRxDataPolarity_Activity

Definition at line 535 of file lpuart_hal.h.

static void LPUART_HAL_SetRxDmaCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Configures DMA requests.

This function configures DMA requests for LPUART Receiver.

Parameters
baseLPUART base pointer
enableReceive DMA request configuration (enable: 1/disable: 0) Implements : LPUART_HAL_SetRxDmaCmd_Activity

Definition at line 656 of file lpuart_hal.h.

static void LPUART_HAL_SetRxFIFOCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the receiver FIFO.

This function enables or disables the receiver FIFO structure, based on the parameter received. Note: The size of the FIFO structure is indicated by RXFIFOSIZE.

Parameters
baseLPUART base pointer
enabledisable(0)/enable(1) receiver FIFO. Implements : LPUART_HAL_SetRxFIFOCmd_Activity

Definition at line 1435 of file lpuart_hal.h.

static void LPUART_HAL_SetRxIdleEmptyDuration ( LPUART_Type base,
uint8_t  duration 
)
inlinestatic

Enables the assertion of RDRF when the receiver is idle.

This function enables the assertion of RDRF when the receiver is idle for a number of idle characters and the FIFO is not empty.

Parameters
baseLPUART base pointer.
durationThe number of characters the receiver must be empty before RDRF assertion 0 - disabled, >0 - rx must be idle for 2^(duration-1) characters before RDRF assertion

Implements : LPUART_HAL_SetRxIdleEmptyDuration_Activity

Definition at line 1454 of file lpuart_hal.h.

static void LPUART_HAL_SetRxRtsCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the receiver request-to-send.

This function enables or disables the receiver request-to-send, based on the parameter received. Note: do not enable both Receiver RTS (RXRTSE) and Transmit RTS (TXRTSE).

Parameters
baseLPUART base pointer
enabledisable(0)/enable(1) receiver RTS. Implements : LPUART_HAL_SetRxRtsCmd_Activity

Definition at line 1365 of file lpuart_hal.h.

static void LPUART_HAL_SetRxWatermark ( LPUART_Type base,
uint8_t  rxWater 
)
inlinestatic

Sets the rx watermark.

This function sets the rx FIFO watermark. When the number of datawords in the receive FIFO/buffer is greater than the value in this register field, an interrupt or a DMA request is generated. Note: For proper operation, the value in RXWATER must be set to be less than the receive FIFO/buffer size and greater than 0.

Parameters
baseLPUART base pointer
rxWaterRx FIFO Watermark Implements : LPUART_HAL_SetRxWatermark_Activity

Definition at line 1540 of file lpuart_hal.h.

static void LPUART_HAL_SetSendMsbFirstCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

LPUART sends the MSB first configuration.

This function configures whether MSB is sent first. Note: In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer
enablefalse - LSB (default, disabled), true - MSB (enabled) Implements : LPUART_HAL_SetSendMsbFirstCmd_Activity

Definition at line 1276 of file lpuart_hal.h.

void LPUART_HAL_SetSingleWireCmd ( LPUART_Type base,
bool  enable 
)

Configures the LPUART single-wire operation (enable/disable single-wire mode).

This function configures the LPUART single-wire operation (enable/disable single-wire mode). In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer
enableLPUART loopback mode - disabled (0) or enabled (1)

Definition at line 492 of file lpuart_hal.c.

static void LPUART_HAL_SetStopBitCount ( LPUART_Type base,
lpuart_stop_bit_count_t  stopBitCount 
)
inlinestatic

Configures the number of stop bits in the LPUART controller.

This function configures the number of stop bits in the LPUART controller. In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer.
stopBitCountNumber of stop bits (1 or 2 - see lpuart_stop_bit_count_t struct) Implements : LPUART_HAL_SetStopBitCount_Activity

Definition at line 579 of file lpuart_hal.h.

static void LPUART_HAL_SetTransmitterCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the LPUART transmitter.

This function enables or disables the LPUART transmitter, based on the parameter received.

Parameters
baseLPUART base pointer.
enableEnable(true) or disable(false) transmitter. Implements : LPUART_HAL_SetTransmitterCmd_Activity

Definition at line 363 of file lpuart_hal.h.

static void LPUART_HAL_SetTxCtsCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the transmitter clear-to-send.

This function controls the transmitter clear-to-send, based on the parameter received.

Parameters
baseLPUART base pointer
enabledisable(0)/enable(1) transmitter CTS. Implements : LPUART_HAL_SetTxCtsCmd_Activity

Definition at line 1348 of file lpuart_hal.h.

static void LPUART_HAL_SetTxdirInSinglewireMode ( LPUART_Type base,
lpuart_singlewire_txdir_t  direction 
)
inlinestatic

Configures the LPUART transmit direction while in single-wire mode.

This function configures the LPUART transmit direction while in single-wire mode.

Parameters
baseLPUART base pointer
directionLPUART single-wire transmit direction - input or output Implements : LPUART_HAL_SetTxdirInSinglewireMode_Activity

Definition at line 1072 of file lpuart_hal.h.

static void LPUART_HAL_SetTxDmaCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Configures DMA requests.

This function configures DMA requests for LPUART Transmitter.

Parameters
baseLPUART base pointer
enableTransmit DMA request configuration (enable:1 /disable: 0) Implements : LPUART_HAL_SetTxDmaCmd_Activity

Definition at line 641 of file lpuart_hal.h.

static void LPUART_HAL_SetTxFIFOCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the transmitter FIFO.

This function enables or disables the transmitter FIFO structure, based on the parameter received. Note: The size of the FIFO structure is indicated by TXFIFOSIZE.

Parameters
baseLPUART base pointer
enabledisable(0)/enable(1) transmitter FIFO. Implements : LPUART_HAL_SetTxFIFOCmd_Activity

Definition at line 1417 of file lpuart_hal.h.

static void LPUART_HAL_SetTxRtsCmd ( LPUART_Type base,
bool  enable 
)
inlinestatic

Enable/Disable the transmitter request-to-send.

This function enables or disables the transmitter request-to-send, based on the parameter received. Note: do not enable both Receiver RTS (RXRTSE) and Transmit RTS (TXRTSE).

Parameters
baseLPUART base pointer
enabledisable(0)/enable(1) transmitter RTS. Implements : LPUART_HAL_SetTxRtsCmd_Activity

Definition at line 1382 of file lpuart_hal.h.

static void LPUART_HAL_SetTxRtsPolarityMode ( LPUART_Type base,
bool  polarity 
)
inlinestatic

Configures the transmitter RTS polarity.

This function configures the transmitter RTS polarity.

Parameters
baseLPUART base pointer
polaritySettings to choose RTS polarity (0=active low, 1=active high) Implements : LPUART_HAL_SetTxRtsPolarityMode_Activity

Definition at line 1397 of file lpuart_hal.h.

static void LPUART_HAL_SetTxSpecialChar ( LPUART_Type base,
uint8_t  specialChar 
)
inlinestatic

Indicates a special character is to be transmitted.

This function sets this bit to indicate a break or idle character is to be transmitted instead of the contents in DATA[T9:T0].

Parameters
baseLPUART base pointer
specialChar-> 0 - break character, 1 - idle character Implements : LPUART_HAL_SetTxSpecialChar_Activity

Definition at line 951 of file lpuart_hal.h.

static void LPUART_HAL_SetTxWatermark ( LPUART_Type base,
uint8_t  txWater 
)
inlinestatic

Sets the tx watermark.

This function sets the tx FIFO watermark. When the number of datawords in the transmit FIFO/buffer is equal to or less than the value in this register field, an interrupt or a DMA request is generated. Note: For proper operation, the value in TXWATER must be set to be less than the transmit FIFO/buffer size and greater than 0.

Parameters
baseLPUART base pointer
txWaterTx FIFO Watermark Implements : LPUART_HAL_SetTxWatermark_Activity

Definition at line 1511 of file lpuart_hal.h.

static void LPUART_HAL_SetWaitModeOperation ( LPUART_Type base,
lpuart_operation_config_t  mode 
)
inlinestatic

Configures the LPUART operation in wait mode (operates or stops operations in wait mode).

This function configures the LPUART operation in wait mode (operates or stops operations in wait mode). In some LPUART instances, the user should disable the transmitter/receiver before calling this function. Generally, this may be applied to all LPUARTs to ensure safe operation.

Parameters
baseLPUART base pointer
modeLPUART wait mode operation - operates or stops to operate in wait mode. Implements : LPUART_HAL_SetWaitModeOperation_Activity

Definition at line 1013 of file lpuart_hal.h.

static bool LPUART_HAL_WasPreviousReceiverStateIdle ( const LPUART_Type base)
inlinestatic

Checks whether the previous BUS state was idle before this byte is received.

This function returns whether the previous BUS state was idle before this byte is received.

Parameters
baseLPUART base pointer
Returns
TRUE if the previous BUS state was IDLE, else FALSE. Implements : LPUART_HAL_WasPreviousReceiverStateIdle_Activity

Definition at line 996 of file lpuart_hal.h.