summaryrefslogtreecommitdiff
path: root/keyboards/hhkb/ansi
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-09-25 16:02:54 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-09-25 16:02:54 +0200
commit6afdd9d74da250e47ac64d6690bd19d037045e99 (patch)
tree661f6cfb244c02bcd1fbfe8fb9b2bd9242a91394 /keyboards/hhkb/ansi
parent93a55e61b59d20f7cd842cce02e5b18a63a23612 (diff)
parent1bdf4cdc22ae57d111efb2f7d71e405e5c7b3f11 (diff)
downloadqmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.tar.gz
qmk_firmware-6afdd9d74da250e47ac64d6690bd19d037045e99.zip
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/hhkb/ansi')
-rw-r--r--keyboards/hhkb/ansi/32u2/rules.mk5
-rw-r--r--keyboards/hhkb/ansi/config.h7
-rw-r--r--keyboards/hhkb/ansi/hhkb_avr.h54
-rw-r--r--keyboards/hhkb/ansi/info.json8
-rw-r--r--keyboards/hhkb/ansi/keymaps/cinaeco/keymap.c2
-rw-r--r--keyboards/hhkb/ansi/keymaps/tominabox1/keymap.c2
-rw-r--r--keyboards/hhkb/ansi/keymaps/xyverz/keymap.c2
-rw-r--r--keyboards/hhkb/ansi/rules.mk4
8 files changed, 71 insertions, 13 deletions
diff --git a/keyboards/hhkb/ansi/32u2/rules.mk b/keyboards/hhkb/ansi/32u2/rules.mk
new file mode 100644
index 0000000000..0c0b4c37c2
--- /dev/null
+++ b/keyboards/hhkb/ansi/32u2/rules.mk
@@ -0,0 +1,5 @@
+# MCU name
+MCU = atmega32u2
+
+CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
diff --git a/keyboards/hhkb/ansi/config.h b/keyboards/hhkb/ansi/config.h
index 8307fc1679..f2ba9fd74a 100644
--- a/keyboards/hhkb/ansi/config.h
+++ b/keyboards/hhkb/ansi/config.h
@@ -19,13 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h"
-/* USB Device descriptor parameter */
-#define VENDOR_ID 0x4848 // HH = happy hacking
-#define PRODUCT_ID 0x0001 // ANSI HHKB
-#define DEVICE_VER 0x0104
-#define MANUFACTURER q.m.k
-#define PRODUCT HHKB mod
-
/* key matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 8
diff --git a/keyboards/hhkb/ansi/hhkb_avr.h b/keyboards/hhkb/ansi/hhkb_avr.h
index f9446deef7..a805445e9b 100644
--- a/keyboards/hhkb/ansi/hhkb_avr.h
+++ b/keyboards/hhkb/ansi/hhkb_avr.h
@@ -78,6 +78,60 @@ static inline void KEY_SELECT(uint8_t ROW, uint8_t COL)
}
+#elif defined(__AVR_ATmega32U2__)
+/*
+ * For TMK HHKB alt controller(ATMega32U4)
+ *
+ * row: PB0-2
+ * col: PB3-5,6
+ * key: PD3(pull-uped)
+ * prev: PB7
+ * power: PD4(L:off/H:on)
+ * row-ext: PC6,7 for HHKB JP(active low)
+ */
+static inline void KEY_ENABLE(void) { (PORTB &= ~(1<<6)); }
+static inline void KEY_UNABLE(void) { (PORTB |= (1<<6)); }
+static inline bool KEY_STATE(void) { return (PIND & (1<<3)); }
+static inline void KEY_PREV_ON(void) { (PORTB |= (1<<7)); }
+static inline void KEY_PREV_OFF(void) { (PORTB &= ~(1<<7)); }
+#ifdef HHKB_POWER_SAVING
+static inline void KEY_POWER_ON(void) {
+ DDRB = 0xFF; PORTB = 0x40; // change pins output
+ DDRD |= (1<<4); PORTD |= (1<<4); // MOS FET switch on
+ /* Without this wait you will miss or get false key events. */
+ _delay_ms(5); // wait for powering up
+}
+static inline void KEY_POWER_OFF(void) {
+ /* input with pull-up consumes less than without it when pin is open. */
+ DDRB = 0x00; PORTB = 0xFF; // change pins input with pull-up
+ DDRD |= (1<<4); PORTD &= ~(1<<4); // MOS FET switch off
+}
+static inline bool KEY_POWER_STATE(void) { return PORTD & (1<<4); }
+#else
+static inline void KEY_POWER_ON(void) {}
+static inline void KEY_POWER_OFF(void) {}
+static inline bool KEY_POWER_STATE(void) { return true; }
+#endif
+static inline void KEY_INIT(void)
+{
+ /* row,col,prev: output */
+ DDRB = 0xFF;
+ PORTB = 0x40; // unable
+ /* key: input with pull-up */
+ DDRD &= ~0x80;
+ PORTD |= 0x80;
+
+ KEY_UNABLE();
+ KEY_PREV_OFF();
+
+ KEY_POWER_OFF();
+}
+static inline void KEY_SELECT(uint8_t ROW, uint8_t COL)
+{
+ PORTB = (PORTB & 0xC0) | (((COL) & 0x07)<<3) | ((ROW) & 0x07);
+
+}
+
#elif defined(__AVR_AT90USB1286__)
/*
diff --git a/keyboards/hhkb/ansi/info.json b/keyboards/hhkb/ansi/info.json
index d2a6e42318..fdc8363141 100644
--- a/keyboards/hhkb/ansi/info.json
+++ b/keyboards/hhkb/ansi/info.json
@@ -1,7 +1,13 @@
{
- "keyboard_name": "HHKB",
+ "keyboard_name": "ANSI",
+ "manufacturer": "HHKB",
"url": "",
"maintainer": "qmk",
+ "usb": {
+ "vid": "0x4848",
+ "pid": "0x0001",
+ "device_version": "1.0.4"
+ },
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/hhkb/ansi/keymaps/cinaeco/keymap.c b/keyboards/hhkb/ansi/keymaps/cinaeco/keymap.c
index 55d482e062..d57d3ccdc7 100644
--- a/keyboards/hhkb/ansi/keymaps/cinaeco/keymap.c
+++ b/keyboards/hhkb/ansi/keymaps/cinaeco/keymap.c
@@ -131,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[UTIL] = LAYOUT(
- RESET, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, ____, ____, ____, ____, ____, ____, ____, ____, DF(QWER), DF(COLE), DF(DVOR), DEBUG,
+ QK_BOOT, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, ____, ____, ____, ____, ____, ____, ____, ____, DF(QWER), DF(COLE), DF(DVOR), DEBUG,
____, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, ____, KC_HOME, KC_PGDN, KC_PGUP, KC_END, ____, ____, ____, ____,
____, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, ____, ____, ____,
____, ____, ____, ____, ____, KC_SPC, ____, ____, ____, ____, ____, ____, ____,
diff --git a/keyboards/hhkb/ansi/keymaps/tominabox1/keymap.c b/keyboards/hhkb/ansi/keymaps/tominabox1/keymap.c
index d7aea97736..1adb6ce5be 100644
--- a/keyboards/hhkb/ansi/keymaps/tominabox1/keymap.c
+++ b/keyboards/hhkb/ansi/keymaps/tominabox1/keymap.c
@@ -6,7 +6,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, KC_CAPS, KC_MFFD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC__MUTE, KC__VOLDOWN, KC__VOLUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
- [2] = LAYOUT(KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS),
+ [2] = LAYOUT(KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS),
[3] = LAYOUT(KC_GESC, KC_EXLM, KC_EML, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, KC_UP, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS)
};
diff --git a/keyboards/hhkb/ansi/keymaps/xyverz/keymap.c b/keyboards/hhkb/ansi/keymaps/xyverz/keymap.c
index eebaede979..9bc5d59302 100644
--- a/keyboards/hhkb/ansi/keymaps/xyverz/keymap.c
+++ b/keyboards/hhkb/ansi/keymaps/xyverz/keymap.c
@@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
/* Layer 3: Functions */
[_FL] = LAYOUT(
- KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET ,
+ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, QK_BOOT,
_______, _______, QWERTY, DVORAK, COLEMAK, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______,
KC_CAPS, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
_______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_END, _______, _______, _______, _______, _______, _______,
diff --git a/keyboards/hhkb/ansi/rules.mk b/keyboards/hhkb/ansi/rules.mk
index 0b110d6561..40a34662bc 100644
--- a/keyboards/hhkb/ansi/rules.mk
+++ b/keyboards/hhkb/ansi/rules.mk
@@ -14,9 +14,9 @@ CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
CUSTOM_MATRIX = yes # Custom matrix file for the HHKB
NKRO_ENABLE = no # Enable N-Key Rollover
-# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-# HHKB_RN42_ENABLE = yes # Enable support for hasu's BT alt controller -- code borrowed from tmk source tree.
+HHKB_RN42_ENABLE = no # Enable support for hasu's BT alt controller -- code borrowed from tmk source tree.
# Either uncomment the HHKB_RN42_ENABLE line above, or run make enabling the
# feature. Be sure to clean any existing build before trying to enable rn42