20#ifndef STM32H7xx_HAL_HSEM_H
21#define STM32H7xx_HAL_HSEM_H
49#define __HAL_HSEM_SEMID_TO_MASK(__SEMID__) (1 << (__SEMID__))
57#define __HAL_HSEM_ENABLE_IT(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
58 (HSEM->C1IER |= (__SEM_MASK__)) : \
59 (HSEM->C2IER |= (__SEM_MASK__)))
61#define __HAL_HSEM_ENABLE_IT(__SEM_MASK__) (HSEM->IER |= (__SEM_MASK__))
69#define __HAL_HSEM_DISABLE_IT(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
70 (HSEM->C1IER &= ~(__SEM_MASK__)) : \
71 (HSEM->C2IER &= ~(__SEM_MASK__)))
73#define __HAL_HSEM_DISABLE_IT(__SEM_MASK__) (HSEM->IER &= ~(__SEM_MASK__))
82#define __HAL_HSEM_GET_IT(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
83 ((__SEM_MASK__) & HSEM->C1MISR) : \
84 ((__SEM_MASK__) & HSEM->C2MISR1))
86#define __HAL_HSEM_GET_IT(__SEM_MASK__) ((__SEM_MASK__) & HSEM->MISR)
95#define __HAL_HSEM_GET_FLAG(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
96 (__SEM_MASK__) & HSEM->C1ISR : \
97 (__SEM_MASK__) & HSEM->C2ISR)
99#define __HAL_HSEM_GET_FLAG(__SEM_MASK__) ((__SEM_MASK__) & HSEM->ISR)
107#if defined(DUAL_CORE)
108#define __HAL_HSEM_CLEAR_FLAG(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
109 (HSEM->C1ICR |= (__SEM_MASK__)) : \
110 (HSEM->C2ICR |= (__SEM_MASK__)))
112#define __HAL_HSEM_CLEAR_FLAG(__SEM_MASK__) (HSEM->ICR |= (__SEM_MASK__))
135void HAL_HSEM_Release(uint32_t SemID, uint32_t ProcessID);
137void HAL_HSEM_ReleaseAll(uint32_t Key, uint32_t CoreID);
139uint32_t HAL_HSEM_IsSemTaken(uint32_t SemID);
150void HAL_HSEM_SetClearKey(uint32_t Key);
152uint32_t HAL_HSEM_GetClearKey(
void);
162void HAL_HSEM_ActivateNotification(uint32_t SemMask);
164void HAL_HSEM_DeactivateNotification(uint32_t SemMask);
166void HAL_HSEM_FreeCallback(uint32_t SemMask);
168void HAL_HSEM_IRQHandler(
void);
184#define IS_HSEM_SEMID(__SEMID__) ((__SEMID__) <= HSEM_SEMID_MAX )
186#define IS_HSEM_PROCESSID(__PROCESSID__) ((__PROCESSID__) <= HSEM_PROCESSID_MAX )
188#define IS_HSEM_KEY(__KEY__) ((__KEY__) <= HSEM_CLEAR_KEY_MAX )
190#if defined(DUAL_CORE)
191#define IS_HSEM_COREID(__COREID__) (((__COREID__) == HSEM_CPU1_COREID) || \
192 ((__COREID__) == HSEM_CPU2_COREID))
194#define IS_HSEM_COREID(__COREID__) ((__COREID__) == HSEM_CPU1_COREID)
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47