MG32L003 Standard Peripherals Firmware Library

mg32l003_iwdg.h
浏览该文件的文档.
1
10 /* Define to prevent recursive inclusion -------------------------------------*/
11 #ifndef __MG32L003_IWDG_H
12 #define __MG32L003_IWDG_H
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /* Includes ------------------------------------------------------------------*/
19 #include "mg32l003.h"
20
29 /* Exported types ------------------------------------------------------------*/
30 /* Exported constants --------------------------------------------------------*/
31
39 #define IWDG_UNLOCK_KEY ((uint32_t)0x55AA6699)
40 #define IWDG_LOCK_KEY ((uint32_t)0x55AA6698)
41 #define IWDG_START_ENABLE ((uint32_t)0x00000055)
42 #define IWDG_RELOAD_REFRESH ((uint32_t)0x000000AA)
44 #define IWDG_MODE_RESET ((uint32_t)0x00000000)
45 #define IWDG_MODE_INT ((uint32_t)0x00000010)
46 #define IWDG_MODE_MASK ((uint32_t)0x00000010)
48 #define IWDG_IT_DISABLE ((uint32_t)0x00000000)
49 #define IWDG_IT_ENABLE ((uint32_t)0x00000100)
50 #define IWDG_IT_MASK ((uint32_t)0x00000100)
52 #define IWDG_RLR_MAX IWDG_RLOAD_IWDGRLOAD
58 #define IWDG_IT_GOVF IWDG_SR_IWDGOVF_Msk
59
67 /* Exported macro ------------------------------------------------------------*/
68
69 #define IWDG_ENABLE_WRITE_ACCESS() \
70 do { \
71 IWDG->UNLOCK = IWDG_UNLOCK_KEY; \
72 } while (0)
73
74 #define IWDG_DISABLE_WRITE_ACCESS() \
75 do { \
76 IWDG->UNLOCK = IWDG_LOCK_KEY; \
77 } while (0)
78
79 /* Exported functions --------------------------------------------------------*/
80
81 void IWDG_Init(uint32_t IWDG_Config, FunctionalState NewState);
82 void IWDG_SetReload(uint32_t Reload);
83 void IWDG_ReloadCounter(void);
84 void IWDG_Start(void);
85 FlagStatus IWDG_GetITStatus(uint32_t IWDG_IT);
86 void IWDG_ClearITPendingBit(uint32_t IWDG_IT);
87
96 #ifdef __cplusplus
97 }
98 #endif
99
100 #endif /*__MG32L003_IWDG_H */
IWDG_GetITStatus
FlagStatus IWDG_GetITStatus(uint32_t IWDG_IT)
Checks whether the specified IWDG interrupt flag is set or not.
Definition: mg32l003_iwdg.c:122
IWDG_SetReload
void IWDG_SetReload(uint32_t Reload)
Sets IWDG Reload value.
Definition: mg32l003_iwdg.c:81
IWDG_ReloadCounter
void IWDG_ReloadCounter(void)
Reloads IWDG counter with value defined in the reload register.
Definition: mg32l003_iwdg.c:93
IWDG_ClearITPendingBit
void IWDG_ClearITPendingBit(uint32_t IWDG_IT)
Clears the IWDG's interrupt pending bits.
Definition: mg32l003_iwdg.c:145
IWDG_Start
void IWDG_Start(void)
IWDG starts running.
Definition: mg32l003_iwdg.c:108
IWDG_Init
void IWDG_Init(uint32_t IWDG_Config, FunctionalState NewState)
Initialize the IWDG according to the specified IWDG_Config.
Definition: mg32l003_iwdg.c:45