diff options
| author | Selene ToyKeeper | 2023-11-27 08:47:37 -0700 |
|---|---|---|
| committer | Selene ToyKeeper | 2023-11-27 08:47:37 -0700 |
| commit | 37feeae1ac48ae9b70c99b768943648fd6c354ff (patch) | |
| tree | cca4e711dc234d33233006afb85b82547cd0f04b /arch/attiny85.h | |
| parent | fixed ADC on attiny1634 and related builds (diff) | |
| download | anduril-37feeae1ac48ae9b70c99b768943648fd6c354ff.tar.gz anduril-37feeae1ac48ae9b70c99b768943648fd6c354ff.tar.bz2 anduril-37feeae1ac48ae9b70c99b768943648fd6c354ff.zip | |
fixed ADC on attiny85 and related builds
(also enabled smooth steps on BLF GT, but had to remove stuff to make room)
Diffstat (limited to 'arch/attiny85.h')
| -rw-r--r-- | arch/attiny85.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/attiny85.h b/arch/attiny85.h index 2753fd7..3f6ffcb 100644 --- a/arch/attiny85.h +++ b/arch/attiny85.h @@ -21,8 +21,6 @@ ////////// default hw_setup() ////////// -// FIXME: fsm/main should call hwdef_setup(), not hw_setup, -// and this function should be hwdef_setup #ifdef USE_GENERIC_HWDEF_SETUP static inline void hwdef_setup(); #endif @@ -48,8 +46,6 @@ inline void mcu_adc_sleep_mode(); inline void mcu_adc_start_measurement(); -inline void mcu_adc_on(); - inline void mcu_adc_off(); // NOP because interrupt flag clears itself @@ -57,6 +53,15 @@ inline void mcu_adc_off(); inline uint16_t mcu_adc_result(); +// return Volts * 40, range 0 to 6.375V +#define voltage_raw2cooked mcu_vdd_raw2cooked +inline uint8_t mcu_vdd_raw2cooked(uint16_t measurement); +inline uint8_t mcu_vdivider_raw2cooked(uint16_t measurement); + +// return (temp in Kelvin << 6) +#define temp_raw2cooked mcu_temp_raw2cooked +inline uint16_t mcu_temp_raw2cooked(uint16_t measurement); + inline uint8_t mcu_adc_lsb(); |
