aboutsummaryrefslogtreecommitdiff
path: root/hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-19 01:48:50 -0700
committerSelene ToyKeeper2023-11-19 01:48:50 -0700
commit79c1d9ebfed691b1048205ebdfd91d33cfcfc8a1 (patch)
tree8078bcf3affb50860da96231fccd3b285622bf97 /hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h
parentmoved prevent_reboot_loop() and some other junk out of fsm/main.c (diff)
downloadanduril-79c1d9ebfed691b1048205ebdfd91d33cfcfc8a1.tar.gz
anduril-79c1d9ebfed691b1048205ebdfd91d33cfcfc8a1.tar.bz2
anduril-79c1d9ebfed691b1048205ebdfd91d33cfcfc8a1.zip
thefreeman/boost*: define Vref values more explicitly without magic numbers
Diffstat (limited to 'hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h')
-rw-r--r--hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h b/hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h
index 72aa7b0..d030516 100644
--- a/hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h
+++ b/hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h
@@ -70,11 +70,13 @@ enum CHANNEL_MODES {
#define DAC_VREF VREF.CTRLA // 0.55V or 2.5V
#define PWM_TOP_INIT 255 // highest value used in top half of ramp (unused?)
// Vref values
-#define V055 16
-#define V11 17
-#define V25 18
-#define V43 19
-#define V15 20
+// (1.1V ADC + variable DAC)
+#define V05 V055
+#define V055 (VREF_ADC0REFSEL_1V1_gc|VREF_DAC0REFSEL_0V55_gc)
+#define V11 (VREF_ADC0REFSEL_1V1_gc|VREF_DAC0REFSEL_1V1_gc)
+#define V25 (VREF_ADC0REFSEL_1V1_gc|VREF_DAC0REFSEL_2V5_gc)
+#define V43 (VREF_ADC0REFSEL_1V1_gc|VREF_DAC0REFSEL_4V34_gc)
+#define V15 (VREF_ADC0REFSEL_1V1_gc|VREF_DAC0REFSEL_1V5_gc)
// BST enable
#define BST_ENABLE_PIN PIN0_bp