From 6076bdf27d3c70675dff3b1866a3bbc82aa1eb00 Mon Sep 17 00:00:00 2001 From: Fabien Poussin Date: Thu, 31 Jan 2019 17:52:13 +0100 Subject: Updating OpAmp code with calibration functions, cleaning. --- testhal/STM32/STM32F3xx/OPAMP/main.c | 9 +++++---- testhal/STM32/STM32F3xx/OPAMP/mcuconf_community.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'testhal') diff --git a/testhal/STM32/STM32F3xx/OPAMP/main.c b/testhal/STM32/STM32F3xx/OPAMP/main.c index 2bdb755..39af13c 100644 --- a/testhal/STM32/STM32F3xx/OPAMP/main.c +++ b/testhal/STM32/STM32F3xx/OPAMP/main.c @@ -83,10 +83,10 @@ static const GPTConfig gpt6cfg1 = { * We will double the input voltage */ static const OPAMPConfig opamp1_conf = { - STM32_OPAMP_NonInvertingInput_IO4 | // INP connectd to PA1 - STM32_OPAMP_InvertingInput_PGA | // INM connected to PGA - STM32_OPAMP_PGAGain_2 | // Gain of 2x - STM32_OPAMP_PGAConnect_No // PGA connected to ground + OPAMP1_CSR_VPSEL_PA01 | // INP connectd to PA1 + OPAMP1_CSR_VMSEL_PGA | // INM connected to PGA + OPAMPx_CSR_PGAGAIN_x2 | // Gain of 2x + OPAMPx_CSR_PGACONNECT_GROUND // PGA connected to ground }; /* @@ -118,6 +118,7 @@ int main(void) { gptStartContinuous(&GPTD6, 2U); opampEnable(&OPAMPD1); + opampCalibrate(); /* * Normal main() thread activity. diff --git a/testhal/STM32/STM32F3xx/OPAMP/mcuconf_community.h b/testhal/STM32/STM32F3xx/OPAMP/mcuconf_community.h index 76f9429..2f44dc1 100644 --- a/testhal/STM32/STM32F3xx/OPAMP/mcuconf_community.h +++ b/testhal/STM32/STM32F3xx/OPAMP/mcuconf_community.h @@ -92,6 +92,7 @@ #define STM32_OPAMP_USE_OPAMP2 TRUE #define STM32_OPAMP_USE_OPAMP3 TRUE #define STM32_OPAMP_USE_OPAMP4 TRUE +#define STM32_OPAMP_USER_TRIM_ENABLED TRUE /* * USBH driver system settings. -- cgit v1.2.3