1 |
582 |
jeremybenn |
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
|
2 |
|
|
* File Name : stm32f10x_bkp.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 |
|
|
* BKP 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_BKP_H
|
23 |
|
|
#define __STM32F10x_BKP_H
|
24 |
|
|
|
25 |
|
|
/* Includes ------------------------------------------------------------------*/
|
26 |
|
|
#include "stm32f10x_map.h"
|
27 |
|
|
|
28 |
|
|
/* Exported types ------------------------------------------------------------*/
|
29 |
|
|
/* Exported constants --------------------------------------------------------*/
|
30 |
|
|
/* Tamper Pin active level*/
|
31 |
|
|
#define BKP_TamperPinLevel_High ((u16)0x0000)
|
32 |
|
|
#define BKP_TamperPinLevel_Low ((u16)0x0001)
|
33 |
|
|
|
34 |
|
|
#define IS_BKP_TAMPER_PIN_LEVEL(LEVEL) ((LEVEL == BKP_TamperPinLevel_High) || \
|
35 |
|
|
(LEVEL == BKP_TamperPinLevel_Low))
|
36 |
|
|
|
37 |
|
|
/* Data Backup Register */
|
38 |
|
|
#define BKP_DR1 ((u16)0x0004)
|
39 |
|
|
#define BKP_DR2 ((u16)0x0008)
|
40 |
|
|
#define BKP_DR3 ((u16)0x000C)
|
41 |
|
|
#define BKP_DR4 ((u16)0x0010)
|
42 |
|
|
#define BKP_DR5 ((u16)0x0014)
|
43 |
|
|
#define BKP_DR6 ((u16)0x0018)
|
44 |
|
|
#define BKP_DR7 ((u16)0x001C)
|
45 |
|
|
#define BKP_DR8 ((u16)0x0020)
|
46 |
|
|
#define BKP_DR9 ((u16)0x0024)
|
47 |
|
|
#define BKP_DR10 ((u16)0x0028)
|
48 |
|
|
|
49 |
|
|
#define IS_BKP_DR(DR) ((DR == BKP_DR1) || (DR == BKP_DR2) || (DR == BKP_DR3) || \
|
50 |
|
|
(DR == BKP_DR4) || (DR == BKP_DR5) || (DR == BKP_DR6) || \
|
51 |
|
|
(DR == BKP_DR7) || (DR == BKP_DR8) || (DR == BKP_DR9) || \
|
52 |
|
|
(DR == BKP_DR10))
|
53 |
|
|
|
54 |
|
|
#define IS_BKP_CALIBRATION_VALUE(VALUE) (VALUE <= 0x7F)
|
55 |
|
|
|
56 |
|
|
/* Exported macro ------------------------------------------------------------*/
|
57 |
|
|
/* Exported functions ------------------------------------------------------- */
|
58 |
|
|
void BKP_DeInit(void);
|
59 |
|
|
void BKP_TamperPinLevelConfig(u16 BKP_TamperPinLevel);
|
60 |
|
|
void BKP_TamperPinCmd(FunctionalState NewState);
|
61 |
|
|
void BKP_ITConfig(FunctionalState NewState);
|
62 |
|
|
void BKP_RTCCalibrationClockOutputCmd(FunctionalState NewState);
|
63 |
|
|
void BKP_SetRTCCalibrationValue(u8 CalibrationValue);
|
64 |
|
|
void BKP_WriteBackupRegister(u16 BKP_DR, u16 Data);
|
65 |
|
|
u16 BKP_ReadBackupRegister(u16 BKP_DR);
|
66 |
|
|
FlagStatus BKP_GetFlagStatus(void);
|
67 |
|
|
void BKP_ClearFlag(void);
|
68 |
|
|
ITStatus BKP_GetITStatus(void);
|
69 |
|
|
void BKP_ClearITPendingBit(void);
|
70 |
|
|
|
71 |
|
|
#endif /* __STM32F10x_BKP_H */
|
72 |
|
|
|
73 |
|
|
/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/
|