apm32f10x_iwdt.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.2
  7. *
  8. * @date 2022-01-05
  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 usefull 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. #ifndef __APM32F10X_IWDT_H
  26. #define __APM32F10X_IWDT_H
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. #include "apm32f10x.h"
  31. /** @addtogroup Peripherals_Library Standard Peripheral Library
  32. @{
  33. */
  34. /** @addtogroup IWDT_Driver IWDT Driver
  35. @{
  36. */
  37. /** @addtogroup IWDT_Enumerations Enumerations
  38. @{
  39. */
  40. /**
  41. * @brief IWDT KEYWORD define
  42. */
  43. typedef enum
  44. {
  45. IWDT_KEYWORD_RELOAD = 0xAAAA,
  46. IWDT_KEYWORD_ENABLE = 0xCCCC
  47. } IWDT_KEYWORD_T;
  48. /**
  49. * @brief IWDT Write Access define
  50. */
  51. typedef enum
  52. {
  53. IWDT_WRITEACCESS_ENABLE = 0x5555,
  54. IWDT_WRITEACCESS_DISABLE = 0x0000
  55. } IWDT_WRITEACCESS_T;
  56. /**
  57. * @brief IWDT Divider
  58. */
  59. typedef enum
  60. {
  61. IWDT_DIVIDER_4 = 0x00,
  62. IWDT_DIVIDER_8 = 0x01,
  63. IWDT_DIVIDER_16 = 0x02,
  64. IWDT_DIVIDER_32 = 0x03,
  65. IWDT_DIVIDER_64 = 0x04,
  66. IWDT_DIVIDER_128 = 0x05,
  67. IWDT_DIVIDER_256 = 0x06
  68. } IWDT_DIVIDER_T;
  69. /**
  70. * @brief IWDT Flag
  71. */
  72. typedef enum
  73. {
  74. IWDT_FLAG_PSCU = BIT0,
  75. IWDT_FLAG_CNTU = BIT1
  76. } IWDT_FLAG_T;
  77. /**@} end of group IWDT_Enumerations*/
  78. /** @addtogroup IWDT_Fuctions Fuctions
  79. @{
  80. */
  81. /** Enable IWDT */
  82. void IWDT_Enable(void);
  83. /** Refresh IWDT */
  84. void IWDT_Refresh(void);
  85. /** Counter reload */
  86. void IWDT_ConfigReload(uint16_t reload);
  87. /** Divider */
  88. void IWDT_ConfigDivider(uint8_t div);
  89. /** Write Access */
  90. void IWDT_EnableWriteAccess(void);
  91. void IWDT_DisableWriteAccess(void);
  92. /** flag */
  93. uint8_t IWDT_ReadStatusFlag(uint16_t flag);
  94. /**@} end of group IWDT_Fuctions*/
  95. /**@} end of group IWDT_Driver*/
  96. /**@} end of group Peripherals_Library*/
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100. #endif /* __APM32F10X_IWDT_H */