gd32f10x_iwdg.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /**
  2. ******************************************************************************
  3. * @brief IWDG header file of the firmware library.
  4. ******************************************************************************
  5. */
  6. /* Define to prevent recursive inclusion -------------------------------------*/
  7. #ifndef __GD32F10X_IWDG_H
  8. #define __GD32F10X_IWDG_H
  9. /* Exported macro ------------------------------------------------------------*/
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /* Includes ------------------------------------------------------------------*/
  14. #include "gd32f10x.h"
  15. /** @addtogroup GD32F10x_Firmware
  16. * @{
  17. */
  18. /** @defgroup IWDG
  19. * @{
  20. */
  21. /** @defgroup IWDG_Exported_Constants
  22. * @{
  23. */
  24. /** @defgroup IWDG_WriteAccess
  25. * @{
  26. */
  27. #define IWDG_WRITEACCESS_ENABLE ((uint16_t)0x5555)
  28. #define IWDG_WRITEACCESS_DISABLE ((uint16_t)0x0000)
  29. /**
  30. * @}
  31. */
  32. /** @defgroup IWDG_prescaler
  33. * @{
  34. */
  35. #define IWDG_PRESCALER_4 ((uint8_t)0x00)
  36. #define IWDG_PRESCALER_8 ((uint8_t)0x01)
  37. #define IWDG_PRESCALER_16 ((uint8_t)0x02)
  38. #define IWDG_PRESCALER_32 ((uint8_t)0x03)
  39. #define IWDG_PRESCALER_64 ((uint8_t)0x04)
  40. #define IWDG_PRESCALER_128 ((uint8_t)0x05)
  41. #define IWDG_PRESCALER_256 ((uint8_t)0x06)
  42. /**
  43. * @}
  44. */
  45. /** @defgroup IWDG_Flag
  46. * @{
  47. */
  48. #define IWDG_BIT_PUD IWDG_STR_PUD
  49. #define IWDG_BIT_RUD IWDG_STR_RUD
  50. #define IWDG_BIT_WUD IWDG_STR_WUD
  51. /**
  52. * @}
  53. */
  54. /**
  55. * @}
  56. */
  57. /** @defgroup IWDG_Exported_functions
  58. * @{
  59. */
  60. /* Prescaler and Counter configuration functions ******************************/
  61. void IWDG_Write_Enable(uint16_t IWDG_WriteAccess);
  62. void IWDG_SetPrescaler(uint8_t PrescalerValue);
  63. void IWDG_SetReloadValue(uint16_t ReloadValue);
  64. void IWDG_ReloadCounter(void);
  65. /* IWDG activation function ***************************************************/
  66. void IWDG_Enable(void);
  67. /* Flag management function ***************************************************/
  68. TypeState IWDG_GetBitState(uint16_t IWDG_FLAG);
  69. /**
  70. * @}
  71. */
  72. #ifdef __cplusplus
  73. }
  74. #endif
  75. #endif /* __IWDG_GD32F10X_H */
  76. /**
  77. * @}
  78. */
  79. /**
  80. * @}
  81. */