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:
116:c0f6e94411f5
.

Who changed what in which revision?

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