1 /** 2 ****************************************************************************** 3 * @file tae32f53xx_ll_cortex.h 4 * @author MCD Application Team 5 * @brief Head file for CORTEX LL module driver. 6 * 7 ****************************************************************************** 8 * @attention 9 * 10 * <h2><center>© Copyright (c) 2020 Tai-Action. 11 * All rights reserved.</center></h2> 12 * 13 * This software is licensed by Tai-Action under BSD 3-Clause license, 14 * the "License"; You may not use this file except in compliance with the 15 * License. You may obtain a copy of the License at: 16 * opensource.org/licenses/BSD-3-Clause 17 * 18 ****************************************************************************** 19 */ 20 21 /* Define to prevent recursive inclusion -------------------------------------*/ 22 #ifndef _TAE32F53XX_LL_CORTEX_H_ 23 #define _TAE32F53XX_LL_CORTEX_H_ 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif /* __cplusplus */ 28 29 /* Includes ------------------------------------------------------------------*/ 30 #include "tae32f53xx_ll_def.h" 31 32 33 /** @addtogroup TAE32F53xx_LL_Driver 34 * @{ 35 */ 36 37 /** @addtogroup CORTEX_LL 38 * @{ 39 */ 40 41 42 /* Exported types ------------------------------------------------------------*/ 43 /* Exported constants --------------------------------------------------------*/ 44 /** @defgroup CORTEX_LL_Exported_Constants CORTEX LL Exported Constants 45 * @brief CORTEX LL Exported Constants 46 * @{ 47 */ 48 49 /** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group 50 * @{ 51 */ 52 #define NVIC_PRIORITYGROUP_0 0x00000007U /*!< 0 bit for pre-emption priority, 3 bits for subpriority */ 53 #define NVIC_PRIORITYGROUP_1 0x00000006U /*!< 1 bit for pre-emption priority, 2 bits for subpriority */ 54 #define NVIC_PRIORITYGROUP_2 0x00000005U /*!< 2 bits for pre-emption priority, 1 bit for subpriority */ 55 #define NVIC_PRIORITYGROUP_3 0x00000004U /*!< 3 bits for pre-emption priority, 0 bit for subpriority */ 56 /** 57 * @} 58 */ 59 60 /** @defgroup CORTEX_SysTick_Clock_Source CORTEX SysTick Clock Source 61 * @brief CORTEX SysTick Clock Source 62 * @{ 63 */ 64 #define SYSTICK_CLKSOURCE_HCLK_DIV8 0x00000000U /*!< SYSTICK Clock Source HCLK Div8 */ 65 #define SYSTICK_CLKSOURCE_HCLK 0x00000004U /*!< SYSTICK Clock Source HCLK */ 66 /** 67 * @} 68 */ 69 70 /** 71 * @} 72 */ 73 74 /* Exported macro ------------------------------------------------------------*/ 75 /* Exported functions --------------------------------------------------------*/ 76 /** @addtogroup CORTEX_LL_Exported_Functions 77 * @{ 78 */ 79 80 /** @addtogroup CORTEX_LL_Exported_Functions_Group1 81 * @{ 82 */ 83 void LL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup); 84 uint32_t LL_NVIC_GetPriorityGrouping(void); 85 void LL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority); 86 void LL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t *pPreemptPriority, uint32_t *pSubPriority); 87 /** 88 * @} 89 */ 90 91 92 /** @addtogroup CORTEX_LL_Exported_Functions_Group2 93 * @{ 94 */ 95 void LL_NVIC_EnableIRQ(IRQn_Type IRQn); 96 void LL_NVIC_DisableIRQ(IRQn_Type IRQn); 97 void LL_NVIC_SetPendingIRQ(IRQn_Type IRQn); 98 uint32_t LL_NVIC_GetPendingIRQ(IRQn_Type IRQn); 99 void LL_NVIC_ClearPendingIRQ(IRQn_Type IRQn); 100 uint32_t LL_NVIC_GetActive(IRQn_Type IRQn); 101 void LL_NVIC_SystemReset(void); 102 /** 103 * @} 104 */ 105 106 107 /** @addtogroup CORTEX_LL_Exported_Functions_Group3 108 * @{ 109 */ 110 void LL_SYSTICK_CLKSourceConfig(uint32_t CLKSource); 111 uint32_t LL_SYSTICK_Config(uint32_t TicksNumb); 112 /** 113 * @} 114 */ 115 116 117 /** @addtogroup CORTEX_LL_Exported_Functions_Interrupt 118 * @{ 119 */ 120 void LL_SYSTICK_IRQHandler(void); 121 void LL_SYSTICK_Callback(void); 122 /** 123 * @} 124 */ 125 126 127 /** 128 * @} 129 */ 130 131 /* Private types -------------------------------------------------------------*/ 132 /* Private variables ---------------------------------------------------------*/ 133 /* Private constants ---------------------------------------------------------*/ 134 /* Private macros ------------------------------------------------------------*/ 135 /** @defgroup CORTEX_LL_Private_Macros CORTEX LL Private Macros 136 * @brief CORTEX LL Private Macros 137 * @{ 138 */ 139 140 /** 141 * @brief Judge is NVIC priority group or not 142 * @param GROUP priority group to judge 143 * @retval 0 isn't NVIC priority group 144 * @retval 1 is NVIC priority group 145 */ 146 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \ 147 ((GROUP) == NVIC_PRIORITYGROUP_1) || \ 148 ((GROUP) == NVIC_PRIORITYGROUP_2) || \ 149 ((GROUP) == NVIC_PRIORITYGROUP_3)) 150 151 /** 152 * @brief Judge is NVIC preemption priority or not 153 * @param PRIORITY preemption priority to judge 154 * @retval 0 isn't NVIC preemption priority 155 * @retval 1 is NVIC preemption priority 156 */ 157 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10U) 158 159 /** 160 * @brief Judge is NVIC SubPriority or not 161 * @param PRIORITY SubPriority to judge 162 * @retval 0 isn't NVIC SubPriority 163 * @retval 1 is NVIC SubPriority 164 */ 165 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10U) 166 167 /** 168 * @brief Judge is NVIC device IRQ or not 169 * @param IRQ IRQ to judge 170 * @retval 0 isn't NVIC device IRQ 171 * @retval 1 is NVIC device IRQ 172 */ 173 #define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= (IRQn_Type)0x00U) 174 175 /** 176 * @brief Judge is SYSTICK clock source or not 177 * @param SOURCE clock source to judge 178 * @retval 0 isn't SYSTICK clock source 179 * @retval 1 is SYSTICK clock source 180 */ 181 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8)) 182 /** 183 * @} 184 */ 185 186 187 /* Private functions ---------------------------------------------------------*/ 188 189 190 /** 191 * @} 192 */ 193 194 /** 195 * @} 196 */ 197 198 199 #ifdef __cplusplus 200 } 201 #endif /* __cplusplus */ 202 203 204 #endif /* _TAE32F53XX_LL_CORTEX_H_ */ 205 206 207 /************************* (C) COPYRIGHT Tai-Action *****END OF FILE***********/ 208 209