aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hwdef-Emisar_D4v2.h12
-rw-r--r--hwdef-Noctigon_KR4.h15
2 files changed, 16 insertions, 11 deletions
diff --git a/hwdef-Emisar_D4v2.h b/hwdef-Emisar_D4v2.h
index fc95e22..e118ed5 100644
--- a/hwdef-Emisar_D4v2.h
+++ b/hwdef-Emisar_D4v2.h
@@ -56,12 +56,12 @@
#endif
// this light has aux LEDs under the optic
-#define AUXLED_R_PIN PA5 // pin 2
-#define AUXLED_G_PIN PA4 // pin 3
-#define AUXLED_B_PIN PA3 // pin 4
-#define AUXLED_RGB_PORT PORTA // PORTA or PORTB or PORTC
-#define AUXLED_RGB_DDR DDRA // DDRA or DDRB or DDRC
-#define AUXLED_RGB_PUE PUEA // PUEA or PUEB or PUEC
+#define AUXLED_R_PIN PA5 // pin 2
+#define AUXLED_G_PIN PA4 // pin 3
+#define AUXLED_B_PIN PA3 // pin 4
+#define AUXLED_RGB_PORT PORTA // PORTA or PORTB or PORTC
+#define AUXLED_RGB_DDR DDRA // DDRA or DDRB or DDRC
+#define AUXLED_RGB_PUE PUEA // PUEA or PUEB or PUEC
#define BUTTON_LED_PIN PA1 // pin 6
#define BUTTON_LED_PORT PORTA // for all "PA" pins
diff --git a/hwdef-Noctigon_KR4.h b/hwdef-Noctigon_KR4.h
index 073fe27..feb49e6 100644
--- a/hwdef-Noctigon_KR4.h
+++ b/hwdef-Noctigon_KR4.h
@@ -1,14 +1,14 @@
#ifndef HWDEF_NOCTIGON_KR4_H
#define HWDEF_NOCTIGON_KR4_H
-/* Noctigon KR4 driver layout (attiny1634)
+/* Noctigon KR4 / D4V2.5 driver layout (attiny1634)
*
* Pin / Name / Function
* 1 PA6 FET PWM (direct drive) (PWM1B)
* 2 PA5 R: red aux LED (PWM0B)
* 3 PA4 G: green aux LED
* 4 PA3 B: blue aux LED
- * 5 PA2 (none)
+ * 5 PA2 button LED (D4V2.5 only)
* 6 PA1 (none)
* 7 PA0 (none)
* 8 GND GND
@@ -82,11 +82,10 @@
#define ADMUX_VOLTAGE_DIVIDER 0b10000110
#define ADC_PRSCL 0x07 // clk/128
-// TODO: calibrate this
// Raw ADC readings at 4.4V and 2.2V
// calibrate the voltage readout here
// estimated / calculated values are:
-// (voltage - D1) * (R2/(R2+R1) * 256 / 1.1)
+// (voltage - D1) * (R2/(R2+R1) * 1024 / 1.1)
// D1, R1, R2 = 0, 330, 100
#ifndef ADC_44
//#define ADC_44 981 // raw value at 4.40V
@@ -105,6 +104,11 @@
#define AUXLED_RGB_DDR DDRA // DDRA or DDRB or DDRC
#define AUXLED_RGB_PUE PUEA // PUEA or PUEB or PUEC
+#define BUTTON_LED_PIN PA2 // pin 5
+#define BUTTON_LED_PORT PORTA // for all "PA" pins
+#define BUTTON_LED_DDR DDRA // for all "PA" pins
+#define BUTTON_LED_PUE PUEA // for all "PA" pins
+
// with so many pins, doing this all with #ifdefs gets awkward...
// ... so just hardcode it in each hwdef file instead
inline void hwdef_setup() {
@@ -112,11 +116,12 @@ inline void hwdef_setup() {
// Opamp level and Opamp on/off
DDRB = (1 << PWM1_PIN)
| (1 << LED_ENABLE_PIN);
- // DD FET PWM, aux R/G/B
+ // DD FET PWM, aux R/G/B, button LED
DDRA = (1 << PWM2_PIN)
| (1 << AUXLED_R_PIN)
| (1 << AUXLED_G_PIN)
| (1 << AUXLED_B_PIN)
+ | (1 << BUTTON_LED_PIN)
;
// configure PWM
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.