analog works

This commit is contained in:
Matthew Kennedy 2020-10-26 12:53:45 -07:00
parent 3e90915d48
commit 55d693e9a5
1 changed files with 7 additions and 3 deletions

View File

@ -2,14 +2,18 @@
#include "hal.h"
#define ADC_CHANNEL_COUNT 3
#define ADC_OVERSAMPLE 8
static adcsample_t adcBuffer[3 * ADC_OVERSAMPLE];
static adcsample_t adcBuffer[ADC_CHANNEL_COUNT * ADC_OVERSAMPLE];
ADCConversionGroup convGroup =
{
false, 3, nullptr, nullptr,
0, // CFGR1
false,
ADC_CHANNEL_COUNT,
nullptr,
nullptr,
ADC_CFGR1_CONT | ADC_CFGR1_RES_12BIT, // CFGR1
ADC_TR(0, 0), // TR
ADC_SMPR_SMP_28P5, // SMPR
ADC_CHSELR_CHSEL0 | ADC_CHSELR_CHSEL1 | ADC_CHSELR_CHSEL2