Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
stm32f1xx_hal_cortex.c File Reference
CORTEX HAL module driver. More...
Go to the source code of this file.
Functions | |
| void | HAL_NVIC_SetPriorityGrouping (uint32_t PriorityGroup) |
| Sets the priority grouping field (pre-emption 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. | |
| void | HAL_MPU_ConfigRegion (MPU_Region_InitTypeDef *MPU_Init) |
| Initializes and configures the Region and the memory to be protected. | |
| 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. | |
| __weak void | HAL_SYSTICK_Callback (void) |
| SYSTICK callback. | |
Detailed Description
CORTEX HAL module driver.
- Version:
- V1.0.4
- Date:
- 29-April-2016 This file provides firmware functions to manage the following functionalities of the CORTEX: + Initialization and de-initialization functions + Peripheral Control functions
==============================================================================
##### How to use this driver #####
==============================================================================
[..]
*** How to configure Interrupts using Cortex HAL driver ***
===========================================================
[..]
This section provide functions allowing to configure the NVIC interrupts (IRQ).
The Cortex-M3 exceptions are managed by CMSIS functions.
(#) Configure the NVIC Priority Grouping using HAL_NVIC_SetPriorityGrouping()
function according to the following table.
The table below gives the allowed values of the pre-emption priority and subpriority according
to the Priority Grouping configuration performed by HAL_NVIC_SetPriorityGrouping() function.
==========================================================================================================================
NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description
==========================================================================================================================
NVIC_PRIORITYGROUP_0 | 0 | 0-15 | 0 bits for pre-emption priority
| | | 4 bits for subpriority
--------------------------------------------------------------------------------------------------------------------------
NVIC_PRIORITYGROUP_1 | 0-1 | 0-7 | 1 bits for pre-emption priority
| | | 3 bits for subpriority
--------------------------------------------------------------------------------------------------------------------------
NVIC_PRIORITYGROUP_2 | 0-3 | 0-3 | 2 bits for pre-emption priority
| | | 2 bits for subpriority
--------------------------------------------------------------------------------------------------------------------------
NVIC_PRIORITYGROUP_3 | 0-7 | 0-1 | 3 bits for pre-emption priority
| | | 1 bits for subpriority
--------------------------------------------------------------------------------------------------------------------------
NVIC_PRIORITYGROUP_4 | 0-15 | 0 | 4 bits for pre-emption priority
| | | 0 bits for subpriority
==========================================================================================================================
(#) Configure the priority of the selected IRQ Channels using HAL_NVIC_SetPriority()
(#) Enable the selected IRQ Channels using HAL_NVIC_EnableIRQ()
-@- When the NVIC_PRIORITYGROUP_0 is selected, IRQ pre-emption 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 pre-emption priority
(+@) Lowest sub priority
(+@) Lowest hardware priority (IRQ number)
[..]
*** How to configure Systick using Cortex HAL driver ***
========================================================
[..]
Setup SysTick Timer for 1 msec interrupts.
(+) 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 function
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK_DIV8) just after the
HAL_SYSTICK_Config() function call.
(+) 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
- Attention:
© COPYRIGHT(c) 2016 STMicroelectronics
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file stm32f1xx_hal_cortex.c.
Generated on Tue Jul 12 2022 15:37:30 by
1.7.2