STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_bkp.h
Go to the documentation of this file.
00001 
00023 /* Define to prevent recursive inclusion -------------------------------------*/
00024 #ifndef __STM32F10x_BKP_H
00025 #define __STM32F10x_BKP_H
00026 
00027 #ifdef __cplusplus
00028  extern "C" {
00029 #endif
00030 
00031 /* Includes ------------------------------------------------------------------*/
00032 #include "stm32f10x.h"
00033 
00058 #define BKP_TamperPinLevel_High           ((uint16_t)0x0000)
00059 #define BKP_TamperPinLevel_Low            ((uint16_t)0x0001)
00060 #define IS_BKP_TAMPER_PIN_LEVEL(LEVEL) (((LEVEL) == BKP_TamperPinLevel_High) || \
00061                                         ((LEVEL) == BKP_TamperPinLevel_Low))
00062 
00070 #define BKP_RTCOutputSource_None          ((uint16_t)0x0000)
00071 #define BKP_RTCOutputSource_CalibClock    ((uint16_t)0x0080)
00072 #define BKP_RTCOutputSource_Alarm         ((uint16_t)0x0100)
00073 #define BKP_RTCOutputSource_Second        ((uint16_t)0x0300)
00074 #define IS_BKP_RTC_OUTPUT_SOURCE(SOURCE) (((SOURCE) == BKP_RTCOutputSource_None) || \
00075                                           ((SOURCE) == BKP_RTCOutputSource_CalibClock) || \
00076                                           ((SOURCE) == BKP_RTCOutputSource_Alarm) || \
00077                                           ((SOURCE) == BKP_RTCOutputSource_Second))
00078 
00086 #define BKP_DR1                           ((uint16_t)0x0004)
00087 #define BKP_DR2                           ((uint16_t)0x0008)
00088 #define BKP_DR3                           ((uint16_t)0x000C)
00089 #define BKP_DR4                           ((uint16_t)0x0010)
00090 #define BKP_DR5                           ((uint16_t)0x0014)
00091 #define BKP_DR6                           ((uint16_t)0x0018)
00092 #define BKP_DR7                           ((uint16_t)0x001C)
00093 #define BKP_DR8                           ((uint16_t)0x0020)
00094 #define BKP_DR9                           ((uint16_t)0x0024)
00095 #define BKP_DR10                          ((uint16_t)0x0028)
00096 #define BKP_DR11                          ((uint16_t)0x0040)
00097 #define BKP_DR12                          ((uint16_t)0x0044)
00098 #define BKP_DR13                          ((uint16_t)0x0048)
00099 #define BKP_DR14                          ((uint16_t)0x004C)
00100 #define BKP_DR15                          ((uint16_t)0x0050)
00101 #define BKP_DR16                          ((uint16_t)0x0054)
00102 #define BKP_DR17                          ((uint16_t)0x0058)
00103 #define BKP_DR18                          ((uint16_t)0x005C)
00104 #define BKP_DR19                          ((uint16_t)0x0060)
00105 #define BKP_DR20                          ((uint16_t)0x0064)
00106 #define BKP_DR21                          ((uint16_t)0x0068)
00107 #define BKP_DR22                          ((uint16_t)0x006C)
00108 #define BKP_DR23                          ((uint16_t)0x0070)
00109 #define BKP_DR24                          ((uint16_t)0x0074)
00110 #define BKP_DR25                          ((uint16_t)0x0078)
00111 #define BKP_DR26                          ((uint16_t)0x007C)
00112 #define BKP_DR27                          ((uint16_t)0x0080)
00113 #define BKP_DR28                          ((uint16_t)0x0084)
00114 #define BKP_DR29                          ((uint16_t)0x0088)
00115 #define BKP_DR30                          ((uint16_t)0x008C)
00116 #define BKP_DR31                          ((uint16_t)0x0090)
00117 #define BKP_DR32                          ((uint16_t)0x0094)
00118 #define BKP_DR33                          ((uint16_t)0x0098)
00119 #define BKP_DR34                          ((uint16_t)0x009C)
00120 #define BKP_DR35                          ((uint16_t)0x00A0)
00121 #define BKP_DR36                          ((uint16_t)0x00A4)
00122 #define BKP_DR37                          ((uint16_t)0x00A8)
00123 #define BKP_DR38                          ((uint16_t)0x00AC)
00124 #define BKP_DR39                          ((uint16_t)0x00B0)
00125 #define BKP_DR40                          ((uint16_t)0x00B4)
00126 #define BKP_DR41                          ((uint16_t)0x00B8)
00127 #define BKP_DR42                          ((uint16_t)0x00BC)
00128 
00129 #define IS_BKP_DR(DR) (((DR) == BKP_DR1)  || ((DR) == BKP_DR2)  || ((DR) == BKP_DR3)  || \
00130                        ((DR) == BKP_DR4)  || ((DR) == BKP_DR5)  || ((DR) == BKP_DR6)  || \
00131                        ((DR) == BKP_DR7)  || ((DR) == BKP_DR8)  || ((DR) == BKP_DR9)  || \
00132                        ((DR) == BKP_DR10) || ((DR) == BKP_DR11) || ((DR) == BKP_DR12) || \
00133                        ((DR) == BKP_DR13) || ((DR) == BKP_DR14) || ((DR) == BKP_DR15) || \
00134                        ((DR) == BKP_DR16) || ((DR) == BKP_DR17) || ((DR) == BKP_DR18) || \
00135                        ((DR) == BKP_DR19) || ((DR) == BKP_DR20) || ((DR) == BKP_DR21) || \
00136                        ((DR) == BKP_DR22) || ((DR) == BKP_DR23) || ((DR) == BKP_DR24) || \
00137                        ((DR) == BKP_DR25) || ((DR) == BKP_DR26) || ((DR) == BKP_DR27) || \
00138                        ((DR) == BKP_DR28) || ((DR) == BKP_DR29) || ((DR) == BKP_DR30) || \
00139                        ((DR) == BKP_DR31) || ((DR) == BKP_DR32) || ((DR) == BKP_DR33) || \
00140                        ((DR) == BKP_DR34) || ((DR) == BKP_DR35) || ((DR) == BKP_DR36) || \
00141                        ((DR) == BKP_DR37) || ((DR) == BKP_DR38) || ((DR) == BKP_DR39) || \
00142                        ((DR) == BKP_DR40) || ((DR) == BKP_DR41) || ((DR) == BKP_DR42))
00143 
00144 #define IS_BKP_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7F)
00145 
00165 void BKP_DeInit(void);
00166 void BKP_TamperPinLevelConfig(uint16_t BKP_TamperPinLevel);
00167 void BKP_TamperPinCmd(FunctionalState NewState);
00168 void BKP_ITConfig(FunctionalState NewState);
00169 void BKP_RTCOutputConfig(uint16_t BKP_RTCOutputSource);
00170 void BKP_SetRTCCalibrationValue(uint8_t CalibrationValue);
00171 void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data);
00172 uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR);
00173 FlagStatus BKP_GetFlagStatus(void);
00174 void BKP_ClearFlag(void);
00175 ITStatus BKP_GetITStatus(void);
00176 void BKP_ClearITPendingBit(void);
00177 
00178 #ifdef __cplusplus
00179 }
00180 #endif
00181 
00182 #endif /* __STM32F10x_BKP_H */
00183 
00195 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/