Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more
Initialization and Configuration functions
[OPAMP_Private_Functions]
Initialization and Configuration functions. More...
Functions | |
void | OPAMP_DeInit (uint32_t OPAMP_Selection) |
Deinitializes OPAMP peripheral registers to their default reset values. | |
void | OPAMP_Init (uint32_t OPAMP_Selection, OPAMP_InitTypeDef *OPAMP_InitStruct) |
Initializes the OPAMP peripheral according to the specified parameters in OPAMP_InitStruct. | |
void | OPAMP_StructInit (OPAMP_InitTypeDef *OPAMP_InitStruct) |
Fills each OPAMP_InitStruct member with its default value. | |
void | OPAMP_PGAConfig (uint32_t OPAMP_Selection, uint32_t OPAMP_PGAGain, uint32_t OPAMP_PGAConnect) |
Configure the feedback resistor gain. | |
void | OPAMP_VrefConfig (uint32_t OPAMP_Selection, uint32_t OPAMP_Vref) |
Configure the OPAMP's internal reference. | |
void | OPAMP_VrefConnectNonInvertingInput (uint32_t OPAMP_Selection, FunctionalState NewState) |
Connect the internal reference to the OPAMP's non inverting input. | |
void | OPAMP_VrefConnectADCCmd (uint32_t OPAMP_Selection, FunctionalState NewState) |
Enables or disables connecting the OPAMP's internal reference to ADC. | |
void | OPAMP_TimerControlledMuxConfig (uint32_t OPAMP_Selection, OPAMP_InitTypeDef *OPAMP_InitStruct) |
Configure the OPAMP peripheral (secondary inputs) for timer-controlled mux mode according to the specified parameters in OPAMP_InitStruct. | |
void | OPAMP_TimerControlledMuxCmd (uint32_t OPAMP_Selection, FunctionalState NewState) |
Enable or disable the timer-controlled mux mode. | |
void | OPAMP_Cmd (uint32_t OPAMP_Selection, FunctionalState NewState) |
Enable or disable the OPAMP peripheral. | |
uint32_t | OPAMP_GetOutputLevel (uint32_t OPAMP_Selection) |
Return the output level (high or low) during calibration of the selected OPAMP. | |
void | OPAMP_OffsetTrimModeSelect (uint32_t OPAMP_Selection, uint32_t OPAMP_Trimming) |
Select the trimming mode. | |
void | OPAMP_OffsetTrimConfig (uint32_t OPAMP_Selection, uint32_t OPAMP_Input, uint32_t OPAMP_TrimValue) |
Configure the trimming value of the OPAMP. | |
void | OPAMP_StartCalibration (uint32_t OPAMP_Selection, FunctionalState NewState) |
Start or stop the calibration of selected OPAMP peripheral. |
Detailed Description
Initialization and Configuration functions.
=============================================================================== ##### Initialization and Configuration functions ##### ===============================================================================
Function Documentation
void OPAMP_Cmd | ( | uint32_t | OPAMP_Selection, |
FunctionalState | NewState | ||
) |
Enable or disable the OPAMP peripheral.
- Note:
- If the selected OPAMP is locked, enable/disable can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. NewState,: new state of the OPAMP peripheral. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 393 of file stm32f30x_opamp.c.
void OPAMP_DeInit | ( | uint32_t | OPAMP_Selection ) |
Deinitializes OPAMP peripheral registers to their default reset values.
- Note:
- Deinitialization can't be performed if the OPAMP configuration is locked. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. None
- Return values:
-
None
< Set OPAMP_CSR register to reset value
Definition at line 144 of file stm32f30x_opamp.c.
uint32_t OPAMP_GetOutputLevel | ( | uint32_t | OPAMP_Selection ) |
Return the output level (high or low) during calibration of the selected OPAMP.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. - OPAMP output is low when the non-inverting input is at a lower voltage than the inverting input
- OPAMP output is high when the non-inverting input is at a higher voltage than the inverting input
- Note:
- OPAMP output level is provided only during calibration phase.
- Return values:
-
Returns the selected OPAMP output level: low or high.
Definition at line 424 of file stm32f30x_opamp.c.
void OPAMP_Init | ( | uint32_t | OPAMP_Selection, |
OPAMP_InitTypeDef * | OPAMP_InitStruct | ||
) |
Initializes the OPAMP peripheral according to the specified parameters in OPAMP_InitStruct.
- Note:
- If the selected OPAMP is locked, initialization can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. OPAMP_InitStruct,: pointer to an OPAMP_InitTypeDef structure that contains the configuration information for the specified OPAMP peripheral. - OPAMP_InvertingInput specifies the inverting input of OPAMP
- OPAMP_NonInvertingInput specifies the non inverting input of OPAMP
- Return values:
-
None
< Get the OPAMPx_CSR register value
< Clear the inverting and non inverting bits selection bits
< Configure OPAMP: inverting and non inverting inputs
< Write to OPAMPx_CSR register
Definition at line 164 of file stm32f30x_opamp.c.
void OPAMP_OffsetTrimConfig | ( | uint32_t | OPAMP_Selection, |
uint32_t | OPAMP_Input, | ||
uint32_t | OPAMP_TrimValue | ||
) |
Configure the trimming value of the OPAMP.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. OPAMP_Input,: the selected OPAMP input. This parameter can be one of the following values: - OPAMP_Input_Inverting: Inverting input is selected to configure the trimming value
- OPAMP_Input_NonInverting: Non inverting input is selected to configure the trimming value
OPAMP_TrimValue,: the trimming value. This parameter can be any value lower or equal to 0x0000001F.
- Return values:
-
None
< Get the OPAMPx_CSR register value
< Clear the trimming bits
< Configure the new trimming value
< Write to OPAMPx_CSR register
Definition at line 484 of file stm32f30x_opamp.c.
void OPAMP_OffsetTrimModeSelect | ( | uint32_t | OPAMP_Selection, |
uint32_t | OPAMP_Trimming | ||
) |
Select the trimming mode.
- Parameters:
-
OffsetTrimming,: the selected offset trimming mode. This parameter can be one of the following values: - OPAMP_Trimming_Factory: factory trimming values are used for offset calibration
- OPAMP_Trimming_User: user trimming values are used for offset calibration
- Note:
- When OffsetTrimming_User is selected, use OPAMP_OffsetTrimConfig() function or OPAMP_OffsetTrimLowPowerConfig() function to adjust trimming value.
- Return values:
-
None
Definition at line 458 of file stm32f30x_opamp.c.
void OPAMP_PGAConfig | ( | uint32_t | OPAMP_Selection, |
uint32_t | OPAMP_PGAGain, | ||
uint32_t | OPAMP_PGAConnect | ||
) |
Configure the feedback resistor gain.
- Note:
- If the selected OPAMP is locked, gain configuration can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. NewState,: new state of the OPAMP peripheral. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 209 of file stm32f30x_opamp.c.
void OPAMP_StartCalibration | ( | uint32_t | OPAMP_Selection, |
FunctionalState | NewState | ||
) |
Start or stop the calibration of selected OPAMP peripheral.
- Note:
- If the selected OPAMP is locked, start/stop can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. NewState,: new state of the OPAMP peripheral. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 517 of file stm32f30x_opamp.c.
void OPAMP_StructInit | ( | OPAMP_InitTypeDef * | OPAMP_InitStruct ) |
Fills each OPAMP_InitStruct member with its default value.
- Parameters:
-
OPAMP_InitStruct,: pointer to an OPAMP_InitTypeDef structure which will be initialized.
- Return values:
-
None
Definition at line 192 of file stm32f30x_opamp.c.
void OPAMP_TimerControlledMuxCmd | ( | uint32_t | OPAMP_Selection, |
FunctionalState | NewState | ||
) |
Enable or disable the timer-controlled mux mode.
- Note:
- If the selected OPAMP is locked, enable/disable can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. NewState,: new state of the OPAMP peripheral. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 364 of file stm32f30x_opamp.c.
void OPAMP_TimerControlledMuxConfig | ( | uint32_t | OPAMP_Selection, |
OPAMP_InitTypeDef * | OPAMP_InitStruct | ||
) |
Configure the OPAMP peripheral (secondary inputs) for timer-controlled mux mode according to the specified parameters in OPAMP_InitStruct.
- Note:
- If the selected OPAMP is locked, timer-controlled mux configuration can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. OPAMP_InitStruct,: pointer to an OPAMP_InitTypeDef structure that contains the configuration information for the specified OPAMP peripheral. - OPAMP_InvertingInput specifies the inverting input of OPAMP
- OPAMP_NonInvertingInput specifies the non inverting input of OPAMP
- Note:
- PGA and Vout can't be selected as secondary inverting input.
- Return values:
-
None
< Get the OPAMPx_CSR register value
< Clear the secondary inverting bit, secondary non inverting bit and TCMEN bits
< Configure OPAMP: secondary inverting and non inverting inputs
< Write to OPAMPx_CSR register
Definition at line 331 of file stm32f30x_opamp.c.
void OPAMP_VrefConfig | ( | uint32_t | OPAMP_Selection, |
uint32_t | OPAMP_Vref | ||
) |
Configure the OPAMP's internal reference.
- Note:
- This feature is used when calibration enabled or OPAMP's reference connected to the non inverting input.
- If the selected OPAMP is locked, Vref configuration can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. OPAMP_Vref,: This parameter can be: OPAMP_Vref_3VDDA: OPMAP Vref = 3.3% VDDA OPAMP_Vref_10VDDA: OPMAP Vref = 10% VDDA OPAMP_Vref_50VDDA: OPMAP Vref = 50% VDDA OPAMP_Vref_90VDDA: OPMAP Vref = 90% VDDA
- Return values:
-
None
< Get the OPAMPx_CSR register value
< Clear the CALSEL bits
< Configure OPAMP reference
< Write to OPAMPx_CSR register
Definition at line 239 of file stm32f30x_opamp.c.
void OPAMP_VrefConnectADCCmd | ( | uint32_t | OPAMP_Selection, |
FunctionalState | NewState | ||
) |
Enables or disables connecting the OPAMP's internal reference to ADC.
- Note:
- If the selected OPAMP is locked, Vref connection can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
NewState,: new state of the Vrefint output. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 297 of file stm32f30x_opamp.c.
void OPAMP_VrefConnectNonInvertingInput | ( | uint32_t | OPAMP_Selection, |
FunctionalState | NewState | ||
) |
Connect the internal reference to the OPAMP's non inverting input.
- Note:
- If the selected OPAMP is locked, Vref configuration can't be performed. To unlock the configuration, perform a system reset.
- Parameters:
-
OPAMP_Selection,: the selected OPAMP. This parameter can be OPAMP_Selection_OPAMPx where x can be 1 to 4 to select the OPAMP peripheral. NewState,: new state of the OPAMP peripheral. This parameter can be: ENABLE or DISABLE.
- Return values:
-
None
Definition at line 271 of file stm32f30x_opamp.c.
Generated on Tue Jul 12 2022 17:34:46 by
