mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Feb 03 09:30:05 2014 +0000
Revision:
84:f54042cbc282
Parent:
70:c1fbde68b492
Synchronized with git revision bbbd8699601c42149ccf0c37bc42bb6856ccc4c6

Full URL: https://github.com/mbedmicro/mbed/commit/bbbd8699601c42149ccf0c37bc42bb6856ccc4c6/

[NUCLEO_L152RE/F030_R8] SPI, I2C, Ticker, PWM updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 52:a51c77007319 1 /**
mbed_official 52:a51c77007319 2 ******************************************************************************
mbed_official 52:a51c77007319 3 * @file stm32f10x_bkp.h
mbed_official 52:a51c77007319 4 * @author MCD Application Team
mbed_official 84:f54042cbc282 5 * @version V3.6.1
mbed_official 84:f54042cbc282 6 * @date 05-March-2012
mbed_official 52:a51c77007319 7 * @brief This file contains all the functions prototypes for the BKP firmware
mbed_official 52:a51c77007319 8 * library.
mbed_official 70:c1fbde68b492 9 *******************************************************************************
mbed_official 70:c1fbde68b492 10 * Copyright (c) 2014, STMicroelectronics
mbed_official 70:c1fbde68b492 11 * All rights reserved.
mbed_official 70:c1fbde68b492 12 *
mbed_official 70:c1fbde68b492 13 * Redistribution and use in source and binary forms, with or without
mbed_official 70:c1fbde68b492 14 * modification, are permitted provided that the following conditions are met:
mbed_official 70:c1fbde68b492 15 *
mbed_official 70:c1fbde68b492 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 70:c1fbde68b492 17 * this list of conditions and the following disclaimer.
mbed_official 70:c1fbde68b492 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 70:c1fbde68b492 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 70:c1fbde68b492 20 * and/or other materials provided with the distribution.
mbed_official 70:c1fbde68b492 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 70:c1fbde68b492 22 * may be used to endorse or promote products derived from this software
mbed_official 70:c1fbde68b492 23 * without specific prior written permission.
mbed_official 70:c1fbde68b492 24 *
mbed_official 70:c1fbde68b492 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 70:c1fbde68b492 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 70:c1fbde68b492 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 70:c1fbde68b492 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 70:c1fbde68b492 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 70:c1fbde68b492 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 70:c1fbde68b492 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 70:c1fbde68b492 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 70:c1fbde68b492 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 70:c1fbde68b492 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 70:c1fbde68b492 35 *******************************************************************************
mbed_official 70:c1fbde68b492 36 */
mbed_official 52:a51c77007319 37
mbed_official 52:a51c77007319 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 52:a51c77007319 39 #ifndef __STM32F10x_BKP_H
mbed_official 52:a51c77007319 40 #define __STM32F10x_BKP_H
mbed_official 52:a51c77007319 41
mbed_official 52:a51c77007319 42 #ifdef __cplusplus
mbed_official 52:a51c77007319 43 extern "C" {
mbed_official 52:a51c77007319 44 #endif
mbed_official 52:a51c77007319 45
mbed_official 52:a51c77007319 46 /* Includes ------------------------------------------------------------------*/
mbed_official 52:a51c77007319 47 #include "stm32f10x.h"
mbed_official 52:a51c77007319 48
mbed_official 52:a51c77007319 49 /** @addtogroup STM32F10x_StdPeriph_Driver
mbed_official 52:a51c77007319 50 * @{
mbed_official 52:a51c77007319 51 */
mbed_official 52:a51c77007319 52
mbed_official 52:a51c77007319 53 /** @addtogroup BKP
mbed_official 52:a51c77007319 54 * @{
mbed_official 52:a51c77007319 55 */
mbed_official 52:a51c77007319 56
mbed_official 52:a51c77007319 57 /** @defgroup BKP_Exported_Types
mbed_official 52:a51c77007319 58 * @{
mbed_official 52:a51c77007319 59 */
mbed_official 52:a51c77007319 60
mbed_official 52:a51c77007319 61 /**
mbed_official 52:a51c77007319 62 * @}
mbed_official 52:a51c77007319 63 */
mbed_official 52:a51c77007319 64
mbed_official 52:a51c77007319 65 /** @defgroup BKP_Exported_Constants
mbed_official 52:a51c77007319 66 * @{
mbed_official 52:a51c77007319 67 */
mbed_official 52:a51c77007319 68
mbed_official 52:a51c77007319 69 /** @defgroup Tamper_Pin_active_level
mbed_official 52:a51c77007319 70 * @{
mbed_official 52:a51c77007319 71 */
mbed_official 52:a51c77007319 72
mbed_official 52:a51c77007319 73 #define BKP_TamperPinLevel_High ((uint16_t)0x0000)
mbed_official 52:a51c77007319 74 #define BKP_TamperPinLevel_Low ((uint16_t)0x0001)
mbed_official 52:a51c77007319 75 #define IS_BKP_TAMPER_PIN_LEVEL(LEVEL) (((LEVEL) == BKP_TamperPinLevel_High) || \
mbed_official 52:a51c77007319 76 ((LEVEL) == BKP_TamperPinLevel_Low))
mbed_official 52:a51c77007319 77 /**
mbed_official 52:a51c77007319 78 * @}
mbed_official 52:a51c77007319 79 */
mbed_official 52:a51c77007319 80
mbed_official 52:a51c77007319 81 /** @defgroup RTC_output_source_to_output_on_the_Tamper_pin
mbed_official 52:a51c77007319 82 * @{
mbed_official 52:a51c77007319 83 */
mbed_official 52:a51c77007319 84
mbed_official 52:a51c77007319 85 #define BKP_RTCOutputSource_None ((uint16_t)0x0000)
mbed_official 52:a51c77007319 86 #define BKP_RTCOutputSource_CalibClock ((uint16_t)0x0080)
mbed_official 52:a51c77007319 87 #define BKP_RTCOutputSource_Alarm ((uint16_t)0x0100)
mbed_official 52:a51c77007319 88 #define BKP_RTCOutputSource_Second ((uint16_t)0x0300)
mbed_official 52:a51c77007319 89 #define IS_BKP_RTC_OUTPUT_SOURCE(SOURCE) (((SOURCE) == BKP_RTCOutputSource_None) || \
mbed_official 52:a51c77007319 90 ((SOURCE) == BKP_RTCOutputSource_CalibClock) || \
mbed_official 52:a51c77007319 91 ((SOURCE) == BKP_RTCOutputSource_Alarm) || \
mbed_official 52:a51c77007319 92 ((SOURCE) == BKP_RTCOutputSource_Second))
mbed_official 52:a51c77007319 93 /**
mbed_official 52:a51c77007319 94 * @}
mbed_official 52:a51c77007319 95 */
mbed_official 52:a51c77007319 96
mbed_official 52:a51c77007319 97 /** @defgroup Data_Backup_Register
mbed_official 52:a51c77007319 98 * @{
mbed_official 52:a51c77007319 99 */
mbed_official 52:a51c77007319 100
mbed_official 52:a51c77007319 101 #define BKP_DR1 ((uint16_t)0x0004)
mbed_official 52:a51c77007319 102 #define BKP_DR2 ((uint16_t)0x0008)
mbed_official 52:a51c77007319 103 #define BKP_DR3 ((uint16_t)0x000C)
mbed_official 52:a51c77007319 104 #define BKP_DR4 ((uint16_t)0x0010)
mbed_official 52:a51c77007319 105 #define BKP_DR5 ((uint16_t)0x0014)
mbed_official 52:a51c77007319 106 #define BKP_DR6 ((uint16_t)0x0018)
mbed_official 52:a51c77007319 107 #define BKP_DR7 ((uint16_t)0x001C)
mbed_official 52:a51c77007319 108 #define BKP_DR8 ((uint16_t)0x0020)
mbed_official 52:a51c77007319 109 #define BKP_DR9 ((uint16_t)0x0024)
mbed_official 52:a51c77007319 110 #define BKP_DR10 ((uint16_t)0x0028)
mbed_official 52:a51c77007319 111 #define BKP_DR11 ((uint16_t)0x0040)
mbed_official 52:a51c77007319 112 #define BKP_DR12 ((uint16_t)0x0044)
mbed_official 52:a51c77007319 113 #define BKP_DR13 ((uint16_t)0x0048)
mbed_official 52:a51c77007319 114 #define BKP_DR14 ((uint16_t)0x004C)
mbed_official 52:a51c77007319 115 #define BKP_DR15 ((uint16_t)0x0050)
mbed_official 52:a51c77007319 116 #define BKP_DR16 ((uint16_t)0x0054)
mbed_official 52:a51c77007319 117 #define BKP_DR17 ((uint16_t)0x0058)
mbed_official 52:a51c77007319 118 #define BKP_DR18 ((uint16_t)0x005C)
mbed_official 52:a51c77007319 119 #define BKP_DR19 ((uint16_t)0x0060)
mbed_official 52:a51c77007319 120 #define BKP_DR20 ((uint16_t)0x0064)
mbed_official 52:a51c77007319 121 #define BKP_DR21 ((uint16_t)0x0068)
mbed_official 52:a51c77007319 122 #define BKP_DR22 ((uint16_t)0x006C)
mbed_official 52:a51c77007319 123 #define BKP_DR23 ((uint16_t)0x0070)
mbed_official 52:a51c77007319 124 #define BKP_DR24 ((uint16_t)0x0074)
mbed_official 52:a51c77007319 125 #define BKP_DR25 ((uint16_t)0x0078)
mbed_official 52:a51c77007319 126 #define BKP_DR26 ((uint16_t)0x007C)
mbed_official 52:a51c77007319 127 #define BKP_DR27 ((uint16_t)0x0080)
mbed_official 52:a51c77007319 128 #define BKP_DR28 ((uint16_t)0x0084)
mbed_official 52:a51c77007319 129 #define BKP_DR29 ((uint16_t)0x0088)
mbed_official 52:a51c77007319 130 #define BKP_DR30 ((uint16_t)0x008C)
mbed_official 52:a51c77007319 131 #define BKP_DR31 ((uint16_t)0x0090)
mbed_official 52:a51c77007319 132 #define BKP_DR32 ((uint16_t)0x0094)
mbed_official 52:a51c77007319 133 #define BKP_DR33 ((uint16_t)0x0098)
mbed_official 52:a51c77007319 134 #define BKP_DR34 ((uint16_t)0x009C)
mbed_official 52:a51c77007319 135 #define BKP_DR35 ((uint16_t)0x00A0)
mbed_official 52:a51c77007319 136 #define BKP_DR36 ((uint16_t)0x00A4)
mbed_official 52:a51c77007319 137 #define BKP_DR37 ((uint16_t)0x00A8)
mbed_official 52:a51c77007319 138 #define BKP_DR38 ((uint16_t)0x00AC)
mbed_official 52:a51c77007319 139 #define BKP_DR39 ((uint16_t)0x00B0)
mbed_official 52:a51c77007319 140 #define BKP_DR40 ((uint16_t)0x00B4)
mbed_official 52:a51c77007319 141 #define BKP_DR41 ((uint16_t)0x00B8)
mbed_official 52:a51c77007319 142 #define BKP_DR42 ((uint16_t)0x00BC)
mbed_official 52:a51c77007319 143
mbed_official 52:a51c77007319 144 #define IS_BKP_DR(DR) (((DR) == BKP_DR1) || ((DR) == BKP_DR2) || ((DR) == BKP_DR3) || \
mbed_official 52:a51c77007319 145 ((DR) == BKP_DR4) || ((DR) == BKP_DR5) || ((DR) == BKP_DR6) || \
mbed_official 52:a51c77007319 146 ((DR) == BKP_DR7) || ((DR) == BKP_DR8) || ((DR) == BKP_DR9) || \
mbed_official 52:a51c77007319 147 ((DR) == BKP_DR10) || ((DR) == BKP_DR11) || ((DR) == BKP_DR12) || \
mbed_official 52:a51c77007319 148 ((DR) == BKP_DR13) || ((DR) == BKP_DR14) || ((DR) == BKP_DR15) || \
mbed_official 52:a51c77007319 149 ((DR) == BKP_DR16) || ((DR) == BKP_DR17) || ((DR) == BKP_DR18) || \
mbed_official 52:a51c77007319 150 ((DR) == BKP_DR19) || ((DR) == BKP_DR20) || ((DR) == BKP_DR21) || \
mbed_official 52:a51c77007319 151 ((DR) == BKP_DR22) || ((DR) == BKP_DR23) || ((DR) == BKP_DR24) || \
mbed_official 52:a51c77007319 152 ((DR) == BKP_DR25) || ((DR) == BKP_DR26) || ((DR) == BKP_DR27) || \
mbed_official 52:a51c77007319 153 ((DR) == BKP_DR28) || ((DR) == BKP_DR29) || ((DR) == BKP_DR30) || \
mbed_official 52:a51c77007319 154 ((DR) == BKP_DR31) || ((DR) == BKP_DR32) || ((DR) == BKP_DR33) || \
mbed_official 52:a51c77007319 155 ((DR) == BKP_DR34) || ((DR) == BKP_DR35) || ((DR) == BKP_DR36) || \
mbed_official 52:a51c77007319 156 ((DR) == BKP_DR37) || ((DR) == BKP_DR38) || ((DR) == BKP_DR39) || \
mbed_official 52:a51c77007319 157 ((DR) == BKP_DR40) || ((DR) == BKP_DR41) || ((DR) == BKP_DR42))
mbed_official 52:a51c77007319 158
mbed_official 52:a51c77007319 159 #define IS_BKP_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7F)
mbed_official 52:a51c77007319 160 /**
mbed_official 52:a51c77007319 161 * @}
mbed_official 52:a51c77007319 162 */
mbed_official 52:a51c77007319 163
mbed_official 52:a51c77007319 164 /**
mbed_official 52:a51c77007319 165 * @}
mbed_official 52:a51c77007319 166 */
mbed_official 52:a51c77007319 167
mbed_official 52:a51c77007319 168 /** @defgroup BKP_Exported_Macros
mbed_official 52:a51c77007319 169 * @{
mbed_official 52:a51c77007319 170 */
mbed_official 52:a51c77007319 171
mbed_official 52:a51c77007319 172 /**
mbed_official 52:a51c77007319 173 * @}
mbed_official 52:a51c77007319 174 */
mbed_official 52:a51c77007319 175
mbed_official 52:a51c77007319 176 /** @defgroup BKP_Exported_Functions
mbed_official 52:a51c77007319 177 * @{
mbed_official 52:a51c77007319 178 */
mbed_official 52:a51c77007319 179
mbed_official 52:a51c77007319 180 void BKP_DeInit(void);
mbed_official 52:a51c77007319 181 void BKP_TamperPinLevelConfig(uint16_t BKP_TamperPinLevel);
mbed_official 52:a51c77007319 182 void BKP_TamperPinCmd(FunctionalState NewState);
mbed_official 52:a51c77007319 183 void BKP_ITConfig(FunctionalState NewState);
mbed_official 52:a51c77007319 184 void BKP_RTCOutputConfig(uint16_t BKP_RTCOutputSource);
mbed_official 52:a51c77007319 185 void BKP_SetRTCCalibrationValue(uint8_t CalibrationValue);
mbed_official 52:a51c77007319 186 void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data);
mbed_official 52:a51c77007319 187 uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR);
mbed_official 52:a51c77007319 188 FlagStatus BKP_GetFlagStatus(void);
mbed_official 52:a51c77007319 189 void BKP_ClearFlag(void);
mbed_official 52:a51c77007319 190 ITStatus BKP_GetITStatus(void);
mbed_official 52:a51c77007319 191 void BKP_ClearITPendingBit(void);
mbed_official 52:a51c77007319 192
mbed_official 52:a51c77007319 193 #ifdef __cplusplus
mbed_official 52:a51c77007319 194 }
mbed_official 52:a51c77007319 195 #endif
mbed_official 52:a51c77007319 196
mbed_official 52:a51c77007319 197 #endif /* __STM32F10x_BKP_H */
mbed_official 52:a51c77007319 198 /**
mbed_official 52:a51c77007319 199 * @}
mbed_official 52:a51c77007319 200 */
mbed_official 52:a51c77007319 201
mbed_official 52:a51c77007319 202 /**
mbed_official 52:a51c77007319 203 * @}
mbed_official 52:a51c77007319 204 */
mbed_official 52:a51c77007319 205
mbed_official 52:a51c77007319 206 /**
mbed_official 52:a51c77007319 207 * @}
mbed_official 52:a51c77007319 208 */
mbed_official 52:a51c77007319 209
mbed_official 84:f54042cbc282 210 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/