MSPM0G1X0X_G3X0X Driver Library  2.05.00.05
Data Structures | Enumerations | Functions
Op-Amp (OPA)

Data Structures

struct  DL_OPA_Config
 Configuration struct for DL_OPA_init. More...
 

Enumerations

enum  DL_OPA_CHOPPING_MODE {
  DL_OPA_CHOPPING_MODE_DISABLE = OA_CFG_CHOP_OFF,
  DL_OPA_CHOPPING_MODE_STANDARD = OA_CFG_CHOP_ON,
  DL_OPA_CHOPPING_MODE_ADC_AVERAGING = OA_CFG_CHOP_AVGON
}
 
enum  DL_OPA_OUTPUT_PIN_STATE {
  DL_OPA_OUTPUT_PIN_ENABLED = OA_CFG_OUTPIN_ENABLED,
  DL_OPA_OUTPUT_PIN_DISABLED = OA_CFG_OUTPIN_DISABLED
}
 
enum  DL_OPA_PSEL {
  DL_OPA_PSEL_OPEN = OA_CFG_PSEL_NC,
  DL_OPA_PSEL_IN0_POS = OA_CFG_PSEL_EXTPIN0,
  DL_OPA_PSEL_IN1_POS = OA_CFG_PSEL_EXTPIN1,
  DL_OPA_PSEL_DAC_OUT = OA_CFG_PSEL_DAC12OUT,
  DL_OPA_PSEL_DAC8_OUT = OA_CFG_PSEL_DAC8OUT,
  DL_OPA_PSEL_VREF = OA_CFG_PSEL_VREF,
  DL_OPA_PSEL_RTOP = OA_CFG_PSEL_OANM1RTOP,
  DL_OPA_PSEL_GPAMP_OUT = OA_CFG_PSEL_GPAMP_OUT_INT,
  DL_OPA_PSEL_GND = OA_CFG_PSEL_VSS
}
 
enum  DL_OPA_NSEL {
  DL_OPA_NSEL_OPEN = OA_CFG_NSEL_NC,
  DL_OPA_NSEL_IN0_NEG = OA_CFG_NSEL_EXTPIN0,
  DL_OPA_NSEL_IN1_NEG = OA_CFG_NSEL_EXTPIN1,
  DL_OPA_NSEL_RBOT = OA_CFG_NSEL_OANP1RBOT,
  DL_OPA_NSEL_RTAP = OA_CFG_NSEL_OANRTAP,
  DL_OPA_NSEL_RTOP = OA_CFG_NSEL_OANRTOP,
  DL_OPA_NSEL_SPARE = OA_CFG_NSEL_SPARE
}
 
enum  DL_OPA_MSEL {
  DL_OPA_MSEL_OPEN = OA_CFG_MSEL_NC,
  DL_OPA_MSEL_IN1_NEG = OA_CFG_MSEL_EXTNPIN1,
  DL_OPA_MSEL_GND = OA_CFG_MSEL_VSS,
  DL_OPA_MSEL_DAC_OUT = OA_CFG_MSEL_DAC12OUT,
  DL_OPA_MSEL_RTOP = OA_CFG_MSEL_OANM1RTOP
}
 
enum  DL_OPA_GBW {
  DL_OPA_GBW_HIGH = OA_CFGBASE_GBW_HIGHGAIN,
  DL_OPA_GBW_LOW = OA_CFGBASE_GBW_LOWGAIN
}
 
enum  DL_OPA_GAIN {
  DL_OPA_GAIN_N0_P1 = (((uint32_t) 0x0) << OA_CFG_GAIN_OFS),
  DL_OPA_GAIN_N1_P2 = (((uint32_t) 0x1) << OA_CFG_GAIN_OFS),
  DL_OPA_GAIN_N3_P4 = (((uint32_t) 0x2) << OA_CFG_GAIN_OFS),
  DL_OPA_GAIN_N7_P8 = (((uint32_t) 0x3) << OA_CFG_GAIN_OFS),
  DL_OPA_GAIN_N15_P16 = (((uint32_t) 0x4) << OA_CFG_GAIN_OFS),
  DL_OPA_GAIN_N31_P32 = (((uint32_t) 0x5) << OA_CFG_GAIN_OFS)
}
 

Functions

__STATIC_INLINE void DL_OPA_enablePower (OA_Regs *opa)
 Enables the Peripheral Write Enable (PWREN) register for the OPA. More...
 
__STATIC_INLINE void DL_OPA_disablePower (OA_Regs *opa)
 Disables the Peripheral Write Enable (PWREN) register for the OPA. More...
 
__STATIC_INLINE bool DL_OPA_isPowerEnabled (const OA_Regs *opa)
 Returns if the Peripheral Write Enable (PWREN) register for the OPA is enabled. More...
 
__STATIC_INLINE void DL_OPA_reset (OA_Regs *opa)
 Resets OPA peripheral. More...
 
__STATIC_INLINE bool DL_OPA_isReset (const OA_Regs *opa)
 Returns if OPA peripheral was reset. More...
 
__STATIC_INLINE void DL_OPA_enable (OA_Regs *opa)
 Enable the OPA peripheral. More...
 
__STATIC_INLINE bool DL_OPA_isEnabled (const OA_Regs *opa)
 Checks if the OPA peripheral is enabled. More...
 
__STATIC_INLINE void DL_OPA_disable (OA_Regs *opa)
 Disable the OPA peripheral. More...
 
__STATIC_INLINE void DL_OPA_init (OA_Regs *opa, const DL_OPA_Config *config)
 Initialize the OPA peripheral. More...
 
__STATIC_INLINE void DL_OPA_setGainBandwidth (OA_Regs *opa, DL_OPA_GBW bandwidth)
 Set the gain bandwidth (GBW) More...
 
__STATIC_INLINE DL_OPA_GBW DL_OPA_getGainBandwidth (const OA_Regs *opa)
 Get the gain bandwidth (GBW) More...
 
__STATIC_INLINE void DL_OPA_enableRailToRailInput (OA_Regs *opa)
 Enable the rail-to-rail input (RRI) More...
 
__STATIC_INLINE bool DL_OPA_isRailToRailInputEnabled (OA_Regs *opa)
 Checks if the the rail-to-rail input (RRI) is enabled. More...
 
__STATIC_INLINE void DL_OPA_disableRailToRailInput (OA_Regs *opa)
 Disable the rail-to-rail input (RRI) More...
 
__STATIC_INLINE void DL_OPA_setChoppingMode (OA_Regs *opa, DL_OPA_CHOPPING_MODE mode)
 Set and enable the chopping mode. More...
 
__STATIC_INLINE DL_OPA_CHOPPING_MODE DL_OPA_getChoppingMode (const OA_Regs *opa)
 Get the chopping mode. More...
 
__STATIC_INLINE void DL_OPA_setOutputPinState (OA_Regs *opa, DL_OPA_OUTPUT_PIN_STATE state)
 Set the state of the output pin. More...
 
__STATIC_INLINE DL_OPA_OUTPUT_PIN_STATE DL_OPA_getOutputPinState (const OA_Regs *opa)
 Get the state of the output pin. More...
 
__STATIC_INLINE void DL_OPA_disableOutputPin (OA_Regs *opa)
 Disable the OPA output signal to be accessed by a device pin. More...
 
__STATIC_INLINE void DL_OPA_setNonInvertingInputChannel (OA_Regs *opa, DL_OPA_PSEL inputChannel)
 Set the non-inverting input channel. More...
 
__STATIC_INLINE DL_OPA_PSEL DL_OPA_getNonInvertingInputChannel (const OA_Regs *opa)
 Get the non-inverting input channel. More...
 
__STATIC_INLINE void DL_OPA_setInvertingInputChannel (OA_Regs *opa, DL_OPA_NSEL inputChannel)
 Set the inverting input channel. More...
 
__STATIC_INLINE DL_OPA_NSEL DL_OPA_getInvertingInputChannel (const OA_Regs *opa)
 Get the inverting input channel. More...
 
__STATIC_INLINE void DL_OPA_setMMUXInputChannel (OA_Regs *opa, DL_OPA_MSEL inputChannel)
 Set the M-MUX input channel. More...
 
__STATIC_INLINE DL_OPA_MSEL DL_OPA_getMMUXInputChannel (const OA_Regs *opa)
 Get the M-MUX input channel. More...
 
__STATIC_INLINE void DL_OPA_setGain (OA_Regs *opa, DL_OPA_GAIN gain)
 Set the gain for the programmable gain stage. More...
 
__STATIC_INLINE DL_OPA_GAIN DL_OPA_getGain (const OA_Regs *opa)
 Get the gain from the programmable gain stage. More...
 
DL_OPA_GAIN DL_OPA_increaseGain (OA_Regs *opa)
 Increment gain to the next DL_OPA_GAIN enum value. More...
 
DL_OPA_GAIN DL_OPA_decreaseGain (OA_Regs *opa)
 Decrement gain to the next DL_OPA_GAIN enum value. More...
 
__STATIC_INLINE bool DL_OPA_isReady (const OA_Regs *opa)
 Checks if the OPA is ready. More...
 

Detailed Description

Overview

The OP-Amp Driver Library allows full configuration of the MSPM0 OPA module. The OPA is a zero-drift chopper stabilized operational amplifier with a programmable gain stage.


Enumeration Type Documentation

§ DL_OPA_CHOPPING_MODE

Enumerator
DL_OPA_CHOPPING_MODE_DISABLE 

Disable chopping mode

DL_OPA_CHOPPING_MODE_STANDARD 

Enable standard chopping mode

DL_OPA_CHOPPING_MODE_ADC_AVERAGING 

Enable ADC assisted chopping mode. Requires OPA output to be connected to an ADC input with hardware averaging.

§ DL_OPA_OUTPUT_PIN_STATE

Enumerator
DL_OPA_OUTPUT_PIN_ENABLED 

Output pin is enabled

DL_OPA_OUTPUT_PIN_DISABLED 

Outpin pin is disabled

§ DL_OPA_PSEL

Enumerator
DL_OPA_PSEL_OPEN 

Non-inverting input channel is Open

DL_OPA_PSEL_IN0_POS 

Non-inverting input is OPAx_IN0+

DL_OPA_PSEL_IN1_POS 

Non-inverting input is OPAx_IN1+

DL_OPA_PSEL_DAC_OUT 

Non-inverting input is DAC_OUT

DL_OPA_PSEL_DAC8_OUT 

Non-inverting input is DAC8.x_OUT

DL_OPA_PSEL_VREF 

Non-inverting input is VREF

DL_OPA_PSEL_RTOP 

Non-inverting input is OPA[x-1]_RTOP

DL_OPA_PSEL_GPAMP_OUT 

Non-inverting input is GPAMP OUT

DL_OPA_PSEL_GND 

Non-inverting input is GND

§ DL_OPA_NSEL

Enumerator
DL_OPA_NSEL_OPEN 

Inverting input channel is Open

DL_OPA_NSEL_IN0_NEG 

Inverting input channel is OPAx_IN0-

DL_OPA_NSEL_IN1_NEG 

Inverting input channel is OPAx_IN1-

DL_OPA_NSEL_RBOT 

Inverting input channel is OPA[x-1]_RBOT

DL_OPA_NSEL_RTAP 

Inverting input channel is RTAP

DL_OPA_NSEL_RTOP 

Inverting input channel is RTOP

DL_OPA_NSEL_SPARE 

Spare input for inverting channel

§ DL_OPA_MSEL

Enumerator
DL_OPA_MSEL_OPEN 

M-MUX input channel is Open

DL_OPA_MSEL_IN1_NEG 

M-MUX input channel is OPAx_IN1-

DL_OPA_MSEL_GND 

M-MUX input channel is GND

DL_OPA_MSEL_DAC_OUT 

M-MUX input channel is DAC_OUT

DL_OPA_MSEL_RTOP 

M-MUX input channel is OPA[x-1]_RTOP

§ DL_OPA_GBW

enum DL_OPA_GBW
Enumerator
DL_OPA_GBW_HIGH 

High gain bandwidth (GBW). See device specific datasheet for values.

DL_OPA_GBW_LOW 

Low gain bandwidth (GBW). See device specific datasheet for values.

§ DL_OPA_GAIN

Enumerator
DL_OPA_GAIN_N0_P1 

Gain value is Not Valid in Non-inverting and inverting PGA modes

DL_OPA_GAIN_N1_P2 

Gain value is -1x in Inverting PGA mode, and 2x in Non-inverting PGA mode

DL_OPA_GAIN_N3_P4 

Gain value is -3x in Inverting PGA mode, and 4x in Non-inverting PGA mode

DL_OPA_GAIN_N7_P8 

Gain value is -7x in Inverting PGA mode, and 8x in Non-inverting PGA mode

DL_OPA_GAIN_N15_P16 

Gain value is -15x in Inverting PGA mode, and 16x in Non-inverting PGA mode

DL_OPA_GAIN_N31_P32 

Gain value is -31x in Inverting PGA mode, and 32x in Non-inverting PGA mode

Function Documentation

§ DL_OPA_enablePower()

__STATIC_INLINE void DL_OPA_enablePower ( OA_Regs *  opa)

Enables the Peripheral Write Enable (PWREN) register for the OPA.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

Note
For power savings, please refer to DL_OPA_enable
Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_disablePower()

__STATIC_INLINE void DL_OPA_disablePower ( OA_Regs *  opa)

Disables the Peripheral Write Enable (PWREN) register for the OPA.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Note
This API does not provide large power savings. For power savings, please refer to DL_OPA_enable
Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_isPowerEnabled()

__STATIC_INLINE bool DL_OPA_isPowerEnabled ( const OA_Regs *  opa)

Returns if the Peripheral Write Enable (PWREN) register for the OPA is enabled.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
true if peripheral register access is enabled
false if peripheral register access is disabled

§ DL_OPA_reset()

__STATIC_INLINE void DL_OPA_reset ( OA_Regs *  opa)

Resets OPA peripheral.

Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_isReset()

__STATIC_INLINE bool DL_OPA_isReset ( const OA_Regs *  opa)

Returns if OPA peripheral was reset.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_OPA_enable()

__STATIC_INLINE void DL_OPA_enable ( OA_Regs *  opa)

Enable the OPA peripheral.

Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_isEnabled()

__STATIC_INLINE bool DL_OPA_isEnabled ( const OA_Regs *  opa)

Checks if the OPA peripheral is enabled.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
Returns the enabled status of the OPA
Return values
trueThe OPA peripheral is enabled
falseThe OPA peripheral is disabled

§ DL_OPA_disable()

__STATIC_INLINE void DL_OPA_disable ( OA_Regs *  opa)

Disable the OPA peripheral.

Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_init()

__STATIC_INLINE void DL_OPA_init ( OA_Regs *  opa,
const DL_OPA_Config config 
)

Initialize the OPA peripheral.

Initializes all the common configurable options for the OPA peripheral. Any other custom configuration can be done after calling this API. The OPA is not enabled in this API.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]configConfiguration for OPA peripheral

References DL_OPA_Config::choppingMode, DL_Common_updateReg(), DL_OPA_Config::gain, DL_OPA_Config::mselChannel, DL_OPA_Config::nselChannel, DL_OPA_Config::outputPinState, and DL_OPA_Config::pselChannel.

§ DL_OPA_setGainBandwidth()

__STATIC_INLINE void DL_OPA_setGainBandwidth ( OA_Regs *  opa,
DL_OPA_GBW  bandwidth 
)

Set the gain bandwidth (GBW)

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]bandwidthThe gain bandwidth to set. One of DL_OPA_GBW
Precondition
The OPA must be ready (STAT.RDY == 1) before setting this configuration.

References DL_Common_updateReg().

§ DL_OPA_getGainBandwidth()

__STATIC_INLINE DL_OPA_GBW DL_OPA_getGainBandwidth ( const OA_Regs *  opa)

Get the gain bandwidth (GBW)

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The current gain bandwidth
Return values
Oneof DL_OPA_GBW

§ DL_OPA_enableRailToRailInput()

__STATIC_INLINE void DL_OPA_enableRailToRailInput ( OA_Regs *  opa)

Enable the rail-to-rail input (RRI)

Parameters
[in]opaPointer to the register overlay for the peripheral
Precondition
The OPA must be ready (STAT.RDY == 1) before setting this configuration.

§ DL_OPA_isRailToRailInputEnabled()

__STATIC_INLINE bool DL_OPA_isRailToRailInputEnabled ( OA_Regs *  opa)

Checks if the the rail-to-rail input (RRI) is enabled.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
Returns the rail-to-rail input status of the OPA
Return values
trueThe rail-to-rail input is enabled
falseThe rail-to-rail input is disabled

§ DL_OPA_disableRailToRailInput()

__STATIC_INLINE void DL_OPA_disableRailToRailInput ( OA_Regs *  opa)

Disable the rail-to-rail input (RRI)

Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_setChoppingMode()

__STATIC_INLINE void DL_OPA_setChoppingMode ( OA_Regs *  opa,
DL_OPA_CHOPPING_MODE  mode 
)

Set and enable the chopping mode.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]modeThe chopping mode to set. One of DL_OPA_CHOPPING_MODE

References DL_Common_updateReg().

§ DL_OPA_getChoppingMode()

__STATIC_INLINE DL_OPA_CHOPPING_MODE DL_OPA_getChoppingMode ( const OA_Regs *  opa)

Get the chopping mode.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The current chopping mode
Return values
Oneof DL_OPA_CHOPPING_MODE

§ DL_OPA_setOutputPinState()

__STATIC_INLINE void DL_OPA_setOutputPinState ( OA_Regs *  opa,
DL_OPA_OUTPUT_PIN_STATE  state 
)

Set the state of the output pin.

When the output pin is enabled, the OPA output goes to the device pin while still maintaining connection to the programmable gain stage and other analog peripherals. When disabled, the OPA output is a purely internal signal and is internally connected to the programmable gain stage and capable of being routed to other on-board analog peripherals.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]stateThe state to set the output pin to One of DL_OPA_OUTPUT_PIN_STATE

References DL_Common_updateReg().

§ DL_OPA_getOutputPinState()

__STATIC_INLINE DL_OPA_OUTPUT_PIN_STATE DL_OPA_getOutputPinState ( const OA_Regs *  opa)

Get the state of the output pin.

When the output pin is enabled, the OPA output goes to the device pin while still maintaining connection to the programmable gain stage and other analog peripherals. When disabled, the OPA output is a purely internal signal and is internally connected to the programmable gain stage and capable of being routed to other on-board analog peripherals.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The state of the output pin
Return values
Oneof DL_OPA_OUTPUT_PIN_STATE

§ DL_OPA_disableOutputPin()

__STATIC_INLINE void DL_OPA_disableOutputPin ( OA_Regs *  opa)

Disable the OPA output signal to be accessed by a device pin.

When disabled, the OPA output is a purely internal signal and is internally connected to the programmable gain stage and capable of being routed to other on-board analog peripherals.

Parameters
[in]opaPointer to the register overlay for the peripheral

§ DL_OPA_setNonInvertingInputChannel()

__STATIC_INLINE void DL_OPA_setNonInvertingInputChannel ( OA_Regs *  opa,
DL_OPA_PSEL  inputChannel 
)

Set the non-inverting input channel.

This API sets the PSEL control bit to select the non-inverting input channel of the amplifier.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]inputChannelThe non-inverting input channel to set. One of DL_OPA_PSEL.

References DL_Common_updateReg().

§ DL_OPA_getNonInvertingInputChannel()

__STATIC_INLINE DL_OPA_PSEL DL_OPA_getNonInvertingInputChannel ( const OA_Regs *  opa)

Get the non-inverting input channel.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The current non-inverting input channel
Return values
Oneof DL_OPA_PSEL

§ DL_OPA_setInvertingInputChannel()

__STATIC_INLINE void DL_OPA_setInvertingInputChannel ( OA_Regs *  opa,
DL_OPA_NSEL  inputChannel 
)

Set the inverting input channel.

This API sets the NSEL control bit to select the inverting input channel of the amplifier.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]inputChannelThe inverting input channel to set. One of DL_OPA_NSEL.

References DL_Common_updateReg().

§ DL_OPA_getInvertingInputChannel()

__STATIC_INLINE DL_OPA_NSEL DL_OPA_getInvertingInputChannel ( const OA_Regs *  opa)

Get the inverting input channel.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The current inverting input channel
Return values
Oneof DL_OPA_NSEL

§ DL_OPA_setMMUXInputChannel()

__STATIC_INLINE void DL_OPA_setMMUXInputChannel ( OA_Regs *  opa,
DL_OPA_MSEL  inputChannel 
)

Set the M-MUX input channel.

This API sets the MSEL control bit to select the input channel for M-MUX, which is connected to the programmable gain stage resistor ladder.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]inputChannelThe M-MUX input channel to set. One of DL_OPA_MSEL.

References DL_Common_updateReg().

§ DL_OPA_getMMUXInputChannel()

__STATIC_INLINE DL_OPA_MSEL DL_OPA_getMMUXInputChannel ( const OA_Regs *  opa)

Get the M-MUX input channel.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The current M-MUX input channel
Return values
Oneof DL_OPA_MSEL

§ DL_OPA_setGain()

__STATIC_INLINE void DL_OPA_setGain ( OA_Regs *  opa,
DL_OPA_GAIN  gain 
)

Set the gain for the programmable gain stage.

The OPA integrates a programmable gain stage in the feedback loop to configure the OPA as a PGA(programmable gain amplifier). The gain stage is a feedback resistance ladder and it supports up to 32x amplification.

Refer to the TRM for gain enumeration information.

Parameters
[in]opaPointer to the register overlay for the peripheral
[in]gainThe gain to set. One of DL_OPA_GAIN.

References DL_Common_updateReg().

§ DL_OPA_getGain()

__STATIC_INLINE DL_OPA_GAIN DL_OPA_getGain ( const OA_Regs *  opa)

Get the gain from the programmable gain stage.

Refer to the TRM for gain enumeration information.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The gain
Return values
Thegain. One of DL_OPA_GAIN

References DL_OPA_decreaseGain(), and DL_OPA_increaseGain().

§ DL_OPA_increaseGain()

DL_OPA_GAIN DL_OPA_increaseGain ( OA_Regs *  opa)

Increment gain to the next DL_OPA_GAIN enum value.

The OPA allows dynamic gain changes. If the gain is already at the maximum setting DL_OPA_GAIN_N31_P32 (CFG.GAIN = 0x5), this function does nothing.

Refer to the TRM for more information about changing gain dynamically.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The gain at the end of the operation.
Return values
Theapplied gain. One of DL_OPA_GAIN

Referenced by DL_OPA_getGain().

§ DL_OPA_decreaseGain()

DL_OPA_GAIN DL_OPA_decreaseGain ( OA_Regs *  opa)

Decrement gain to the next DL_OPA_GAIN enum value.

The OPA allows dynamic gain changes. If the gain is at the minimum setting DL_OPA_GAIN_N1_P2 (CFG.GAIN = 0x1), this function does nothing.

Refer to the TRM for more information about changing gain dynamically.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The gain at the end of the operation.
Return values
Theapplied gain. One of DL_OPA_GAIN

Referenced by DL_OPA_getGain().

§ DL_OPA_isReady()

__STATIC_INLINE bool DL_OPA_isReady ( const OA_Regs *  opa)

Checks if the OPA is ready.

Parameters
[in]opaPointer to the register overlay for the peripheral
Returns
The status of the OPA ready bit
Return values
trueThe OPA is ready
falseThe OPA is not ready
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale