Operational Amplifier (OPAMP) peripheral API. More...
![]() |
Data Structures | |
struct | OPAMP_Init_TypeDef |
Defines | |
#define | OPA_INIT_UNITY_GAIN |
#define | OPA_INIT_UNITY_GAIN_OPA2 |
#define | OPA_INIT_NON_INVERTING |
#define | OPA_INIT_NON_INVERTING_OPA2 |
#define | OPA_INIT_INVERTING |
#define | OPA_INIT_INVERTING_OPA2 |
#define | OPA_INIT_CASCADED_NON_INVERTING_OPA0 |
#define | OPA_INIT_CASCADED_NON_INVERTING_OPA1 |
#define | OPA_INIT_CASCADED_NON_INVERTING_OPA2 |
#define | OPA_INIT_CASCADED_INVERTING_OPA0 |
#define | OPA_INIT_CASCADED_INVERTING_OPA1 |
#define | OPA_INIT_CASCADED_INVERTING_OPA2 |
#define | OPA_INIT_DIFF_DRIVER_OPA0 |
#define | OPA_INIT_DIFF_DRIVER_OPA1 |
#define | OPA_INIT_DIFF_RECEIVER_OPA0 |
#define | OPA_INIT_DIFF_RECEIVER_OPA1 |
#define | OPA_INIT_DIFF_RECEIVER_OPA2 |
Enumerations | |
enum | OPAMP_TypeDef { OPA0 = 0, OPA1 = 1, OPA2 = 2 } |
enum | OPAMP_NegSel_TypeDef { opaNegSelDisable = DAC_OPA0MUX_NEGSEL_DISABLE, opaNegSelUnityGain = DAC_OPA0MUX_NEGSEL_UG, opaNegSelResTap = DAC_OPA0MUX_NEGSEL_OPATAP, opaNegSelNegPad = DAC_OPA0MUX_NEGSEL_NEGPAD } |
enum | OPAMP_PosSel_TypeDef { opaPosSelDisable = DAC_OPA0MUX_POSSEL_DISABLE, opaPosSelDac = DAC_OPA0MUX_POSSEL_DAC, opaPosSelPosPad = DAC_OPA0MUX_POSSEL_POSPAD, opaPosSelOpaIn = DAC_OPA0MUX_POSSEL_OPA0INP, opaPosSelResTapOpa0 = DAC_OPA0MUX_POSSEL_OPATAP } |
enum | OPAMP_OutMode_TypeDef { opaOutModeDisable = DAC_OPA0MUX_OUTMODE_DISABLE, opaOutModeMain = DAC_OPA0MUX_OUTMODE_MAIN, opaOutModeAlt = DAC_OPA0MUX_OUTMODE_ALT, opaOutModeAll = DAC_OPA0MUX_OUTMODE_ALL } |
enum | OPAMP_ResSel_TypeDef { opaResSelDefault = DAC_OPA0MUX_RESSEL_DEFAULT, opaResSelR2eq0_33R1 = DAC_OPA0MUX_RESSEL_RES0, opaResSelR2eqR1 = DAC_OPA0MUX_RESSEL_RES1, opaResSelR1eq1_67R1 = DAC_OPA0MUX_RESSEL_RES2, opaResSelR2eq2R1 = DAC_OPA0MUX_RESSEL_RES3, opaResSelR2eq3R1 = DAC_OPA0MUX_RESSEL_RES4, opaResSelR2eq4_33R1 = DAC_OPA0MUX_RESSEL_RES5, opaResSelR2eq7R1 = DAC_OPA0MUX_RESSEL_RES6, opaResSelR2eq15R1 = DAC_OPA0MUX_RESSEL_RES7 } |
enum | OPAMP_ResInMux_TypeDef { opaResInMuxDisable = DAC_OPA0MUX_RESINMUX_DISABLE, opaResInMuxOpaIn = DAC_OPA0MUX_RESINMUX_OPA0INP, opaResInMuxNegPad = DAC_OPA0MUX_RESINMUX_NEGPAD, opaResInMuxPosPad = DAC_OPA0MUX_RESINMUX_POSPAD, opaResInMuxVss = DAC_OPA0MUX_RESINMUX_VSS } |
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. |
Operational Amplifier (OPAMP) peripheral API.
This module contains functions to:
All OPAMP functions assume that the DAC clock is running. If the DAC is not used, the clock can be turned off when the opamp's are configured.
If the available gain values dont 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).
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 |___________|
#define OPA_INIT_CASCADED_INVERTING_OPA0 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA1). */ \ true, /* Neg pad enabled, used as signal input. */ \ true, /* Pos pad enabled, used as signal ground. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0 in cascaded inverting amplifier mode.
Definition at line 380 of file em_opamp.h.
#define OPA_INIT_CASCADED_INVERTING_OPA1 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxOpaIn, /* Resistor ladder input from OPA0. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA2). */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal ground. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA1 in cascaded inverting amplifier mode.
Definition at line 402 of file em_opamp.h.
#define OPA_INIT_CASCADED_INVERTING_OPA2 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxOpaIn, /* Resistor ladder input from OPA1. */ \ DAC_OPA0MUX_OUTPEN_OUT0, /* Alternate output 0 enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal ground. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA2 in cascaded inverting amplifier mode.
Definition at line 424 of file em_opamp.h.
#define OPA_INIT_CASCADED_NON_INVERTING_OPA0 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelR2eq0_33R1, /* R2 = 1/3 R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA1). */ \ true, /* Neg pad enabled, used as signal ground. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0 in cascaded non-inverting amplifier mode.
Definition at line 314 of file em_opamp.h.
#define OPA_INIT_CASCADED_NON_INVERTING_OPA1 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelOpaIn, /* Pos input from OPA0 output. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelR2eq0_33R1, /* R2 = 1/3 R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA2). */ \ true, /* Neg pad enabled, used as signal ground. */ \ false, /* Pos pad disabled. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA1 in cascaded non-inverting amplifier mode.
Definition at line 336 of file em_opamp.h.
#define OPA_INIT_CASCADED_NON_INVERTING_OPA2 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelOpaIn, /* Pos input from OPA1 output. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eq0_33R1, /* R2 = 1/3 R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ DAC_OPA0MUX_OUTPEN_OUT0, /* Alternate output 0 enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ true, /* Neg pad enabled, used as signal ground. */ \ false, /* Pos pad disabled. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA2 in cascaded non-inverting amplifier mode.
Definition at line 358 of file em_opamp.h.
#define OPA_INIT_DIFF_DRIVER_OPA0 |
{ \ opaNegSelUnityGain, /* Unity gain. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelDefault, /* Resistor ladder is not used. */ \ opaResInMuxDisable, /* Resistor ladder disabled. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA1). */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0 in two-opamp differential driver mode.
Definition at line 446 of file em_opamp.h.
#define OPA_INIT_DIFF_DRIVER_OPA1 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxOpaIn, /* Resistor ladder input from OPA0. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal ground. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA1 in two-opamp differential driver mode.
Definition at line 468 of file em_opamp.h.
#define OPA_INIT_DIFF_RECEIVER_OPA0 |
{ \ opaNegSelUnityGain, /* Unity gain. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA2). */ \ true, /* Neg pad enabled, used as signal ground. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0 in three-opamp differential receiver mode.
Definition at line 490 of file em_opamp.h.
#define OPA_INIT_DIFF_RECEIVER_OPA1 |
{ \ opaNegSelUnityGain, /* Unity gain. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeAll, /* Both main and alternate outputs. */ \ opaResSelDefault, /* Resistor ladder is not used. */ \ opaResInMuxDisable, /* Disable resistor ladder. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ true, /* Pass output to next stage (OPA2). */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA1 in three-opamp differential receiver mode.
Definition at line 512 of file em_opamp.h.
#define OPA_INIT_DIFF_RECEIVER_OPA2 |
{ \ opaNegSelResTap, /* Input from resistor ladder tap. */ \ opaPosSelResTapOpa0, /* Input from OPA0 resistor ladder tap. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxOpaIn, /* Resistor ladder input from OPA1. */ \ DAC_OPA0MUX_OUTPEN_OUT0, /* Enable alternate output 0. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ false, /* Neg pad disabled. */ \ false, /* Pos pad disabled. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA2 in three-opamp differential receiver mode.
Definition at line 534 of file em_opamp.h.
#define OPA_INIT_INVERTING |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ true, /* Neg pad enabled, used as signal input. */ \ true, /* Pos pad enabled, used as signal ground. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0/1 in inverting amplifier mode.
Definition at line 270 of file em_opamp.h.
#define OPA_INIT_INVERTING_OPA2 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eqR1, /* R2 = R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ DAC_OPA0MUX_OUTPEN_OUT0, /* Alternate output 0 enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ true, /* Neg pad enabled, used as signal input. */ \ true, /* Pos pad enabled, used as signal ground. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA2 in inverting amplifier mode.
Definition at line 292 of file em_opamp.h.
#define OPA_INIT_NON_INVERTING |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eq0_33R1, /* R2 = 1/3 R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ true, /* Neg pad enabled, used as signal ground. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0/1 in non-inverting amplifier mode.
Definition at line 226 of file em_opamp.h.
#define OPA_INIT_NON_INVERTING_OPA2 |
{ \ opaNegSelResTap, /* Neg input from resistor ladder tap. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelR2eq0_33R1, /* R2 = 1/3 R1 */ \ opaResInMuxNegPad, /* Resistor ladder input from neg pad. */ \ DAC_OPA0MUX_OUTPEN_OUT0, /* Alternate output 0 enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ true, /* Neg pad enabled, used as signal ground. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA2 in non-inverting amplifier mode.
Definition at line 248 of file em_opamp.h.
#define OPA_INIT_UNITY_GAIN |
{ \ opaNegSelUnityGain, /* Unity gain. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelDefault, /* Resistor ladder is not used. */ \ opaResInMuxDisable, /* Resistor ladder disabled. */ \ 0, /* No alternate outputs enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA0/1 in unity gain voltage follower mode.
Definition at line 182 of file em_opamp.h.
#define OPA_INIT_UNITY_GAIN_OPA2 |
{ \ opaNegSelUnityGain, /* Unity gain. */ \ opaPosSelPosPad, /* Pos input from pad. */ \ opaOutModeMain, /* Main output enabled. */ \ opaResSelDefault, /* Resistor ladder is not used. */ \ opaResInMuxDisable, /* Resistor ladder disabled. */ \ DAC_OPA0MUX_OUTPEN_OUT0, /* Alternate output 0 enabled. */ \ _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting. */ \ _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting. */ \ false, /* No low pass filter on pos pad. */ \ false, /* No low pass filter on neg pad. */ \ false, /* No nextout output enabled. */ \ false, /* Neg pad disabled. */ \ true, /* Pos pad enabled, used as signal input. */ \ false, /* No shorting of inputs. */ \ false, /* Rail-to-rail input enabled. */ \ true, /* Use factory calibrated opamp offset. */ \ 0 /* Opamp offset value (not used). */ \ }
Configuration of OPA2 in unity gain voltage follower mode.
Definition at line 204 of file em_opamp.h.
enum OPAMP_NegSel_TypeDef |
OPAMP negative terminal input selection values.
opaNegSelDisable |
Input disabled. |
opaNegSelUnityGain |
Unity gain feedback path. |
opaNegSelResTap |
Feedback resistor ladder tap. |
opaNegSelNegPad |
Negative pad as input. |
Definition at line 78 of file em_opamp.h.
OPAMP output terminal selection values.
opaOutModeDisable |
OPA output disabled. |
opaOutModeMain |
Main output to pin enabled. |
opaOutModeAlt |
Alternate output(s) enabled (not OPA2). |
opaOutModeAll |
Both main and alternate enabled (not OPA2). |
Definition at line 97 of file em_opamp.h.
enum OPAMP_PosSel_TypeDef |
OPAMP positive terminal input selection values.
Definition at line 87 of file em_opamp.h.
OPAMP resistor ladder input selector values.
Definition at line 120 of file em_opamp.h.
enum OPAMP_ResSel_TypeDef |
OPAMP gain values.
Definition at line 106 of file em_opamp.h.
enum OPAMP_TypeDef |
OPAMP selector values.
Definition at line 70 of file em_opamp.h.
void OPAMP_Disable | ( | DAC_TypeDef * | dac, | |
OPAMP_TypeDef | opa | |||
) |
void OPAMP_Enable | ( | DAC_TypeDef * | dac, | |
OPAMP_TypeDef | opa, | |||
const OPAMP_Init_TypeDef * | init | |||
) |
Configure and enable an Operational Amplifier.
[in] | dac | Pointer to DAC peripheral register block. |
[in] | opa | Selects an OPA, valid vaules are OPA0, OPA1 and OPA2. |
[in] | init | Pointer to a structure containing OPAMP init information. |
Definition at line 268 of file em_opamp.c.
References OPAMP_Init_TypeDef::bias, OPAMP_Init_TypeDef::defaultOffset, OPAMP_Init_TypeDef::halfBias, OPAMP_Init_TypeDef::hcmDisable, OPAMP_Init_TypeDef::lpfNegPadDisable, OPAMP_Init_TypeDef::lpfPosPadDisable, OPAMP_Init_TypeDef::negSel, OPAMP_Init_TypeDef::nextOut, OPAMP_Init_TypeDef::npEn, OPAMP_Init_TypeDef::offset, OPA0, OPA1, OPAMP_Init_TypeDef::outMode, OPAMP_Init_TypeDef::outPen, OPAMP_Init_TypeDef::posSel, OPAMP_Init_TypeDef::ppEn, OPAMP_Init_TypeDef::resInMux, OPAMP_Init_TypeDef::resSel, OPAMP_Init_TypeDef::shortInputs, and SYSTEM_GetCalibrationValue().