aboutsummaryrefslogtreecommitdiffstats
path: root/source/adc.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2021-03-04 17:54:40 -0500
committerClyne Sullivan <clyne@bitgloo.com>2021-03-04 17:54:40 -0500
commiteeeb04fa1a202c68279d4b4ee0a1e3ff34c62c7f (patch)
treed297b41a662c831d7e5bab76c85f48d33e2c604b /source/adc.cpp
parent5f6181bb3c6ab4274a8068aaf14b278fa65e443e (diff)
add L4 and G4 to ChibiOS; delete bloat
Diffstat (limited to 'source/adc.cpp')
-rw-r--r--source/adc.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/adc.cpp b/source/adc.cpp
index 3f334ac..b0c0312 100644
--- a/source/adc.cpp
+++ b/source/adc.cpp
@@ -53,10 +53,38 @@ adcsample_t *ADC::m_current_buffer = nullptr;
size_t ADC::m_current_buffer_size = 0;
ADC::Operation ADC::m_operation = nullptr;
+//static const ADCConfig m_config2 = {};
+//ADCConversionGroup m_group_config2 = {
+// .circular = false,
+// .num_channels = 1,
+// .end_cb = nullptr,
+// .error_cb = nullptr,
+// .cfgr = 0,
+// .cfgr2 = 0,
+// .ccr = 0,
+// .pcsel = 0,
+// .ltr1 = 0, .htr1 = 0x0FFF,
+// .ltr2 = 0, .htr2 = 0x0FFF,
+// .ltr3 = 0, .htr3 = 0x0FFF,
+// .smpr = {
+// ADC_SMPR1_SMP_AN5(ADC_SMPR_SMP_12P5), 0
+// },
+// .sqr = {
+// ADC_SQR1_SQ1_N(ADC_CHANNEL_IN10),
+// 0, 0, 0
+// },
+//};
+
void ADC::begin()
{
palSetPadMode(GPIOF, 3, PAL_MODE_INPUT_ANALOG);
+ //palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_ANALOG);
+ //adcStart(&ADCD1, &m_config2);
+ //adcsample_t val = 0;
+ //adcConvert(&ADCD1, &m_group_config2, &val, 1);
+ //adcStop(&ADCD1);
+
adcStart(m_driver, &m_config);
adcSTM32EnableVREF(m_driver);
}