A bundled STM32F10x Std Periph and CMSIS library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

197 lines
7.4 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32f10x_bkp.h
  4. * @author MCD Application Team
  5. * @version V3.5.0
  6. * @date 11-March-2011
  7. * @brief This file contains all the functions prototypes for the BKP firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  13. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  14. * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  15. * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  16. * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  17. * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  18. *
  19. * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  20. ******************************************************************************
  21. */
  22. /* Define to prevent recursive inclusion -------------------------------------*/
  23. #ifndef __STM32F10x_BKP_H
  24. #define __STM32F10x_BKP_H
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Includes ------------------------------------------------------------------*/
  29. #include "stm32f10x.h"
  30. #include "stm32f10x_assert.h"
  31. /** @addtogroup STM32F10x_StdPeriph_Driver
  32. * @{
  33. */
  34. /** @addtogroup BKP
  35. * @{
  36. */
  37. /** @defgroup BKP_Exported_Types
  38. * @{
  39. */
  40. /**
  41. * @}
  42. */
  43. /** @defgroup BKP_Exported_Constants
  44. * @{
  45. */
  46. /** @defgroup Tamper_Pin_active_level
  47. * @{
  48. */
  49. #define BKP_TamperPinLevel_High ((uint16_t)0x0000)
  50. #define BKP_TamperPinLevel_Low ((uint16_t)0x0001)
  51. #define IS_BKP_TAMPER_PIN_LEVEL(LEVEL) (((LEVEL) == BKP_TamperPinLevel_High) || \
  52. ((LEVEL) == BKP_TamperPinLevel_Low))
  53. /**
  54. * @}
  55. */
  56. /** @defgroup RTC_output_source_to_output_on_the_Tamper_pin
  57. * @{
  58. */
  59. #define BKP_RTCOutputSource_None ((uint16_t)0x0000)
  60. #define BKP_RTCOutputSource_CalibClock ((uint16_t)0x0080)
  61. #define BKP_RTCOutputSource_Alarm ((uint16_t)0x0100)
  62. #define BKP_RTCOutputSource_Second ((uint16_t)0x0300)
  63. #define IS_BKP_RTC_OUTPUT_SOURCE(SOURCE) (((SOURCE) == BKP_RTCOutputSource_None) || \
  64. ((SOURCE) == BKP_RTCOutputSource_CalibClock) || \
  65. ((SOURCE) == BKP_RTCOutputSource_Alarm) || \
  66. ((SOURCE) == BKP_RTCOutputSource_Second))
  67. /**
  68. * @}
  69. */
  70. /** @defgroup Data_Backup_Register
  71. * @{
  72. */
  73. #define BKP_DR1 ((uint16_t)0x0004)
  74. #define BKP_DR2 ((uint16_t)0x0008)
  75. #define BKP_DR3 ((uint16_t)0x000C)
  76. #define BKP_DR4 ((uint16_t)0x0010)
  77. #define BKP_DR5 ((uint16_t)0x0014)
  78. #define BKP_DR6 ((uint16_t)0x0018)
  79. #define BKP_DR7 ((uint16_t)0x001C)
  80. #define BKP_DR8 ((uint16_t)0x0020)
  81. #define BKP_DR9 ((uint16_t)0x0024)
  82. #define BKP_DR10 ((uint16_t)0x0028)
  83. #define BKP_DR11 ((uint16_t)0x0040)
  84. #define BKP_DR12 ((uint16_t)0x0044)
  85. #define BKP_DR13 ((uint16_t)0x0048)
  86. #define BKP_DR14 ((uint16_t)0x004C)
  87. #define BKP_DR15 ((uint16_t)0x0050)
  88. #define BKP_DR16 ((uint16_t)0x0054)
  89. #define BKP_DR17 ((uint16_t)0x0058)
  90. #define BKP_DR18 ((uint16_t)0x005C)
  91. #define BKP_DR19 ((uint16_t)0x0060)
  92. #define BKP_DR20 ((uint16_t)0x0064)
  93. #define BKP_DR21 ((uint16_t)0x0068)
  94. #define BKP_DR22 ((uint16_t)0x006C)
  95. #define BKP_DR23 ((uint16_t)0x0070)
  96. #define BKP_DR24 ((uint16_t)0x0074)
  97. #define BKP_DR25 ((uint16_t)0x0078)
  98. #define BKP_DR26 ((uint16_t)0x007C)
  99. #define BKP_DR27 ((uint16_t)0x0080)
  100. #define BKP_DR28 ((uint16_t)0x0084)
  101. #define BKP_DR29 ((uint16_t)0x0088)
  102. #define BKP_DR30 ((uint16_t)0x008C)
  103. #define BKP_DR31 ((uint16_t)0x0090)
  104. #define BKP_DR32 ((uint16_t)0x0094)
  105. #define BKP_DR33 ((uint16_t)0x0098)
  106. #define BKP_DR34 ((uint16_t)0x009C)
  107. #define BKP_DR35 ((uint16_t)0x00A0)
  108. #define BKP_DR36 ((uint16_t)0x00A4)
  109. #define BKP_DR37 ((uint16_t)0x00A8)
  110. #define BKP_DR38 ((uint16_t)0x00AC)
  111. #define BKP_DR39 ((uint16_t)0x00B0)
  112. #define BKP_DR40 ((uint16_t)0x00B4)
  113. #define BKP_DR41 ((uint16_t)0x00B8)
  114. #define BKP_DR42 ((uint16_t)0x00BC)
  115. #define IS_BKP_DR(DR) (((DR) == BKP_DR1) || ((DR) == BKP_DR2) || ((DR) == BKP_DR3) || \
  116. ((DR) == BKP_DR4) || ((DR) == BKP_DR5) || ((DR) == BKP_DR6) || \
  117. ((DR) == BKP_DR7) || ((DR) == BKP_DR8) || ((DR) == BKP_DR9) || \
  118. ((DR) == BKP_DR10) || ((DR) == BKP_DR11) || ((DR) == BKP_DR12) || \
  119. ((DR) == BKP_DR13) || ((DR) == BKP_DR14) || ((DR) == BKP_DR15) || \
  120. ((DR) == BKP_DR16) || ((DR) == BKP_DR17) || ((DR) == BKP_DR18) || \
  121. ((DR) == BKP_DR19) || ((DR) == BKP_DR20) || ((DR) == BKP_DR21) || \
  122. ((DR) == BKP_DR22) || ((DR) == BKP_DR23) || ((DR) == BKP_DR24) || \
  123. ((DR) == BKP_DR25) || ((DR) == BKP_DR26) || ((DR) == BKP_DR27) || \
  124. ((DR) == BKP_DR28) || ((DR) == BKP_DR29) || ((DR) == BKP_DR30) || \
  125. ((DR) == BKP_DR31) || ((DR) == BKP_DR32) || ((DR) == BKP_DR33) || \
  126. ((DR) == BKP_DR34) || ((DR) == BKP_DR35) || ((DR) == BKP_DR36) || \
  127. ((DR) == BKP_DR37) || ((DR) == BKP_DR38) || ((DR) == BKP_DR39) || \
  128. ((DR) == BKP_DR40) || ((DR) == BKP_DR41) || ((DR) == BKP_DR42))
  129. #define IS_BKP_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7F)
  130. /**
  131. * @}
  132. */
  133. /**
  134. * @}
  135. */
  136. /** @defgroup BKP_Exported_Macros
  137. * @{
  138. */
  139. /**
  140. * @}
  141. */
  142. /** @defgroup BKP_Exported_Functions
  143. * @{
  144. */
  145. void BKP_DeInit(void);
  146. void BKP_TamperPinLevelConfig(uint16_t BKP_TamperPinLevel);
  147. void BKP_TamperPinCmd(FunctionalState NewState);
  148. void BKP_ITConfig(FunctionalState NewState);
  149. void BKP_RTCOutputConfig(uint16_t BKP_RTCOutputSource);
  150. void BKP_SetRTCCalibrationValue(uint8_t CalibrationValue);
  151. void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data);
  152. uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR);
  153. FlagStatus BKP_GetFlagStatus(void);
  154. void BKP_ClearFlag(void);
  155. ITStatus BKP_GetITStatus(void);
  156. void BKP_ClearITPendingBit(void);
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #endif /* __STM32F10x_BKP_H */
  161. /**
  162. * @}
  163. */
  164. /**
  165. * @}
  166. */
  167. /**
  168. * @}
  169. */
  170. /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/