]> git.tdb.fi Git - model-railway-devices.git/blob - common/adc.h
Provide peak current since last read
[model-railway-devices.git] / common / adc.h
1 #ifndef ADC_H_
2 #define ADC_H_
3
4 #include <avr/interrupt.h>
5
6 #define ADC_SET_CALLBACK(f) \
7         ISR(ADC_vect) \
8         { \
9                 uint16_t v = ADCL; \
10                 v |= ADCH<<8; \
11                 f(v); \
12         }
13
14 void adc_init();
15 void adc_read_async(uint8_t);
16
17 #endif