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