LL HSEM function API migration

LL HSEM 1-step lock

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_1StepLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
__STATIC_INLINE uint32_t LL_HSEM_1StepLock(uint32_t sem_id, uint32_t attribute)

LL HSEM 2-step lock

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_2StepLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
__STATIC_INLINE uint32_t LL_HSEM_2StepLock(uint32_t sem_id, uint32_t process_id, uint32_t attribute)

LL HSEM get core ID

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_GetCoreId(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
Removed; use __STATIC_INLINE uint32_t LL_HSEM_GetLockId(uint32_t sem_id) instead.

LL HSEM get key

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_GetKey(HSEM_TypeDef *HSEMx)
__STATIC_INLINE uint32_t LL_HSEM_GetKey(void)

LL HSEM get process ID

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_GetProcessId(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
__STATIC_INLINE uint32_t LL_HSEM_GetProcessId(uint32_t sem_id)

Note

  • In HAL2, LL_HSEM_GetProcessId() no longer takes the HSEM instance as an argument and uses sem_id directly.

LL HSEM get status

Note

  • In HAL2, LL_HSEM_GetStatus() has been removed because it duplicates the functionality provided by LL_HSEM_IsSemaphoreLocked() function.

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_GetStatus(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
Removed; use __STATIC_INLINE uint32_t LL_HSEM_IsSemaphoreLocked(uint32_t sem_id) instead.

LL HSEM Is semaphore locked

HAL1

HAL2

__STATIC_INLINE uint32_t LL_HSEM_IsSemaphoreLocked(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
__STATIC_INLINE uint32_t LL_HSEM_IsSemaphoreLocked(uint32_t sem_id)

Note

  • In HAL2, LL_HSEM_IsSemaphoreLocked() no longer takes the HSEM instance as an argument and uses sem_id directly.

LL HSEM release lock

HAL1

HAL2

__STATIC_INLINE void LL_HSEM_ReleaseLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
__STATIC_INLINE void LL_HSEM_ReleaseLock(uint32_t sem_id, uint32_t process_id, uint32_t attribute)

LL HSEM reset all locks

HAL1

HAL2

__STATIC_INLINE void LL_HSEM_ResetAllLock(HSEM_TypeDef *HSEMx, uint32_t key, uint32_t core)
__STATIC_INLINE void LL_HSEM_ResetAllLock(uint32_t key, uint32_t lock_id, uint32_t attribute)

LL HSEM set key

HAL1

HAL2

__STATIC_INLINE void LL_HSEM_SetKey(HSEM_TypeDef *HSEMx, uint32_t key)
__STATIC_INLINE void LL_HSEM_SetKey(uint32_t key)

Note

  • In HAL2, LL_HSEM_SetKey() no longer takes the HSEM instance as an argument, while keeping the same key usage and behavior.