m05e00 done
This commit is contained in:
15
headers/adc.h
Normal file
15
headers/adc.h
Normal 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
|
||||
Reference in New Issue
Block a user