aboutsummaryrefslogtreecommitdiff
path: root/hw/thefreeman/boost21-mp3431-hdr-dac-argb
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
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')
-rw-r--r--hw/thefreeman/boost21-mp3431-hdr-dac-argb/anduril.h8
-rw-r--r--hw/thefreeman/boost21-mp3431-hdr-dac-argb/hwdef.h12
2 files changed, 11 insertions, 9 deletions
diff --git a/hw/thefreeman/boost21-mp3431-hdr-dac-argb/anduril.h b/hw/thefreeman/boost21-mp3431-hdr-dac-argb/anduril.h
index 64da638..a6a111c 100644
--- a/hw/thefreeman/boost21-mp3431-hdr-dac-argb/anduril.h
+++ b/hw/thefreeman/boost21-mp3431-hdr-dac-argb/anduril.h
@@ -24,10 +24,10 @@
8, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 23, 24, 26, 27, 29, 31, 33, 35, 37, 40, 42, 45, 47, 50, 53, 56, 59, 62, 66, 69, 73, 77, 81, 85, 90, 94, 99,104,109,114,120,126,132,138,144,151,158,165,173,180,188,196,205,214,223,232,242,252, \
57, 60, 62, 65, 67, 70, 73, 76, 78, 82, 85, 88, 91, 95, 98,102,105,109,113,117,121,126,130,135,139,144,149,154,159,164,170,175,181,187,193,199,206,212,219,225,232,240,247,255
// PWM Tops: VREF selector (0.55V=16,1.1V=17, 2.5V=18, 4.3V=19, 1.5V=20)
-#define PWM_TOPS 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, \
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, \
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18
+#define PWM_TOPS V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05, \
+ V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25, \
+ V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05,V05, \
+ V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25,V25
#define MAX_1x7135 44
#define DEFAULT_LEVEL 44
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