aboutsummaryrefslogtreecommitdiff
path: root/hw/hank/noctigon-kr4/boost
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-11-03 09:07:37 -0600
committerSelene ToyKeeper2023-11-03 09:07:37 -0600
commitcf0ed5c4bd07e191088977722010e9eec94a7c05 (patch)
tree4c2e4156a74cf3a6f1bad1f1d4b5087bb74a9f32 /hw/hank/noctigon-kr4/boost
parentfixed compile scripts and added a "./make" wrapper for convenience (diff)
downloadanduril-cf0ed5c4bd07e191088977722010e9eec94a7c05.tar.gz
anduril-cf0ed5c4bd07e191088977722010e9eec94a7c05.tar.bz2
anduril-cf0ed5c4bd07e191088977722010e9eec94a7c05.zip
moved variant builds under their parent, like "d4-219" -> "d4/219"
Diffstat (limited to 'hw/hank/noctigon-kr4/boost')
-rw-r--r--hw/hank/noctigon-kr4/boost/anduril.h16
-rw-r--r--hw/hank/noctigon-kr4/boost/hwdef.h57
2 files changed, 73 insertions, 0 deletions
diff --git a/hw/hank/noctigon-kr4/boost/anduril.h b/hw/hank/noctigon-kr4/boost/anduril.h
new file mode 100644
index 0000000..a3b33ee
--- /dev/null
+++ b/hw/hank/noctigon-kr4/boost/anduril.h
@@ -0,0 +1,16 @@
+// Noctigon KR4 (12V) config options for Anduril
+// (and Noctigon KR1)
+// Copyright (C) 2020-2023 Selene ToyKeeper
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+// the only things different from dm11-boost are:
+// - e-switch is on a different pin (defined in hwdef)
+// - different model number
+#include "hank/noctigon-dm11/boost/anduril.h"
+#include "hank/noctigon-kr4/boost/hwdef.h"
+#undef MODEL_NUMBER
+#define MODEL_NUMBER "0216"
+#include "hank/anduril.h"
+// ATTINY: 1634
+
diff --git a/hw/hank/noctigon-kr4/boost/hwdef.h b/hw/hank/noctigon-kr4/boost/hwdef.h
new file mode 100644
index 0000000..f17d263
--- /dev/null
+++ b/hw/hank/noctigon-kr4/boost/hwdef.h
@@ -0,0 +1,57 @@
+// Noctigon KR4 boost driver layout (attiny1634)
+// Copyright (C) 2020-2023 Selene ToyKeeper
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+/*
+ * (based on Noctigon DM11-boost and KR4)
+ * (is basically the same except the switch is on a different pin)
+ *
+ * Pin / Name / Function
+ * 1 PA6 (none) (PWM1B) (reserved for DD drivers)
+ * 2 PA5 R: red aux LED (PWM0B)
+ * 3 PA4 G: green aux LED
+ * 4 PA3 B: blue aux LED
+ * 5 PA2 L: button LED
+ * 6 PA1 (none)
+ * 7 PA0 (none)
+ * 8 GND GND
+ * 9 VCC VCC
+ * 10 PC5 (none)
+ * 11 PC4 (none)
+ * 12 PC3 RESET
+ * 13 PC2 (none)
+ * 14 PC1 SCK
+ * 15 PC0 boost PMIC enable (PWM0A not used)
+ * 16 PB3 main LED PWM (PWM1A)
+ * 17 PB2 MISO / e-switch (PCINT10)
+ * 18 PB1 MOSI / battery voltage (ADC6)
+ * 19 PB0 Opamp power
+ * 20 PA7 (none) (PCINT7)
+ * ADC12 thermal sensor
+ *
+ * Main LED power uses one pin to turn the Opamp on/off,
+ * and one pin to control Opamp power level.
+ * Linear brightness control uses the power level pin, with dynamic PWM.
+ * The on/off pin is only used to turn the main LED on and off,
+ * not to change brightness.
+ */
+
+#include "hank/noctigon-dm11/boost/hwdef.h"
+
+// e-switch is on a different pin
+#undef SWITCH_PIN
+#undef SWITCH_PCINT
+#undef SWITCH_PCIE
+#undef SWITCH_PCMSK
+#undef SWITCH_PORT
+#undef SWITCH_PUE
+#undef PCINT_vect
+#define SWITCH_PIN PB2 // pin 17
+#define SWITCH_PCINT PCINT10 // pin 17 pin change interrupt
+#define SWITCH_PCIE PCIE1 // PCIE1 is for PCINT[11:8]
+#define SWITCH_PCMSK PCMSK1 // PCMSK1 is for PCINT[11:8]
+#define SWITCH_PORT PINB // PINA or PINB or PINC
+#define SWITCH_PUE PUEB // pullup group B
+#define PCINT_vect PCINT1_vect // ISR for PCINT[11:8]
+
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.