diff options
author | Drashna Jael're <drashna@live.com> | 2022-03-25 16:19:22 -0700 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2022-03-25 16:19:22 -0700 |
commit | 53ff570bf068e04740f187163774327839dfa68b (patch) | |
tree | 5429e069fc593d484b0b479de422b51ac239be83 /platforms/avr/drivers/analog.h | |
parent | e8171efc7158ba4ebb24827680b19b775d366b1a (diff) | |
parent | efc9c525b19b33c6e09057218ea64f07f45f9555 (diff) |
Remerge 0.16.x' into firmware21
Diffstat (limited to 'platforms/avr/drivers/analog.h')
-rw-r--r-- | platforms/avr/drivers/analog.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/platforms/avr/drivers/analog.h b/platforms/avr/drivers/analog.h index fa2fb0d89b..214f1f01fb 100644 --- a/platforms/avr/drivers/analog.h +++ b/platforms/avr/drivers/analog.h @@ -17,7 +17,7 @@ #pragma once #include <stdint.h> -#include "quantum.h" +#include "gpio.h" #ifdef __cplusplus extern "C" { @@ -32,21 +32,21 @@ int16_t adc_read(uint8_t mux); } #endif -#define ADC_REF_EXTERNAL 0 // AREF, Internal Vref turned off -#define ADC_REF_POWER _BV(REFS0) // AVCC with external capacitor on AREF pin -#define ADC_REF_INTERNAL (_BV(REFS1) | _BV(REFS0)) // Internal 2.56V Voltage Reference with external capacitor on AREF pin (1.1V for 328P) +#define ADC_REF_EXTERNAL 0 // AREF, Internal Vref turned off +#define ADC_REF_POWER _BV(REFS0) // AVCC with external capacitor on AREF pin +#define ADC_REF_INTERNAL (_BV(REFS1) | _BV(REFS0)) // Internal 2.56V Voltage Reference with external capacitor on AREF pin (1.1V for 328P) // These prescaler values are for high speed mode, ADHSM = 1 #if F_CPU == 16000000L || F_CPU == 12000000L -# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS1)) // /64 +# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS1)) // /64 #elif F_CPU == 8000000L -# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS0)) // /32 +# define ADC_PRESCALER (_BV(ADPS2) | _BV(ADPS0)) // /32 #elif F_CPU == 4000000L -# define ADC_PRESCALER (_BV(ADPS2)) // /16 +# define ADC_PRESCALER (_BV(ADPS2)) // /16 #elif F_CPU == 2000000L -# define ADC_PRESCALER (_BV(ADPS1) | _BV(ADPS0)) // /8 +# define ADC_PRESCALER (_BV(ADPS1) | _BV(ADPS0)) // /8 #elif F_CPU == 1000000L -# define ADC_PRESCALER _BV(ADPS1) // /4 +# define ADC_PRESCALER _BV(ADPS1) // /4 #else -# define ADC_PRESCALER _BV(ADPS0) // /2 +# define ADC_PRESCALER _BV(ADPS0) // /2 #endif |