Basic setup is simple:
Code: Select all
adcStart(&ADCD1, NULL);
adcSTM32EnableVREF(&ADCD1);
adcSTM32EnableTS(&ADCD1);
:
:
static const ADCConversionGroup adcgrpcfg1 =
{
.circular = FALSE,
.num_channels = ADC_GRP1_NUM_CHANNELS,
.end_cb = NULL,
.error_cb = adcerrorcallback,
// ADC_CFGR1_ALIGN | ADC_CFGR1_RES_12BIT, /* CFGRR1 - Left align data, 12-bit */
.cfgr1 = ADC_CFGR1_RES_12BIT, /* CFGRR1 - Right align data, 12-bit */
.cfgr2 = 0, /* CFGRR2 */
.tr = ADC_TR(0, 0), /* TR */
.smpr = ADC_SMPR_SMP_79P5, /* SMPR - Go for slow sampling/conversion */
.chselr = ADC_CHSELR_CHSEL1 | ADC_CHSELR_CHSEL4 | ADC_CHSELR_CHSEL5 /* CHSELR */
};
result = adcConvert(&ADCD1, &adcgrpcfg1, samples1, ADC_GRP1_BUF_DEPTH);
Works as expected with ADC_GRP1_BUF_DEPTH = 1, but not with ADC_GRP1_BUF_DEPTH = 4
(I also tried with .circular = TRUE; just hangs).
Am I missing something, or is the feature not implemented on ADC1?
(I also looked at ADC5 for a comparison, and couldn't see that it was implemented there either)