![]() |
S32 SDK
|
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) |
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... | |
#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.
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
Definition at line 123 of file lpuart_hal.h.
enum lpuart_cts_config_t |
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.
enum lpuart_cts_source_t |
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.
enum lpuart_idle_char_t |
LPUART Configures the number of idle characters that must be received before the IDLE flag is set.
Implements : lpuart_idle_char_t_Class
Definition at line 173 of file lpuart_hal.h.
enum lpuart_interrupt_t |
LPUART interrupt configuration structure, default settings are 0 (disabled)
Implements : lpuart_interrupt_t_Class
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
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.
enum lpuart_parity_mode_t |
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.
enum lpuart_status_flag_t |
LPUART status flags.
This provides constants for the LPUART status flags for use in the UART functions.
Implements : lpuart_status_flag_t_Class
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.
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).
base | LPUART base pointer |
statusFlag | Desired LPUART status flag to clear |
Definition at line 684 of file lpuart_hal.c.
|
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.
base | LPUART base pointer Implements : LPUART_HAL_FlushRxFifoBuffer_Activity |
Definition at line 1492 of file lpuart_hal.h.
|
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.
base | LPUART base pointer Implements : LPUART_HAL_FlushTxFifoBuffer_Activity |
Definition at line 1477 of file lpuart_hal.h.
|
inlinestatic |
Gets the LPUART 8-bit character.
This functions receives an 8-bit character.
base | LPUART base pointer |
readData | Data 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.
base | LPUART base pointer |
readData | Data 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.
base | LPUART base pointer |
readData | Data read from receive (9-bit) |
Definition at line 274 of file lpuart_hal.c.
|
inlinestatic |
Get LPUART tx/rx data register address.
This function returns LPUART tx/rx data register address.
base | LPUART base pointer. |
Definition at line 594 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
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.
base | LPUART module base pointer. |
intSrc | LPUART interrupt configuration data. |
Definition at line 418 of file lpuart_hal.c.
|
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.
base | LPUART base pointer |
Definition at line 415 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
Definition at line 1147 of file lpuart_hal.h.
|
inlinestatic |
Returns whether the receive data is inverted or not.
This function returns the polarity of the receive data.
base | LPUART base pointer. |
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.
base | LPUART base pointer |
statusFlag | The status flag to query |
Definition at line 636 of file lpuart_hal.c.
|
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.
base | LPUART base pointer |
Definition at line 381 of file lpuart_hal.h.
|
inlinestatic |
Gets the LPUART operation in wait mode.
This function returns the LPUART operation in wait mode (operates or stops operations in wait mode).
base | LPUART base pointer |
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.
base | LPUART base pointer. |
Definition at line 62 of file lpuart_hal.c.
|
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.
base | LPUART base pointer |
Definition at line 935 of file lpuart_hal.h.
|
inlinestatic |
Checks whether the current data word was received with noise.
This function returns whether the current data word was received with noise.
base | LPUART base pointer. |
Definition at line 920 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
Definition at line 966 of file lpuart_hal.h.
|
inlinestatic |
Checks whether the receive buffer is empty.
This function returns whether the receive buffer is empty.
base | LPUART base pointer |
Definition at line 981 of file lpuart_hal.h.
|
inlinestatic |
Checks whether the LPUART receiver is in a standby mode.
This function returns whether the LPUART receiver is in a standby mode.
base | LPUART base pointer |
Definition at line 1113 of file lpuart_hal.h.
|
inlinestatic |
Gets the LPUART DMA request configuration.
This function returns the LPUART Receive DMA request configuration.
base | LPUART base pointer |
Definition at line 686 of file lpuart_hal.h.
|
inlinestatic |
Gets the LPUART DMA request configuration.
This function returns the LPUART Transmit DMA request configuration.
base | LPUART base pointer |
Definition at line 671 of file lpuart_hal.h.
|
inlinestatic |
Sends the LPUART 8-bit character.
This functions sends an 8-bit character.
base | LPUART Instance |
data | data 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.
base | LPUART Instance |
data | data 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.
base | LPUART Instance |
data | data to send (9-bit) |
Definition at line 226 of file lpuart_hal.c.
|
inlinestatic |
Places the LPUART receiver in a normal mode.
This function places the LPUART receiver in a normal mode (disable standby mode operation).
base | LPUART base pointer Implements : LPUART_HAL_PutReceiverInNormalMode_Activity |
Definition at line 1098 of file lpuart_hal.h.
|
inlinestatic |
LPUART transmit sends break character configuration.
This function sets break character transmission in queue mode.
base | LPUART 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.
base | LPUART module base pointer. |
rxBuff | The buffer pointer which saves the data to be received. |
rxSize | Size of data need to be received in unit of byte. |
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.
base | LPUART module base pointer. |
txBuff | The buffer pointer which saves the data to be sent. |
txSize | Size 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.
base | LPUART base pointer. |
sourceClockInHz | LPUART source input clock in Hz. |
desiredBaudRate | LPUART desired baud rate. |
Definition at line 95 of file lpuart_hal.c.
|
inlinestatic |
Sets the LPUART baud rate modulo divisor.
This function sets the LPUART baud rate modulo divisor.
base | LPUART base pointer. |
baudRateDivisor | The 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.
base | LPUART base pointer. |
bitCountPerChar | Number of bits per char (8, 9, or 10, depending on the LPUART instance) |
Definition at line 187 of file lpuart_hal.c.
|
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.
base | LPUART base pointer. |
enable | Enable (1) or Disable (0) Both Edge Sampling Implements : LPUART_HAL_SetBothEdgeSamplingCmd_Activity |
Definition at line 506 of file lpuart_hal.h.
|
inlinestatic |
LPUART break character detect length configuration.
This function sets the LPUART detectable break character length.
base | LPUART base pointer |
length | LPUART 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.
|
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.
base | LPUART base pointer |
length | LPUART 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.
|
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.
base | LPUART base pointer |
mode | LPUART CTS configuration Implements : LPUART_HAL_SetCtsMode_Activity |
Definition at line 1332 of file lpuart_hal.h.
|
inlinestatic |
Transmits the CTS source configuration.
This function transmits the CTS source configuration.
base | LPUART base pointer |
source | LPUART CTS source Implements : LPUART_HAL_SetCtsSource_Activity |
Definition at line 1314 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
idleConfig | Idle 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.
base | LPUART base pointer |
config | LPUART 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.
base | LPUART base pointer |
enable | Enable (1) or disable (0) the infrared operation |
pulseWidth | The 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.
base | LPUART module base pointer. |
intSrc | LPUART interrupt configuration data. |
enable | true: 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.
base | LPUART base pointer |
enable | LPUART loopback mode - disabled (0) or enabled (1) |
Definition at line 469 of file lpuart_hal.c.
|
inlinestatic |
Configures match address mode control.
This function configures match address mode control.
base | LPUART base pointer |
config | MATCFG: 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.
base | LPUART base pointer |
enable | Match address model enable (true)/disable (false) |
value | Match 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.
base | LPUART base pointer |
enable | Match address model enable (true)/disable (false) |
value | Match address value to program into match address register 2 |
Definition at line 588 of file lpuart_hal.c.
|
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.
base | LPUART base pointer. |
overSamplingRatio | The 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.
base | LPUART base pointer. |
parityModeType | Parity mode (enabled, disable, odd, even - see parity_mode_t struct) |
Definition at line 213 of file lpuart_hal.c.
|
inlinestatic |
Enable/Disable the LPUART receiver.
This function enables or disables the LPUART receiver, based on the parameter received.
base | LPUART base pointer |
enable | Enable(true) or disable(false) receiver. Implements : LPUART_HAL_SetReceiverCmd_Activity |
Definition at line 397 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
enable | re-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.
base | LPUART base pointer |
Definition at line 510 of file lpuart_hal.c.
|
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.
base | LPUART base pointer |
method | LPUART 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.
|
inlinestatic |
Sets whether the recevie data is inverted or not.
This function sets the polarity of the receive data.
base | LPUART base pointer. |
polarity | Rx Data polarity; true: inverted, false: not inverted. Implements : LPUART_HAL_SetRxDataPolarity_Activity |
Definition at line 535 of file lpuart_hal.h.
|
inlinestatic |
Configures DMA requests.
This function configures DMA requests for LPUART Receiver.
base | LPUART base pointer |
enable | Receive DMA request configuration (enable: 1/disable: 0) Implements : LPUART_HAL_SetRxDmaCmd_Activity |
Definition at line 656 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
enable | disable(0)/enable(1) receiver FIFO. Implements : LPUART_HAL_SetRxFIFOCmd_Activity |
Definition at line 1435 of file lpuart_hal.h.
|
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.
base | LPUART base pointer. |
duration | The 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.
|
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).
base | LPUART base pointer |
enable | disable(0)/enable(1) receiver RTS. Implements : LPUART_HAL_SetRxRtsCmd_Activity |
Definition at line 1365 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
rxWater | Rx FIFO Watermark Implements : LPUART_HAL_SetRxWatermark_Activity |
Definition at line 1540 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
enable | false - 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.
base | LPUART base pointer |
enable | LPUART loopback mode - disabled (0) or enabled (1) |
Definition at line 492 of file lpuart_hal.c.
|
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.
base | LPUART base pointer. |
stopBitCount | Number 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.
|
inlinestatic |
Enable/Disable the LPUART transmitter.
This function enables or disables the LPUART transmitter, based on the parameter received.
base | LPUART base pointer. |
enable | Enable(true) or disable(false) transmitter. Implements : LPUART_HAL_SetTransmitterCmd_Activity |
Definition at line 363 of file lpuart_hal.h.
|
inlinestatic |
Enable/Disable the transmitter clear-to-send.
This function controls the transmitter clear-to-send, based on the parameter received.
base | LPUART base pointer |
enable | disable(0)/enable(1) transmitter CTS. Implements : LPUART_HAL_SetTxCtsCmd_Activity |
Definition at line 1348 of file lpuart_hal.h.
|
inlinestatic |
Configures the LPUART transmit direction while in single-wire mode.
This function configures the LPUART transmit direction while in single-wire mode.
base | LPUART base pointer |
direction | LPUART single-wire transmit direction - input or output Implements : LPUART_HAL_SetTxdirInSinglewireMode_Activity |
Definition at line 1072 of file lpuart_hal.h.
|
inlinestatic |
Configures DMA requests.
This function configures DMA requests for LPUART Transmitter.
base | LPUART base pointer |
enable | Transmit DMA request configuration (enable:1 /disable: 0) Implements : LPUART_HAL_SetTxDmaCmd_Activity |
Definition at line 641 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
enable | disable(0)/enable(1) transmitter FIFO. Implements : LPUART_HAL_SetTxFIFOCmd_Activity |
Definition at line 1417 of file lpuart_hal.h.
|
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).
base | LPUART base pointer |
enable | disable(0)/enable(1) transmitter RTS. Implements : LPUART_HAL_SetTxRtsCmd_Activity |
Definition at line 1382 of file lpuart_hal.h.
|
inlinestatic |
Configures the transmitter RTS polarity.
This function configures the transmitter RTS polarity.
base | LPUART base pointer |
polarity | Settings to choose RTS polarity (0=active low, 1=active high) Implements : LPUART_HAL_SetTxRtsPolarityMode_Activity |
Definition at line 1397 of file lpuart_hal.h.
|
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].
base | LPUART base pointer |
specialChar | -> 0 - break character, 1 - idle character Implements : LPUART_HAL_SetTxSpecialChar_Activity |
Definition at line 951 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
txWater | Tx FIFO Watermark Implements : LPUART_HAL_SetTxWatermark_Activity |
Definition at line 1511 of file lpuart_hal.h.
|
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.
base | LPUART base pointer |
mode | LPUART 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.
|
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.
base | LPUART base pointer |
Definition at line 996 of file lpuart_hal.h.