apm32f10x_iwdt.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*!
  2. * @file apm32f10x_iwdt.h
  3. *
  4. * @brief This file contains all the functions prototypes for the IWDT firmware library
  5. *
  6. * @version V1.0.1
  7. *
  8. * @date 2021-03-23
  9. *
  10. */
  11. #ifndef __APM32F10X_IWDT_H
  12. #define __APM32F10X_IWDT_H
  13. #include "apm32f10x.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /** @addtogroup Peripherals_Library Standard Peripheral Library
  18. @{
  19. */
  20. /** @addtogroup IWDT_Driver IWDT Driver
  21. @{
  22. */
  23. /** @addtogroup IWDT_Enumerations Enumerations
  24. @{
  25. */
  26. /**
  27. * @brief IWDT KEYWORD define
  28. */
  29. typedef enum
  30. {
  31. IWDT_KEYWORD_RELOAD = 0xAAAA,
  32. IWDT_KEYWORD_ENABLE = 0xCCCC
  33. }IWDT_KEYWORD_T;
  34. /**
  35. * @brief IWDT Write Access define
  36. */
  37. typedef enum
  38. {
  39. IWDT_WRITEACCESS_ENABLE = 0x5555,
  40. IWDT_WRITEACCESS_DISABLE = 0x0000
  41. }IWDT_WRITEACCESS_T;
  42. /**
  43. * @brief IWDT Divider
  44. */
  45. typedef enum
  46. {
  47. IWDT_DIVIDER_4 = 0x00,
  48. IWDT_DIVIDER_8 = 0x01,
  49. IWDT_DIVIDER_16 = 0x02,
  50. IWDT_DIVIDER_32 = 0x03,
  51. IWDT_DIVIDER_64 = 0x04,
  52. IWDT_DIVIDER_128 = 0x05,
  53. IWDT_DIVIDER_256 = 0x06
  54. }IWDT_DIVIDER_T;
  55. /**
  56. * @brief IWDT Flag
  57. */
  58. typedef enum
  59. {
  60. IWDT_FLAG_PSCU = BIT0,
  61. IWDT_FLAG_CNTU = BIT1
  62. }IWDT_FLAG_T;
  63. /**@} end of group IWDT_Enumerations*/
  64. /** @addtogroup IWDT_Fuctions Fuctions
  65. @{
  66. */
  67. /** Enable IWDT */
  68. void IWDT_Enable(void);
  69. /** Refresh IWDT */
  70. void IWDT_Refresh(void);
  71. /** Counter reload */
  72. void IWDT_ConfigReload(uint16_t reload);
  73. /** Divider */
  74. void IWDT_ConfigDivider(uint8_t div);
  75. /** Write Access */
  76. void IWDT_EnableWriteAccess(void);
  77. void IWDT_DisableWriteAccess(void);
  78. /** flag */
  79. uint8_t IWDT_ReadStatusFlag(uint16_t flag);
  80. /**@} end of group IWDT_Fuctions*/
  81. /**@} end of group IWDT_Driver */
  82. /**@} end of group Peripherals_Library*/
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif /* __APM32F10X_IWDT_H */