mbed SDK library sources

Fork of mbed-src by mbed official

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

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_pwr.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 PWR 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_PWR_H
mbed_official 52:a51c77007319 40 #define __STM32F10x_PWR_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 PWR
mbed_official 52:a51c77007319 54 * @{
mbed_official 52:a51c77007319 55 */
mbed_official 52:a51c77007319 56
mbed_official 52:a51c77007319 57 /** @defgroup PWR_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 PWR_Exported_Constants
mbed_official 52:a51c77007319 66 * @{
mbed_official 52:a51c77007319 67 */
mbed_official 52:a51c77007319 68
mbed_official 52:a51c77007319 69 /** @defgroup PVD_detection_level
mbed_official 52:a51c77007319 70 * @{
mbed_official 52:a51c77007319 71 */
mbed_official 52:a51c77007319 72
mbed_official 52:a51c77007319 73 #define PWR_PVDLevel_2V2 ((uint32_t)0x00000000)
mbed_official 52:a51c77007319 74 #define PWR_PVDLevel_2V3 ((uint32_t)0x00000020)
mbed_official 52:a51c77007319 75 #define PWR_PVDLevel_2V4 ((uint32_t)0x00000040)
mbed_official 52:a51c77007319 76 #define PWR_PVDLevel_2V5 ((uint32_t)0x00000060)
mbed_official 52:a51c77007319 77 #define PWR_PVDLevel_2V6 ((uint32_t)0x00000080)
mbed_official 52:a51c77007319 78 #define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0)
mbed_official 52:a51c77007319 79 #define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0)
mbed_official 52:a51c77007319 80 #define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0)
mbed_official 52:a51c77007319 81 #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \
mbed_official 52:a51c77007319 82 ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \
mbed_official 52:a51c77007319 83 ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \
mbed_official 52:a51c77007319 84 ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9))
mbed_official 52:a51c77007319 85 /**
mbed_official 52:a51c77007319 86 * @}
mbed_official 52:a51c77007319 87 */
mbed_official 52:a51c77007319 88
mbed_official 52:a51c77007319 89 /** @defgroup Regulator_state_is_STOP_mode
mbed_official 52:a51c77007319 90 * @{
mbed_official 52:a51c77007319 91 */
mbed_official 52:a51c77007319 92
mbed_official 52:a51c77007319 93 #define PWR_Regulator_ON ((uint32_t)0x00000000)
mbed_official 52:a51c77007319 94 #define PWR_Regulator_LowPower ((uint32_t)0x00000001)
mbed_official 52:a51c77007319 95 #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \
mbed_official 52:a51c77007319 96 ((REGULATOR) == PWR_Regulator_LowPower))
mbed_official 52:a51c77007319 97 /**
mbed_official 52:a51c77007319 98 * @}
mbed_official 52:a51c77007319 99 */
mbed_official 52:a51c77007319 100
mbed_official 52:a51c77007319 101 /** @defgroup STOP_mode_entry
mbed_official 52:a51c77007319 102 * @{
mbed_official 52:a51c77007319 103 */
mbed_official 52:a51c77007319 104
mbed_official 52:a51c77007319 105 #define PWR_STOPEntry_WFI ((uint8_t)0x01)
mbed_official 52:a51c77007319 106 #define PWR_STOPEntry_WFE ((uint8_t)0x02)
mbed_official 52:a51c77007319 107 #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE))
mbed_official 52:a51c77007319 108
mbed_official 52:a51c77007319 109 /**
mbed_official 52:a51c77007319 110 * @}
mbed_official 52:a51c77007319 111 */
mbed_official 52:a51c77007319 112
mbed_official 52:a51c77007319 113 /** @defgroup PWR_Flag
mbed_official 52:a51c77007319 114 * @{
mbed_official 52:a51c77007319 115 */
mbed_official 52:a51c77007319 116
mbed_official 52:a51c77007319 117 #define PWR_FLAG_WU ((uint32_t)0x00000001)
mbed_official 52:a51c77007319 118 #define PWR_FLAG_SB ((uint32_t)0x00000002)
mbed_official 52:a51c77007319 119 #define PWR_FLAG_PVDO ((uint32_t)0x00000004)
mbed_official 52:a51c77007319 120 #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \
mbed_official 52:a51c77007319 121 ((FLAG) == PWR_FLAG_PVDO))
mbed_official 52:a51c77007319 122
mbed_official 52:a51c77007319 123 #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB))
mbed_official 52:a51c77007319 124 /**
mbed_official 52:a51c77007319 125 * @}
mbed_official 52:a51c77007319 126 */
mbed_official 52:a51c77007319 127
mbed_official 52:a51c77007319 128 /**
mbed_official 52:a51c77007319 129 * @}
mbed_official 52:a51c77007319 130 */
mbed_official 52:a51c77007319 131
mbed_official 52:a51c77007319 132 /** @defgroup PWR_Exported_Macros
mbed_official 52:a51c77007319 133 * @{
mbed_official 52:a51c77007319 134 */
mbed_official 52:a51c77007319 135
mbed_official 52:a51c77007319 136 /**
mbed_official 52:a51c77007319 137 * @}
mbed_official 52:a51c77007319 138 */
mbed_official 52:a51c77007319 139
mbed_official 52:a51c77007319 140 /** @defgroup PWR_Exported_Functions
mbed_official 52:a51c77007319 141 * @{
mbed_official 52:a51c77007319 142 */
mbed_official 52:a51c77007319 143
mbed_official 52:a51c77007319 144 void PWR_DeInit(void);
mbed_official 52:a51c77007319 145 void PWR_BackupAccessCmd(FunctionalState NewState);
mbed_official 52:a51c77007319 146 void PWR_PVDCmd(FunctionalState NewState);
mbed_official 52:a51c77007319 147 void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel);
mbed_official 52:a51c77007319 148 void PWR_WakeUpPinCmd(FunctionalState NewState);
mbed_official 52:a51c77007319 149 void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry);
mbed_official 52:a51c77007319 150 void PWR_EnterSTANDBYMode(void);
mbed_official 52:a51c77007319 151 FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG);
mbed_official 52:a51c77007319 152 void PWR_ClearFlag(uint32_t PWR_FLAG);
mbed_official 52:a51c77007319 153
mbed_official 52:a51c77007319 154 #ifdef __cplusplus
mbed_official 52:a51c77007319 155 }
mbed_official 52:a51c77007319 156 #endif
mbed_official 52:a51c77007319 157
mbed_official 52:a51c77007319 158 #endif /* __STM32F10x_PWR_H */
mbed_official 52:a51c77007319 159 /**
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 * @}
mbed_official 52:a51c77007319 169 */
mbed_official 52:a51c77007319 170
mbed_official 84:f54042cbc282 171 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/