summaryrefslogtreecommitdiff
path: root/keyboard/planck
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard/planck')
-rw-r--r--keyboard/planck/Makefile2
-rw-r--r--keyboard/planck/keymap_sean.c50
-rw-r--r--keyboard/planck/matrix.c58
3 files changed, 79 insertions, 31 deletions
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile
index 0d84d8b472..22101096e9 100644
--- a/keyboard/planck/Makefile
+++ b/keyboard/planck/Makefile
@@ -55,7 +55,7 @@ SRC = keymap_common.c \
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
- SRC := keymap_dotcom.c $(SRC)
+ SRC := keymap_sean.c $(SRC)
endif
CONFIG_H = config.h
diff --git a/keyboard/planck/keymap_sean.c b/keyboard/planck/keymap_sean.c
new file mode 100644
index 0000000000..4029846640
--- /dev/null
+++ b/keyboard/planck/keymap_sean.c
@@ -0,0 +1,50 @@
+#include "keymap_common.h"
+
+const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = KEYMAP( /* Matrix Dvorak */
+ QUOT, COMM, DOT, P, Y, SLSH, EQL, F, G, C, R, L,
+ A, O, E, U, I, ESC, BSPC, D, H, T, N, S,
+ SCLN, Q, J, K, X, TAB, ENT, B, M, W, V, Z,
+ LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT),
+
+ [1] = KEYMAP( /* Matrix Qwerty */
+ Q, W, E, R, T, SLSH, EQL, Y, U, I, O, P,
+ A, S, D, F, G, ESC, BSPC, H, J, K, L, SCLN,
+ Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH,
+ LSFT, LCTL, LALT, LGUI, FN1, SPC, FN2, LEFT, DOWN, UP, RGHT),
+
+ [2] = KEYMAP( /* fn1 */
+ F1, F2, F3, F4, F5, NO, NO, F6, F7, F8, F9, F10,
+ 1, 2, 3, 4, 5, ESC, DEL, 6, 7, 8, 9, 0,
+ FN3, FN4, NO, GRV, MINS, F18, INS, BSLS, LBRC, RBRC, NO, NO,
+ TRNS, TRNS, TRNS, TRNS, FN1, TRNS, FN3, HOME, PGDN, PGUP, END),
+
+ [3] = KEYMAP( /* fn2 */
+ F11, F12, F13, F14, F15, NO, NO, F16, F17, F18, F19, F20,
+ F1, F2, F3, F4, F5, ESC, DEL, F6, F7, F8, F9, F10,
+ FN3, FN4, NO, GRV, MINS, F18, INS, INS, PSCR, SLCK, PAUS, TRNS,
+ TRNS, TRNS, TRNS, TRNS, FN3, TRNS, FN2, MUTE, VOLD, VOLU, MPLY),
+};
+const uint16_t PROGMEM fn_actions[] = {
+ [1] = ACTION_LAYER_MOMENTARY(2), // to Fn overlay
+ [2] = ACTION_LAYER_MOMENTARY(3), // to Fn overlay
+ [3] = ACTION_DEFAULT_LAYER_SET(0),
+ [4] = ACTION_DEFAULT_LAYER_SET(1),
+
+ [10] = ACTION_MODS_KEY(MOD_LSFT, KC_1),
+ [11] = ACTION_MODS_KEY(MOD_LSFT, KC_2),
+ [12] = ACTION_MODS_KEY(MOD_LSFT, KC_3),
+ [13] = ACTION_MODS_KEY(MOD_LSFT, KC_4),
+ [14] = ACTION_MODS_KEY(MOD_LSFT, KC_5),
+ [15] = ACTION_MODS_KEY(MOD_LSFT, KC_6),
+ [16] = ACTION_MODS_KEY(MOD_LSFT, KC_7),
+ [17] = ACTION_MODS_KEY(MOD_LSFT, KC_8),
+ [18] = ACTION_MODS_KEY(MOD_LSFT, KC_9),
+ [19] = ACTION_MODS_KEY(MOD_LSFT, KC_0),
+ [20] = ACTION_MODS_KEY(MOD_LSFT, KC_MINS),
+ [21] = ACTION_MODS_KEY(MOD_LSFT, KC_EQL),
+ [22] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV),
+ [23] = ACTION_MODS_KEY(MOD_LSFT, KC_LBRC),
+ [24] = ACTION_MODS_KEY(MOD_LSFT, KC_RBRC),
+ [28] = ACTION_MODS_KEY(MOD_LSFT, KC_BSLS),
+}; \ No newline at end of file
diff --git a/keyboard/planck/matrix.c b/keyboard/planck/matrix.c
index ca59f7c73b..38d35e3e07 100644
--- a/keyboard/planck/matrix.c
+++ b/keyboard/planck/matrix.c
@@ -136,38 +136,36 @@ uint8_t matrix_key_count(void)
static void init_cols(void)
{
- DDRB &= ~(1<<7 | 1<<4 | 1<<5 | 1<<6);
- PORTB |= (1<<7 | 1<<4 | 1<<5 | 1<<6);
- DDRC &= ~(1<<6);
- PORTC |= (1<<6);
- DDRD &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<7);
- PORTD |= (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<7);
- DDRF &= ~(1<<7 | 1<<6);
- PORTF |= (1<<7 | 1<<6);
+ DDRB &= ~(1<<6 | 1<<5 | 1<<4);
+ PORTB |= (1<<6 | 1<<5 | 1<<4);
+ DDRD &= ~(1<<7 | 1<<6 | 1<<4);
+ PORTD |= (1<<7 | 1<<6 | 1<<4);
+ DDRF &= ~(1<<0 | 1<<1 | 1<<4 | 1<<5 | 1<<6 | 1<<7);
+ PORTF |= (1<<0 | 1<<1 | 1<<4 | 1<<5 | 1<<6 | 1<<7);
}
static matrix_row_t read_cols(void)
{
- return (PINB&(1<<7) ? 0 : (1<<0)) |
- (PIND&(1<<0) ? 0 : (1<<1)) |
- (PIND&(1<<1) ? 0 : (1<<2)) |
- (PIND&(1<<2) ? 0 : (1<<3)) |
- (PIND&(1<<3) ? 0 : (1<<4)) |
- (PINC&(1<<6) ? 0 : (1<<5)) |
- (PIND&(1<<7) ? 0 : (1<<6)) |
- (PINB&(1<<4) ? 0 : (1<<7)) |
- (PINB&(1<<5) ? 0 : (1<<8)) |
- (PINB&(1<<6) ? 0 : (1<<9)) |
- (PINF&(1<<7) ? 0 : (1<<10)) |
- (PINF&(1<<6) ? 0 : (1<<11));
+ return (PIND&(1<<4) ? 0 : (1<<0)) |
+ (PIND&(1<<6) ? 0 : (1<<1)) |
+ (PIND&(1<<7) ? 0 : (1<<2)) |
+ (PINB&(1<<4) ? 0 : (1<<3)) |
+ (PINB&(1<<5) ? 0 : (1<<4)) |
+ (PINB&(1<<6) ? 0 : (1<<5)) |
+ (PINF&(1<<7) ? 0 : (1<<6)) |
+ (PINF&(1<<6) ? 0 : (1<<7)) |
+ (PINF&(1<<5) ? 0 : (1<<8)) |
+ (PINF&(1<<4) ? 0 : (1<<9)) |
+ (PINF&(1<<1) ? 0 : (1<<10)) |
+ (PINF&(1<<0) ? 0 : (1<<11));
}
static void unselect_rows(void)
{
- DDRF &= ~(1<<0 | 1<<1 | 1<<4 | 1<<5);
- PORTF |= (1<<0 | 1<<1 | 1<<4 | 1<<5);
+ DDRB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3);
+ PORTB |= (1<<0 | 1<<1 | 1<<2 | 1<<3);
}
@@ -175,20 +173,20 @@ static void select_row(uint8_t row)
{
switch (row) {
case 0:
- DDRF |= (1<<0);
- PORTF &= ~(1<<0);
+ DDRB |= (1<<0);
+ PORTB &= ~(1<<0);
break;
case 1:
- DDRF |= (1<<1);
- PORTF &= ~(1<<1);
+ DDRB |= (1<<1);
+ PORTB &= ~(1<<1);
break;
case 2:
- DDRF |= (1<<4);
- PORTF &= ~(1<<4);
+ DDRB |= (1<<2);
+ PORTB &= ~(1<<2);
break;
case 3:
- DDRF |= (1<<5);
- PORTF &= ~(1<<5);
+ DDRB |= (1<<3);
+ PORTB &= ~(1<<3);
break;
}