M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
wwdt.h
Go to the documentation of this file.
1/**************************************************************************/
8#ifndef __WWDT_H__
9#define __WWDT_H__
10
11#ifdef __cplusplus
12extern "C"
13{
14#endif
15
16
28/*---------------------------------------------------------------------------------------------------------*/
29/* WWDT Prescale Period Constant Definitions */
30/*---------------------------------------------------------------------------------------------------------*/
31#define WWDT_PRESCALER_1 (0 << WWDT_CTL_PSCSEL_Pos)
32#define WWDT_PRESCALER_2 (1 << WWDT_CTL_PSCSEL_Pos)
33#define WWDT_PRESCALER_4 (2 << WWDT_CTL_PSCSEL_Pos)
34#define WWDT_PRESCALER_8 (3 << WWDT_CTL_PSCSEL_Pos)
35#define WWDT_PRESCALER_16 (4 << WWDT_CTL_PSCSEL_Pos)
36#define WWDT_PRESCALER_32 (5 << WWDT_CTL_PSCSEL_Pos)
37#define WWDT_PRESCALER_64 (6 << WWDT_CTL_PSCSEL_Pos)
38#define WWDT_PRESCALER_128 (7 << WWDT_CTL_PSCSEL_Pos)
39#define WWDT_PRESCALER_192 (8 << WWDT_CTL_PSCSEL_Pos)
40#define WWDT_PRESCALER_256 (9 << WWDT_CTL_PSCSEL_Pos)
41#define WWDT_PRESCALER_384 (10 << WWDT_CTL_PSCSEL_Pos)
42#define WWDT_PRESCALER_512 (11 << WWDT_CTL_PSCSEL_Pos)
43#define WWDT_PRESCALER_768 (12 << WWDT_CTL_PSCSEL_Pos)
44#define WWDT_PRESCALER_1024 (13 << WWDT_CTL_PSCSEL_Pos)
45#define WWDT_PRESCALER_1536 (14 << WWDT_CTL_PSCSEL_Pos)
46#define WWDT_PRESCALER_2048 (15 << WWDT_CTL_PSCSEL_Pos)
48/*---------------------------------------------------------------------------------------------------------*/
49/* WWDT Reload Counter Keyword Constant Definitions */
50/*---------------------------------------------------------------------------------------------------------*/
51#define WWDT_RELOAD_WORD (0x00005AA5) /* end of group WWDT_EXPORTED_CONSTANTS */
54
55
69#define WWDT_CLEAR_RESET_FLAG() (WWDT->STATUS = (WWDT->STATUS & ~WWDT_STATUS_WWDTIF_Msk) | WWDT_STATUS_WWDTRF_Msk)
70
80#define WWDT_CLEAR_INT_FLAG() (WWDT->STATUS = (WWDT->STATUS & ~WWDT_STATUS_WWDTRF_Msk) | WWDT_STATUS_WWDTIF_Msk)
81
92#define WWDT_GET_RESET_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTRF_Msk)? 1 : 0)
93
104#define WWDT_GET_INT_FLAG() ((WWDT->STATUS & WWDT_STATUS_WWDTIF_Msk)? 1 : 0)
105
115#define WWDT_GET_COUNTER() (WWDT->CNT)
116
129#define WWDT_RELOAD_COUNTER() (WWDT->RLDCNT = WWDT_RELOAD_WORD)
130
131void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt);
132 /* end of group WWDT_EXPORTED_FUNCTIONS */
134 /* end of group WWDT_Driver */
136 /* end of group Standard_Driver */
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif //__WWDT_H__
144
void WWDT_Open(uint32_t u32PreScale, uint32_t u32CmpValue, uint32_t u32EnableInt)
Open WWDT and start counting.
Definition: wwdt.c:51