2 ******************************************************************************
3 * @file stm32l0xx_hal_cortex.h
4 * @author MCD Application Team
6 * @date 06-February-2015
7 * @brief Header file of CORTEX HAL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32L0xx_HAL_CORTEX_H
40 #define __STM32L0xx_HAL_CORTEX_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32l0xx_hal_def.h"
49 /** @addtogroup STM32L0xx_HAL_Driver
53 /** @defgroup CORTEX CORTEX
56 /* Exported types ------------------------------------------------------------*/
57 /* Exported constants --------------------------------------------------------*/
59 /** @defgroup CORTEX_Exported_Constants CORTEX Exported constants
64 #define IS_NVIC_PREEMPTION_PRIORITY(__PRIORITY__) ((__PRIORITY__) < 0x4)
66 #define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00)
68 /** @defgroup CORTEX_SysTick_clock_source
71 #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000)
72 #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004)
73 #define IS_SYSTICK_CLK_SOURCE(__SOURCE__) (((__SOURCE__) == SYSTICK_CLKSOURCE_HCLK) || \
74 ((__SOURCE__) == SYSTICK_CLKSOURCE_HCLK_DIV8))
83 /* Exported Macros -----------------------------------------------------------*/
84 /** @defgroup CORTEX_Exported_Macros CORTEX Exported Macros
87 /** @brief Configures the SysTick clock source.
88 * @param __CLKSRC__ : specifies the SysTick clock source.
89 * This parameter can be one of the following values:
90 * @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
91 * @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
94 #define __HAL_CORTEX_SYSTICKCLK_CONFIG(__CLKSRC__) \
96 if ((__CLKSRC__) == SYSTICK_CLKSOURCE_HCLK) \
98 SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; \
101 SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK; \
108 /* Exported functions --------------------------------------------------------*/
109 /** @defgroup CORTEX_Exported_Functions CORTEX Exported Functions
113 /** @defgroup CORTEX_Exported_Functions_Group1 Initialization and de-initialization functions
114 * @brief Initialization and Configuration functions
117 void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority);
118 void HAL_NVIC_EnableIRQ(IRQn_Type IRQn);
119 void HAL_NVIC_DisableIRQ(IRQn_Type IRQn);
120 void HAL_NVIC_SystemReset(void);
121 uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
126 /** @defgroup CORTEX_Exported_Functions_Group2 Peripheral Control functions
127 * @brief Cortex control functions
130 uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn);
131 void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn);
132 void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
133 void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource);
134 void HAL_SYSTICK_IRQHandler(void);
135 void HAL_SYSTICK_Callback(void);
157 #endif /* __STM32L0xx_HAL_CORTEX_H */
160 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/