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