STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
|
CORTEX HAL module driver. This file provides firmware functions to manage the following functionalities of the CORTEX: More...
#include "stm32f4xx_hal.h"
Go to the source code of this file.
Functions | |
void | HAL_NVIC_SetPriorityGrouping (uint32_t PriorityGroup) |
Sets the priority grouping field (preemption priority and subpriority) using the required unlock sequence. | |
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. | |
void | HAL_NVIC_DisableIRQ (IRQn_Type IRQn) |
Disables a device specific interrupt in the NVIC interrupt controller. | |
void | HAL_NVIC_SystemReset (void) |
Initiates a system reset request to reset the MCU. | |
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 running mode to generate periodic interrupts. | |
void | HAL_CORTEX_ClearEvent (void) |
Clear pending events. | |
uint32_t | HAL_NVIC_GetPriorityGrouping (void) |
Gets the priority grouping field from the NVIC Interrupt Controller. | |
void | HAL_NVIC_GetPriority (IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t *pPreemptPriority, uint32_t *pSubPriority) |
Gets the priority of an interrupt. | |
void | HAL_NVIC_SetPendingIRQ (IRQn_Type IRQn) |
Sets Pending bit of an external interrupt. | |
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 specified interrupt). | |
void | HAL_NVIC_ClearPendingIRQ (IRQn_Type IRQn) |
Clears the pending bit of an external interrupt. | |
uint32_t | HAL_NVIC_GetActive (IRQn_Type IRQn) |
Gets active interrupt ( reads the active register in NVIC and returns the active bit). | |
void | HAL_SYSTICK_CLKSourceConfig (uint32_t CLKSource) |
Configures the SysTick clock source. | |
void | HAL_SYSTICK_IRQHandler (void) |
This function handles SYSTICK interrupt request. | |
void | HAL_SYSTICK_Callback (void) |
SYSTICK callback. | |
CORTEX HAL module driver. This file provides firmware functions to manage the following functionalities of the CORTEX:
============================================================================== ##### How to use this driver ##### ============================================================================== [..] *** How to configure Interrupts using CORTEX HAL driver *** =========================================================== [..] This section provides functions allowing to configure the NVIC interrupts (IRQ). The Cortex-M4 exceptions are managed by CMSIS functions. (#) Configure the NVIC Priority Grouping using HAL_NVIC_SetPriorityGrouping() function according to the following table. (#) Configure the priority of the selected IRQ Channels using HAL_NVIC_SetPriority(). (#) Enable the selected IRQ Channels using HAL_NVIC_EnableIRQ(). (#) please refer to programming manual for details in how to configure priority. -@- When the NVIC_PRIORITYGROUP_0 is selected, IRQ preemption is no more possible. The pending IRQ priority will be managed only by the sub priority. -@- IRQ priority order (sorted by highest to lowest priority): (+@) Lowest preemption priority (+@) Lowest sub priority (+@) Lowest hardware priority (IRQ number) [..] *** How to configure Systick using CORTEX HAL driver *** ======================================================== [..] Setup SysTick Timer for time base. (+) The HAL_SYSTICK_Config() function calls the SysTick_Config() function which is a CMSIS function that: (++) Configures the SysTick Reload register with value passed as function parameter. (++) Configures the SysTick IRQ priority to the lowest value 0x0F. (++) Resets the SysTick Counter register. (++) Configures the SysTick Counter clock source to be Core Clock Source (HCLK). (++) Enables the SysTick Interrupt. (++) Starts the SysTick Counter. (+) You can change the SysTick Clock source to be HCLK_Div8 by calling the macro __HAL_CORTEX_SYSTICKCLK_CONFIG(SYSTICK_CLKSOURCE_HCLK_DIV8) just after the HAL_SYSTICK_Config() function call. The __HAL_CORTEX_SYSTICKCLK_CONFIG() macro is defined inside the stm32f4xx_hal_cortex.h file. (+) You can change the SysTick IRQ priority by calling the HAL_NVIC_SetPriority(SysTick_IRQn,...) function just after the HAL_SYSTICK_Config() function call. The HAL_NVIC_SetPriority() call the NVIC_SetPriority() function which is a CMSIS function. (+) To adjust the SysTick time base, use the following formula: Reload Value = SysTick Counter Clock (Hz) x Desired Time base (s) (++) Reload Value is the parameter to be passed for HAL_SYSTICK_Config() function (++) Reload Value should not exceed 0xFFFFFF
Copyright (c) 2017 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
Definition in file stm32f4xx_hal_cortex.c.