/**
  @page PWR_CurrentConsumption PWR Current Consumption example
  
  @verbatim
  ******************** (C) COPYRIGHT 2013 STMicroelectronics *******************
  * @file    PWR/PWR_CurrentConsumption/readme.txt 
  * @author  MCD Application Team
  * @version V1.3.0
  * @date    13-November-2013
  * @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 STM32F4xx 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 stm32f4xx_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-M4 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 (168MHz)
            - Flash 5 wait state
            - Instruction and Data caches ON
            - Prefetch OFF       
            - 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/PWR_CurrentConsumption/system_stm32f4xx.c     STM32F4xx system clock configuration file
  - PWR/PWR_CurrentConsumption/stm32f4xx_conf.h       Library Configuration file
  - PWR/PWR_CurrentConsumption/stm32f4xx_it.c         Interrupt handlers
  - PWR/PWR_CurrentConsumption/stm32f4xx_it.h         Interrupt handlers header file
  - PWR/PWR_CurrentConsumption/main.c                 Main program
  - PWR/PWR_CurrentConsumption/main.h                 Main program header file
  - PWR/PWR_CurrentConsumption/stm32f4xx_lp_modes.c   STM32F4xx Low Power Modes source file
  - PWR/PWR_CurrentConsumption/stm32f4xx_lp_modes.h   STM32F4xx Low Power Modes header file


@par Hardware and Software environment

  - This example runs on STM32F405xx/407xx, STM32F415xx/417xx and STM32F427xx/437xx 
    devices.
    
  - This example has been tested with STMicroelectronics STM324xG-EVAL (STM32F40xx/
    STM32F41xx Devices) and STM32437I-EVAL (STM32F427xx/STM32F437xx Devices) evaluation 
    boards and can be easily tailored to any other supported device and development board.

  - STM324xG-EVAL/STM32437I-EVAL Set-up
    - Use LED1 connected  to PG.06 pin.
    - Use Key Button connected to PG.15 pin.
    - Make sure that JP31 is open. 
    - 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\STM32F4xx_StdPeriph_Templates
 - Open your preferred toolchain 
 - Select the project workspace related to the used device 
   - If "STM32F40_41xxx" is selected as default project Add the following files in the project source list:
     - Utilities\STM32_EVAL\STM3240_41_G_EVAL\stm324xg_eval.c
     - stm32f4xx_lp_modes.c
        
   - If "STM32F427_437xx" is selected as default project Add the following files in the project source list:
     - Utilities\STM32_EVAL\STM324x7I_EVAL\stm324x7i_eval.c
     - stm32f4xx_lp_modes.c
             
 - Rebuild all files and load your image into target memory
 - Run the example

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