apm32f10x_iwdt.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.4
  7. *
  8. * @date 2022-12-01
  9. *
  10. * @attention
  11. *
  12. * Copyright (C) 2020-2022 Geehy Semiconductor
  13. *
  14. * You may not use this file except in compliance with the
  15. * GEEHY COPYRIGHT NOTICE (GEEHY SOFTWARE PACKAGE LICENSE).
  16. *
  17. * The program is only for reference, which is distributed in the hope
  18. * that it will be useful and instructional for customers to develop
  19. * their software. Unless required by applicable law or agreed to in
  20. * writing, the program is distributed on an "AS IS" BASIS, WITHOUT
  21. * ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
  22. * See the GEEHY SOFTWARE PACKAGE LICENSE for the governing permissions
  23. * and limitations under the License.
  24. */
  25. /* Define to prevent recursive inclusion */
  26. #ifndef __APM32F10X_IWDT_H
  27. #define __APM32F10X_IWDT_H
  28. /* Includes */
  29. #include "apm32f10x.h"
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33. /** @addtogroup APM32F10x_StdPeriphDriver
  34. @{
  35. */
  36. /** @addtogroup IWDT_Driver IWDT Driver
  37. @{
  38. */
  39. /** @defgroup IWDT_Enumerations Enumerations
  40. @{
  41. */
  42. /**
  43. * @brief IWDT KEYWORD define
  44. */
  45. typedef enum
  46. {
  47. IWDT_KEYWORD_RELOAD = 0xAAAA,
  48. IWDT_KEYWORD_ENABLE = 0xCCCC
  49. } IWDT_KEYWORD_T;
  50. /**
  51. * @brief IWDT Write Access define
  52. */
  53. typedef enum
  54. {
  55. IWDT_WRITEACCESS_ENABLE = 0x5555,
  56. IWDT_WRITEACCESS_DISABLE = 0x0000
  57. } IWDT_WRITEACCESS_T;
  58. /**
  59. * @brief IWDT Divider
  60. */
  61. typedef enum
  62. {
  63. IWDT_DIVIDER_4 = 0x00,
  64. IWDT_DIVIDER_8 = 0x01,
  65. IWDT_DIVIDER_16 = 0x02,
  66. IWDT_DIVIDER_32 = 0x03,
  67. IWDT_DIVIDER_64 = 0x04,
  68. IWDT_DIVIDER_128 = 0x05,
  69. IWDT_DIVIDER_256 = 0x06
  70. } IWDT_DIVIDER_T;
  71. /**
  72. * @brief IWDT Flag
  73. */
  74. typedef enum
  75. {
  76. IWDT_FLAG_PSCU = BIT0,
  77. IWDT_FLAG_CNTU = BIT1
  78. } IWDT_FLAG_T;
  79. /**@} end of group IWDT_Enumerations*/
  80. /** @defgroup IWDT_Functions Functions
  81. @{
  82. */
  83. /* Enable IWDT */
  84. void IWDT_Enable(void);
  85. /* Refresh IWDT */
  86. void IWDT_Refresh(void);
  87. /* Counter reload */
  88. void IWDT_ConfigReload(uint16_t reload);
  89. /* Divider */
  90. void IWDT_ConfigDivider(uint8_t div);
  91. /* Write Access */
  92. void IWDT_EnableWriteAccess(void);
  93. void IWDT_DisableWriteAccess(void);
  94. /* flag */
  95. uint8_t IWDT_ReadStatusFlag(uint16_t flag);
  96. /**@} end of group IWDT_Functions*/
  97. /**@} end of group IWDT_Driver */
  98. /**@} end of group APM32F10x_StdPeriphDriver*/
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102. #endif /* __APM32F10X_IWDT_H */