stm32f0xx_misc.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /**
  2. ******************************************************************************
  3. * @file stm32f0xx_misc.h
  4. * @author MCD Application Team
  5. * @version V1.5.0
  6. * @date 05-December-2014
  7. * @brief This file contains all the functions prototypes for the miscellaneous
  8. * firmware library functions (add-on to CMSIS functions).
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
  13. *
  14. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15. * You may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at:
  17. *
  18. * http://www.st.com/software_license_agreement_liberty_v2
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. ******************************************************************************
  27. */
  28. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F0XX_MISC_H
  30. #define __STM32F0XX_MISC_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /* Includes ------------------------------------------------------------------*/
  35. #include "stm32f0xx.h"
  36. /** @addtogroup STM32F0xx_StdPeriph_Driver
  37. * @{
  38. */
  39. /** @addtogroup MISC
  40. * @{
  41. */
  42. /* Exported types ------------------------------------------------------------*/
  43. /**
  44. * @brief NVIC Init Structure definition
  45. */
  46. typedef struct
  47. {
  48. uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled.
  49. This parameter can be a value of @ref IRQn_Type
  50. (For the complete STM32 Devices IRQ Channels list,
  51. please refer to stm32f0xx.h file) */
  52. uint8_t NVIC_IRQChannelPriority; /*!< Specifies the priority level for the IRQ channel specified
  53. in NVIC_IRQChannel. This parameter can be a value
  54. between 0 and 3. */
  55. FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel
  56. will be enabled or disabled.
  57. This parameter can be set either to ENABLE or DISABLE */
  58. } NVIC_InitTypeDef;
  59. /**
  60. *
  61. @verbatim
  62. @endverbatim
  63. */
  64. /* Exported constants --------------------------------------------------------*/
  65. /** @defgroup MISC_Exported_Constants
  66. * @{
  67. */
  68. /** @defgroup MISC_System_Low_Power
  69. * @{
  70. */
  71. #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
  72. #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
  73. #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
  74. #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
  75. ((LP) == NVIC_LP_SLEEPDEEP) || \
  76. ((LP) == NVIC_LP_SLEEPONEXIT))
  77. /**
  78. * @}
  79. */
  80. /** @defgroup MISC_Preemption_Priority_Group
  81. * @{
  82. */
  83. #define IS_NVIC_PRIORITY(PRIORITY) ((PRIORITY) < 0x04)
  84. /**
  85. * @}
  86. */
  87. /** @defgroup MISC_SysTick_clock_source
  88. * @{
  89. */
  90. #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
  91. #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
  92. #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
  93. ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
  94. /**
  95. * @}
  96. */
  97. /**
  98. * @}
  99. */
  100. /* Exported macro ------------------------------------------------------------*/
  101. /* Exported functions ------------------------------------------------------- */
  102. void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
  103. void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
  104. void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
  105. #ifdef __cplusplus
  106. }
  107. #endif
  108. #endif /* __STM32F0XX_MISC_H */
  109. /**
  110. * @}
  111. */
  112. /**
  113. * @}
  114. */
  115. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/