ch32v30x_iwdg.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : ch32v30x_iwdg.h
  3. * Author : WCH
  4. * Version : V1.0.0
  5. * Date : 2021/06/06
  6. * Description : This file contains all the functions prototypes for the
  7. * IWDG firmware library.
  8. *********************************************************************************
  9. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  10. * Attention: This software (modified or not) and binary are used for
  11. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  12. *******************************************************************************/
  13. #ifndef __CH32V30x_IWDG_H
  14. #define __CH32V30x_IWDG_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "ch32v30x.h"
  19. /* IWDG_WriteAccess */
  20. #define IWDG_WriteAccess_Enable ((uint16_t)0x5555)
  21. #define IWDG_WriteAccess_Disable ((uint16_t)0x0000)
  22. /* IWDG_prescaler */
  23. #define IWDG_Prescaler_4 ((uint8_t)0x00)
  24. #define IWDG_Prescaler_8 ((uint8_t)0x01)
  25. #define IWDG_Prescaler_16 ((uint8_t)0x02)
  26. #define IWDG_Prescaler_32 ((uint8_t)0x03)
  27. #define IWDG_Prescaler_64 ((uint8_t)0x04)
  28. #define IWDG_Prescaler_128 ((uint8_t)0x05)
  29. #define IWDG_Prescaler_256 ((uint8_t)0x06)
  30. /* IWDG_Flag */
  31. #define IWDG_FLAG_PVU ((uint16_t)0x0001)
  32. #define IWDG_FLAG_RVU ((uint16_t)0x0002)
  33. void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess);
  34. void IWDG_SetPrescaler(uint8_t IWDG_Prescaler);
  35. void IWDG_SetReload(uint16_t Reload);
  36. void IWDG_ReloadCounter(void);
  37. void IWDG_Enable(void);
  38. FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif