m05e00 done

This commit is contained in:
hugogogo
2025-03-13 18:42:34 +01:00
parent 7ca02352d9
commit 00bcdb1a79
4 changed files with 18 additions and 15 deletions

15
headers/adc.h Normal file
View File

@@ -0,0 +1,15 @@
#ifndef ADC_H
#define ADC_H
// Table 24-5 : prescaler ADC
#define ADC_PRESCALE_SET(value) \
((value) == 2 ? (0<<ADPS2 | 0<<ADPS1 | 1<<ADPS0) : \
(value) == 4 ? (0<<ADPS2 | 1<<ADPS1 | 0<<ADPS0) : \
(value) == 8 ? (0<<ADPS2 | 1<<ADPS1 | 1<<ADPS0) : \
(value) == 16 ? (1<<ADPS2 | 0<<ADPS1 | 0<<ADPS0) : \
(value) == 32 ? (1<<ADPS2 | 0<<ADPS1 | 1<<ADPS0) : \
(value) == 64 ? (1<<ADPS2 | 1<<ADPS1 | 0<<ADPS0) : \
(value) == 128 ? (1<<ADPS2 | 1<<ADPS1 | 1<<ADPS0) : \
(0<<ADPS2 | 0<<ADPS1 | 0<<ADPS0))
#endif // ADC_H