wip commenting

This commit is contained in:
hugogogo
2025-03-13 16:02:27 +01:00
parent 24158c8f4d
commit 7ca02352d9
7 changed files with 62 additions and 36 deletions

15
module05/ex00/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