/**
  @page OPAMP_PGA Amplify an applied signal example
  @verbatim
  ******************************************************************************
  * @file    OPAMP/OPAMP_PGA/readme.txt
  * @author  MCD Application Team
  * @brief   Description of the OPAMP PGA: programmable gain example.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2019 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  @endverbatim

@par Example Description

How to configure the OPAMP peripheral in PGA mode (OPAMP programmable gain).

- Test description:
  - The example uses the the built-in PGA mode (OPAMP programmable gain).
  - The DMA provides samples (sinewave) to the DAC.
  - The DAC peripheral generates a sine wave signal on DAC_OUT2 (PA5) which is
    amplified by the OPAMP2.
  - The OPAMP2 amplifies output is on PB0 with gain of either 2 or 4.
  - The OPAMP gain is changed on the fly while OPAMP remains enabled.
  - The OPAMP is used in both normal and low power mode (sample and hold mode).
  - The low power mode of OPAMP (and DAC)can also be used while Cortex stays
    in sleep mode.
  - The Cortex can be set into sleep mode
  - The tests steps are:
      - Step 0:
        DAC:     normal power mode
        OPAMP:   normal power mode - gain = 2
        DMA:     circular mode
        Cortex:  run mode
      - Step 1:
        DAC:     normal power mode
        OPAMP:   normal power mode - gain = 4
        DMA:     circular mode
        Cortex:  run mode
      - Step 2:
        DAC:     Low power mode
        OPAMP:   Low power power mode - gain = 4
        DMA:     circular mode
        Cortex:  run mode
      - Step 3:
        DAC:     Low power mode
        OPAMP:   Low power mode - gain = 4
        DMA:     circular mode
        Cortex:  sleep mode
      - Step 4:
        DAC:     Low power mode
        OPAMP:   Low power mode - gain = 2
        DMA:     circular mode
        Cortex:  sleep mode

@note The instruction cache (ICACHE) must be enabled by software to get a 0 wait-state execution
      from Flash memory and external memories, and reach the maximum performance.

@par Keywords

Analog, OPAMP, DAC, DMA, PGA mode, Normal power mode, Low power mode

@par Directory contents

  - OPAMP/OPAMP_PGA/Inc/stm32l5xx_hal_conf.h    HAL configuration file
  - OPAMP/OPAMP_PGA/Inc/stm32l5xx_it.h          Interrupt handlers header file
  - OPAMP/OPAMP_PGA/Inc/main.h                  Header for main.c module
  - OPAMP/OPAMP_PGA/Src/stm32l5xx_it.c          Interrupt handlers
  - OPAMP/OPAMP_PGA/Src/main.c                  Main program
  - OPAMP/OPAMP_PGA/Src/stm32l5xx_hal_msp.c     HAL MSP file
  - OPAMP/OPAMP_PGA/Src/system_stm32l5xx.c      STM32L5xx system source file

@par Hardware and Software environment

  - This example runs on STM32L552ZETxQ devices.

  - This example has been tested with NUCLEO-L552ZE-Q (144 pins) board and can be
    easily tailored to any other supported device and development board.

  - NUCLEO-L552ZE-Q (144 pins) Set-up

    - Connect an oscilloscope to DAC_OUT2 from: pin 11 - connector CN12 (PA5 pin)
      to display the sine wave signal generated by the DAC
      (about 850 mV amplitude peak to peak). (DAC output = OPAMP input).
    - Connect an oscilloscope to OPAMP_OUT2: pin 34 - connector CN11 (PB0 pin)
      to display waveform (OPAMP output).
    - Press user button to switch between steps.
    - You may redo the tests, either via
      -> changing sample and hold parameters of the DAC.

@par How to use it ?

In order to make the program work, you must do the following :
 - Open your preferred toolchain
 - Rebuild all files and load your image into target memory
 - Run the example


 */

