1 |
608 |
jeremybenn |
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
|
2 |
|
|
* File Name : stm32f10x_iwdg.h
|
3 |
|
|
* Author : MCD Application Team
|
4 |
|
|
* Date First Issued : 09/29/2006
|
5 |
|
|
* Description : This file contains all the functions prototypes for the
|
6 |
|
|
* IWDG firmware library.
|
7 |
|
|
********************************************************************************
|
8 |
|
|
* History:
|
9 |
|
|
* 04/02/2007: V0.2
|
10 |
|
|
* 02/05/2007: V0.1
|
11 |
|
|
* 09/29/2006: V0.01
|
12 |
|
|
********************************************************************************
|
13 |
|
|
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
14 |
|
|
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
|
15 |
|
|
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
|
16 |
|
|
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
|
17 |
|
|
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
|
18 |
|
|
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
19 |
|
|
*******************************************************************************/
|
20 |
|
|
|
21 |
|
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
22 |
|
|
#ifndef __STM32F10x_IWDG_H
|
23 |
|
|
#define __STM32F10x_IWDG_H
|
24 |
|
|
|
25 |
|
|
/* Includes ------------------------------------------------------------------*/
|
26 |
|
|
#include "stm32f10x_map.h"
|
27 |
|
|
|
28 |
|
|
/* Exported types ------------------------------------------------------------*/
|
29 |
|
|
/* Exported constants --------------------------------------------------------*/
|
30 |
|
|
/* Write access to IWDG_PR and IWDG_RLR registers */
|
31 |
|
|
#define IWDG_WriteAccess_Enable ((u16)0x5555)
|
32 |
|
|
#define IWDG_WriteAccess_Disable ((u16)0x0000)
|
33 |
|
|
|
34 |
|
|
#define IS_IWDG_WRITE_ACCESS(ACCESS) ((ACCESS == IWDG_WriteAccess_Enable) || \
|
35 |
|
|
(ACCESS == IWDG_WriteAccess_Disable))
|
36 |
|
|
|
37 |
|
|
/* IWDG prescaler */
|
38 |
|
|
#define IWDG_Prescaler_4 ((u8)0x00)
|
39 |
|
|
#define IWDG_Prescaler_8 ((u8)0x01)
|
40 |
|
|
#define IWDG_Prescaler_16 ((u8)0x02)
|
41 |
|
|
#define IWDG_Prescaler_32 ((u8)0x03)
|
42 |
|
|
#define IWDG_Prescaler_64 ((u8)0x04)
|
43 |
|
|
#define IWDG_Prescaler_128 ((u8)0x05)
|
44 |
|
|
#define IWDG_Prescaler_256 ((u8)0x06)
|
45 |
|
|
|
46 |
|
|
#define IS_IWDG_PRESCALER(PRESCALER) ((PRESCALER == IWDG_Prescaler_4) || \
|
47 |
|
|
(PRESCALER == IWDG_Prescaler_8) || \
|
48 |
|
|
(PRESCALER == IWDG_Prescaler_16) || \
|
49 |
|
|
(PRESCALER == IWDG_Prescaler_32) || \
|
50 |
|
|
(PRESCALER == IWDG_Prescaler_64) || \
|
51 |
|
|
(PRESCALER == IWDG_Prescaler_128)|| \
|
52 |
|
|
(PRESCALER == IWDG_Prescaler_256))
|
53 |
|
|
|
54 |
|
|
/* IWDG Flag */
|
55 |
|
|
#define IWDG_FLAG_PVU ((u16)0x0001)
|
56 |
|
|
#define IWDG_FLAG_RVU ((u16)0x0002)
|
57 |
|
|
|
58 |
|
|
#define IS_IWDG_FLAG(FLAG) ((FLAG == IWDG_FLAG_PVU) || (FLAG == IWDG_FLAG_RVU))
|
59 |
|
|
|
60 |
|
|
#define IS_IWDG_RELOAD(RELOAD) (RELOAD <= 0xFFF)
|
61 |
|
|
|
62 |
|
|
/* Exported macro ------------------------------------------------------------*/
|
63 |
|
|
/* Exported functions ------------------------------------------------------- */
|
64 |
|
|
void IWDG_WriteAccessCmd(u16 IWDG_WriteAccess);
|
65 |
|
|
void IWDG_SetPrescaler(u8 IWDG_Prescaler);
|
66 |
|
|
void IWDG_SetReload(u16 Reload);
|
67 |
|
|
void IWDG_ReloadCounter(void);
|
68 |
|
|
void IWDG_Enable(void);
|
69 |
|
|
FlagStatus IWDG_GetFlagStatus(u16 IWDG_FLAG);
|
70 |
|
|
|
71 |
|
|
#endif /* __STM32F10x_IWDG_H */
|
72 |
|
|
|
73 |
|
|
/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
|