apm32f0xx_misc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*!
  2. * @file apm32f0xx_misc.h
  3. *
  4. * @brief This file contains all the functions prototypes for the miscellaneous
  5. * firmware library functions (add-on to CMSIS functions).
  6. *
  7. * @version V1.0.3
  8. *
  9. * @date 2022-09-20
  10. *
  11. * @attention
  12. *
  13. * Copyright (C) 2020-2022 Geehy Semiconductor
  14. *
  15. * You may not use this file except in compliance with the
  16. * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
  17. *
  18. * The program is only for reference, which is distributed in the hope
  19. * that it will be useful and instructional for customers to develop
  20. * their software. Unless required by applicable law or agreed to in
  21. * writing, the program is distributed on an "AS IS" BASIS, WITHOUT
  22. * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
  24. * and limitations under the License.
  25. */
  26. /* Define to prevent recursive inclusion */
  27. #ifndef __APM32F0XX_MISC_H
  28. #define __APM32F0XX_MISC_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /* Includes */
  33. #include "apm32f0xx.h"
  34. /** @addtogroup APM32F0xx_StdPeriphDriver
  35. @{
  36. */
  37. /** @addtogroup MISC_Driver
  38. @{
  39. */
  40. /** @defgroup MISC_Macros Macros
  41. @{
  42. */
  43. /* MISC SysTick clock source */
  44. #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB)
  45. #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004)
  46. /**@} end of group MISC_Macros */
  47. /** @defgroup MISC_Enumerations Enumerations
  48. @{
  49. */
  50. /**
  51. * @brief System low power mode
  52. */
  53. typedef enum
  54. {
  55. NVIC_LOWPOER_SEVONPEND = 0x10, /*!< Wake up according to pending request */
  56. NVIC_LOWPOER_SLEEPDEEP = 0x04, /*!< Enable sleep deep */
  57. NVIC_LOWPOER_SLEEPONEXIT = 0x02 /*!< Sleep after exit ISR */
  58. } NVIC_LOWPOER_T;
  59. /**@} end of group MISC_Enumerations */
  60. /** @defgroup MISC_Structures Structures
  61. @{
  62. */
  63. /**@} end of group MISC_Structures */
  64. /** @defgroup MISC_Variables Variables
  65. @{
  66. */
  67. /**@} end of group MISC_Variables*/
  68. /** @defgroup MISC_Functions Functions
  69. @{
  70. */
  71. /* NVIC */
  72. void NVIC_EnableIRQRequest(IRQn_Type irq, uint8_t priority);
  73. void NVIC_DisableIRQRequest(IRQn_Type irq);
  74. /* Low Power */
  75. void NVIC_EnableSystemLowPower(uint8_t lowPowerMode);
  76. void NVIC_DisableSystemLowPower(uint8_t lowPowerMode);
  77. /* SysTick */
  78. void SysTick_ConfigCLKSource(uint32_t sysTickCLKSource);
  79. /* PMU */
  80. void PMU_EnterWaitMode(void);
  81. void PMU_EnterHaltModeWFI(void);
  82. void PMU_EnterHaltModeWFE(void);
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif /* __APM32F0XX_MISC_H */
  87. /**@} end of group MISC_Functions */
  88. /**@} end of group MISC_Driver */
  89. /**@} end of group APM32F0xx_StdPeriphDriver */