diff options
Diffstat (limited to 'chip/stm32/adc-stm32l.c')
-rw-r--r-- | chip/stm32/adc-stm32l.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/chip/stm32/adc-stm32l.c b/chip/stm32/adc-stm32l.c index 3e8edde278..5a67254f29 100644 --- a/chip/stm32/adc-stm32l.c +++ b/chip/stm32/adc-stm32l.c @@ -174,40 +174,3 @@ int adc_read_channel(enum adc_channel ch) return (value == ADC_READ_ERROR) ? ADC_READ_ERROR : value * adc->factor_mul / adc->factor_div + adc->shift; } - -int adc_read_all_channels(int *data) -{ - int i; - int16_t raw_data[ADC_CH_COUNT]; - const struct adc_t *adc; - int ret = EC_SUCCESS; - - mutex_lock(&adc_lock); - - adc_prepare(); - - adc_configure_all(); - - dma_start_rx(&dma_adc_option, ADC_CH_COUNT, raw_data); - - /* Start conversion */ - STM32_ADC_CR2 |= (1 << 30); /* SWSTART */ - - if (dma_wait(STM32_DMAC_ADC)) { - ret = EC_ERROR_UNKNOWN; - goto exit_all_channels; - } - dma_clear_isr(STM32_DMAC_ADC); - - for (i = 0; i < ADC_CH_COUNT; ++i) { - adc = adc_channels + i; - data[i] = raw_data[i] * adc->factor_mul / adc->factor_div + - adc->shift; - } - -exit_all_channels: - adc_release(); - mutex_unlock(&adc_lock); - - return ret; -} |