HAL_misc.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /**
  2. ******************************************************************************
  3. * @file HAL_misc.h
  4. * @author AE Team
  5. * @version V2.0.0
  6. * @date 22/08/2017
  7. * @brief This file contains all the functions prototypes for the
  8. * miscellaneous firmware library functions.
  9. ******************************************************************************
  10. */
  11. /* Define to prevent recursive inclusion -------------------------------------*/
  12. #ifndef __HAL_MISC_H
  13. #define __HAL_MISC_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* Includes ------------------------------------------------------------------*/
  18. #include "HAL_device.h"
  19. /** @addtogroup StdPeriph_Driver
  20. * @{
  21. */
  22. /** @addtogroup MISC
  23. * @{
  24. */
  25. /** @defgroup MISC_Exported_Types
  26. * @{
  27. */
  28. /**
  29. * @brief NVIC Init Structure definition
  30. */
  31. typedef struct
  32. {
  33. uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled.
  34. This parameter can be a value of @ref IRQn_Type
  35. (For the complete MM32 Devices IRQ Channels list,
  36. please refer to HAL_device.h file) */
  37. uint8_t NVIC_IRQChannelPriority; /*!< Specifies the priority level for the IRQ channel specified
  38. in NVIC_IRQChannel. This parameter can be a value
  39. between 0 and 3. */
  40. FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel
  41. will be enabled or disabled.
  42. This parameter can be set either to ENABLE or DISABLE */
  43. } NVIC_InitTypeDef;
  44. /**
  45. * @}
  46. */
  47. /** @defgroup MISC_Exported_Constants
  48. * @{
  49. */
  50. /** @defgroup MISC_System_Low_Power
  51. * @{
  52. */
  53. #define NVIC_LP_SEVONPEND ((uint8_t)0x10)
  54. #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04)
  55. #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02)
  56. #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \
  57. ((LP) == NVIC_LP_SLEEPDEEP) || \
  58. ((LP) == NVIC_LP_SLEEPONEXIT))
  59. /**
  60. * @}
  61. */
  62. /** @defgroup MISC_Preemption_Priority_Group
  63. * @{
  64. */
  65. #define IS_NVIC_PRIORITY(PRIORITY) ((PRIORITY) < 0x04)
  66. /**
  67. * @}
  68. */
  69. /** @defgroup SysTick_clock_source
  70. * @{
  71. */
  72. #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
  73. #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
  74. #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \
  75. ((SOURCE) == SysTick_CLKSource_HCLK_Div8))
  76. /**
  77. * @}
  78. */
  79. /**
  80. * @}
  81. */
  82. /** @defgroup MISC_Exported_Macros
  83. * @{
  84. */
  85. /**
  86. * @}
  87. */
  88. /** @defgroup MISC_Exported_Functions
  89. * @{
  90. */
  91. void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct);
  92. void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState);
  93. void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource);
  94. #ifdef __cplusplus
  95. }
  96. #endif
  97. #endif /* __HAL_MISC_H */
  98. /**
  99. * @}
  100. */
  101. /**
  102. * @}
  103. */
  104. /**
  105. * @}
  106. */
  107. /*-------------------------(C) COPYRIGHT 2017 MindMotion ----------------------*/