mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F334R8/stm32f3xx_hal_cortex.h@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 237:f3da66175598
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 237:f3da66175598 | 1 | /** |
mbed_official | 237:f3da66175598 | 2 | ****************************************************************************** |
mbed_official | 237:f3da66175598 | 3 | * @file stm32f3xx_hal_cortex.h |
mbed_official | 237:f3da66175598 | 4 | * @author MCD Application Team |
mbed_official | 237:f3da66175598 | 5 | * @version V1.0.1 |
mbed_official | 237:f3da66175598 | 6 | * @date 18-June-2014 |
mbed_official | 237:f3da66175598 | 7 | * @brief Header file of CORTEX HAL module. |
mbed_official | 237:f3da66175598 | 8 | ****************************************************************************** |
mbed_official | 237:f3da66175598 | 9 | * @attention |
mbed_official | 237:f3da66175598 | 10 | * |
mbed_official | 237:f3da66175598 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 237:f3da66175598 | 12 | * |
mbed_official | 237:f3da66175598 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 237:f3da66175598 | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 237:f3da66175598 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 237:f3da66175598 | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 237:f3da66175598 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 237:f3da66175598 | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 237:f3da66175598 | 19 | * and/or other materials provided with the distribution. |
mbed_official | 237:f3da66175598 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 237:f3da66175598 | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 237:f3da66175598 | 22 | * without specific prior written permission. |
mbed_official | 237:f3da66175598 | 23 | * |
mbed_official | 237:f3da66175598 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 237:f3da66175598 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 237:f3da66175598 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 237:f3da66175598 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 237:f3da66175598 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 237:f3da66175598 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 237:f3da66175598 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 237:f3da66175598 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 237:f3da66175598 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 237:f3da66175598 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 237:f3da66175598 | 34 | * |
mbed_official | 237:f3da66175598 | 35 | ****************************************************************************** |
mbed_official | 237:f3da66175598 | 36 | */ |
mbed_official | 237:f3da66175598 | 37 | |
mbed_official | 237:f3da66175598 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 237:f3da66175598 | 39 | #ifndef __STM32F3xx_HAL_CORTEX_H |
mbed_official | 237:f3da66175598 | 40 | #define __STM32F3xx_HAL_CORTEX_H |
mbed_official | 237:f3da66175598 | 41 | |
mbed_official | 237:f3da66175598 | 42 | #ifdef __cplusplus |
mbed_official | 237:f3da66175598 | 43 | extern "C" { |
mbed_official | 237:f3da66175598 | 44 | #endif |
mbed_official | 237:f3da66175598 | 45 | |
mbed_official | 237:f3da66175598 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 47 | #include "stm32f3xx_hal_def.h" |
mbed_official | 237:f3da66175598 | 48 | |
mbed_official | 237:f3da66175598 | 49 | /** @addtogroup STM32F3xx_HAL_Driver |
mbed_official | 237:f3da66175598 | 50 | * @{ |
mbed_official | 237:f3da66175598 | 51 | */ |
mbed_official | 237:f3da66175598 | 52 | |
mbed_official | 237:f3da66175598 | 53 | /** @addtogroup CORTEX |
mbed_official | 237:f3da66175598 | 54 | * @{ |
mbed_official | 237:f3da66175598 | 55 | */ |
mbed_official | 237:f3da66175598 | 56 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 57 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 58 | |
mbed_official | 237:f3da66175598 | 59 | /** @defgroup CORTEX_Exported_Constants |
mbed_official | 237:f3da66175598 | 60 | * @{ |
mbed_official | 237:f3da66175598 | 61 | */ |
mbed_official | 237:f3da66175598 | 62 | |
mbed_official | 237:f3da66175598 | 63 | |
mbed_official | 237:f3da66175598 | 64 | /** @defgroup CORTEX_Preemption_Priority_Group |
mbed_official | 237:f3da66175598 | 65 | * @{ |
mbed_official | 237:f3da66175598 | 66 | */ |
mbed_official | 237:f3da66175598 | 67 | |
mbed_official | 237:f3da66175598 | 68 | #define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bits for pre-emption priority |
mbed_official | 237:f3da66175598 | 69 | 4 bits for subpriority */ |
mbed_official | 237:f3da66175598 | 70 | #define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bits for pre-emption priority |
mbed_official | 237:f3da66175598 | 71 | 3 bits for subpriority */ |
mbed_official | 237:f3da66175598 | 72 | #define NVIC_PRIORITYGROUP_2 ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority |
mbed_official | 237:f3da66175598 | 73 | 2 bits for subpriority */ |
mbed_official | 237:f3da66175598 | 74 | #define NVIC_PRIORITYGROUP_3 ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority |
mbed_official | 237:f3da66175598 | 75 | 1 bits for subpriority */ |
mbed_official | 237:f3da66175598 | 76 | #define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority |
mbed_official | 237:f3da66175598 | 77 | 0 bits for subpriority */ |
mbed_official | 237:f3da66175598 | 78 | |
mbed_official | 237:f3da66175598 | 79 | #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \ |
mbed_official | 237:f3da66175598 | 80 | ((GROUP) == NVIC_PRIORITYGROUP_1) || \ |
mbed_official | 237:f3da66175598 | 81 | ((GROUP) == NVIC_PRIORITYGROUP_2) || \ |
mbed_official | 237:f3da66175598 | 82 | ((GROUP) == NVIC_PRIORITYGROUP_3) || \ |
mbed_official | 237:f3da66175598 | 83 | ((GROUP) == NVIC_PRIORITYGROUP_4)) |
mbed_official | 237:f3da66175598 | 84 | |
mbed_official | 237:f3da66175598 | 85 | #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) |
mbed_official | 237:f3da66175598 | 86 | |
mbed_official | 237:f3da66175598 | 87 | #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) |
mbed_official | 237:f3da66175598 | 88 | |
mbed_official | 237:f3da66175598 | 89 | /** |
mbed_official | 237:f3da66175598 | 90 | * @} |
mbed_official | 237:f3da66175598 | 91 | */ |
mbed_official | 237:f3da66175598 | 92 | |
mbed_official | 237:f3da66175598 | 93 | /** @defgroup CORTEX_SysTick_clock_source |
mbed_official | 237:f3da66175598 | 94 | * @{ |
mbed_official | 237:f3da66175598 | 95 | */ |
mbed_official | 237:f3da66175598 | 96 | #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000) |
mbed_official | 237:f3da66175598 | 97 | #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004) |
mbed_official | 237:f3da66175598 | 98 | #define IS_SYSTICK_CLKSOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \ |
mbed_official | 237:f3da66175598 | 99 | ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8)) |
mbed_official | 237:f3da66175598 | 100 | /** |
mbed_official | 237:f3da66175598 | 101 | * @} |
mbed_official | 237:f3da66175598 | 102 | */ |
mbed_official | 237:f3da66175598 | 103 | |
mbed_official | 237:f3da66175598 | 104 | /** |
mbed_official | 237:f3da66175598 | 105 | * @} |
mbed_official | 237:f3da66175598 | 106 | */ |
mbed_official | 237:f3da66175598 | 107 | |
mbed_official | 237:f3da66175598 | 108 | |
mbed_official | 237:f3da66175598 | 109 | /* Exported Macros -----------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 110 | |
mbed_official | 237:f3da66175598 | 111 | /** @brief Configures the SysTick clock source. |
mbed_official | 237:f3da66175598 | 112 | * @param __CLKSRC__: specifies the SysTick clock source. |
mbed_official | 237:f3da66175598 | 113 | * This parameter can be one of the following values: |
mbed_official | 237:f3da66175598 | 114 | * @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source. |
mbed_official | 237:f3da66175598 | 115 | * @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source. |
mbed_official | 237:f3da66175598 | 116 | * @retval None |
mbed_official | 237:f3da66175598 | 117 | */ |
mbed_official | 237:f3da66175598 | 118 | #define __HAL_CORTEX_SYSTICKCLK_CONFIG(__CLKSRC__) \ |
mbed_official | 237:f3da66175598 | 119 | do { \ |
mbed_official | 237:f3da66175598 | 120 | if ((__CLKSRC__) == SYSTICK_CLKSOURCE_HCLK) \ |
mbed_official | 237:f3da66175598 | 121 | { \ |
mbed_official | 237:f3da66175598 | 122 | SysTick->CTRL |= SYSTICK_CLKSOURCE_HCLK; \ |
mbed_official | 237:f3da66175598 | 123 | } \ |
mbed_official | 237:f3da66175598 | 124 | else \ |
mbed_official | 237:f3da66175598 | 125 | SysTick->CTRL &= ~SYSTICK_CLKSOURCE_HCLK; \ |
mbed_official | 237:f3da66175598 | 126 | } while(0) |
mbed_official | 237:f3da66175598 | 127 | |
mbed_official | 237:f3da66175598 | 128 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 129 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 130 | /* Initialization and de-initialization functions *****************************/ |
mbed_official | 237:f3da66175598 | 131 | void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup); |
mbed_official | 237:f3da66175598 | 132 | void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority); |
mbed_official | 237:f3da66175598 | 133 | void HAL_NVIC_EnableIRQ(IRQn_Type IRQn); |
mbed_official | 237:f3da66175598 | 134 | void HAL_NVIC_DisableIRQ(IRQn_Type IRQn); |
mbed_official | 237:f3da66175598 | 135 | void HAL_NVIC_SystemReset(void); |
mbed_official | 237:f3da66175598 | 136 | uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb); |
mbed_official | 237:f3da66175598 | 137 | |
mbed_official | 237:f3da66175598 | 138 | /* Peripheral Control functions ***********************************************/ |
mbed_official | 237:f3da66175598 | 139 | uint32_t HAL_NVIC_GetPriorityGrouping(void); |
mbed_official | 237:f3da66175598 | 140 | void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority); |
mbed_official | 237:f3da66175598 | 141 | uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn); |
mbed_official | 237:f3da66175598 | 142 | void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn); |
mbed_official | 237:f3da66175598 | 143 | void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn); |
mbed_official | 237:f3da66175598 | 144 | uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn); |
mbed_official | 237:f3da66175598 | 145 | void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource); |
mbed_official | 237:f3da66175598 | 146 | void HAL_SYSTICK_IRQHandler(void); |
mbed_official | 237:f3da66175598 | 147 | void HAL_SYSTICK_Callback(void); |
mbed_official | 237:f3da66175598 | 148 | |
mbed_official | 237:f3da66175598 | 149 | /** |
mbed_official | 237:f3da66175598 | 150 | * @} |
mbed_official | 237:f3da66175598 | 151 | */ |
mbed_official | 237:f3da66175598 | 152 | |
mbed_official | 237:f3da66175598 | 153 | /** |
mbed_official | 237:f3da66175598 | 154 | * @} |
mbed_official | 237:f3da66175598 | 155 | */ |
mbed_official | 237:f3da66175598 | 156 | |
mbed_official | 237:f3da66175598 | 157 | #ifdef __cplusplus |
mbed_official | 237:f3da66175598 | 158 | } |
mbed_official | 237:f3da66175598 | 159 | #endif |
mbed_official | 237:f3da66175598 | 160 | |
mbed_official | 237:f3da66175598 | 161 | #endif /* __STM32F3xx_HAL_CORTEX_H */ |
mbed_official | 237:f3da66175598 | 162 | |
mbed_official | 237:f3da66175598 | 163 | |
mbed_official | 237:f3da66175598 | 164 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |