Martin Johnson / STM32F3-Discovery

Dependents:   Space_Invaders_Demo neopixels gpio_test_stm32f3_discovery gpio_test_systimer ... more

Embed: (wiki syntax)

« Back to documentation index

stm32f30x_opamp.c File Reference

stm32f30x_opamp.c File Reference

This file provides firmware functions to manage the following functionalities of the operational amplifiers (OPAMP1,...OPAMP4) peripheral: + OPAMP Configuration + OPAMP calibration. More...

Go to the source code of this file.

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.
void OPAMP_LockConfig (uint32_t OPAMP_Selection)
 Lock the selected OPAMP configuration.

Detailed Description

This file provides firmware functions to manage the following functionalities of the operational amplifiers (OPAMP1,...OPAMP4) peripheral: + OPAMP Configuration + OPAMP calibration.

Author:
MCD Application Team
Version:
V1.2.3
Date:
10-July-2015
  
  ==============================================================================
                        ##### OPAMP Peripheral Features #####
  ==============================================================================
                   
  [..]
      The device integrates 4 operational amplifiers OPAMP1, OPAMP2, OPAMP3 and OPAMP4:
              
      (+) The OPAMPs non inverting input can be selected among the list shown by
          table below.
  
      (+) The OPAMPs inverting input can be selected among the list shown by
          table below.
  
      (+) The OPAMPs outputs can be internally connected to the inverting input 
          (follower mode)
      (+) The OPAMPs outputs can be internally connected to resistor feedback
          output (Programmable Gain Amplifier mode)
  
      (+) The OPAMPs outputs can be internally connected to ADC
  
      (+) The OPAMPs can be calibrated to compensate the offset compensation
  
      (+) Timer-controlled Mux for automatic switch of inverting and
          non-inverting input
  
  OPAMPs inverting/non-inverting inputs:
    +--------------------------------------------------------------+     
    |                 |        | OPAMP1 | OPAMP2 | OPAMP3 | OPAMP4 |
    |-----------------|--------|--------|--------|--------|--------|
    |                 | PGA    |  OK    |  OK    |  OK    |  OK    |
    | Inverting Input | Vout   |  OK    |  OK    |  OK    |  OK    |
    |                 | IO1    |  PC5   |  PC5   |  PB10  |  PB10  |
    |                 | IO2    |  PA3   |  PA5   |  PB2   |  PD8   |
    |-----------------|--------|--------|--------|--------|--------|
    |                 | IO1    |  PA7   |  PD14  |  PB13  |  PD11  |
    |  Non Inverting  | IO2    |  PA5   |  PB14  |  PA5   |  PB11  |
    |    Input        | IO3    |  PA3   |  PB0   |  PA1   |  PA4   |
    |                 | IO4    |  PA1   |  PA7   |  PB0   |  PB13  |
    +--------------------------------------------------------------+  
  
                        ##### How to use this driver #####
  ==============================================================================
  [..]
  This driver provides functions to configure and program the OPAMP 
  of all STM32F30x devices.
  
  To use the OPAMP, perform the following steps:
 
  (#) Enable the SYSCFG APB clock to get write access to OPAMP
      register using RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
  
  (#) Configure the OPAMP input in analog mode using GPIO_Init()
  
  (#) Configure the OPAMP using OPAMP_Init() function:
      (++) Select the inverting input
      (++) Select the non-inverting inverting input
    
  (#) Enable the OPAMP using OPAMP_Cmd() function
    
  
Attention:

© COPYRIGHT 2015 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm32f30x_opamp.c.