HAL UART constants migration ¶
This section provides information about the HAL UART constants migration.
HAL UART states ¶
|
HAL1 |
HAL2 |
|---|---|
|
In HAL1, UART states have been defined using macros, where each state is defined as a macro with a specific name. |
In HAL2, key changes include:
|
#define HAL_UART_STATE_RESET
#define HAL_UART_STATE_READY
#define HAL_UART_STATE_BUSY
#define HAL_UART_STATE_BUSY_TX
#define HAL_UART_STATE_BUSY_RX
#define HAL_UART_STATE_BUSY_TX_RX
#define HAL_UART_STATE_TIMEOUT
#define HAL_UART_STATE_ERROR
|
typedef enum
{
HAL_UART_STATE_RESET,
HAL_UART_STATE_INIT,
HAL_UART_STATE_CONFIGURED
} hal_uart_state_t;
typedef enum
{
HAL_UART_RX_STATE_RESET,
HAL_UART_RX_STATE_IDLE,
HAL_UART_RX_STATE_ACTIVE,
HAL_UART_RX_STATE_ABORT
} hal_uart_rx_state_t;
typedef enum
{
HAL_UART_TX_STATE_RESET,
HAL_UART_TX_STATE_IDLE,
HAL_UART_TX_STATE_ACTIVE,
HAL_UART_TX_STATE_ABORT
} hal_uart_tx_state_t;
|
Related concept:
HAL UART errors ¶
|
HAL1 |
HAL2 |
|---|---|
|
In HAL1, error handling has been done using a set of macros that define various error states.
Some errors, like
|
In HAL2, the error defines have been reorganized and renamed to provide more specific handling for receive and transmit operations.
|
#define HAL_UART_ERROR_NONE
#define HAL_UART_ERROR_PE
#define HAL_UART_ERROR_NE
#define HAL_UART_ERROR_FE
#define HAL_UART_ERROR_ORE
#define HAL_UART_ERROR_RTO
#define HAL_UART_ERROR_DMA
#define HAL_UART_ERROR_INVALID_CALLBACK
|
#define HAL_UART_RECEIVE_ERROR_NONE
#define HAL_UART_TRANSMIT_ERROR_NONE
#define HAL_UART_RECEIVE_ERROR_PE
#define HAL_UART_RECEIVE_ERROR_NE
#define HAL_UART_RECEIVE_ERROR_FE
#define HAL_UART_RECEIVE_ERROR_ORE
#define HAL_UART_RECEIVE_ERROR_RTO
#define HAL_UART_RECEIVE_ERROR_DMA
#define HAL_UART_TRANSMIT_ERROR_DMA
|
Related concept:
Note
For the following UART constants, which were previously defined using
#define
directive, have been converted to an enumerated type (enum).
Related concept:
Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels.
HAL UART reception event types ¶
In HAL2, these constants are used in the context of
Receive
to
Idle
and
Receive
until
Timeout/Character
Match.
They are passed as parameters to the RX complete callbacks to indicate the type of event that occurred.
|
HAL1 |
HAL2 |
|---|---|
#define HAL_UART_RXEVENT_TC
#define HAL_UART_RXEVENT_HT
#define HAL_UART_RXEVENT_IDLE
|
typedef enum
{
HAL_UART_RX_EVENT_TC,
HAL_UART_RX_EVENT_IDLE,
HAL_UART_RX_EVENT_RTO,
HAL_UART_RX_EVENT_CHAR_MATCH
} hal_uart_rx_event_types_t;
|
Note
The “Receive to Timeout” and “Character Match” functionalities are added in HAL2, which are not available in HAL1.
HAL UART reception modes ¶
Note
These constants are used internally and do not impact user-level operations.
|
HAL1 |
HAL2 |
|---|---|
#define HAL_UART_RECEPTION_STANDARD
#define HAL_UART_RECEPTION_TOIDLE
#define HAL_UART_RECEPTION_TORTO
#define HAL_UART_RECEPTION_TOCHARMATCH
|
typedef enum
{
HAL_UART_RX_STANDARD,
HAL_UART_RX_TO_IDLE,
HAL_UART_RX_TO_RTO,
HAL_UART_RX_TO_CHAR_MATCH
} hal_uart_rx_modes_t;
|
HAL UART wake-up sources ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_WAKEUP_ON_ADDRESS
#define UART_WAKEUP_ON_STARTBIT
#define UART_WAKEUP_ON_READDATA_NONEMPTY
|
typedef enum
{
HAL_UART_WAKEUP_ON_ADDRESS,
HAL_UART_WAKEUP_ON_STARTBIT,
HAL_UART_WAKEUP_ON_READDATA_NONEMPTY
} hal_uart_wakeup_source_t;
|
HAL UART FIFO thresholds ¶
In HAL2, UART FIFO thresholds for TX and RX are merged and defined using an enumeration type,
hal_uart_fifo_threshold_t.
|
HAL1 |
HAL2 |
|---|---|
#define UART_TXFIFO_THRESHOLD_1_8
#define UART_TXFIFO_THRESHOLD_1_4
#define UART_TXFIFO_THRESHOLD_1_2
#define UART_TXFIFO_THRESHOLD_3_4
#define UART_TXFIFO_THRESHOLD_7_8
#define UART_TXFIFO_THRESHOLD_8_8
#define UART_RXFIFO_THRESHOLD_1_8
#define UART_RXFIFO_THRESHOLD_1_4
#define UART_RXFIFO_THRESHOLD_1_2
#define UART_RXFIFO_THRESHOLD_3_4
#define UART_RXFIFO_THRESHOLD_7_8
#define UART_RXFIFO_THRESHOLD_8_8
|
typedef enum
{
HAL_UART_FIFO_THRESHOLD_1_8,
HAL_UART_FIFO_THRESHOLD_1_4,
HAL_UART_FIFO_THRESHOLD_1_2,
HAL_UART_FIFO_THRESHOLD_3_4,
HAL_UART_FIFO_THRESHOLD_7_8,
HAL_UART_FIFO_THRESHOLD_8_8
} hal_uart_fifo_threshold_t;
|
HAL UART address detect length ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADDRESS_DETECT_4B
#define UART_ADDRESS_DETECT_7B
|
typedef enum
{
HAL_UART_ADDRESS_DETECT_4_BIT,
HAL_UART_ADDRESS_DETECT_7_BIT
} hal_uart_address_detect_length_t;
|
HAL UART trigger polarity ¶
|
HAL1 |
HAL2 |
|---|---|
#define USART_TRIG_POLARITY_RISING
#define USART_TRIG_POLARITY_FALLING
|
typedef enum
{
HAL_UART_AM_TRIG_RISING,
HAL_UART_AM_TRIG_FALLING
} hal_uart_am_trig_polarity_t;
|
HAL UART trigger sources ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_GPDMA1_CH0_TCF_TRG
#define UART_GPDMA1_CH1_TCF_TRG
#define UART_GPDMA1_CH2_TCF_TRG
#define UART_GPDMA1_CH3_TCF_TRG
.
.
.
#define LPUART_LPDMA1_CH0_TCF_TRG
#define LPUART_LPDMA1_CH1_TCF_TRG
#define LPUART_LPDMA1_CH2_TCF_TRG
#define LPUART_LPDMA1_CH3_TCF_TRG
.
.
.
|
typedef enum
{
HAL_UART_AM_TRIG_GPDMA1_CH0_TC,
HAL_UART_AM_TRIG_GPDMA1_CH1_TC,
HAL_UART_AM_TRIG_GPDMA1_CH2_TC,
HAL_UART_AM_TRIG_GPDMA1_CH3_TC,
.
.
.
HAL_LPUART_AM_TRIG_LPDMA1_CH0_TC
HAL_LPUART_AM_TRIG_LPDMA1_CH1_TC
HAL_LPUART_AM_TRIG_LPDMA1_CH2_TC
HAL_LPUART_AM_TRIG_LPDMA1_CH3_TC
.
.
.
} hal_uart_am_trig_source_t;
|
HAL UART requests ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_AUTOBAUD_REQUEST
#define UART_SENDBREAK_REQUEST
#define UART_MUTE_MODE_REQUEST
#define UART_RXDATA_FLUSH_REQUEST
#define UART_TXDATA_FLUSH_REQUEST
|
typedef enum
{
HAL_UART_REQUEST_AUTO_BAUD_RATE,
HAL_UART_REQUEST_SEND_BREAK,
HAL_UART_REQUEST_MUTE_MODE,
HAL_UART_REQUEST_RX_DATA_FLUSH,
HAL_UART_REQUEST_TX_DATA_FLUSH
} hal_uart_request_t;
|
HAL UART wakeup methods ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_WAKEUPMETHOD_IDLELINE
#define UART_WAKEUPMETHOD_ADDRESSMARK
|
typedef enum
{
HAL_UART_WAKEUP_METHOD_IDLE_LINE,
HAL_UART_WAKEUP_METHOD_ADDRESS_MARK
} hal_uart_wakeup_method_t;
|
HAL UART LIN break detection length ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_LINBREAKDETECTLENGTH_10B
#define UART_LINBREAKDETECTLENGTH_11B
|
typedef enum
{
HAL_UART_LIN_BREAK_DETECT_10_BIT,
HAL_UART_LIN_BREAK_DETECT_11_BIT
} hal_uart_lin_break_detect_length_t;
|
HAL UART word length ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_WORDLENGTH_7B
#define UART_WORDLENGTH_8B
#define UART_WORDLENGTH_9B
|
typedef enum
{
HAL_UART_WORD_LENGTH_7_BIT,
HAL_UART_WORD_LENGTH_8_BIT,
HAL_UART_WORD_LENGTH_9_BIT
} hal_uart_word_length_t;
|
HAL UART clock prescaler ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_PRESCALER_DIV1
#define UART_PRESCALER_DIV2
#define UART_PRESCALER_DIV4
#define UART_PRESCALER_DIV6
#define UART_PRESCALER_DIV8
#define UART_PRESCALER_DIV10
#define UART_PRESCALER_DIV12
#define UART_PRESCALER_DIV16
#define UART_PRESCALER_DIV32
#define UART_PRESCALER_DIV64
#define UART_PRESCALER_DIV128
#define UART_PRESCALER_DIV256
|
typedef enum
{
HAL_UART_PRESCALER_DIV1,
HAL_UART_PRESCALER_DIV2,
HAL_UART_PRESCALER_DIV4,
HAL_UART_PRESCALER_DIV6,
HAL_UART_PRESCALER_DIV8,
HAL_UART_PRESCALER_DIV10,
HAL_UART_PRESCALER_DIV12,
HAL_UART_PRESCALER_DIV16,
HAL_UART_PRESCALER_DIV32,
HAL_UART_PRESCALER_DIV64,
HAL_UART_PRESCALER_DIV128,
HAL_UART_PRESCALER_DIV256
} hal_uart_prescaler_t;
|
HAL UART one-bit sample mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ONE_BIT_SAMPLE_DISABLE
#define UART_ONE_BIT_SAMPLE_ENABLE
|
typedef enum
{
HAL_UART_ONE_BIT_SAMPLE_DISABLE,
HAL_UART_ONE_BIT_SAMPLE_ENABLE
} hal_uart_one_bit_sample_t;
|
HAL UART oversampling modes ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_OVERSAMPLING_16
#define UART_OVERSAMPLING_8
|
typedef enum
{
HAL_UART_OVERSAMPLING_16,
HAL_UART_OVERSAMPLING_8
} hal_uart_oversampling_t;
|
HAL UART stop bits ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_STOPBITS_0_5
#define UART_STOPBITS_1
#define UART_STOPBITS_1_5
#define UART_STOPBITS_2
|
typedef enum
{
HAL_UART_STOP_BIT_0_5,
HAL_UART_STOP_BIT_1,
HAL_UART_STOP_BIT_1_5,
HAL_UART_STOP_BIT_2
} hal_uart_stop_bits_t;
|
HAL UART parity ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_PARITY_NONE
#define UART_PARITY_EVEN
#define UART_PARITY_ODD
|
typedef enum
{
HAL_UART_PARITY_NONE,
HAL_UART_PARITY_EVEN,
HAL_UART_PARITY_ODD
} hal_uart_parity_t;
|
HAL UART directions ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_MODE_RX
#define UART_MODE_TX
#define UART_MODE_TX_RX
|
typedef enum
{
HAL_UART_DIRECTION_RX,
HAL_UART_DIRECTION_TX,
HAL_UART_DIRECTION_TX_RX
} hal_uart_direction_t;
|
HAL UART DE polarity ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_DE_POLARITY_HIGH
#define UART_DE_POLARITY_LOW
|
typedef enum
{
HAL_UART_DE_POLARITY_HIGH,
HAL_UART_DE_POLARITY_LOW
} hal_uart_de_polarity_t;
|
HAL UART hardware flow control ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_HWCONTROL_NONE
#define UART_HWCONTROL_RTS
#define UART_HWCONTROL_CTS
#define UART_HWCONTROL_RTS_CTS
|
typedef enum
{
HAL_UART_HW_CONTROL_NONE
HAL_UART_HW_CONTROL_RTS
HAL_UART_HW_CONTROL_CTS
HAL_UART_HW_CONTROL_RTS_CTS
} hal_uart_hw_control_t;
|
HAL UART flags ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_FLAG_TXFT
#define UART_FLAG_RXFT
#define UART_FLAG_RXFF
#define UART_FLAG_TXFE
#define UART_FLAG_REACK
#define UART_FLAG_TEACK
#define UART_FLAG_WUF
#define UART_FLAG_RWU
#define UART_FLAG_SBKF
#define UART_FLAG_CMF
#define UART_FLAG_BUSY
#define UART_FLAG_ABRF
#define UART_FLAG_ABRE
#define UART_FLAG_RTOF
#define UART_FLAG_CTS
#define UART_FLAG_CTSIF
#define UART_FLAG_LBDF
#define UART_FLAG_TXE
#define UART_FLAG_TXFNF
#define UART_FLAG_TC
#define UART_FLAG_RXNE
#define UART_FLAG_RXFNE
#define UART_FLAG_IDLE
#define UART_FLAG_ORE
#define UART_FLAG_NE
#define UART_FLAG_FE
#define UART_FLAG_PE
|
Removed; use the equivalent static inline functions provided in the LL Layer for flag management. For more details, refer to HAL UART get flag/interrupt. |
HAL UART clear flags ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_CLEAR_PEF
#define UART_CLEAR_FEF
#define UART_CLEAR_NEF
#define UART_CLEAR_OREF
#define UART_CLEAR_IDLEF
#define UART_CLEAR_TXFECF
#define UART_CLEAR_TCF
#define UART_CLEAR_LBDF
#define UART_CLEAR_CTSF
#define UART_CLEAR_RTOF
#define UART_CLEAR_CMF
#define UART_CLEAR_WUF
|
Removed; use the equivalent static inline functions provided in the LL Layer to clear flags. For more details, refer to Specific HAL UART clear flags. |
HAL UART interrupts ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_IT_PE
#define UART_IT_TXE
#define UART_IT_TXFNF
#define UART_IT_TC
#define UART_IT_RXNE
#define UART_IT_RXFNE
#define UART_IT_IDLE
#define UART_IT_LBD
#define UART_IT_CTS
#define UART_IT_CM
#define UART_IT_WUF
#define UART_IT_RXFF
#define UART_IT_TXFE
#define UART_IT_RXFT
#define UART_IT_TXFT
#define UART_IT_RTO
#define UART_IT_ERR
#define UART_IT_ORE
#define UART_IT_NE
#define UART_IT_FE
|
Removed; use the equivalent static inline functions provided in the LL Layer for interrupt management. For more details, refer to HAL UART enable interrupt. |
HAL UART IT mask ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_IT_MASK
|
Removed; this constant was used internally in
|
HAL UART advanced features ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_NO_INIT
#define UART_ADVFEATURE_TXINVERT_INIT
#define UART_ADVFEATURE_RXINVERT_INIT
#define UART_ADVFEATURE_DATAINVERT_INIT
#define UART_ADVFEATURE_SWAP_INIT
#define UART_ADVFEATURE_RXOVERRUNDISABLE_INIT
#define UART_ADVFEATURE_DMADISABLEONERROR_INIT
#define UART_ADVFEATURE_AUTOBAUDRATE_INIT
#define UART_ADVFEATURE_MSBFIRST_INIT
|
These constants have been removed because the structure UART_AdvFeatureInitTypeDef, which used them in HAL1, has itself been removed. Each advanced feature is now configured and controlled through dedicated functions, enabling direct management of these features without relying on the former structure. |
HAL UART auto baudrate modes ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT
#define UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE
#define UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME
#define UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME
|
typedef enum
{
HAL_UART_AUTO_BAUD_DET_ON_START_BIT,
HAL_UART_AUTO_BAUD_DET_ON_FALLING_EDGE,
HAL_UART_AUTO_BAUD_DET_ON_0X7F_FRAME,
HAL_UART_AUTO_BAUD_DET_ON_0X55_FRAME
} hal_uart_auto_baud_rate_mode_t;
|
HAL UART enable/disable advanced features ¶
HAL UART auto baudrate mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_AUTOBAUDRATE_DISABLE
#define UART_ADVFEATURE_AUTOBAUDRATE_ENABLE
|
Removed; use the following functions to manage the auto baudrate mode: hal_status_t HAL_UART_EnableAutoBaudRate(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableAutoBaudRate(const hal_uart_handle_t *huart)
|
HAL UART DMA error mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_DMA_ENABLEONRXERROR
#define UART_ADVFEATURE_DMA_DISABLEONRXERROR
|
Removed; use the following functions to manage the DMA error mode: hal_status_t HAL_UART_EnableDMAStopOnRxError(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableDMAStopOnRxError(const hal_uart_handle_t *huart)
|
HAL UART overrun detect mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_OVERRUN_ENABLE
#define UART_ADVFEATURE_OVERRUN_DISABLE
|
Removed; use the following functions to manage the overrun detect mode: hal_status_t HAL_UART_EnableRxOverRunDetection(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableRxOverRunDetection(const hal_uart_handle_t *huart)
|
HAL UART MSP mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_MSBFIRST_DISABLE
#define UART_ADVFEATURE_MSBFIRST_ENABLE
|
Removed; use the following functions to manage MSB mode: hal_status_t HAL_UART_EnableMSBFirst(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableMSBFirst(const hal_uart_handle_t *huart)
|
HAL UART SWAP mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_SWAP_DISABLE
#define UART_ADVFEATURE_SWAP_ENABLE
|
Removed; use the following functions to manage swap mode: hal_status_t HAL_UART_EnableTxRxSwap(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableTxRxSwap(const hal_uart_handle_t *huart)
|
HAL UART data inversion mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_DATAINV_DISABLE
#define UART_ADVFEATURE_DATAINV_ENABLE
|
Removed; use the following functions to manage data inversion mode: hal_status_t HAL_UART_EnableDataInvert(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableDataInvert(const hal_uart_handle_t *huart)
|
HAL UART RX pin inversion mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_RXINV_DISABLE
#define UART_ADVFEATURE_RXINV_ENABLE
|
Removed; use the following functions to manage RX pin inversion mode: hal_status_t HAL_UART_EnableRxPinLevelInvert(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableRxPinLevelInvert(const hal_uart_handle_t *huart)
|
HAL UART TX pin inversion mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_TXINV_DISABLE
#define UART_ADVFEATURE_TXINV_ENABLE
|
Removed; use the following functions to manage TX pin inversion mode: hal_status_t HAL_UART_EnableTxPinLevelInvert(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableTxPinLevelInvert(const hal_uart_handle_t *huart)
|
HAL UART stop mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_STOPMODE_DISABLE
#define UART_ADVFEATURE_STOPMODE_ENABLE
|
Removed; use the following functions to manage the stop mode: hal_status_t HAL_UART_EnableStopMode(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableStopMode(const hal_uart_handle_t *huart)
|
HAL UART mute mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_ADVFEATURE_MUTEMODE_DISABLE
#define UART_ADVFEATURE_MUTEMODE_ENABLE
|
Removed; use the following functions to manage the Mute mode: hal_status_t HAL_UART_EnableMultiProcessorMode(const hal_uart_handle_t *huart);
hal_status_t HAL_UART_DisableMultiProcessorMode(const hal_uart_handle_t *huart);
|
HAL UART FIFO modes ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_FIFOMODE_ENABLE
#define UART_FIFOMODE_DISABLE
|
Removed; use the following functions to manage the FIFO mode: hal_status_t HAL_UART_EnableFifoMode(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableFifoMode(const hal_uart_handle_t *huart)
|
HAL UART autonomous mode ¶
HAL UART enable/disable autonomous mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define USART_AUTONOMOUS_MODE_DISABLE
#define USART_AUTONOMOUS_MODE_ENABLE
|
The constants for managing the UART autonomous mode are removed because enabling or disabling the UART the autonomous mode is no longer handled within the USART_AutonomousModeConfTypeDef. Instead, use the following functions to manage the autonomous mode: hal_status_t HAL_UART_AM_EnablePacketTrigger(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_AM_DisablePacketTrigger(const hal_uart_handle_t *huart)
|
HAL UART idle frame mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define USART_IDLE_FRAME_ENABLE
#define USART_IDLE_FRAME_DISABLE
|
The constants for managing the UART autonomous mode are removed because enabling or disabling the UART idle frame mode is no longer handled within the USART_AutonomousModeConfTypeDef. Instead, use the following functions to manage the idle frame mode: hal_status_t HAL_UART_AM_EnableIdle(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_AM_DisableIdle(const hal_uart_handle_t *huart)
|
HAL UART receiver timeout ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_RECEIVER_TIMEOUT_DISABLE
#define UART_RECEIVER_TIMEOUT_ENABLE
|
Removed; use the following functions to manage the receiver timeout: hal_status_t HAL_UART_EnableReceiverTimeout(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableReceiverTimeout(const hal_uart_handle_t *huart)
|
HAL UART LIN mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_LIN_DISABLE
#define UART_LIN_ENABLE
|
Removed; use the following functions to manage the LIN mode : hal_status_t HAL_UART_EnableLINMode(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableLINMode(const hal_uart_handle_t *huart)
For the complete LIN initialization sequence, refer to UART LIN Mode Initialization. |
HAL UART half-duplex mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_HALF_DUPLEX_DISABLE
#define UART_HALF_DUPLEX_ENABLE
|
Removed; use the following functions to manage the half-duplex mode: hal_status_t HAL_UART_EnableHalfDuplexMode(const hal_uart_handle_t *huart)
hal_status_t HAL_UART_DisableHalfDuplexMode(const hal_uart_handle_t *huart)
|
HAL UART DMA RX mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_DMA_RX_DISABLE
#define UART_DMA_RX_ENABLE
|
Removed; these constants have been used internally in
|
HAL UART DMA TX mode ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_DMA_TX_DISABLE
#define UART_DMA_TX_ENABLE
|
Removed; these constants have been used internally in
|
HAL UART enable/disable states ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_STATE_DISABLE
#define UART_STATE_ENABLE
|
Removed; these constants have been used internally in
|
HAL UART timeout value ¶
|
HAL1 |
HAL2 |
|---|---|
#define HAL_UART_TIMEOUT_VALUE
|
Removed in HAL2; the user can specify the timeout value directly as a parameter to APIs that require it. |
HAL UART register positions ¶
|
HAL1 |
HAL2 |
|---|---|
#define UART_CR2_ADDRESS_LSB_POS
#define UART_CR1_DEDT_ADDRESS_LSB_POS
#define UART_CR1_DEAT_ADDRESS_LSB_POS
|
Removed; these constants have been removed from HAL2 and are already provided in the DFP. |