gd32f10x_iwdg.h 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
/**
  ******************************************************************************
  * @brief   IWDG header file of the firmware library.
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __GD32F10X_IWDG_H
#define __GD32F10X_IWDG_H

/* Exported macro ------------------------------------------------------------*/

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "gd32f10x.h"

/** @addtogroup GD32F10x_Firmware
  * @{
  */

/** @defgroup IWDG
  * @{
  */

/** @defgroup IWDG_Exported_Constants
  * @{
  */

/** @defgroup IWDG_WriteAccess
  * @{
  */
#define IWDG_WRITEACCESS_ENABLE     ((uint16_t)0x5555)
#define IWDG_WRITEACCESS_DISABLE    ((uint16_t)0x0000)

/**
  * @}
  */

/** @defgroup IWDG_prescaler
  * @{
  */
#define IWDG_PRESCALER_4            ((uint8_t)0x00)
#define IWDG_PRESCALER_8            ((uint8_t)0x01)
#define IWDG_PRESCALER_16           ((uint8_t)0x02)
#define IWDG_PRESCALER_32           ((uint8_t)0x03)
#define IWDG_PRESCALER_64           ((uint8_t)0x04)
#define IWDG_PRESCALER_128          ((uint8_t)0x05)
#define IWDG_PRESCALER_256          ((uint8_t)0x06)

/**
  * @}
  */

/** @defgroup IWDG_Flag
  * @{
  */
#define IWDG_BIT_PUD                IWDG_STR_PUD
#define IWDG_BIT_RUD                IWDG_STR_RUD
#define IWDG_BIT_WUD                IWDG_STR_WUD

/**
  * @}
  */

/**
  * @}
  */

/** @defgroup IWDG_Exported_functions
  * @{
  */
/* Prescaler and Counter configuration functions ******************************/
void IWDG_Write_Enable(uint16_t IWDG_WriteAccess);
void IWDG_SetPrescaler(uint8_t PrescalerValue);
void IWDG_SetReloadValue(uint16_t ReloadValue);
void IWDG_ReloadCounter(void);

/* IWDG activation function ***************************************************/
void IWDG_Enable(void);

/* Flag management function ***************************************************/
TypeState IWDG_GetBitState(uint16_t IWDG_FLAG);

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* __IWDG_GD32F10X_H */

/**
  * @}
  */

/**
  * @}
  */