Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
112:6f327212ef96
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32f4xx_hal_cortex.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V1.4.1
Kojto 112:6f327212ef96 6 * @date 09-October-2015
Kojto 112:6f327212ef96 7 * @brief Header file of CORTEX HAL module.
Kojto 112:6f327212ef96 8 ******************************************************************************
Kojto 112:6f327212ef96 9 * @attention
Kojto 112:6f327212ef96 10 *
Kojto 112:6f327212ef96 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 12 *
Kojto 112:6f327212ef96 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 14 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 16 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 18 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 19 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 21 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 22 * without specific prior written permission.
Kojto 112:6f327212ef96 23 *
Kojto 112:6f327212ef96 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 34 *
Kojto 112:6f327212ef96 35 ******************************************************************************
Kojto 112:6f327212ef96 36 */
Kojto 112:6f327212ef96 37
Kojto 112:6f327212ef96 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 112:6f327212ef96 39 #ifndef __STM32F4xx_HAL_CORTEX_H
Kojto 112:6f327212ef96 40 #define __STM32F4xx_HAL_CORTEX_H
Kojto 112:6f327212ef96 41
Kojto 112:6f327212ef96 42 #ifdef __cplusplus
Kojto 112:6f327212ef96 43 extern "C" {
Kojto 112:6f327212ef96 44 #endif
Kojto 112:6f327212ef96 45
Kojto 112:6f327212ef96 46 /* Includes ------------------------------------------------------------------*/
Kojto 112:6f327212ef96 47 #include "stm32f4xx_hal_def.h"
Kojto 112:6f327212ef96 48
Kojto 112:6f327212ef96 49 /** @addtogroup STM32F4xx_HAL_Driver
Kojto 112:6f327212ef96 50 * @{
Kojto 112:6f327212ef96 51 */
Kojto 112:6f327212ef96 52
Kojto 112:6f327212ef96 53 /** @addtogroup CORTEX
Kojto 112:6f327212ef96 54 * @{
Kojto 112:6f327212ef96 55 */
Kojto 112:6f327212ef96 56 /* Exported types ------------------------------------------------------------*/
Kojto 112:6f327212ef96 57 /** @defgroup CORTEX_Exported_Types Cortex Exported Types
Kojto 112:6f327212ef96 58 * @{
Kojto 112:6f327212ef96 59 */
Kojto 112:6f327212ef96 60
Kojto 112:6f327212ef96 61 #if (__MPU_PRESENT == 1)
Kojto 112:6f327212ef96 62 /** @defgroup CORTEX_MPU_Region_Initialization_Structure_definition MPU Region Initialization Structure Definition
Kojto 112:6f327212ef96 63 * @brief MPU Region initialization structure
Kojto 112:6f327212ef96 64 * @{
Kojto 112:6f327212ef96 65 */
Kojto 112:6f327212ef96 66 typedef struct
Kojto 112:6f327212ef96 67 {
Kojto 112:6f327212ef96 68 uint8_t Enable; /*!< Specifies the status of the region.
Kojto 112:6f327212ef96 69 This parameter can be a value of @ref CORTEX_MPU_Region_Enable */
Kojto 112:6f327212ef96 70 uint8_t Number; /*!< Specifies the number of the region to protect.
Kojto 112:6f327212ef96 71 This parameter can be a value of @ref CORTEX_MPU_Region_Number */
Kojto 112:6f327212ef96 72 uint32_t BaseAddress; /*!< Specifies the base address of the region to protect. */
Kojto 112:6f327212ef96 73 uint8_t Size; /*!< Specifies the size of the region to protect.
Kojto 112:6f327212ef96 74 This parameter can be a value of @ref CORTEX_MPU_Region_Size */
Kojto 112:6f327212ef96 75 uint8_t SubRegionDisable; /*!< Specifies the number of the subregion protection to disable.
Kojto 112:6f327212ef96 76 This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */
Kojto 112:6f327212ef96 77 uint8_t TypeExtField; /*!< Specifies the TEX field level.
Kojto 112:6f327212ef96 78 This parameter can be a value of @ref CORTEX_MPU_TEX_Levels */
Kojto 112:6f327212ef96 79 uint8_t AccessPermission; /*!< Specifies the region access permission type.
Kojto 112:6f327212ef96 80 This parameter can be a value of @ref CORTEX_MPU_Region_Permission_Attributes */
Kojto 112:6f327212ef96 81 uint8_t DisableExec; /*!< Specifies the instruction access status.
Kojto 112:6f327212ef96 82 This parameter can be a value of @ref CORTEX_MPU_Instruction_Access */
Kojto 112:6f327212ef96 83 uint8_t IsShareable; /*!< Specifies the shareability status of the protected region.
Kojto 112:6f327212ef96 84 This parameter can be a value of @ref CORTEX_MPU_Access_Shareable */
Kojto 112:6f327212ef96 85 uint8_t IsCacheable; /*!< Specifies the cacheable status of the region protected.
Kojto 112:6f327212ef96 86 This parameter can be a value of @ref CORTEX_MPU_Access_Cacheable */
Kojto 112:6f327212ef96 87 uint8_t IsBufferable; /*!< Specifies the bufferable status of the protected region.
Kojto 112:6f327212ef96 88 This parameter can be a value of @ref CORTEX_MPU_Access_Bufferable */
Kojto 112:6f327212ef96 89 }MPU_Region_InitTypeDef;
Kojto 112:6f327212ef96 90 /**
Kojto 112:6f327212ef96 91 * @}
Kojto 112:6f327212ef96 92 */
Kojto 112:6f327212ef96 93 #endif /* __MPU_PRESENT */
Kojto 112:6f327212ef96 94
Kojto 112:6f327212ef96 95 /**
Kojto 112:6f327212ef96 96 * @}
Kojto 112:6f327212ef96 97 */
Kojto 112:6f327212ef96 98
Kojto 112:6f327212ef96 99 /* Exported constants --------------------------------------------------------*/
Kojto 112:6f327212ef96 100
Kojto 112:6f327212ef96 101 /** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants
Kojto 112:6f327212ef96 102 * @{
Kojto 112:6f327212ef96 103 */
Kojto 112:6f327212ef96 104
Kojto 112:6f327212ef96 105 /** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group
Kojto 112:6f327212ef96 106 * @{
Kojto 112:6f327212ef96 107 */
Kojto 112:6f327212ef96 108 #define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bits for pre-emption priority
Kojto 112:6f327212ef96 109 4 bits for subpriority */
Kojto 112:6f327212ef96 110 #define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bits for pre-emption priority
Kojto 112:6f327212ef96 111 3 bits for subpriority */
Kojto 112:6f327212ef96 112 #define NVIC_PRIORITYGROUP_2 ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority
Kojto 112:6f327212ef96 113 2 bits for subpriority */
Kojto 112:6f327212ef96 114 #define NVIC_PRIORITYGROUP_3 ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority
Kojto 112:6f327212ef96 115 1 bits for subpriority */
Kojto 112:6f327212ef96 116 #define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority
Kojto 112:6f327212ef96 117 0 bits for subpriority */
Kojto 112:6f327212ef96 118 /**
Kojto 112:6f327212ef96 119 * @}
Kojto 112:6f327212ef96 120 */
Kojto 112:6f327212ef96 121
Kojto 112:6f327212ef96 122 /** @defgroup CORTEX_SysTick_clock_source CORTEX _SysTick clock source
Kojto 112:6f327212ef96 123 * @{
Kojto 112:6f327212ef96 124 */
Kojto 112:6f327212ef96 125 #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000)
Kojto 112:6f327212ef96 126 #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004)
Kojto 112:6f327212ef96 127
Kojto 112:6f327212ef96 128 /**
Kojto 112:6f327212ef96 129 * @}
Kojto 112:6f327212ef96 130 */
Kojto 112:6f327212ef96 131
Kojto 112:6f327212ef96 132 #if (__MPU_PRESENT == 1)
Kojto 112:6f327212ef96 133 /** @defgroup CORTEX_MPU_HFNMI_PRIVDEF_Control MPU HFNMI and PRIVILEGED Access control
Kojto 112:6f327212ef96 134 * @{
Kojto 112:6f327212ef96 135 */
Kojto 112:6f327212ef96 136 #define MPU_HFNMI_PRIVDEF_NONE ((uint32_t)0x00000000)
Kojto 112:6f327212ef96 137 #define MPU_HARDFAULT_NMI ((uint32_t)0x00000002)
Kojto 112:6f327212ef96 138 #define MPU_PRIVILEGED_DEFAULT ((uint32_t)0x00000004)
Kojto 112:6f327212ef96 139 #define MPU_HFNMI_PRIVDEF ((uint32_t)0x00000006)
Kojto 112:6f327212ef96 140 /**
Kojto 112:6f327212ef96 141 * @}
Kojto 112:6f327212ef96 142 */
Kojto 112:6f327212ef96 143
Kojto 112:6f327212ef96 144 /** @defgroup CORTEX_MPU_Region_Enable CORTEX MPU Region Enable
Kojto 112:6f327212ef96 145 * @{
Kojto 112:6f327212ef96 146 */
Kojto 112:6f327212ef96 147 #define MPU_REGION_ENABLE ((uint8_t)0x01)
Kojto 112:6f327212ef96 148 #define MPU_REGION_DISABLE ((uint8_t)0x00)
Kojto 112:6f327212ef96 149 /**
Kojto 112:6f327212ef96 150 * @}
Kojto 112:6f327212ef96 151 */
Kojto 112:6f327212ef96 152
Kojto 112:6f327212ef96 153 /** @defgroup CORTEX_MPU_Instruction_Access CORTEX MPU Instruction Access
Kojto 112:6f327212ef96 154 * @{
Kojto 112:6f327212ef96 155 */
Kojto 112:6f327212ef96 156 #define MPU_INSTRUCTION_ACCESS_ENABLE ((uint8_t)0x00)
Kojto 112:6f327212ef96 157 #define MPU_INSTRUCTION_ACCESS_DISABLE ((uint8_t)0x01)
Kojto 112:6f327212ef96 158 /**
Kojto 112:6f327212ef96 159 * @}
Kojto 112:6f327212ef96 160 */
Kojto 112:6f327212ef96 161
Kojto 112:6f327212ef96 162 /** @defgroup CORTEX_MPU_Access_Shareable CORTEX MPU Instruction Access Shareable
Kojto 112:6f327212ef96 163 * @{
Kojto 112:6f327212ef96 164 */
Kojto 112:6f327212ef96 165 #define MPU_ACCESS_SHAREABLE ((uint8_t)0x01)
Kojto 112:6f327212ef96 166 #define MPU_ACCESS_NOT_SHAREABLE ((uint8_t)0x00)
Kojto 112:6f327212ef96 167 /**
Kojto 112:6f327212ef96 168 * @}
Kojto 112:6f327212ef96 169 */
Kojto 112:6f327212ef96 170
Kojto 112:6f327212ef96 171 /** @defgroup CORTEX_MPU_Access_Cacheable CORTEX MPU Instruction Access Cacheable
Kojto 112:6f327212ef96 172 * @{
Kojto 112:6f327212ef96 173 */
Kojto 112:6f327212ef96 174 #define MPU_ACCESS_CACHEABLE ((uint8_t)0x01)
Kojto 112:6f327212ef96 175 #define MPU_ACCESS_NOT_CACHEABLE ((uint8_t)0x00)
Kojto 112:6f327212ef96 176 /**
Kojto 112:6f327212ef96 177 * @}
Kojto 112:6f327212ef96 178 */
Kojto 112:6f327212ef96 179
Kojto 112:6f327212ef96 180 /** @defgroup CORTEX_MPU_Access_Bufferable CORTEX MPU Instruction Access Bufferable
Kojto 112:6f327212ef96 181 * @{
Kojto 112:6f327212ef96 182 */
Kojto 112:6f327212ef96 183 #define MPU_ACCESS_BUFFERABLE ((uint8_t)0x01)
Kojto 112:6f327212ef96 184 #define MPU_ACCESS_NOT_BUFFERABLE ((uint8_t)0x00)
Kojto 112:6f327212ef96 185 /**
Kojto 112:6f327212ef96 186 * @}
Kojto 112:6f327212ef96 187 */
Kojto 112:6f327212ef96 188
Kojto 112:6f327212ef96 189 /** @defgroup CORTEX_MPU_TEX_Levels MPU TEX Levels
Kojto 112:6f327212ef96 190 * @{
Kojto 112:6f327212ef96 191 */
Kojto 112:6f327212ef96 192 #define MPU_TEX_LEVEL0 ((uint8_t)0x00)
Kojto 112:6f327212ef96 193 #define MPU_TEX_LEVEL1 ((uint8_t)0x01)
Kojto 112:6f327212ef96 194 #define MPU_TEX_LEVEL2 ((uint8_t)0x02)
Kojto 112:6f327212ef96 195 /**
Kojto 112:6f327212ef96 196 * @}
Kojto 112:6f327212ef96 197 */
Kojto 112:6f327212ef96 198
Kojto 112:6f327212ef96 199 /** @defgroup CORTEX_MPU_Region_Size CORTEX MPU Region Size
Kojto 112:6f327212ef96 200 * @{
Kojto 112:6f327212ef96 201 */
Kojto 112:6f327212ef96 202 #define MPU_REGION_SIZE_32B ((uint8_t)0x04)
Kojto 112:6f327212ef96 203 #define MPU_REGION_SIZE_64B ((uint8_t)0x05)
Kojto 112:6f327212ef96 204 #define MPU_REGION_SIZE_128B ((uint8_t)0x06)
Kojto 112:6f327212ef96 205 #define MPU_REGION_SIZE_256B ((uint8_t)0x07)
Kojto 112:6f327212ef96 206 #define MPU_REGION_SIZE_512B ((uint8_t)0x08)
Kojto 112:6f327212ef96 207 #define MPU_REGION_SIZE_1KB ((uint8_t)0x09)
Kojto 112:6f327212ef96 208 #define MPU_REGION_SIZE_2KB ((uint8_t)0x0A)
Kojto 112:6f327212ef96 209 #define MPU_REGION_SIZE_4KB ((uint8_t)0x0B)
Kojto 112:6f327212ef96 210 #define MPU_REGION_SIZE_8KB ((uint8_t)0x0C)
Kojto 112:6f327212ef96 211 #define MPU_REGION_SIZE_16KB ((uint8_t)0x0D)
Kojto 112:6f327212ef96 212 #define MPU_REGION_SIZE_32KB ((uint8_t)0x0E)
Kojto 112:6f327212ef96 213 #define MPU_REGION_SIZE_64KB ((uint8_t)0x0F)
Kojto 112:6f327212ef96 214 #define MPU_REGION_SIZE_128KB ((uint8_t)0x10)
Kojto 112:6f327212ef96 215 #define MPU_REGION_SIZE_256KB ((uint8_t)0x11)
Kojto 112:6f327212ef96 216 #define MPU_REGION_SIZE_512KB ((uint8_t)0x12)
Kojto 112:6f327212ef96 217 #define MPU_REGION_SIZE_1MB ((uint8_t)0x13)
Kojto 112:6f327212ef96 218 #define MPU_REGION_SIZE_2MB ((uint8_t)0x14)
Kojto 112:6f327212ef96 219 #define MPU_REGION_SIZE_4MB ((uint8_t)0x15)
Kojto 112:6f327212ef96 220 #define MPU_REGION_SIZE_8MB ((uint8_t)0x16)
Kojto 112:6f327212ef96 221 #define MPU_REGION_SIZE_16MB ((uint8_t)0x17)
Kojto 112:6f327212ef96 222 #define MPU_REGION_SIZE_32MB ((uint8_t)0x18)
Kojto 112:6f327212ef96 223 #define MPU_REGION_SIZE_64MB ((uint8_t)0x19)
Kojto 112:6f327212ef96 224 #define MPU_REGION_SIZE_128MB ((uint8_t)0x1A)
Kojto 112:6f327212ef96 225 #define MPU_REGION_SIZE_256MB ((uint8_t)0x1B)
Kojto 112:6f327212ef96 226 #define MPU_REGION_SIZE_512MB ((uint8_t)0x1C)
Kojto 112:6f327212ef96 227 #define MPU_REGION_SIZE_1GB ((uint8_t)0x1D)
Kojto 112:6f327212ef96 228 #define MPU_REGION_SIZE_2GB ((uint8_t)0x1E)
Kojto 112:6f327212ef96 229 #define MPU_REGION_SIZE_4GB ((uint8_t)0x1F)
Kojto 112:6f327212ef96 230 /**
Kojto 112:6f327212ef96 231 * @}
Kojto 112:6f327212ef96 232 */
Kojto 112:6f327212ef96 233
Kojto 112:6f327212ef96 234 /** @defgroup CORTEX_MPU_Region_Permission_Attributes CORTEX MPU Region Permission Attributes
Kojto 112:6f327212ef96 235 * @{
Kojto 112:6f327212ef96 236 */
Kojto 112:6f327212ef96 237 #define MPU_REGION_NO_ACCESS ((uint8_t)0x00)
Kojto 112:6f327212ef96 238 #define MPU_REGION_PRIV_RW ((uint8_t)0x01)
Kojto 112:6f327212ef96 239 #define MPU_REGION_PRIV_RW_URO ((uint8_t)0x02)
Kojto 112:6f327212ef96 240 #define MPU_REGION_FULL_ACCESS ((uint8_t)0x03)
Kojto 112:6f327212ef96 241 #define MPU_REGION_PRIV_RO ((uint8_t)0x05)
Kojto 112:6f327212ef96 242 #define MPU_REGION_PRIV_RO_URO ((uint8_t)0x06)
Kojto 112:6f327212ef96 243 /**
Kojto 112:6f327212ef96 244 * @}
Kojto 112:6f327212ef96 245 */
Kojto 112:6f327212ef96 246
Kojto 112:6f327212ef96 247 /** @defgroup CORTEX_MPU_Region_Number CORTEX MPU Region Number
Kojto 112:6f327212ef96 248 * @{
Kojto 112:6f327212ef96 249 */
Kojto 112:6f327212ef96 250 #define MPU_REGION_NUMBER0 ((uint8_t)0x00)
Kojto 112:6f327212ef96 251 #define MPU_REGION_NUMBER1 ((uint8_t)0x01)
Kojto 112:6f327212ef96 252 #define MPU_REGION_NUMBER2 ((uint8_t)0x02)
Kojto 112:6f327212ef96 253 #define MPU_REGION_NUMBER3 ((uint8_t)0x03)
Kojto 112:6f327212ef96 254 #define MPU_REGION_NUMBER4 ((uint8_t)0x04)
Kojto 112:6f327212ef96 255 #define MPU_REGION_NUMBER5 ((uint8_t)0x05)
Kojto 112:6f327212ef96 256 #define MPU_REGION_NUMBER6 ((uint8_t)0x06)
Kojto 112:6f327212ef96 257 #define MPU_REGION_NUMBER7 ((uint8_t)0x07)
Kojto 112:6f327212ef96 258 /**
Kojto 112:6f327212ef96 259 * @}
Kojto 112:6f327212ef96 260 */
Kojto 112:6f327212ef96 261 #endif /* __MPU_PRESENT */
Kojto 112:6f327212ef96 262
Kojto 112:6f327212ef96 263 /**
Kojto 112:6f327212ef96 264 * @}
Kojto 112:6f327212ef96 265 */
Kojto 112:6f327212ef96 266
Kojto 112:6f327212ef96 267
Kojto 112:6f327212ef96 268 /* Exported Macros -----------------------------------------------------------*/
Kojto 112:6f327212ef96 269 /** @defgroup CORTEX_Exported_Macros CORTEX Exported Macros
Kojto 112:6f327212ef96 270 * @{
Kojto 112:6f327212ef96 271 */
Kojto 112:6f327212ef96 272
Kojto 112:6f327212ef96 273 /** @brief Configures the SysTick clock source.
Kojto 112:6f327212ef96 274 * @param __CLKSRC__: specifies the SysTick clock source.
Kojto 112:6f327212ef96 275 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 276 * @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
Kojto 112:6f327212ef96 277 * @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
Kojto 112:6f327212ef96 278 * @retval None
Kojto 112:6f327212ef96 279 */
Kojto 112:6f327212ef96 280 #define __HAL_CORTEX_SYSTICKCLK_CONFIG(__CLKSRC__) \
Kojto 112:6f327212ef96 281 do { \
Kojto 112:6f327212ef96 282 if ((__CLKSRC__) == SYSTICK_CLKSOURCE_HCLK) \
Kojto 112:6f327212ef96 283 { \
Kojto 112:6f327212ef96 284 SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; \
Kojto 112:6f327212ef96 285 } \
Kojto 112:6f327212ef96 286 else \
Kojto 112:6f327212ef96 287 SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK; \
Kojto 112:6f327212ef96 288 } while(0)
Kojto 112:6f327212ef96 289 /**
Kojto 112:6f327212ef96 290 * @}
Kojto 112:6f327212ef96 291 */
Kojto 112:6f327212ef96 292
Kojto 112:6f327212ef96 293 /* Exported functions --------------------------------------------------------*/
Kojto 112:6f327212ef96 294 /** @addtogroup CORTEX_Exported_Functions
Kojto 112:6f327212ef96 295 * @{
Kojto 112:6f327212ef96 296 */
Kojto 112:6f327212ef96 297
Kojto 112:6f327212ef96 298 /** @addtogroup CORTEX_Exported_Functions_Group1
Kojto 112:6f327212ef96 299 * @{
Kojto 112:6f327212ef96 300 */
Kojto 112:6f327212ef96 301 /* Initialization and de-initialization functions *****************************/
Kojto 112:6f327212ef96 302 void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup);
Kojto 112:6f327212ef96 303 void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority);
Kojto 112:6f327212ef96 304 void HAL_NVIC_EnableIRQ(IRQn_Type IRQn);
Kojto 112:6f327212ef96 305 void HAL_NVIC_DisableIRQ(IRQn_Type IRQn);
Kojto 112:6f327212ef96 306 void HAL_NVIC_SystemReset(void);
Kojto 112:6f327212ef96 307 uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
Kojto 112:6f327212ef96 308 /**
Kojto 112:6f327212ef96 309 * @}
Kojto 112:6f327212ef96 310 */
Kojto 112:6f327212ef96 311
Kojto 112:6f327212ef96 312 /** @addtogroup CORTEX_Exported_Functions_Group2
Kojto 112:6f327212ef96 313 * @{
Kojto 112:6f327212ef96 314 */
Kojto 112:6f327212ef96 315 /* Peripheral Control functions ***********************************************/
Kojto 112:6f327212ef96 316 #if (__MPU_PRESENT == 1)
Kojto 112:6f327212ef96 317 void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
Kojto 112:6f327212ef96 318 #endif /* __MPU_PRESENT */
Kojto 112:6f327212ef96 319 uint32_t HAL_NVIC_GetPriorityGrouping(void);
Kojto 112:6f327212ef96 320 void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority);
Kojto 112:6f327212ef96 321 uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn);
Kojto 112:6f327212ef96 322 void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn);
Kojto 112:6f327212ef96 323 void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
Kojto 112:6f327212ef96 324 uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn);
Kojto 112:6f327212ef96 325 void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource);
Kojto 112:6f327212ef96 326 void HAL_SYSTICK_IRQHandler(void);
Kojto 112:6f327212ef96 327 void HAL_SYSTICK_Callback(void);
Kojto 112:6f327212ef96 328 /**
Kojto 112:6f327212ef96 329 * @}
Kojto 112:6f327212ef96 330 */
Kojto 112:6f327212ef96 331
Kojto 112:6f327212ef96 332 /**
Kojto 112:6f327212ef96 333 * @}
Kojto 112:6f327212ef96 334 */
Kojto 112:6f327212ef96 335
Kojto 112:6f327212ef96 336 /* Private types -------------------------------------------------------------*/
Kojto 112:6f327212ef96 337 /* Private variables ---------------------------------------------------------*/
Kojto 112:6f327212ef96 338 /* Private constants ---------------------------------------------------------*/
Kojto 112:6f327212ef96 339 /* Private macros ------------------------------------------------------------*/
Kojto 112:6f327212ef96 340 /** @defgroup CORTEX_Private_Macros CORTEX Private Macros
Kojto 112:6f327212ef96 341 * @{
Kojto 112:6f327212ef96 342 */
Kojto 112:6f327212ef96 343 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \
Kojto 112:6f327212ef96 344 ((GROUP) == NVIC_PRIORITYGROUP_1) || \
Kojto 112:6f327212ef96 345 ((GROUP) == NVIC_PRIORITYGROUP_2) || \
Kojto 112:6f327212ef96 346 ((GROUP) == NVIC_PRIORITYGROUP_3) || \
Kojto 112:6f327212ef96 347 ((GROUP) == NVIC_PRIORITYGROUP_4))
Kojto 112:6f327212ef96 348
Kojto 112:6f327212ef96 349 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
Kojto 112:6f327212ef96 350
Kojto 112:6f327212ef96 351 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
Kojto 112:6f327212ef96 352
Kojto 112:6f327212ef96 353 #define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00)
Kojto 112:6f327212ef96 354
Kojto 112:6f327212ef96 355 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \
Kojto 112:6f327212ef96 356 ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8))
Kojto 112:6f327212ef96 357
Kojto 112:6f327212ef96 358 #if (__MPU_PRESENT == 1)
Kojto 112:6f327212ef96 359 #define IS_MPU_REGION_ENABLE(STATE) (((STATE) == MPU_REGION_ENABLE) || \
Kojto 112:6f327212ef96 360 ((STATE) == MPU_REGION_DISABLE))
Kojto 112:6f327212ef96 361
Kojto 112:6f327212ef96 362 #define IS_MPU_INSTRUCTION_ACCESS(STATE) (((STATE) == MPU_INSTRUCTION_ACCESS_ENABLE) || \
Kojto 112:6f327212ef96 363 ((STATE) == MPU_INSTRUCTION_ACCESS_DISABLE))
Kojto 112:6f327212ef96 364
Kojto 112:6f327212ef96 365 #define IS_MPU_ACCESS_SHAREABLE(STATE) (((STATE) == MPU_ACCESS_SHAREABLE) || \
Kojto 112:6f327212ef96 366 ((STATE) == MPU_ACCESS_NOT_SHAREABLE))
Kojto 112:6f327212ef96 367
Kojto 112:6f327212ef96 368 #define IS_MPU_ACCESS_CACHEABLE(STATE) (((STATE) == MPU_ACCESS_CACHEABLE) || \
Kojto 112:6f327212ef96 369 ((STATE) == MPU_ACCESS_NOT_CACHEABLE))
Kojto 112:6f327212ef96 370
Kojto 112:6f327212ef96 371 #define IS_MPU_ACCESS_BUFFERABLE(STATE) (((STATE) == MPU_ACCESS_BUFFERABLE) || \
Kojto 112:6f327212ef96 372 ((STATE) == MPU_ACCESS_NOT_BUFFERABLE))
Kojto 112:6f327212ef96 373
Kojto 112:6f327212ef96 374 #define IS_MPU_TEX_LEVEL(TYPE) (((TYPE) == MPU_TEX_LEVEL0) || \
Kojto 112:6f327212ef96 375 ((TYPE) == MPU_TEX_LEVEL1) || \
Kojto 112:6f327212ef96 376 ((TYPE) == MPU_TEX_LEVEL2))
Kojto 112:6f327212ef96 377
Kojto 112:6f327212ef96 378 #define IS_MPU_REGION_PERMISSION_ATTRIBUTE(TYPE) (((TYPE) == MPU_REGION_NO_ACCESS) || \
Kojto 112:6f327212ef96 379 ((TYPE) == MPU_REGION_PRIV_RW) || \
Kojto 112:6f327212ef96 380 ((TYPE) == MPU_REGION_PRIV_RW_URO) || \
Kojto 112:6f327212ef96 381 ((TYPE) == MPU_REGION_FULL_ACCESS) || \
Kojto 112:6f327212ef96 382 ((TYPE) == MPU_REGION_PRIV_RO) || \
Kojto 112:6f327212ef96 383 ((TYPE) == MPU_REGION_PRIV_RO_URO))
Kojto 112:6f327212ef96 384
Kojto 112:6f327212ef96 385 #define IS_MPU_REGION_NUMBER(NUMBER) (((NUMBER) == MPU_REGION_NUMBER0) || \
Kojto 112:6f327212ef96 386 ((NUMBER) == MPU_REGION_NUMBER1) || \
Kojto 112:6f327212ef96 387 ((NUMBER) == MPU_REGION_NUMBER2) || \
Kojto 112:6f327212ef96 388 ((NUMBER) == MPU_REGION_NUMBER3) || \
Kojto 112:6f327212ef96 389 ((NUMBER) == MPU_REGION_NUMBER4) || \
Kojto 112:6f327212ef96 390 ((NUMBER) == MPU_REGION_NUMBER5) || \
Kojto 112:6f327212ef96 391 ((NUMBER) == MPU_REGION_NUMBER6) || \
Kojto 112:6f327212ef96 392 ((NUMBER) == MPU_REGION_NUMBER7))
Kojto 112:6f327212ef96 393
Kojto 112:6f327212ef96 394 #define IS_MPU_REGION_SIZE(SIZE) (((SIZE) == MPU_REGION_SIZE_32B) || \
Kojto 112:6f327212ef96 395 ((SIZE) == MPU_REGION_SIZE_64B) || \
Kojto 112:6f327212ef96 396 ((SIZE) == MPU_REGION_SIZE_128B) || \
Kojto 112:6f327212ef96 397 ((SIZE) == MPU_REGION_SIZE_256B) || \
Kojto 112:6f327212ef96 398 ((SIZE) == MPU_REGION_SIZE_512B) || \
Kojto 112:6f327212ef96 399 ((SIZE) == MPU_REGION_SIZE_1KB) || \
Kojto 112:6f327212ef96 400 ((SIZE) == MPU_REGION_SIZE_2KB) || \
Kojto 112:6f327212ef96 401 ((SIZE) == MPU_REGION_SIZE_4KB) || \
Kojto 112:6f327212ef96 402 ((SIZE) == MPU_REGION_SIZE_8KB) || \
Kojto 112:6f327212ef96 403 ((SIZE) == MPU_REGION_SIZE_16KB) || \
Kojto 112:6f327212ef96 404 ((SIZE) == MPU_REGION_SIZE_32KB) || \
Kojto 112:6f327212ef96 405 ((SIZE) == MPU_REGION_SIZE_64KB) || \
Kojto 112:6f327212ef96 406 ((SIZE) == MPU_REGION_SIZE_128KB) || \
Kojto 112:6f327212ef96 407 ((SIZE) == MPU_REGION_SIZE_256KB) || \
Kojto 112:6f327212ef96 408 ((SIZE) == MPU_REGION_SIZE_512KB) || \
Kojto 112:6f327212ef96 409 ((SIZE) == MPU_REGION_SIZE_1MB) || \
Kojto 112:6f327212ef96 410 ((SIZE) == MPU_REGION_SIZE_2MB) || \
Kojto 112:6f327212ef96 411 ((SIZE) == MPU_REGION_SIZE_4MB) || \
Kojto 112:6f327212ef96 412 ((SIZE) == MPU_REGION_SIZE_8MB) || \
Kojto 112:6f327212ef96 413 ((SIZE) == MPU_REGION_SIZE_16MB) || \
Kojto 112:6f327212ef96 414 ((SIZE) == MPU_REGION_SIZE_32MB) || \
Kojto 112:6f327212ef96 415 ((SIZE) == MPU_REGION_SIZE_64MB) || \
Kojto 112:6f327212ef96 416 ((SIZE) == MPU_REGION_SIZE_128MB) || \
Kojto 112:6f327212ef96 417 ((SIZE) == MPU_REGION_SIZE_256MB) || \
Kojto 112:6f327212ef96 418 ((SIZE) == MPU_REGION_SIZE_512MB) || \
Kojto 112:6f327212ef96 419 ((SIZE) == MPU_REGION_SIZE_1GB) || \
Kojto 112:6f327212ef96 420 ((SIZE) == MPU_REGION_SIZE_2GB) || \
Kojto 112:6f327212ef96 421 ((SIZE) == MPU_REGION_SIZE_4GB))
Kojto 112:6f327212ef96 422
Kojto 112:6f327212ef96 423 #define IS_MPU_SUB_REGION_DISABLE(SUBREGION) ((SUBREGION) < (uint16_t)0x00FF)
Kojto 112:6f327212ef96 424 #endif /* __MPU_PRESENT */
Kojto 112:6f327212ef96 425
Kojto 112:6f327212ef96 426 /**
Kojto 112:6f327212ef96 427 * @}
Kojto 112:6f327212ef96 428 */
Kojto 112:6f327212ef96 429
Kojto 112:6f327212ef96 430 /* Private functions ---------------------------------------------------------*/
Kojto 112:6f327212ef96 431 /** @defgroup CORTEX_Private_Functions CORTEX Private Functions
Kojto 112:6f327212ef96 432 * @brief CORTEX private functions
Kojto 112:6f327212ef96 433 * @{
Kojto 112:6f327212ef96 434 */
Kojto 112:6f327212ef96 435
Kojto 112:6f327212ef96 436 #if (__MPU_PRESENT == 1)
Kojto 112:6f327212ef96 437 /**
Kojto 112:6f327212ef96 438 * @brief Disables the MPU
Kojto 112:6f327212ef96 439 * @retval None
Kojto 112:6f327212ef96 440 */
Kojto 112:6f327212ef96 441 __STATIC_INLINE void HAL_MPU_Disable(void)
Kojto 112:6f327212ef96 442 {
Kojto 112:6f327212ef96 443 /* Disable fault exceptions */
Kojto 112:6f327212ef96 444 SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
Kojto 112:6f327212ef96 445
Kojto 112:6f327212ef96 446 /* Disable the MPU */
Kojto 112:6f327212ef96 447 MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
Kojto 112:6f327212ef96 448 }
Kojto 112:6f327212ef96 449
Kojto 112:6f327212ef96 450 /**
Kojto 112:6f327212ef96 451 * @brief Enables the MPU
Kojto 112:6f327212ef96 452 * @param MPU_Control: Specifies the control mode of the MPU during hard fault,
Kojto 112:6f327212ef96 453 * NMI, FAULTMASK and privileged access to the default memory
Kojto 112:6f327212ef96 454 * This parameter can be one of the following values:
Kojto 112:6f327212ef96 455 * @arg MPU_HFNMI_PRIVDEF_NONE
Kojto 112:6f327212ef96 456 * @arg MPU_HARDFAULT_NMI
Kojto 112:6f327212ef96 457 * @arg MPU_PRIVILEGED_DEFAULT
Kojto 112:6f327212ef96 458 * @arg MPU_HFNMI_PRIVDEF
Kojto 112:6f327212ef96 459 * @retval None
Kojto 112:6f327212ef96 460 */
Kojto 112:6f327212ef96 461 __STATIC_INLINE void HAL_MPU_Enable(uint32_t MPU_Control)
Kojto 112:6f327212ef96 462 {
Kojto 112:6f327212ef96 463 /* Enable the MPU */
Kojto 112:6f327212ef96 464 MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
Kojto 112:6f327212ef96 465
Kojto 112:6f327212ef96 466 /* Enable fault exceptions */
Kojto 112:6f327212ef96 467 SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
Kojto 112:6f327212ef96 468 }
Kojto 112:6f327212ef96 469 #endif /* __MPU_PRESENT */
Kojto 112:6f327212ef96 470
Kojto 112:6f327212ef96 471 /**
Kojto 112:6f327212ef96 472 * @}
Kojto 112:6f327212ef96 473 */
Kojto 112:6f327212ef96 474
Kojto 112:6f327212ef96 475 /**
Kojto 112:6f327212ef96 476 * @}
Kojto 112:6f327212ef96 477 */
Kojto 112:6f327212ef96 478
Kojto 112:6f327212ef96 479 /**
Kojto 112:6f327212ef96 480 * @}
Kojto 112:6f327212ef96 481 */
Kojto 112:6f327212ef96 482
Kojto 112:6f327212ef96 483 #ifdef __cplusplus
Kojto 112:6f327212ef96 484 }
Kojto 112:6f327212ef96 485 #endif
Kojto 112:6f327212ef96 486
Kojto 112:6f327212ef96 487 #endif /* __STM32F4xx_HAL_CORTEX_H */
Kojto 112:6f327212ef96 488
Kojto 112:6f327212ef96 489
Kojto 112:6f327212ef96 490 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/