HAL UCPD Constants

UCPD Group Error Code reflecting the processes asynchronous errors

group UCPD_Error_Code

Defines

HAL_UCPD_ERROR_NONE (0UL)

No error

HAL_UCPD_ERROR_RXERR (1UL << 0U)

Error Rx

HAL_UCPD_ERROR_RXOVR (1UL << 1U)

Error Rx overrun

HAL_UCPD_ERROR_TXUND (1UL << 2U)

Error Tx underrun

HAL_UCPD_ERROR_DMA (1UL << 3U)

DMA error

UCPD Group Rx Ordered set

group UCPD_Group_RXORDEREDSET

Defines

HAL_UCPD_RX_ORDERED_SET_SOP LL_UCPD_RX_ORDERED_SET_SOP

SOP ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_SOP1 LL_UCPD_RX_ORDERED_SET_SOP1

SOP’ ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_SOP2 LL_UCPD_RX_ORDERED_SET_SOP2

SOP’’ ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_HARD_RST LL_UCPD_RX_ORDERED_SET_HARDRST

Hard reset ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_CABLE_RST LL_UCPD_RX_ORDERED_SET_CABLERST

Cable reset ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_SOP1_DEBUG LL_UCPD_RX_ORDERED_SET_SOP1_DEBUG

SOP’ debug ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_SOP2_DEBUG LL_UCPD_RX_ORDERED_SET_SOP2_DEBUG

SOP’’ debug ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_SOP_EXT1 LL_UCPD_RX_ORDERED_SET_SOP_EXT1

SOP ext#1 ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_SOP_EXT2 LL_UCPD_RX_ORDERED_SET_SOP_EXT2

SOP ext#2 ordered set detection enabled

HAL_UCPD_RX_ORDERED_SET_NONE LL_UCPD_RX_ORDERED_SET_NONE

Ordered set detection disabled

UCPD Group Rx max size

group UCPD_Group_RXMAXSIZE

Defines

HAL_UCPD_RX_MAX_SIZE_CHUNKED (30U)

Max size of possible chunked message reception

HAL_UCPD_RX_MAX_SIZE_UNCHUNKED (264U)

Max size of possible unchunked message reception

UCPD Check update state macro

group UCPD_Macro_CheckUpdateState

Defines

UCPD_CHECK_UPDATE_STATE ( handle , state_field , ppp_conditional_state , ppp_new_state , old_state_field )

do { \

do { \

/* Return

HAL_BUSY

if the status is not ready */ \

if ((__LDREXW((volatile uint32_t *)((uint32_t)&(handle)->state_field)) & \

(uint32_t)(ppp_conditional_state)) == 0U) \

{ \

return

HAL_BUSY

; \

} \

(handle)->old_state_field = (handle)->state_field; \

/* If state is ready then attempt to change the state to the new one */ \

} while (__STREXW((uint32_t)(ppp_new_state), (volatile uint32_t *)((uint32_t)&((handle)->state_field))) != 0U); \

/* Do not start any other memory access until memory barrier is complete */ \

__DMB(); \

} while (0)


Check the current peripheral handle state and move it to new state, and save the previous state in an atomic way.

Note

This macro can be used for the following purpose:

  • When the define USE_HAL_CHECK_PROCESS_STATE is set to “1”, this macro allows to check the current handle state versus a conditional state and if true set to the desired new state, and save the previous state. The check and update of the state and previous state is done using exclusive Load/store instruction making the operation atomic.

  • When the define USE_HAL_CHECK_PROCESS_STATE is not set to “1”, this macro simply assign the new handle state field to the new desired state and sets the previous state without any check.

Parameters :
  • handle – Specifies the Peripheral Handle.

  • state_field – Specifies the state field within the Handle.

  • ppp_conditional_state – State to be checked to authorize moving to the new state.

  • ppp_new_state – New state to be set.

  • old_state_field – Specifies the previous state field within the Handle.

Return values :

HAL_BUSY – if the define USE_HAL_CHECK_PROCESS_STATE is set to “1” and the current state doesn’t match ppp_conditional_state.