mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_DISCO_F100RB/stm32f10x_pwr.h@126:549ba18ddd81, 2014-03-19 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Mar 19 16:00:09 2014 +0000
- Revision:
- 126:549ba18ddd81
Synchronized with git revision cf8fd1cf86b0cd85131dd24a6ded21cc6fe04827
Full URL: https://github.com/mbedmicro/mbed/commit/cf8fd1cf86b0cd85131dd24a6ded21cc6fe04827/
Conflicts:
workspace_tools/targets.py
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 126:549ba18ddd81 | 1 | /** |
mbed_official | 126:549ba18ddd81 | 2 | ****************************************************************************** |
mbed_official | 126:549ba18ddd81 | 3 | * @file stm32f10x_pwr.h |
mbed_official | 126:549ba18ddd81 | 4 | * @author MCD Application Team |
mbed_official | 126:549ba18ddd81 | 5 | * @version V3.6.1 |
mbed_official | 126:549ba18ddd81 | 6 | * @date 05-March-2012 |
mbed_official | 126:549ba18ddd81 | 7 | * @brief This file contains all the functions prototypes for the PWR firmware |
mbed_official | 126:549ba18ddd81 | 8 | * library. |
mbed_official | 126:549ba18ddd81 | 9 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 10 | * Copyright (c) 2014, STMicroelectronics |
mbed_official | 126:549ba18ddd81 | 11 | * All rights reserved. |
mbed_official | 126:549ba18ddd81 | 12 | * |
mbed_official | 126:549ba18ddd81 | 13 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 126:549ba18ddd81 | 14 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 126:549ba18ddd81 | 15 | * |
mbed_official | 126:549ba18ddd81 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 17 | * this list of conditions and the following disclaimer. |
mbed_official | 126:549ba18ddd81 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 19 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 126:549ba18ddd81 | 20 | * and/or other materials provided with the distribution. |
mbed_official | 126:549ba18ddd81 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 126:549ba18ddd81 | 22 | * may be used to endorse or promote products derived from this software |
mbed_official | 126:549ba18ddd81 | 23 | * without specific prior written permission. |
mbed_official | 126:549ba18ddd81 | 24 | * |
mbed_official | 126:549ba18ddd81 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 126:549ba18ddd81 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 126:549ba18ddd81 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 126:549ba18ddd81 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 126:549ba18ddd81 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 126:549ba18ddd81 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 126:549ba18ddd81 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 126:549ba18ddd81 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 126:549ba18ddd81 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 126:549ba18ddd81 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 126:549ba18ddd81 | 35 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 36 | */ |
mbed_official | 126:549ba18ddd81 | 37 | |
mbed_official | 126:549ba18ddd81 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 126:549ba18ddd81 | 39 | #ifndef __STM32F10x_PWR_H |
mbed_official | 126:549ba18ddd81 | 40 | #define __STM32F10x_PWR_H |
mbed_official | 126:549ba18ddd81 | 41 | |
mbed_official | 126:549ba18ddd81 | 42 | #ifdef __cplusplus |
mbed_official | 126:549ba18ddd81 | 43 | extern "C" { |
mbed_official | 126:549ba18ddd81 | 44 | #endif |
mbed_official | 126:549ba18ddd81 | 45 | |
mbed_official | 126:549ba18ddd81 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 126:549ba18ddd81 | 47 | #include "stm32f10x.h" |
mbed_official | 126:549ba18ddd81 | 48 | |
mbed_official | 126:549ba18ddd81 | 49 | /** @addtogroup STM32F10x_StdPeriph_Driver |
mbed_official | 126:549ba18ddd81 | 50 | * @{ |
mbed_official | 126:549ba18ddd81 | 51 | */ |
mbed_official | 126:549ba18ddd81 | 52 | |
mbed_official | 126:549ba18ddd81 | 53 | /** @addtogroup PWR |
mbed_official | 126:549ba18ddd81 | 54 | * @{ |
mbed_official | 126:549ba18ddd81 | 55 | */ |
mbed_official | 126:549ba18ddd81 | 56 | |
mbed_official | 126:549ba18ddd81 | 57 | /** @defgroup PWR_Exported_Types |
mbed_official | 126:549ba18ddd81 | 58 | * @{ |
mbed_official | 126:549ba18ddd81 | 59 | */ |
mbed_official | 126:549ba18ddd81 | 60 | |
mbed_official | 126:549ba18ddd81 | 61 | /** |
mbed_official | 126:549ba18ddd81 | 62 | * @} |
mbed_official | 126:549ba18ddd81 | 63 | */ |
mbed_official | 126:549ba18ddd81 | 64 | |
mbed_official | 126:549ba18ddd81 | 65 | /** @defgroup PWR_Exported_Constants |
mbed_official | 126:549ba18ddd81 | 66 | * @{ |
mbed_official | 126:549ba18ddd81 | 67 | */ |
mbed_official | 126:549ba18ddd81 | 68 | |
mbed_official | 126:549ba18ddd81 | 69 | /** @defgroup PVD_detection_level |
mbed_official | 126:549ba18ddd81 | 70 | * @{ |
mbed_official | 126:549ba18ddd81 | 71 | */ |
mbed_official | 126:549ba18ddd81 | 72 | |
mbed_official | 126:549ba18ddd81 | 73 | #define PWR_PVDLevel_2V2 ((uint32_t)0x00000000) |
mbed_official | 126:549ba18ddd81 | 74 | #define PWR_PVDLevel_2V3 ((uint32_t)0x00000020) |
mbed_official | 126:549ba18ddd81 | 75 | #define PWR_PVDLevel_2V4 ((uint32_t)0x00000040) |
mbed_official | 126:549ba18ddd81 | 76 | #define PWR_PVDLevel_2V5 ((uint32_t)0x00000060) |
mbed_official | 126:549ba18ddd81 | 77 | #define PWR_PVDLevel_2V6 ((uint32_t)0x00000080) |
mbed_official | 126:549ba18ddd81 | 78 | #define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0) |
mbed_official | 126:549ba18ddd81 | 79 | #define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0) |
mbed_official | 126:549ba18ddd81 | 80 | #define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0) |
mbed_official | 126:549ba18ddd81 | 81 | #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \ |
mbed_official | 126:549ba18ddd81 | 82 | ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \ |
mbed_official | 126:549ba18ddd81 | 83 | ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \ |
mbed_official | 126:549ba18ddd81 | 84 | ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9)) |
mbed_official | 126:549ba18ddd81 | 85 | /** |
mbed_official | 126:549ba18ddd81 | 86 | * @} |
mbed_official | 126:549ba18ddd81 | 87 | */ |
mbed_official | 126:549ba18ddd81 | 88 | |
mbed_official | 126:549ba18ddd81 | 89 | /** @defgroup Regulator_state_is_STOP_mode |
mbed_official | 126:549ba18ddd81 | 90 | * @{ |
mbed_official | 126:549ba18ddd81 | 91 | */ |
mbed_official | 126:549ba18ddd81 | 92 | |
mbed_official | 126:549ba18ddd81 | 93 | #define PWR_Regulator_ON ((uint32_t)0x00000000) |
mbed_official | 126:549ba18ddd81 | 94 | #define PWR_Regulator_LowPower ((uint32_t)0x00000001) |
mbed_official | 126:549ba18ddd81 | 95 | #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \ |
mbed_official | 126:549ba18ddd81 | 96 | ((REGULATOR) == PWR_Regulator_LowPower)) |
mbed_official | 126:549ba18ddd81 | 97 | /** |
mbed_official | 126:549ba18ddd81 | 98 | * @} |
mbed_official | 126:549ba18ddd81 | 99 | */ |
mbed_official | 126:549ba18ddd81 | 100 | |
mbed_official | 126:549ba18ddd81 | 101 | /** @defgroup STOP_mode_entry |
mbed_official | 126:549ba18ddd81 | 102 | * @{ |
mbed_official | 126:549ba18ddd81 | 103 | */ |
mbed_official | 126:549ba18ddd81 | 104 | |
mbed_official | 126:549ba18ddd81 | 105 | #define PWR_STOPEntry_WFI ((uint8_t)0x01) |
mbed_official | 126:549ba18ddd81 | 106 | #define PWR_STOPEntry_WFE ((uint8_t)0x02) |
mbed_official | 126:549ba18ddd81 | 107 | #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE)) |
mbed_official | 126:549ba18ddd81 | 108 | |
mbed_official | 126:549ba18ddd81 | 109 | /** |
mbed_official | 126:549ba18ddd81 | 110 | * @} |
mbed_official | 126:549ba18ddd81 | 111 | */ |
mbed_official | 126:549ba18ddd81 | 112 | |
mbed_official | 126:549ba18ddd81 | 113 | /** @defgroup PWR_Flag |
mbed_official | 126:549ba18ddd81 | 114 | * @{ |
mbed_official | 126:549ba18ddd81 | 115 | */ |
mbed_official | 126:549ba18ddd81 | 116 | |
mbed_official | 126:549ba18ddd81 | 117 | #define PWR_FLAG_WU ((uint32_t)0x00000001) |
mbed_official | 126:549ba18ddd81 | 118 | #define PWR_FLAG_SB ((uint32_t)0x00000002) |
mbed_official | 126:549ba18ddd81 | 119 | #define PWR_FLAG_PVDO ((uint32_t)0x00000004) |
mbed_official | 126:549ba18ddd81 | 120 | #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \ |
mbed_official | 126:549ba18ddd81 | 121 | ((FLAG) == PWR_FLAG_PVDO)) |
mbed_official | 126:549ba18ddd81 | 122 | |
mbed_official | 126:549ba18ddd81 | 123 | #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB)) |
mbed_official | 126:549ba18ddd81 | 124 | /** |
mbed_official | 126:549ba18ddd81 | 125 | * @} |
mbed_official | 126:549ba18ddd81 | 126 | */ |
mbed_official | 126:549ba18ddd81 | 127 | |
mbed_official | 126:549ba18ddd81 | 128 | /** |
mbed_official | 126:549ba18ddd81 | 129 | * @} |
mbed_official | 126:549ba18ddd81 | 130 | */ |
mbed_official | 126:549ba18ddd81 | 131 | |
mbed_official | 126:549ba18ddd81 | 132 | /** @defgroup PWR_Exported_Macros |
mbed_official | 126:549ba18ddd81 | 133 | * @{ |
mbed_official | 126:549ba18ddd81 | 134 | */ |
mbed_official | 126:549ba18ddd81 | 135 | |
mbed_official | 126:549ba18ddd81 | 136 | /** |
mbed_official | 126:549ba18ddd81 | 137 | * @} |
mbed_official | 126:549ba18ddd81 | 138 | */ |
mbed_official | 126:549ba18ddd81 | 139 | |
mbed_official | 126:549ba18ddd81 | 140 | /** @defgroup PWR_Exported_Functions |
mbed_official | 126:549ba18ddd81 | 141 | * @{ |
mbed_official | 126:549ba18ddd81 | 142 | */ |
mbed_official | 126:549ba18ddd81 | 143 | |
mbed_official | 126:549ba18ddd81 | 144 | void PWR_DeInit(void); |
mbed_official | 126:549ba18ddd81 | 145 | void PWR_BackupAccessCmd(FunctionalState NewState); |
mbed_official | 126:549ba18ddd81 | 146 | void PWR_PVDCmd(FunctionalState NewState); |
mbed_official | 126:549ba18ddd81 | 147 | void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel); |
mbed_official | 126:549ba18ddd81 | 148 | void PWR_WakeUpPinCmd(FunctionalState NewState); |
mbed_official | 126:549ba18ddd81 | 149 | void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry); |
mbed_official | 126:549ba18ddd81 | 150 | void PWR_EnterSTANDBYMode(void); |
mbed_official | 126:549ba18ddd81 | 151 | FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG); |
mbed_official | 126:549ba18ddd81 | 152 | void PWR_ClearFlag(uint32_t PWR_FLAG); |
mbed_official | 126:549ba18ddd81 | 153 | |
mbed_official | 126:549ba18ddd81 | 154 | #ifdef __cplusplus |
mbed_official | 126:549ba18ddd81 | 155 | } |
mbed_official | 126:549ba18ddd81 | 156 | #endif |
mbed_official | 126:549ba18ddd81 | 157 | |
mbed_official | 126:549ba18ddd81 | 158 | #endif /* __STM32F10x_PWR_H */ |
mbed_official | 126:549ba18ddd81 | 159 | /** |
mbed_official | 126:549ba18ddd81 | 160 | * @} |
mbed_official | 126:549ba18ddd81 | 161 | */ |
mbed_official | 126:549ba18ddd81 | 162 | |
mbed_official | 126:549ba18ddd81 | 163 | /** |
mbed_official | 126:549ba18ddd81 | 164 | * @} |
mbed_official | 126:549ba18ddd81 | 165 | */ |
mbed_official | 126:549ba18ddd81 | 166 | |
mbed_official | 126:549ba18ddd81 | 167 | /** |
mbed_official | 126:549ba18ddd81 | 168 | * @} |
mbed_official | 126:549ba18ddd81 | 169 | */ |
mbed_official | 126:549ba18ddd81 | 170 | |
mbed_official | 126:549ba18ddd81 | 171 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |