STM32L4xx_HAL_Driver  1.14.0
Initialization and Configuration functions

Initialization and Configuration functions. More...

Functions

void HAL_NVIC_SetPriorityGrouping (uint32_t PriorityGroup)
 Set the priority grouping field (pre-emption priority and subpriority) using the required unlock sequence. More...
 
void HAL_NVIC_SetPriority (IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
 Set the priority of an interrupt. More...
 
void HAL_NVIC_EnableIRQ (IRQn_Type IRQn)
 Enable a device specific interrupt in the NVIC interrupt controller. More...
 
void HAL_NVIC_DisableIRQ (IRQn_Type IRQn)
 Disable a device specific interrupt in the NVIC interrupt controller. More...
 
void HAL_NVIC_SystemReset (void)
 Initiate a system reset request to reset the MCU. More...
 
uint32_t HAL_SYSTICK_Config (uint32_t TicksNumb)
 Initialize the System Timer with interrupt enabled and start the System Tick Timer (SysTick): Counter is in free running mode to generate periodic interrupts. More...
 

Detailed Description

Initialization and Configuration functions.

  ==============================================================================
              ##### Initialization and Configuration functions #####
  ==============================================================================
    [..]
      This section provides the CORTEX HAL driver functions allowing to configure Interrupts
      SysTick functionalities

Function Documentation

◆ HAL_NVIC_DisableIRQ()

void HAL_NVIC_DisableIRQ ( IRQn_Type  IRQn)

Disable a device specific interrupt in the NVIC interrupt controller.

Parameters
IRQnExternal interrupt number. This parameter can be an enumerator of IRQn_Type enumeration (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32l4xxxx.h))
Return values
None

Definition at line 224 of file stm32l4xx_hal_cortex.c.

225 {
226  /* Check the parameters */
227  assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
228 
229  /* Disable interrupt */
230  NVIC_DisableIRQ(IRQn);
231 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_NVIC_EnableIRQ()

void HAL_NVIC_EnableIRQ ( IRQn_Type  IRQn)

Enable a device specific interrupt in the NVIC interrupt controller.

Note
To configure interrupts priority correctly, the NVIC_PriorityGroupConfig() function should be called before.
Parameters
IRQnExternal interrupt number. This parameter can be an enumerator of IRQn_Type enumeration (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32l4xxxx.h))
Return values
None

Definition at line 208 of file stm32l4xx_hal_cortex.c.

209 {
210  /* Check the parameters */
211  assert_param(IS_NVIC_DEVICE_IRQ(IRQn));
212 
213  /* Enable interrupt */
214  NVIC_EnableIRQ(IRQn);
215 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_NVIC_SetPriority()

void HAL_NVIC_SetPriority ( IRQn_Type  IRQn,
uint32_t  PreemptPriority,
uint32_t  SubPriority 
)

Set the priority of an interrupt.

Parameters
IRQnExternal interrupt number. This parameter can be an enumerator of IRQn_Type enumeration (For the complete STM32 Devices IRQ Channels list, please refer to the appropriate CMSIS device file (stm32l4xxxx.h))
PreemptPriorityThe pre-emption priority for the IRQn channel. This parameter can be a value between 0 and 15 A lower priority value indicates a higher priority
SubPrioritythe subpriority level for the IRQ channel. This parameter can be a value between 0 and 15 A lower priority value indicates a higher priority.
Return values
None

Definition at line 186 of file stm32l4xx_hal_cortex.c.

187 {
188  uint32_t prioritygroup = 0x00;
189 
190  /* Check the parameters */
191  assert_param(IS_NVIC_SUB_PRIORITY(SubPriority));
192  assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority));
193 
194  prioritygroup = NVIC_GetPriorityGrouping();
195 
196  NVIC_SetPriority(IRQn, NVIC_EncodePriority(prioritygroup, PreemptPriority, SubPriority));
197 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_NVIC_SetPriorityGrouping()

void HAL_NVIC_SetPriorityGrouping ( uint32_t  PriorityGroup)

Set the priority grouping field (pre-emption priority and subpriority) using the required unlock sequence.

Parameters
PriorityGroupThe priority grouping bits length. This parameter can be one of the following values:
  • NVIC_PRIORITYGROUP_0: 0 bit for pre-emption priority, 4 bits for subpriority
  • NVIC_PRIORITYGROUP_1: 1 bit for pre-emption priority, 3 bits for subpriority
  • NVIC_PRIORITYGROUP_2: 2 bits for pre-emption priority, 2 bits for subpriority
  • NVIC_PRIORITYGROUP_3: 3 bits for pre-emption priority, 1 bit for subpriority
  • NVIC_PRIORITYGROUP_4: 4 bits for pre-emption priority, 0 bit for subpriority
Note
When the NVIC_PriorityGroup_0 is selected, IRQ pre-emption is no more possible. The pending IRQ priority will be managed only by the subpriority.
Return values
None

Definition at line 164 of file stm32l4xx_hal_cortex.c.

165 {
166  /* Check the parameters */
167  assert_param(IS_NVIC_PRIORITY_GROUP(PriorityGroup));
168 
169  /* Set the PRIGROUP[10:8] bits according to the PriorityGroup parameter value */
170  NVIC_SetPriorityGrouping(PriorityGroup);
171 }
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))

◆ HAL_NVIC_SystemReset()

void HAL_NVIC_SystemReset ( void  )

Initiate a system reset request to reset the MCU.

Return values
None

Definition at line 237 of file stm32l4xx_hal_cortex.c.

238 {
239  /* System Reset */
240  NVIC_SystemReset();
241 }

◆ HAL_SYSTICK_Config()

uint32_t HAL_SYSTICK_Config ( uint32_t  TicksNumb)

Initialize the System Timer with interrupt enabled and start the System Tick Timer (SysTick): Counter is in free running mode to generate periodic interrupts.

Parameters
TicksNumbSpecifies the ticks Number of ticks between two interrupts.
Return values
status- 0 Function succeeded.
  • 1 Function failed.

Definition at line 250 of file stm32l4xx_hal_cortex.c.

251 {
252  return SysTick_Config(TicksNumb);
253 }