version_2.0
Dependents: cc3000_ping_demo_try_2
Fork of mbed by
TARGET_NUCLEO_F302R8/stm32f30x_misc.h@82:6473597d706e, 2014-04-07 (annotated)
- Committer:
- bogdanm
- Date:
- Mon Apr 07 18:28:36 2014 +0100
- Revision:
- 82:6473597d706e
Release 82 of the mbed library
Main changes:
- support for K64F
- Revisited Nordic code structure
- Test infrastructure improvements
- various bug fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 82:6473597d706e | 1 | /** |
bogdanm | 82:6473597d706e | 2 | ****************************************************************************** |
bogdanm | 82:6473597d706e | 3 | * @file stm32f30x_misc.h |
bogdanm | 82:6473597d706e | 4 | * @author MCD Application Team |
bogdanm | 82:6473597d706e | 5 | * @version V1.1.0 |
bogdanm | 82:6473597d706e | 6 | * @date 27-February-2014 |
bogdanm | 82:6473597d706e | 7 | * @brief This file contains all the functions prototypes for the miscellaneous |
bogdanm | 82:6473597d706e | 8 | * firmware library functions (add-on to CMSIS functions). |
bogdanm | 82:6473597d706e | 9 | ****************************************************************************** |
bogdanm | 82:6473597d706e | 10 | * @attention |
bogdanm | 82:6473597d706e | 11 | * |
bogdanm | 82:6473597d706e | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
bogdanm | 82:6473597d706e | 13 | * |
bogdanm | 82:6473597d706e | 14 | * Redistribution and use in source and binary forms, with or without modification, |
bogdanm | 82:6473597d706e | 15 | * are permitted provided that the following conditions are met: |
bogdanm | 82:6473597d706e | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
bogdanm | 82:6473597d706e | 17 | * this list of conditions and the following disclaimer. |
bogdanm | 82:6473597d706e | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
bogdanm | 82:6473597d706e | 19 | * this list of conditions and the following disclaimer in the documentation |
bogdanm | 82:6473597d706e | 20 | * and/or other materials provided with the distribution. |
bogdanm | 82:6473597d706e | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
bogdanm | 82:6473597d706e | 22 | * may be used to endorse or promote products derived from this software |
bogdanm | 82:6473597d706e | 23 | * without specific prior written permission. |
bogdanm | 82:6473597d706e | 24 | * |
bogdanm | 82:6473597d706e | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
bogdanm | 82:6473597d706e | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
bogdanm | 82:6473597d706e | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
bogdanm | 82:6473597d706e | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
bogdanm | 82:6473597d706e | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
bogdanm | 82:6473597d706e | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
bogdanm | 82:6473597d706e | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
bogdanm | 82:6473597d706e | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
bogdanm | 82:6473597d706e | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
bogdanm | 82:6473597d706e | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
bogdanm | 82:6473597d706e | 35 | * |
bogdanm | 82:6473597d706e | 36 | ****************************************************************************** |
bogdanm | 82:6473597d706e | 37 | */ |
bogdanm | 82:6473597d706e | 38 | |
bogdanm | 82:6473597d706e | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
bogdanm | 82:6473597d706e | 40 | #ifndef __STM32F30x_MISC_H |
bogdanm | 82:6473597d706e | 41 | #define __STM32F30x_MISC_H |
bogdanm | 82:6473597d706e | 42 | |
bogdanm | 82:6473597d706e | 43 | #ifdef __cplusplus |
bogdanm | 82:6473597d706e | 44 | extern "C" { |
bogdanm | 82:6473597d706e | 45 | #endif |
bogdanm | 82:6473597d706e | 46 | |
bogdanm | 82:6473597d706e | 47 | /* Includes ------------------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 48 | #include "stm32f30x.h" |
bogdanm | 82:6473597d706e | 49 | |
bogdanm | 82:6473597d706e | 50 | /** @addtogroup STM32F30x_StdPeriph_Driver |
bogdanm | 82:6473597d706e | 51 | * @{ |
bogdanm | 82:6473597d706e | 52 | */ |
bogdanm | 82:6473597d706e | 53 | |
bogdanm | 82:6473597d706e | 54 | /** @addtogroup MISC |
bogdanm | 82:6473597d706e | 55 | * @{ |
bogdanm | 82:6473597d706e | 56 | */ |
bogdanm | 82:6473597d706e | 57 | |
bogdanm | 82:6473597d706e | 58 | /* Exported types ------------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 59 | |
bogdanm | 82:6473597d706e | 60 | /** |
bogdanm | 82:6473597d706e | 61 | * @brief NVIC Init Structure definition |
bogdanm | 82:6473597d706e | 62 | */ |
bogdanm | 82:6473597d706e | 63 | |
bogdanm | 82:6473597d706e | 64 | typedef struct |
bogdanm | 82:6473597d706e | 65 | { |
bogdanm | 82:6473597d706e | 66 | uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled. |
bogdanm | 82:6473597d706e | 67 | This parameter can be a value of @ref IRQn_Type (For |
bogdanm | 82:6473597d706e | 68 | the complete STM32 Devices IRQ Channels list, please |
bogdanm | 82:6473597d706e | 69 | refer to stm32f30x.h file) */ |
bogdanm | 82:6473597d706e | 70 | |
bogdanm | 82:6473597d706e | 71 | uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel |
bogdanm | 82:6473597d706e | 72 | specified in NVIC_IRQChannel. This parameter can be a value |
bogdanm | 82:6473597d706e | 73 | between 0 and 15. |
bogdanm | 82:6473597d706e | 74 | A lower priority value indicates a higher priority */ |
bogdanm | 82:6473597d706e | 75 | |
bogdanm | 82:6473597d706e | 76 | |
bogdanm | 82:6473597d706e | 77 | uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified |
bogdanm | 82:6473597d706e | 78 | in NVIC_IRQChannel. This parameter can be a value |
bogdanm | 82:6473597d706e | 79 | between 0 and 15. |
bogdanm | 82:6473597d706e | 80 | A lower priority value indicates a higher priority */ |
bogdanm | 82:6473597d706e | 81 | |
bogdanm | 82:6473597d706e | 82 | FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel |
bogdanm | 82:6473597d706e | 83 | will be enabled or disabled. |
bogdanm | 82:6473597d706e | 84 | This parameter can be set either to ENABLE or DISABLE */ |
bogdanm | 82:6473597d706e | 85 | } NVIC_InitTypeDef; |
bogdanm | 82:6473597d706e | 86 | |
bogdanm | 82:6473597d706e | 87 | /** |
bogdanm | 82:6473597d706e | 88 | * |
bogdanm | 82:6473597d706e | 89 | @verbatim |
bogdanm | 82:6473597d706e | 90 | The table below gives the allowed values of the pre-emption priority and subpriority according |
bogdanm | 82:6473597d706e | 91 | to the Priority Grouping configuration performed by NVIC_PriorityGroupConfig function |
bogdanm | 82:6473597d706e | 92 | ============================================================================================================================ |
bogdanm | 82:6473597d706e | 93 | NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description |
bogdanm | 82:6473597d706e | 94 | ============================================================================================================================ |
bogdanm | 82:6473597d706e | 95 | NVIC_PriorityGroup_0 | 0 | 0-15 | 0 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 96 | | | | 4 bits for subpriority |
bogdanm | 82:6473597d706e | 97 | ---------------------------------------------------------------------------------------------------------------------------- |
bogdanm | 82:6473597d706e | 98 | NVIC_PriorityGroup_1 | 0-1 | 0-7 | 1 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 99 | | | | 3 bits for subpriority |
bogdanm | 82:6473597d706e | 100 | ---------------------------------------------------------------------------------------------------------------------------- |
bogdanm | 82:6473597d706e | 101 | NVIC_PriorityGroup_2 | 0-3 | 0-3 | 2 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 102 | | | | 2 bits for subpriority |
bogdanm | 82:6473597d706e | 103 | ---------------------------------------------------------------------------------------------------------------------------- |
bogdanm | 82:6473597d706e | 104 | NVIC_PriorityGroup_3 | 0-7 | 0-1 | 3 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 105 | | | | 1 bits for subpriority |
bogdanm | 82:6473597d706e | 106 | ---------------------------------------------------------------------------------------------------------------------------- |
bogdanm | 82:6473597d706e | 107 | NVIC_PriorityGroup_4 | 0-15 | 0 | 4 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 108 | | | | 0 bits for subpriority |
bogdanm | 82:6473597d706e | 109 | ============================================================================================================================ |
bogdanm | 82:6473597d706e | 110 | @endverbatim |
bogdanm | 82:6473597d706e | 111 | */ |
bogdanm | 82:6473597d706e | 112 | |
bogdanm | 82:6473597d706e | 113 | /* Exported constants --------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 114 | |
bogdanm | 82:6473597d706e | 115 | /** @defgroup MISC_Exported_Constants |
bogdanm | 82:6473597d706e | 116 | * @{ |
bogdanm | 82:6473597d706e | 117 | */ |
bogdanm | 82:6473597d706e | 118 | |
bogdanm | 82:6473597d706e | 119 | /** @defgroup MISC_Vector_Table_Base |
bogdanm | 82:6473597d706e | 120 | * @{ |
bogdanm | 82:6473597d706e | 121 | */ |
bogdanm | 82:6473597d706e | 122 | |
bogdanm | 82:6473597d706e | 123 | #define NVIC_VectTab_RAM ((uint32_t)0x20000000) |
bogdanm | 82:6473597d706e | 124 | #define NVIC_VectTab_FLASH ((uint32_t)0x08000000) |
bogdanm | 82:6473597d706e | 125 | #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \ |
bogdanm | 82:6473597d706e | 126 | ((VECTTAB) == NVIC_VectTab_FLASH)) |
bogdanm | 82:6473597d706e | 127 | /** |
bogdanm | 82:6473597d706e | 128 | * @} |
bogdanm | 82:6473597d706e | 129 | */ |
bogdanm | 82:6473597d706e | 130 | |
bogdanm | 82:6473597d706e | 131 | /** @defgroup MISC_System_Low_Power |
bogdanm | 82:6473597d706e | 132 | * @{ |
bogdanm | 82:6473597d706e | 133 | */ |
bogdanm | 82:6473597d706e | 134 | |
bogdanm | 82:6473597d706e | 135 | #define NVIC_LP_SEVONPEND ((uint8_t)0x10) |
bogdanm | 82:6473597d706e | 136 | #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04) |
bogdanm | 82:6473597d706e | 137 | #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02) |
bogdanm | 82:6473597d706e | 138 | #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \ |
bogdanm | 82:6473597d706e | 139 | ((LP) == NVIC_LP_SLEEPDEEP) || \ |
bogdanm | 82:6473597d706e | 140 | ((LP) == NVIC_LP_SLEEPONEXIT)) |
bogdanm | 82:6473597d706e | 141 | /** |
bogdanm | 82:6473597d706e | 142 | * @} |
bogdanm | 82:6473597d706e | 143 | */ |
bogdanm | 82:6473597d706e | 144 | |
bogdanm | 82:6473597d706e | 145 | /** @defgroup MISC_Preemption_Priority_Group |
bogdanm | 82:6473597d706e | 146 | * @{ |
bogdanm | 82:6473597d706e | 147 | */ |
bogdanm | 82:6473597d706e | 148 | |
bogdanm | 82:6473597d706e | 149 | #define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 150 | 4 bits for subpriority */ |
bogdanm | 82:6473597d706e | 151 | #define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 152 | 3 bits for subpriority */ |
bogdanm | 82:6473597d706e | 153 | #define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 154 | 2 bits for subpriority */ |
bogdanm | 82:6473597d706e | 155 | #define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 156 | 1 bits for subpriority */ |
bogdanm | 82:6473597d706e | 157 | #define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority |
bogdanm | 82:6473597d706e | 158 | 0 bits for subpriority */ |
bogdanm | 82:6473597d706e | 159 | |
bogdanm | 82:6473597d706e | 160 | #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \ |
bogdanm | 82:6473597d706e | 161 | ((GROUP) == NVIC_PriorityGroup_1) || \ |
bogdanm | 82:6473597d706e | 162 | ((GROUP) == NVIC_PriorityGroup_2) || \ |
bogdanm | 82:6473597d706e | 163 | ((GROUP) == NVIC_PriorityGroup_3) || \ |
bogdanm | 82:6473597d706e | 164 | ((GROUP) == NVIC_PriorityGroup_4)) |
bogdanm | 82:6473597d706e | 165 | |
bogdanm | 82:6473597d706e | 166 | #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) |
bogdanm | 82:6473597d706e | 167 | |
bogdanm | 82:6473597d706e | 168 | #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) |
bogdanm | 82:6473597d706e | 169 | |
bogdanm | 82:6473597d706e | 170 | #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF) |
bogdanm | 82:6473597d706e | 171 | |
bogdanm | 82:6473597d706e | 172 | /** |
bogdanm | 82:6473597d706e | 173 | * @} |
bogdanm | 82:6473597d706e | 174 | */ |
bogdanm | 82:6473597d706e | 175 | |
bogdanm | 82:6473597d706e | 176 | /** @defgroup MISC_SysTick_clock_source |
bogdanm | 82:6473597d706e | 177 | */ |
bogdanm | 82:6473597d706e | 178 | |
bogdanm | 82:6473597d706e | 179 | #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB) |
bogdanm | 82:6473597d706e | 180 | #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004) |
bogdanm | 82:6473597d706e | 181 | #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \ |
bogdanm | 82:6473597d706e | 182 | ((SOURCE) == SysTick_CLKSource_HCLK_Div8)) |
bogdanm | 82:6473597d706e | 183 | /** |
bogdanm | 82:6473597d706e | 184 | * @} |
bogdanm | 82:6473597d706e | 185 | */ |
bogdanm | 82:6473597d706e | 186 | |
bogdanm | 82:6473597d706e | 187 | /** |
bogdanm | 82:6473597d706e | 188 | * @} |
bogdanm | 82:6473597d706e | 189 | */ |
bogdanm | 82:6473597d706e | 190 | |
bogdanm | 82:6473597d706e | 191 | /* Exported macro ------------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 192 | /* Exported functions --------------------------------------------------------*/ |
bogdanm | 82:6473597d706e | 193 | |
bogdanm | 82:6473597d706e | 194 | void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup); |
bogdanm | 82:6473597d706e | 195 | void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct); |
bogdanm | 82:6473597d706e | 196 | void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset); |
bogdanm | 82:6473597d706e | 197 | void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState); |
bogdanm | 82:6473597d706e | 198 | void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource); |
bogdanm | 82:6473597d706e | 199 | |
bogdanm | 82:6473597d706e | 200 | #ifdef __cplusplus |
bogdanm | 82:6473597d706e | 201 | } |
bogdanm | 82:6473597d706e | 202 | #endif |
bogdanm | 82:6473597d706e | 203 | |
bogdanm | 82:6473597d706e | 204 | #endif /* __STM32F30x_MISC_H */ |
bogdanm | 82:6473597d706e | 205 | |
bogdanm | 82:6473597d706e | 206 | /** |
bogdanm | 82:6473597d706e | 207 | * @} |
bogdanm | 82:6473597d706e | 208 | */ |
bogdanm | 82:6473597d706e | 209 | |
bogdanm | 82:6473597d706e | 210 | /** |
bogdanm | 82:6473597d706e | 211 | * @} |
bogdanm | 82:6473597d706e | 212 | */ |
bogdanm | 82:6473597d706e | 213 | |
bogdanm | 82:6473597d706e | 214 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |