aboutsummaryrefslogtreecommitdiff
path: root/hwdef-Noctigon_K1-12V.h
diff options
context:
space:
mode:
authorSelene ToyKeeper2020-02-25 23:43:33 -0700
committerSelene ToyKeeper2020-02-25 23:43:33 -0700
commit7d07887e11cf7804ce8eb15fac666551b9a2497e (patch)
treef0b1d770aa80cc37f9e47e5ee30219846b38f912 /hwdef-Noctigon_K1-12V.h
parentAdded template files for Noctigon K1 12V model. (diff)
downloadanduril-7d07887e11cf7804ce8eb15fac666551b9a2497e.tar.gz
anduril-7d07887e11cf7804ce8eb15fac666551b9a2497e.tar.bz2
anduril-7d07887e11cf7804ce8eb15fac666551b9a2497e.zip
added support for boost PMIC enable pin (K1 12V has 2 pins which need to turn on/off for main LED output)
Diffstat (limited to 'hwdef-Noctigon_K1-12V.h')
-rw-r--r--hwdef-Noctigon_K1-12V.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/hwdef-Noctigon_K1-12V.h b/hwdef-Noctigon_K1-12V.h
index f34b768..2294bac 100644
--- a/hwdef-Noctigon_K1-12V.h
+++ b/hwdef-Noctigon_K1-12V.h
@@ -19,7 +19,7 @@
* 12 PC3 RESET
* 13 PC2 (none)
* 14 PC1 SCK
- * 15 PC0 (none) PWM0A
+ * 15 PC0 boost PMIC enable (PWM0A not used)
* 16 PB3 main LED PWM (PWM1A)
* 17 PB2 MISO
* 18 PB1 MOSI / battery voltage (ADC6)
@@ -56,6 +56,9 @@
#define LED_ENABLE_PIN PB0 // pin 19, Opamp power
#define LED_ENABLE_PORT PORTB // control port for PB0
+#define LED_ENABLE2_PIN PC0 // pin 15, boost PMIC enable
+#define LED_ENABLE2_PORT PORTC // control port for PC0
+
#define USE_VOLTAGE_DIVIDER // use a dedicated pin, not VCC, because VCC input is flattened
#define VOLTAGE_PIN PB1 // Pin 18 / PB1 / ADC6
@@ -101,6 +104,8 @@
// ... so just hardcode it in each hwdef file instead
inline void hwdef_setup() {
// enable output ports
+ // boost PMIC on/off
+ DDRC = (1 << LED_ENABLE2_PIN);
// Opamp level and Opamp on/off
DDRB = (1 << PWM1_PIN)
| (1 << LED_ENABLE_PIN);
@@ -126,7 +131,6 @@ inline void hwdef_setup() {
;
// set up e-switch
- //PORTA = (1 << SWITCH_PIN); // TODO: configure PORTA / PORTB / PORTC?
PUEA = (1 << SWITCH_PIN); // pull-up for e-switch
SWITCH_PCMSK = (1 << SWITCH_PCINT); // enable pin change interrupt
}