Subversion Repositories EngineBay2

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 28
Line 1... Line 1...
1
/**
1
/**
2
  ******************************************************************************
2
  ******************************************************************************
3
  * @file    stm32l1xx_hal_pwr_ex.c
3
  * @file    stm32l1xx_hal_pwr_ex.c
4
  * @author  MCD Application Team
4
  * @author  MCD Application Team
5
  * @version V1.2.0
-
 
6
  * @date    01-July-2016
-
 
7
  * @brief   Extended PWR HAL module driver.
5
  * @brief   Extended PWR HAL module driver.
8
  *          This file provides firmware functions to manage the following
6
  *          This file provides firmware functions to manage the following
9
  *          functionalities of the Power Controller (PWR) peripheral:
7
  *          functionalities of the Power Controller (PWR) peripheral:
10
  *           + Extended Initialization and de-initialization functions
8
  *           + Extended Initialization and de-initialization functions
11
  *           + Extended Peripheral Control functions
9
  *           + Extended Peripheral Control functions
12
  *        
10
  *
13
  ******************************************************************************
11
  ******************************************************************************
14
  * @attention
12
  * @attention
15
  *
13
  *
16
  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
14
  * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
17
  *
-
 
18
  * Redistribution and use in source and binary forms, with or without modification,
-
 
19
  * are permitted provided that the following conditions are met:
-
 
20
  *   1. Redistributions of source code must retain the above copyright notice,
-
 
21
  *      this list of conditions and the following disclaimer.
-
 
22
  *   2. Redistributions in binary form must reproduce the above copyright notice,
-
 
23
  *      this list of conditions and the following disclaimer in the documentation
-
 
24
  *      and/or other materials provided with the distribution.
-
 
25
  *   3. Neither the name of STMicroelectronics nor the names of its contributors
-
 
26
  *      may be used to endorse or promote products derived from this software
-
 
27
  *      without specific prior written permission.
15
  * All rights reserved.</center></h2>
28
  *
16
  *
29
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
  * This software component is licensed by ST under BSD 3-Clause license,
30
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-
 
31
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-
 
32
  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-
 
33
  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-
 
34
  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18
  * the "License"; You may not use this file except in compliance with the
35
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
19
  * License. You may obtain a copy of the License at:
36
  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-
 
37
  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-
 
38
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
  *                        opensource.org/licenses/BSD-3-Clause
39
  *
21
  *
40
  ******************************************************************************
22
  ******************************************************************************
41
  */
23
  */
42
 
24
 
43
/* Includes ------------------------------------------------------------------*/
25
/* Includes ------------------------------------------------------------------*/
Line 76... Line 58...
76
@endverbatim
58
@endverbatim
77
  * @{
59
  * @{
78
  */
60
  */
79
 
61
 
80
/**
62
/**
81
  * @brief Return Voltage Scaling Range.  
63
  * @brief Return Voltage Scaling Range.
82
  * @retval VOS bit field (PWR_REGULATOR_VOLTAGE_SCALE1, PWR_REGULATOR_VOLTAGE_SCALE2 or PWR_REGULATOR_VOLTAGE_SCALE3)
64
  * @retval VOS bit field (PWR_REGULATOR_VOLTAGE_SCALE1, PWR_REGULATOR_VOLTAGE_SCALE2 or PWR_REGULATOR_VOLTAGE_SCALE3)
83
  */  
65
  */
84
uint32_t HAL_PWREx_GetVoltageRange(void)
66
uint32_t HAL_PWREx_GetVoltageRange(void)
85
{
67
{
86
  return  (PWR->CR & PWR_CR_VOS);
68
  return  (PWR->CR & PWR_CR_VOS);
87
}
69
}
88
 
70
 
89
 
71
 
90
/**
72
/**
91
  * @brief  Enables the Fast WakeUp from Ultra Low Power mode.
73
  * @brief  Enables the Fast WakeUp from Ultra Low Power mode.
92
  * @note   This bit works in conjunction with ULP bit.
74
  * @note   This bit works in conjunction with ULP bit.
93
  *         Means, when ULP = 1 and FWU = 1 :VREFINT startup time is ignored when
75
  *         Means, when ULP = 1 and FWU = 1 :VREFINT startup time is ignored when
94
  *         exiting from low power mode.
76
  *         exiting from low power mode.
95
  * @retval None
77
  * @retval None
96
  */
78
  */
97
void HAL_PWREx_EnableFastWakeUp(void)
79
void HAL_PWREx_EnableFastWakeUp(void)
98
{
80
{
Line 133... Line 115...
133
/**
115
/**
134
  * @brief  Enters the Low Power Run mode.
116
  * @brief  Enters the Low Power Run mode.
135
  * @note   Low power run mode can only be entered when VCORE is in range 2.
117
  * @note   Low power run mode can only be entered when VCORE is in range 2.
136
  *         In addition, the dynamic voltage scaling must not be used when Low
118
  *         In addition, the dynamic voltage scaling must not be used when Low
137
  *         power run mode is selected. Only Stop and Sleep modes with regulator
119
  *         power run mode is selected. Only Stop and Sleep modes with regulator
138
  *         configured in Low power mode is allowed when Low power run mode is
120
  *         configured in Low power mode is allowed when Low power run mode is
139
  *         selected.
121
  *         selected.
140
  * @note   In Low power run mode, all I/O pins keep the same state as in Run mode.
122
  * @note   In Low power run mode, all I/O pins keep the same state as in Run mode.
141
  * @retval None
123
  * @retval None
142
  */
124
  */
143
void HAL_PWREx_EnableLowPowerRunMode(void)
125
void HAL_PWREx_EnableLowPowerRunMode(void)