/**
  @page PWR_CurrentConsumption PWR Current Consumption example
  
  @verbatim
  ******************** (C) COPYRIGHT 2012 STMicroelectronics *******************
  * @file    PWR/CurrentConsumption/readme.txt 
  * @author  MCD Application Team
  * @version V1.1.0
  * @date    13-April-2012
  * @brief   Description of the PWR Current Consumption example.
  ******************************************************************************
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing, software 
  * distributed under the License is distributed on an "AS IS" BASIS, 
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
   @endverbatim

@par Example Description 

This example shows how to configure the STM32F2xx system to measure different
Low Power modes current consumption. The Low Power modes are:
  - Sleep Mode
  - STOP mode with RTC
  - STANDBY mode without RTC and BKPSRAM
  - STANDBY mode with RTC
  - STANDBY mode with RTC and BKPSRAM
  
To run this example, user has to follow the following steps:
 1. Select the Low power modes to be measured by uncommenting the corresponding
    line inside the stm32f2xx_lp_modes.h file.
    @code
       /*#define SLEEP_MODE*/
       /*#define STOP_MODE*/
       /*#define STANDBY_MODE*/
       #define STANDBY_RTC_MODE
       /*#define STANDBY_RTC_BKPSRAM_MODE*/
    @endcode       

 2. Use an external amperemeter to measure the IDD current. 

 3. This example can not be used in DEBUG mode,this is due to the fact that the 
    Cortex-M3 core is no longer clocked during low power mode so debugging 
    features are disbaled

Here below a detailed description of the example code:

  @verbatim

 1. After reset, the program waits for Key button connected to the PG.15 to be 
    pressed to enter the selected low power mode.
     - When the RTC is not used in the low power mode configuration, press
       again the Key button to exit the low power mode.
     - When the RTC is used, the wakeup from low power mode is automatically 
       generated by the RTC (after 4s).

 2. Low power modes description:

    - Sleep Mode
    ============  
            - System Running at PLL (120MHz)
            - Flash 3 wait state
            - Prefetch and Cache enabled
            - Code running from Internal FLASH
            - All peripherals disabled.
            - Wakeup using EXTI Line (Key Button PG.15)

    - STOP Mode
    ===========
            - RTC Clocked by LSE or LSI
            - Regulator in LP mode
            - HSI, HSE OFF and LSI if not used as RTC Clock source
            - No IWDG
            - FLASH in deep power down mode
            - Automatic Wakeup using RTC clocked by LSE/LSI (after ~20s)

    - STANDBY Mode
    ==============
            - Backup SRAM and RTC OFF
            - IWDG and LSI OFF
            - Wakeup using WakeUp Pin (PA.00)
                        
    - STANDBY Mode with RTC clocked by LSE/LSI 
    ==========================================
            - RTC Clocked by LSE or LSI
            - IWDG OFF and LSI OFF  if not used as RTC Clock source
            - Backup SRAM OFF
            - Automatic Wakeup using RTC clocked by LSE/LSI (after ~20s)

    - STANDBY Mode with RTC clocked by LSE/LSI and BKPSRAM
    ======================================================
            - RTC Clocked by LSE or LSI
            - Backup SRAM ON
            - IWDG OFF
            - Automatic Wakeup using RTC clocked by LSE/LSI (after ~20s)

   @endverbatim


@par Directory contents 

  - PWR/CurrentConsumption/stm32f2xx_conf.h              Library Configuration file
  - PWR/CurrentConsumption/stm32f2xx_it.c                Interrupt handlers
  - PWR/CurrentConsumption/stm32f2xx_it.h                Interrupt handlers header file
  - PWR/CurrentConsumption/main.c                        Main program
  - PWR/CurrentConsumption/system_stm32f2xx.c            STM32F2xx system source file
  - PWR/CurrentConsumption/stm32f2xx_lp_modes.c          STM32F2xx Low Power Modes source file
  - PWR/CurrentConsumption/stm32f2xx_lp_modes.h          STM32F2xx Low Power Modes header file

@note The "system_stm32f2xx.c" is generated by an automatic clock configuration 
      tool and can be easily customized to your own configuration. 
      To select different clock setup, use the "STM32F2xx_Clock_Configuration_V1.0.0.xls" 
      provided with the AN3362 package available on <a href="http://www.st.com/internet/mcu/family/141.jsp">  ST Microcontrollers </a>


@par Hardware and Software environment

  - This example runs on STM32F2xx Devices revision B and revision Y
  
  - This example has been tested with STM322xG-EVAL RevB and can be easily tailored
    to any other development board.

  - STM322xG-EVAL Set-up
    - Use LED1 connected  to PG.06 pin.
    - Use Key Button connected to PG.15 pin
    - Make sure that JP31 is not fitted.
    - Connect an amperemeter to JP32 to measure the IDD current

      
@par How to use it ? 

In order to make the program work, you must do the following :
 - Copy all source files from this example folder to the template folder under
   Project\STM32F2xx_StdPeriph_Template
 - Open your preferred toolchain 
 - Add the file stm32f2xx_lp_modes.c to the project source list
 - Rebuild all files and load your image into target memory
 - Run the example

 * <h3><center>&copy; COPYRIGHT STMicroelectronics</center></h3>
 */


