Hi Francisco,
We did it a while ago, it's quite easy.
https://github.com/unwireddevices/RIOT/blob/master/cpu/stm32l1/periph/adc.c
https://github.com/unwireddevices/RIOT/blob/master/cpu/stm32l1/include/perip
h_cpu.h
1) In board.h configure internal ADC channels with GPIO_UNDEF pin
#define ADC_CONFIG {\
{ GPIO_PIN(PORT_A, 1), 1 },\
{ GPIO_PIN(PORT_A, 2), 2 },\
{ GPIO_PIN(PORT_A, 3), 3 },\
{ GPIO_PIN(PORT_A, 4), 4 },\
{ GPIO_PIN(PORT_A, 5), 5 },\
{ GPIO_PIN(PORT_A, 6), 6 }, \
{ GPIO_PIN(PORT_A, 7), 7 }, \
{ GPIO_UNDEF, ADC_VREF_CHANNEL}, \
{ GPIO_UNDEF, ADC_TEMPERATURE_CHANNEL}, \
}
2) In adc.c do not initialize GPIO if it equals GPIO_UNDEF (lines
87-90)
3) In adc.c before accessing internal lines, wake up sensor and Vref
(lines 171-174), after getting data disable it (lines 206-207)
That's it.
--
Oleg Artamonov
+7 (916) 631-34-90
www.unwds.com
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel