aboutsummaryrefslogtreecommitdiff
path: root/hw/hank/kr1aa
diff options
context:
space:
mode:
Diffstat (limited to 'hw/hank/kr1aa')
-rw-r--r--hw/hank/kr1aa/anduril.h65
-rw-r--r--hw/hank/kr1aa/arch1
-rw-r--r--hw/hank/kr1aa/model1
-rw-r--r--hw/hank/kr1aa/readme.md12
4 files changed, 79 insertions, 0 deletions
diff --git a/hw/hank/kr1aa/anduril.h b/hw/hank/kr1aa/anduril.h
new file mode 100644
index 0000000..f3ed9ad
--- /dev/null
+++ b/hw/hank/kr1aa/anduril.h
@@ -0,0 +1,65 @@
+// Emisar / Noctigon KR1AA config options for Anduril
+// Copyright (C) 2026 Selene ToyKeeper
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+#define HWDEF_H hank/emisar-d3aa/hwdef.h
+#include "hank/anduril.h"
+#include "hank/emisar-d3aa/anduril.h"
+
+// wait this many ms at boot before testing the battery
+// (or doing anything else)
+// (to give the user more time to make a solid electrical connection)
+#define WEAK_BATTERY_TEST_DELAY 500
+
+#undef RAMP_SIZE
+#define RAMP_SIZE 150
+
+// 4 ramp segments:
+// - low 1.024V
+// - low 2.5 V
+// - high 1.024V
+// - high 2.5 V
+// 2nd gear starts at 23:
+// ./bin/dac-scale.py $( ./bin/level_calc.py 3.906 1 150 7135 3 0.01 1400 --pwm 285400 | grep PWM1 | cut -d : -f 2- )
+// top level for each "gear": 30 40 118 150
+// 2nd gear starts at 24:
+// ./bin/dac-scale.py $( ./bin/level_calc.py 3.856 1 150 7135 3 0.01 1400 --pwm 273200 | grep PWM1 | cut -d : -f 2- )
+// top level for each "gear": 30 40 117 150
+#undef PWM1_LEVELS
+#define PWM1_LEVELS \
+ 3, 5, 6, 9, 12, 16, 21, 28, 36, 46, 57, 71, 86, 105, 126, 150, 177, 208, 243, 282, 326, 374, 428, 487, 552, 623, 700, 785, 877, 977, \
+ 444, 491, 543, 598, 658, 722, 790, 862, 940,1023, \
+ 24, 26, 29, 31, 33, 36, 39, 42, 45, 48, 52, 55, 59, 63, 67, 71, 76, 81, 86, 91, 96, 102, 108, 114, 120, 127, 134, 141, 149, 157, 165, 173, 182, 191, 200, 210, 220, 230, 241, 252, 264, 276, 288, 301, 314, 327, 341, 355, 370, 385, 401, 417, 434, 451, 469, 487, 505, 525, 544, 564, 585, 607, 628, 651, 674, 698, 722, 747, 773, 799, 826, 853, 881, 910, 940, 970,1001, \
+ 423, 436, 450, 463, 478, 492, 507, 522, 538, 554, 570, 586, 603, 621, 638, 656, 675, 693, 712, 732, 752, 772, 793, 814, 836, 858, 880, 903, 926, 950, 974, 998,1023
+#undef PWM2_LEVELS
+#define PWM2_LEVELS \
+ V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, \
+ V25, V25, V25, V25, V25, V25, V25, V25, V25, V25, \
+ V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, V10, \
+ 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 40
+#undef MAX_1x7135
+#define HDR_ENABLE_LEVEL_MIN 41
+#define MAX_1x7135 40
+
+#undef DEFAULT_LEVEL
+#define DEFAULT_LEVEL 50
+
+// no PWM, so MCU clock speed can be slow
+#undef HALFSPEED_LEVEL
+#define HALFSPEED_LEVEL 41
+#undef QUARTERSPEED_LEVEL
+#define QUARTERSPEED_LEVEL 40 // seems to run fine at 10kHz/4, try reducing more?
+
+
+// AUX
+
+// there is no lighted button
+// (but it doesn't hurt to leave this enabled,
+// and then this firmware can be used on D3AA too)
+//#ifdef USE_BUTTON_LED
+//#undef USE_BUTTON_LED
+//#endif
+
+
diff --git a/hw/hank/kr1aa/arch b/hw/hank/kr1aa/arch
new file mode 100644
index 0000000..bcf4552
--- /dev/null
+++ b/hw/hank/kr1aa/arch
@@ -0,0 +1 @@
+avr32dd20
diff --git a/hw/hank/kr1aa/model b/hw/hank/kr1aa/model
new file mode 100644
index 0000000..cdc9591
--- /dev/null
+++ b/hw/hank/kr1aa/model
@@ -0,0 +1 @@
+0162
diff --git a/hw/hank/kr1aa/readme.md b/hw/hank/kr1aa/readme.md
new file mode 100644
index 0000000..247080b
--- /dev/null
+++ b/hw/hank/kr1aa/readme.md
@@ -0,0 +1,12 @@
+# Emisar / Noctigon KR1AA
+
+This is the same as the [D3AA](../emisar-d3aa) driver, but with the following
+changes:
+
+- Increased the time before measuring battery strength, to give the user more
+ time to tighten the tailcap first. The host has a reputation for being
+ difficult to tighten quickly enough to get a strong connection.
+
+- Tweaked the ramp shape slightly to eliminate a "gear change" zig-zag which
+ seems to occur on KR1AA but not D3AA.
+
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.