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:
Kojto
Date:
Tue Mar 17 14:27:45 2015 +0000
Revision:
96:487b796308b0
Release 96 of the mbed library

Changes:
- IAR support for ble boards, lpc, ethernet stack
- RTC - attach function to redirect time functions
- Nucleo F103RB - cube driver
- k20xx - fixes for teensy and k20 platforms in sleep/deepsleep and usb
- STM32L0, Nucleo/Disco L053 - refactoring

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 96:487b796308b0 1 /**
Kojto 96:487b796308b0 2 ******************************************************************************
Kojto 96:487b796308b0 3 * @file stm32f1xx_hal_cortex.h
Kojto 96:487b796308b0 4 * @author MCD Application Team
Kojto 96:487b796308b0 5 * @version V1.0.0
Kojto 96:487b796308b0 6 * @date 15-December-2014
Kojto 96:487b796308b0 7 * @brief Header file of CORTEX HAL module.
Kojto 96:487b796308b0 8 ******************************************************************************
Kojto 96:487b796308b0 9 * @attention
Kojto 96:487b796308b0 10 *
Kojto 96:487b796308b0 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 96:487b796308b0 12 *
Kojto 96:487b796308b0 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 96:487b796308b0 14 * are permitted provided that the following conditions are met:
Kojto 96:487b796308b0 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 96:487b796308b0 16 * this list of conditions and the following disclaimer.
Kojto 96:487b796308b0 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 96:487b796308b0 18 * this list of conditions and the following disclaimer in the documentation
Kojto 96:487b796308b0 19 * and/or other materials provided with the distribution.
Kojto 96:487b796308b0 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 96:487b796308b0 21 * may be used to endorse or promote products derived from this software
Kojto 96:487b796308b0 22 * without specific prior written permission.
Kojto 96:487b796308b0 23 *
Kojto 96:487b796308b0 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 96:487b796308b0 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 96:487b796308b0 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 96:487b796308b0 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 96:487b796308b0 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 96:487b796308b0 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 96:487b796308b0 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 96:487b796308b0 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 96:487b796308b0 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 96:487b796308b0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 96:487b796308b0 34 *
Kojto 96:487b796308b0 35 ******************************************************************************
Kojto 96:487b796308b0 36 */
Kojto 96:487b796308b0 37
Kojto 96:487b796308b0 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 96:487b796308b0 39 #ifndef __STM32F1xx_HAL_CORTEX_H
Kojto 96:487b796308b0 40 #define __STM32F1xx_HAL_CORTEX_H
Kojto 96:487b796308b0 41
Kojto 96:487b796308b0 42 #ifdef __cplusplus
Kojto 96:487b796308b0 43 extern "C" {
Kojto 96:487b796308b0 44 #endif
Kojto 96:487b796308b0 45
Kojto 96:487b796308b0 46 /* Includes ------------------------------------------------------------------*/
Kojto 96:487b796308b0 47 #include "stm32f1xx_hal_def.h"
Kojto 96:487b796308b0 48
Kojto 96:487b796308b0 49 /** @addtogroup STM32F1xx_HAL_Driver
Kojto 96:487b796308b0 50 * @{
Kojto 96:487b796308b0 51 */
Kojto 96:487b796308b0 52
Kojto 96:487b796308b0 53 /** @addtogroup CORTEX
Kojto 96:487b796308b0 54 * @{
Kojto 96:487b796308b0 55 */
Kojto 96:487b796308b0 56 /* Exported types ------------------------------------------------------------*/
Kojto 96:487b796308b0 57 /* Exported constants --------------------------------------------------------*/
Kojto 96:487b796308b0 58
Kojto 96:487b796308b0 59 /** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants
Kojto 96:487b796308b0 60 * @{
Kojto 96:487b796308b0 61 */
Kojto 96:487b796308b0 62
Kojto 96:487b796308b0 63
Kojto 96:487b796308b0 64 /** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group
Kojto 96:487b796308b0 65 * @{
Kojto 96:487b796308b0 66 */
Kojto 96:487b796308b0 67
Kojto 96:487b796308b0 68 #define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bits for pre-emption priority
Kojto 96:487b796308b0 69 4 bits for subpriority */
Kojto 96:487b796308b0 70 #define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bits for pre-emption priority
Kojto 96:487b796308b0 71 3 bits for subpriority */
Kojto 96:487b796308b0 72 #define NVIC_PRIORITYGROUP_2 ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority
Kojto 96:487b796308b0 73 2 bits for subpriority */
Kojto 96:487b796308b0 74 #define NVIC_PRIORITYGROUP_3 ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority
Kojto 96:487b796308b0 75 1 bits for subpriority */
Kojto 96:487b796308b0 76 #define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority
Kojto 96:487b796308b0 77 0 bits for subpriority */
Kojto 96:487b796308b0 78 /**
Kojto 96:487b796308b0 79 * @}
Kojto 96:487b796308b0 80 */
Kojto 96:487b796308b0 81
Kojto 96:487b796308b0 82 /** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick clock source
Kojto 96:487b796308b0 83 * @{
Kojto 96:487b796308b0 84 */
Kojto 96:487b796308b0 85 #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000)
Kojto 96:487b796308b0 86 #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004)
Kojto 96:487b796308b0 87
Kojto 96:487b796308b0 88 /**
Kojto 96:487b796308b0 89 * @}
Kojto 96:487b796308b0 90 */
Kojto 96:487b796308b0 91
Kojto 96:487b796308b0 92 /**
Kojto 96:487b796308b0 93 * @}
Kojto 96:487b796308b0 94 */
Kojto 96:487b796308b0 95
Kojto 96:487b796308b0 96 /* Exported Macros -----------------------------------------------------------*/
Kojto 96:487b796308b0 97 /** @defgroup CORTEX_Exported_Macros CORTEX Exported Macros
Kojto 96:487b796308b0 98 * @{
Kojto 96:487b796308b0 99 */
Kojto 96:487b796308b0 100
Kojto 96:487b796308b0 101 /** @defgroup CORTEX_SysTick_clock_source_Macro_Exported CORTEX SysTick clock source
Kojto 96:487b796308b0 102 * @{
Kojto 96:487b796308b0 103 */
Kojto 96:487b796308b0 104
Kojto 96:487b796308b0 105 /** @brief Configures the SysTick clock source.
Kojto 96:487b796308b0 106 * @param __CLKSRC__: specifies the SysTick clock source.
Kojto 96:487b796308b0 107 * This parameter can be one of the following values:
Kojto 96:487b796308b0 108 * @arg SYSTICK_CLKSOURCE_HCLK_DIV8: AHB clock divided by 8 selected as SysTick clock source.
Kojto 96:487b796308b0 109 * @arg SYSTICK_CLKSOURCE_HCLK: AHB clock selected as SysTick clock source.
Kojto 96:487b796308b0 110 * @retval None
Kojto 96:487b796308b0 111 */
Kojto 96:487b796308b0 112 #define __HAL_CORTEX_SYSTICKCLK_CONFIG(__CLKSRC__) \
Kojto 96:487b796308b0 113 do { \
Kojto 96:487b796308b0 114 if ((__CLKSRC__) == SYSTICK_CLKSOURCE_HCLK) \
Kojto 96:487b796308b0 115 { \
Kojto 96:487b796308b0 116 SET_BIT(SysTick->CTRL, SYSTICK_CLKSOURCE_HCLK); \
Kojto 96:487b796308b0 117 } \
Kojto 96:487b796308b0 118 else \
Kojto 96:487b796308b0 119 CLEAR_BIT(SysTick->CTRL, SYSTICK_CLKSOURCE_HCLK); \
Kojto 96:487b796308b0 120 } while(0)
Kojto 96:487b796308b0 121 /**
Kojto 96:487b796308b0 122 * @}
Kojto 96:487b796308b0 123 */
Kojto 96:487b796308b0 124
Kojto 96:487b796308b0 125 /**
Kojto 96:487b796308b0 126 * @}
Kojto 96:487b796308b0 127 */
Kojto 96:487b796308b0 128
Kojto 96:487b796308b0 129 /* Private macro -------------------------------------------------------------*/
Kojto 96:487b796308b0 130 /** @defgroup CORTEX_Private_Macros CORTEX Private Macros
Kojto 96:487b796308b0 131 * @{
Kojto 96:487b796308b0 132 */
Kojto 96:487b796308b0 133
Kojto 96:487b796308b0 134 /** @defgroup CORTEX_Preemption_Priority_Group_Macro CORTEX Preemption Priority Group
Kojto 96:487b796308b0 135 * @{
Kojto 96:487b796308b0 136 */
Kojto 96:487b796308b0 137 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \
Kojto 96:487b796308b0 138 ((GROUP) == NVIC_PRIORITYGROUP_1) || \
Kojto 96:487b796308b0 139 ((GROUP) == NVIC_PRIORITYGROUP_2) || \
Kojto 96:487b796308b0 140 ((GROUP) == NVIC_PRIORITYGROUP_3) || \
Kojto 96:487b796308b0 141 ((GROUP) == NVIC_PRIORITYGROUP_4))
Kojto 96:487b796308b0 142
Kojto 96:487b796308b0 143 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
Kojto 96:487b796308b0 144
Kojto 96:487b796308b0 145 #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
Kojto 96:487b796308b0 146
Kojto 96:487b796308b0 147 #define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00)
Kojto 96:487b796308b0 148
Kojto 96:487b796308b0 149 /**
Kojto 96:487b796308b0 150 * @}
Kojto 96:487b796308b0 151 */
Kojto 96:487b796308b0 152
Kojto 96:487b796308b0 153 /** @defgroup CORTEX_SysTick_clock_source_Macro_Private CORTEX SysTick clock source
Kojto 96:487b796308b0 154 * @{
Kojto 96:487b796308b0 155 */
Kojto 96:487b796308b0 156 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \
Kojto 96:487b796308b0 157 ((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8))
Kojto 96:487b796308b0 158 /**
Kojto 96:487b796308b0 159 * @}
Kojto 96:487b796308b0 160 */
Kojto 96:487b796308b0 161
Kojto 96:487b796308b0 162 /**
Kojto 96:487b796308b0 163 * @}
Kojto 96:487b796308b0 164 */
Kojto 96:487b796308b0 165
Kojto 96:487b796308b0 166 /* Exported functions --------------------------------------------------------*/
Kojto 96:487b796308b0 167
Kojto 96:487b796308b0 168 /** @addtogroup CORTEX_Exported_Functions
Kojto 96:487b796308b0 169 * @{
Kojto 96:487b796308b0 170 */
Kojto 96:487b796308b0 171
Kojto 96:487b796308b0 172 /** @addtogroup CORTEX_Exported_Functions_Group1
Kojto 96:487b796308b0 173 * @{
Kojto 96:487b796308b0 174 */
Kojto 96:487b796308b0 175 /* Initialization and de-initialization functions *****************************/
Kojto 96:487b796308b0 176 void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup);
Kojto 96:487b796308b0 177 void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority);
Kojto 96:487b796308b0 178 void HAL_NVIC_EnableIRQ(IRQn_Type IRQn);
Kojto 96:487b796308b0 179 void HAL_NVIC_DisableIRQ(IRQn_Type IRQn);
Kojto 96:487b796308b0 180 void HAL_NVIC_SystemReset(void);
Kojto 96:487b796308b0 181 uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
Kojto 96:487b796308b0 182 /**
Kojto 96:487b796308b0 183 * @}
Kojto 96:487b796308b0 184 */
Kojto 96:487b796308b0 185
Kojto 96:487b796308b0 186 /** @addtogroup CORTEX_Exported_Functions_Group2
Kojto 96:487b796308b0 187 * @{
Kojto 96:487b796308b0 188 */
Kojto 96:487b796308b0 189 /* Peripheral Control functions ***********************************************/
Kojto 96:487b796308b0 190 uint32_t HAL_NVIC_GetPriorityGrouping(void);
Kojto 96:487b796308b0 191 void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority);
Kojto 96:487b796308b0 192 uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn);
Kojto 96:487b796308b0 193 void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn);
Kojto 96:487b796308b0 194 void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
Kojto 96:487b796308b0 195 uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn);
Kojto 96:487b796308b0 196 void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource);
Kojto 96:487b796308b0 197 void HAL_SYSTICK_IRQHandler(void);
Kojto 96:487b796308b0 198 void HAL_SYSTICK_Callback(void);
Kojto 96:487b796308b0 199 /**
Kojto 96:487b796308b0 200 * @}
Kojto 96:487b796308b0 201 */
Kojto 96:487b796308b0 202
Kojto 96:487b796308b0 203 /**
Kojto 96:487b796308b0 204 * @}
Kojto 96:487b796308b0 205 */
Kojto 96:487b796308b0 206
Kojto 96:487b796308b0 207 /**
Kojto 96:487b796308b0 208 * @}
Kojto 96:487b796308b0 209 */
Kojto 96:487b796308b0 210
Kojto 96:487b796308b0 211 /**
Kojto 96:487b796308b0 212 * @}
Kojto 96:487b796308b0 213 */
Kojto 96:487b796308b0 214
Kojto 96:487b796308b0 215 #ifdef __cplusplus
Kojto 96:487b796308b0 216 }
Kojto 96:487b796308b0 217 #endif
Kojto 96:487b796308b0 218
Kojto 96:487b796308b0 219 #endif /* __STM32F1xx_HAL_CORTEX_H */
Kojto 96:487b796308b0 220
Kojto 96:487b796308b0 221
Kojto 96:487b796308b0 222 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/