mattia griotti / Mbed 2 deprecated HelloWorld_IKS01A1

Dependencies:   BLE_API X_NUCLEO_IDB0XA1 X_NUCLEO_IKS01A1 mbed

Fork of HelloWorld_IKS01A1 by ST

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers misc.h Source File

misc.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    misc.h
00004   * @author  MCD Application Team
00005   * @version V1.0.0
00006   * @date    30-September-2011
00007   * @brief   This file contains all the functions prototypes for the miscellaneous
00008   *          firmware library functions (add-on to CMSIS functions).
00009   ******************************************************************************
00010   * @attention
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
00020   ******************************************************************************
00021   */
00022 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __MISC_H
00025 #define __MISC_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f4xx.h"
00033 
00034 /** @addtogroup STM32F4xx_StdPeriph_Driver
00035   * @{
00036   */
00037 
00038 /** @addtogroup MISC
00039   * @{
00040   */
00041 
00042 /* Exported types ------------------------------------------------------------*/
00043 
00044 /** 
00045   * @brief  NVIC Init Structure definition  
00046   */
00047 
00048 typedef struct
00049 {
00050   uint8_t NVIC_IRQChannel;                    /*!< Specifies the IRQ channel to be enabled or disabled.
00051                                                    This parameter can be an enumerator of @ref IRQn_Type 
00052                                                    enumeration (For the complete STM32 Devices IRQ Channels
00053                                                    list, please refer to stm32f4xx.h file) */
00054 
00055   uint8_t NVIC_IRQChannelPreemptionPriority;  /*!< Specifies the pre-emption priority for the IRQ channel
00056                                                    specified in NVIC_IRQChannel. This parameter can be a value
00057                                                    between 0 and 15 as described in the table @ref MISC_NVIC_Priority_Table
00058                                                    A lower priority value indicates a higher priority */
00059 
00060   uint8_t NVIC_IRQChannelSubPriority;         /*!< Specifies the subpriority level for the IRQ channel specified
00061                                                    in NVIC_IRQChannel. This parameter can be a value
00062                                                    between 0 and 15 as described in the table @ref MISC_NVIC_Priority_Table
00063                                                    A lower priority value indicates a higher priority */
00064 
00065   FunctionalState NVIC_IRQChannelCmd;         /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel
00066                                                    will be enabled or disabled. 
00067                                                    This parameter can be set either to ENABLE or DISABLE */   
00068 } NVIC_InitTypeDef;
00069  
00070 /* Exported constants --------------------------------------------------------*/
00071 
00072 /** @defgroup MISC_Exported_Constants
00073   * @{
00074   */
00075 
00076 /** @defgroup MISC_Vector_Table_Base 
00077   * @{
00078   */
00079 
00080 #define NVIC_VectTab_RAM             ((uint32_t)0x20000000)
00081 #define NVIC_VectTab_FLASH           ((uint32_t)0x08000000)
00082 #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \
00083                                   ((VECTTAB) == NVIC_VectTab_FLASH))
00084 /**
00085   * @}
00086   */
00087 
00088 /** @defgroup MISC_System_Low_Power 
00089   * @{
00090   */
00091 
00092 #define NVIC_LP_SEVONPEND            ((uint8_t)0x10)
00093 #define NVIC_LP_SLEEPDEEP            ((uint8_t)0x04)
00094 #define NVIC_LP_SLEEPONEXIT          ((uint8_t)0x02)
00095 #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
00096                         ((LP) == NVIC_LP_SLEEPDEEP) || \
00097                         ((LP) == NVIC_LP_SLEEPONEXIT))
00098 /**
00099   * @}
00100   */
00101 
00102 /** @defgroup MISC_Preemption_Priority_Group 
00103   * @{
00104   */
00105 
00106 #define NVIC_PriorityGroup_0         ((uint32_t)0x700) /*!< 0 bits for pre-emption priority
00107                                                             4 bits for subpriority */
00108 #define NVIC_PriorityGroup_1         ((uint32_t)0x600) /*!< 1 bits for pre-emption priority
00109                                                             3 bits for subpriority */
00110 #define NVIC_PriorityGroup_2         ((uint32_t)0x500) /*!< 2 bits for pre-emption priority
00111                                                             2 bits for subpriority */
00112 #define NVIC_PriorityGroup_3         ((uint32_t)0x400) /*!< 3 bits for pre-emption priority
00113                                                             1 bits for subpriority */
00114 #define NVIC_PriorityGroup_4         ((uint32_t)0x300) /*!< 4 bits for pre-emption priority
00115                                                             0 bits for subpriority */
00116 
00117 #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \
00118                                        ((GROUP) == NVIC_PriorityGroup_1) || \
00119                                        ((GROUP) == NVIC_PriorityGroup_2) || \
00120                                        ((GROUP) == NVIC_PriorityGroup_3) || \
00121                                        ((GROUP) == NVIC_PriorityGroup_4))
00122 
00123 #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10)
00124 
00125 #define IS_NVIC_SUB_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10)
00126 
00127 #define IS_NVIC_OFFSET(OFFSET)  ((OFFSET) < 0x000FFFFF)
00128 
00129 /**
00130   * @}
00131   */
00132 
00133 /** @defgroup MISC_SysTick_clock_source 
00134   * @{
00135   */
00136 
00137 #define SysTick_CLKSource_HCLK_Div8    ((uint32_t)0xFFFFFFFB)
00138 #define SysTick_CLKSource_HCLK         ((uint32_t)0x00000004)
00139 #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
00140                                        ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
00141 /**
00142   * @}
00143   */
00144 
00145 /**
00146   * @}
00147   */
00148 
00149 /* Exported macro ------------------------------------------------------------*/
00150 /* Exported functions --------------------------------------------------------*/
00151 
00152 void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup);
00153 void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
00154 void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset);
00155 void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
00156 void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
00157 
00158 #ifdef __cplusplus
00159 }
00160 #endif
00161 
00162 #endif /* __MISC_H */
00163 
00164 /**
00165   * @}
00166   */
00167 
00168 /**
00169   * @}
00170   */
00171 
00172 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
00173