aboutsummaryrefslogtreecommitdiff
path: root/arch/avr32dd20.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-24 06:29:56 -0700
committerSelene ToyKeeper2023-11-24 06:29:56 -0700
commit8c237206aba74f9096d85f90209ac6b7dc238b1b (patch)
tree529b22b5dec28bdab1029016dde9d85d80039c57 /arch/avr32dd20.h
parentavr32dd20-devkit: make the defaults a bit more dev friendly (diff)
downloadanduril-8c237206aba74f9096d85f90209ac6b7dc238b1b.tar.gz
anduril-8c237206aba74f9096d85f90209ac6b7dc238b1b.tar.bz2
anduril-8c237206aba74f9096d85f90209ac6b7dc238b1b.zip
more ADC / DAC / MCU progress...
- fixed t1616 Vref values getting clobbered sometimes, wrapped setting those in a #define'd function for ease and consistency - moved some DAC definitions from hw/ to arch/ to reduce repetition - fixed thefreeman's other builds - switched from PWM_TOPS to PWM2_LEVELS (I'm trying to phase out _TOPS)
Diffstat (limited to 'arch/avr32dd20.h')
-rw-r--r--arch/avr32dd20.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/avr32dd20.h b/arch/avr32dd20.h
index 82951de..09b4096 100644
--- a/arch/avr32dd20.h
+++ b/arch/avr32dd20.h
@@ -30,6 +30,19 @@ typedef enum
} clock_div_t;
+////////// DAC controls //////////
+
+// main LED outputs
+#define DAC_LVL DAC0_DATA // 0 to 1023, for 0V to Vref
+#define DAC_VREF VREF_DAC0REF // 1.024V, 2.048V, 4.096V, or 2.5V
+
+// Vref values (suitable for DAC and ADC0)
+#define V10 VREF_REFSEL_1V024_gc
+#define V20 VREF_REFSEL_2V048_gc
+#define V25 VREF_REFSEL_2V500_gc
+#define V40 VREF_REFSEL_4V096_gc
+
+
////////// ADC voltage / temperature //////////
#define hwdef_set_admux_therm mcu_set_admux_therm