92 #ifdef HAL_CORTEX_MODULE_ENABLED
144 assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup));
147 NVIC_SetPriorityGrouping(PriorityGroup);
165 uint32_t prioritygroup = 0x00U;
168 assert_param(IS_NVIC_SUB_PRIORITY(SubPriority));
169 assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority));
171 prioritygroup = NVIC_GetPriorityGrouping();
173 NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority));
188 assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
191 NVIC_EnableIRQ(IRQn);
204 assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
207 NVIC_DisableIRQ(IRQn);
229 return SysTick_Config(TicksNumb);
251 #if (__MPU_PRESENT == 1U)
262 SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
282 MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
285 SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
299 assert_param(IS_MPU_REGION_NUMBER(RegionNumber));
302 MPU->RNR = RegionNumber;
305 SET_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
315 assert_param(IS_MPU_REGION_NUMBER(RegionNumber));
318 MPU->RNR = RegionNumber;
321 CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
333 assert_param(IS_MPU_REGION_NUMBER(MPU_Init->Number));
334 assert_param(IS_MPU_REGION_ENABLE(MPU_Init->Enable));
335 assert_param(IS_MPU_INSTRUCTION_ACCESS(MPU_Init->DisableExec));
336 assert_param(IS_MPU_REGION_PERMISSION_ATTRIBUTE(MPU_Init->AccessPermission));
337 assert_param(IS_MPU_TEX_LEVEL(MPU_Init->TypeExtField));
338 assert_param(IS_MPU_ACCESS_SHAREABLE(MPU_Init->IsShareable));
339 assert_param(IS_MPU_ACCESS_CACHEABLE(MPU_Init->IsCacheable));
340 assert_param(IS_MPU_ACCESS_BUFFERABLE(MPU_Init->IsBufferable));
341 assert_param(IS_MPU_SUB_REGION_DISABLE(MPU_Init->SubRegionDisable));
342 assert_param(IS_MPU_REGION_SIZE(MPU_Init->Size));
345 MPU->RNR = MPU_Init->Number;
348 CLEAR_BIT(MPU->RASR, MPU_RASR_ENABLE_Msk);
351 MPU->RBAR = MPU_Init->BaseAddress;
352 MPU->RASR = ((uint32_t)MPU_Init->DisableExec << MPU_RASR_XN_Pos) |
353 ((uint32_t)MPU_Init->AccessPermission << MPU_RASR_AP_Pos) |
354 ((uint32_t)MPU_Init->TypeExtField << MPU_RASR_TEX_Pos) |
355 ((uint32_t)MPU_Init->IsShareable << MPU_RASR_S_Pos) |
356 ((uint32_t)MPU_Init->IsCacheable << MPU_RASR_C_Pos) |
357 ((uint32_t)MPU_Init->IsBufferable << MPU_RASR_B_Pos) |
358 ((uint32_t)MPU_Init->SubRegionDisable << MPU_RASR_SRD_Pos) |
359 ((uint32_t)MPU_Init->Size << MPU_RASR_SIZE_Pos) |
360 ((uint32_t)MPU_Init->Enable << MPU_RASR_ENABLE_Pos);
381 return NVIC_GetPriorityGrouping();
405 void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t *pPreemptPriority, uint32_t *pSubPriority)
408 assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup));
410 NVIC_DecodePriority(NVIC_GetPriority(IRQn), PriorityGroup, pPreemptPriority, pSubPriority);
423 assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
426 NVIC_SetPendingIRQ(IRQn);
441 assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
444 return NVIC_GetPendingIRQ(IRQn);
457 assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
460 NVIC_ClearPendingIRQ(IRQn);
474 assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
477 return NVIC_GetActive(IRQn);
491 assert_param(IS_SYSTICK_CLK_SOURCE(CLKSource));
492 if (CLKSource == SYSTICK_CLKSOURCE_HCLK)
494 SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK;
498 SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK;
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn)
Disables a device specific interrupt in the NVIC interrupt controller.
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
Sets the priority of an interrupt.
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
Enables a device specific interrupt in the NVIC interrupt controller.
uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb)
Initializes the System Timer and its interrupt, and starts the System Tick Timer. Counter is in free ...
void HAL_NVIC_SystemReset(void)
Initiates a system reset request to reset the MCU.
void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
Sets the priority grouping field (preemption priority and subpriority) using the required unlock sequ...
void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn)
Clears the pending bit of an external interrupt.
void HAL_CORTEX_ClearEvent(void)
Clear pending events.
void HAL_MPU_Disable(void)
Disables the MPU.
void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource)
Configures the SysTick clock source.
uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn)
Gets Pending Interrupt (reads the pending register in the NVIC and returns the pending bit for the sp...
void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init)
Initializes and configures the Region and the memory to be protected.
void HAL_MPU_DisableRegion(uint32_t RegionNumber)
Disables the MPU Region.
void HAL_SYSTICK_IRQHandler(void)
This function handles SYSTICK interrupt request.
void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t *pPreemptPriority, uint32_t *pSubPriority)
Gets the priority of an interrupt.
void HAL_MPU_Enable(uint32_t MPU_Control)
Enable the MPU.
uint32_t HAL_NVIC_GetPriorityGrouping(void)
Gets the priority grouping field from the NVIC Interrupt Controller.
void HAL_SYSTICK_Callback(void)
SYSTICK callback.
void HAL_MPU_EnableRegion(uint32_t RegionNumber)
Enables the MPU Region.
uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn)
Gets active interrupt ( reads the active register in NVIC and returns the active bit).
void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn)
Sets Pending bit of an external interrupt.
This file contains all the functions prototypes for the HAL module driver.