ft32f0xx_misc.h 3.4 KB

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