OPAMP - Operational Amplifier

Description

Operational Amplifier (OPAMP) peripheral API.

This module contains functions to:

All OPAMP functions assume that the DAC clock is running. If DAC is not used, the clock can be turned off when OPAMPs are configured.

If the available gain values don't suit the application at hand, the resistor ladders can be disabled and external gain programming resistors used.

A number of predefined OPAMP setup macros are available for configuration of the most common OPAMP topologies (see figures below).

Note
The terms POSPAD and NEGPAD in the figures are used to indicate that these pads should be connected to a suitable signal ground.


Unity gain voltage follower.
Use predefined macros OPA_INIT_UNITY_GAIN and OPA_INIT_UNITY_GAIN_OPA2 .

                    |\
         ___________|+\
                    |  \_______
                 ___|_ /    |
                |   | /     |
                |   |/      |
                |___________|


Non-inverting amplifier.
Use predefined macros OPA_INIT_NON_INVERTING and OPA_INIT_NON_INVERTING_OPA2 .

                    |\
         ___________|+\
                    |  \_______
                 ___|_ /    |
                |   | /     |
                |   |/      |
                |_____R2____|
                |
                R1
                |
              NEGPAD 


Inverting amplifier.
Use predefined macros OPA_INIT_INVERTING and OPA_INIT_INVERTING_OPA2 .

                 _____R2____
                |           |
                |   |\      |
         ____R1_|___|_\     |
                    |  \____|___
                 ___|  /
                |   |+/
                |   |/
                |
              POSPAD 


Cascaded non-inverting amplifiers.
Use predefined macros OPA_INIT_CASCADED_NON_INVERTING_OPA0 , OPA_INIT_CASCADED_NON_INVERTING_OPA1 and OPA_INIT_CASCADED_NON_INVERTING_OPA2 .

                    |\                       |\                       |\
         ___________|+\ OPA0      ___________|+\ OPA1      ___________|+\ OPA2
                    |  \_________|           |  \_________|           |  \_______
                 ___|_ /    |             ___|_ /    |             ___|_ /    |
                |   | /     |            |   | /     |            |   | /     |
                |   |/      |            |   |/      |            |   |/      |
                |_____R2____|            |_____R2____|            |_____R2____|
                |                        |                        |
                R1                       R1                       R1
                |                        |                        |
              NEGPAD                   NEGPAD                   NEGPAD 


Cascaded inverting amplifiers.
Use predefined macros OPA_INIT_CASCADED_INVERTING_OPA0 , OPA_INIT_CASCADED_INVERTING_OPA1 and OPA_INIT_CASCADED_INVERTING_OPA2 .

                 _____R2____              _____R2____              _____R2____
                |           |            |           |            |           |
                |   |\      |            |   |\      |            |   |\      |
         ____R1_|___|_\     |     ____R1_|___|_\     |     ____R1_|___|_\     |
                    |  \____|____|           |  \____|___|            |  \____|__
                 ___|  /                  ___|  /                  ___|  /
                |   |+/ OPA0             |   |+/ OPA1             |   |+/ OPA2
                |   |/                   |   |/                   |   |/
                |                        |                        |
              POSPAD                   POSPAD                   POSPAD 


Differential driver with two opamp's.
Use predefined macros OPA_INIT_DIFF_DRIVER_OPA0 and OPA_INIT_DIFF_DRIVER_OPA1 .

                                  __________________________
                                 |                          +
                                 |        _____R2____
                    |\           |       |           |
         ___________|+\ OPA0     |       |   |\ OPA1 |
                    |  \_________|____R1_|___|_\     |      _
                 ___|_ /         |           |  \____|______
                |   | /          |        ___|  /
                |   |/           |       |   |+/
                |________________|       |   |/
                                         |
                                       POSPAD 


Differential receiver with three opamp's.
Use predefined macros OPA_INIT_DIFF_RECEIVER_OPA0 , OPA_INIT_DIFF_RECEIVER_OPA1 and OPA_INIT_DIFF_RECEIVER_OPA2 .

                    |\
          __________|+\ OPA1
         _          |  \_________
                 ___|_ /    |    |        _____R2____
                |   | /     |    |       |           |
                |   |/      |    |       |   |\      |
                |___________|    |____R1_|___|_\     |
                                             |  \____|___
                    |\            ____R1_ ___|  /
         +__________|+\ OPA0     |       |   |+/ OPA2
                    |  \_________|       |   |/
                 ___|_ /    |            R2
                |   | /     |            |
                |   |/      |          NEGPAD OPA0
                |___________|

Data Structures

struct OPAMP_Init_TypeDef
OPAMP init structure.

Functions

void OPAMP_Disable (DAC_TypeDef *dac, OPAMP_TypeDef opa)
Disable an Operational Amplifier.
void OPAMP_Enable (DAC_TypeDef *dac, OPAMP_TypeDef opa, const OPAMP_Init_TypeDef *init)
Configure and enable an Operational Amplifier.

Macros

#define OPA_INIT_UNITY_GAIN
Configuration of OPA0/1 in unity gain voltage follower mode.
#define OPA_INIT_UNITY_GAIN_OPA2
Configuration of OPA2 in unity gain voltage follower mode.
#define OPA_INIT_NON_INVERTING
Configuration of OPA0/1 in non-inverting amplifier mode.
#define OPA_INIT_NON_INVERTING_OPA2
Configuration of OPA2 in non-inverting amplifier mode.
#define OPA_INIT_INVERTING
Configuration of OPA0/1 in inverting amplifier mode.
#define OPA_INIT_INVERTING_OPA2
Configuration of OPA2 in inverting amplifier mode.
#define OPA_INIT_CASCADED_NON_INVERTING_OPA0
Configuration of OPA0 in cascaded non-inverting amplifier mode.