diff options
author | Fabien Poussin <fabien.poussin@gmail.com> | 2019-01-08 20:15:28 +0100 |
---|---|---|
committer | Fabien Poussin <fabien.poussin@gmail.com> | 2019-01-08 20:15:28 +0100 |
commit | 05faf884a41470970fd9638a1be6a0b76bfb71e2 (patch) | |
tree | ffd9ff8eed2f7f7231281f5656f2daea198deb27 /testhal | |
parent | 91e635b08a57e44ce1f7deb0328a5ae78117f8d4 (diff) | |
download | ChibiOS-Contrib-05faf884a41470970fd9638a1be6a0b76bfb71e2.tar.gz ChibiOS-Contrib-05faf884a41470970fd9638a1be6a0b76bfb71e2.tar.bz2 ChibiOS-Contrib-05faf884a41470970fd9638a1be6a0b76bfb71e2.zip |
Updated opamp example
Diffstat (limited to 'testhal')
-rw-r--r-- | testhal/STM32/STM32F3xx/OPAMP/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/testhal/STM32/STM32F3xx/OPAMP/main.c b/testhal/STM32/STM32F3xx/OPAMP/main.c index 0345f12..2bdb755 100644 --- a/testhal/STM32/STM32F3xx/OPAMP/main.c +++ b/testhal/STM32/STM32F3xx/OPAMP/main.c @@ -78,8 +78,15 @@ static const GPTConfig gpt6cfg1 = { .dier = 0U
};
+/*
+ * OpAmp configuration.
+ * We will double the input voltage
+ */
static const OPAMPConfig opamp1_conf = {
- 0
+ 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
};
/*
|