uc-sdk
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
stm32f10x_iwdg.c
Go to the documentation of this file.
1
22
/* Includes ------------------------------------------------------------------*/
23
#include "
stm32f10x_iwdg.h
"
24
46
/* ---------------------- IWDG registers bit mask ----------------------------*/
47
48
/* KR register bit mask */
49
#define KR_KEY_Reload ((uint16_t)0xAAAA)
50
#define KR_KEY_Enable ((uint16_t)0xCCCC)
51
92
void
IWDG_WriteAccessCmd
(uint16_t IWDG_WriteAccess)
93
{
94
/* Check the parameters */
95
assert_param
(
IS_IWDG_WRITE_ACCESS
(IWDG_WriteAccess));
96
IWDG
->KR = IWDG_WriteAccess;
97
}
98
112
void
IWDG_SetPrescaler
(uint8_t IWDG_Prescaler)
113
{
114
/* Check the parameters */
115
assert_param
(
IS_IWDG_PRESCALER
(IWDG_Prescaler));
116
IWDG
->PR = IWDG_Prescaler;
117
}
118
125
void
IWDG_SetReload
(uint16_t Reload)
126
{
127
/* Check the parameters */
128
assert_param
(
IS_IWDG_RELOAD
(Reload));
129
IWDG
->RLR = Reload;
130
}
131
138
void
IWDG_ReloadCounter
(
void
)
139
{
140
IWDG
->KR =
KR_KEY_Reload
;
141
}
142
148
void
IWDG_Enable
(
void
)
149
{
150
IWDG
->KR =
KR_KEY_Enable
;
151
}
152
161
FlagStatus
IWDG_GetFlagStatus
(uint16_t IWDG_FLAG)
162
{
163
FlagStatus
bitstatus =
RESET
;
164
/* Check the parameters */
165
assert_param
(
IS_IWDG_FLAG
(IWDG_FLAG));
166
if
((
IWDG
->SR & IWDG_FLAG) != (uint32_t)
RESET
)
167
{
168
bitstatus =
SET
;
169
}
170
else
171
{
172
bitstatus =
RESET
;
173
}
174
/* Return the flag status */
175
return
bitstatus;
176
}
177
190
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
arch
arm
stm32f10x
Drivers
source
stm32f10x_iwdg.c
Generated on Fri Nov 15 2013 05:00:18 for uc-sdk by
1.8.4