aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/spiderisland/split78/config.h35
-rw-r--r--keyboards/spiderisland/split78/info.json94
-rw-r--r--keyboards/spiderisland/split78/keymaps/default/keymap.c41
-rw-r--r--keyboards/spiderisland/split78/matrix.c155
-rw-r--r--keyboards/spiderisland/split78/readme.md25
-rw-r--r--keyboards/spiderisland/split78/rules.mk24
-rw-r--r--keyboards/spiderisland/split78/split78.c17
-rw-r--r--keyboards/spiderisland/split78/split78.h36
8 files changed, 427 insertions, 0 deletions
diff --git a/keyboards/spiderisland/split78/config.h b/keyboards/spiderisland/split78/config.h
new file mode 100644
index 000000000..a7ec160fa
--- /dev/null
+++ b/keyboards/spiderisland/split78/config.h
@@ -0,0 +1,35 @@
1/*
2Copyright 2020 unrelenting.technology
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0xF4E4
25#define DEVICE_VER 0x0001
26#define MANUFACTURER SpiderIsland
27#define PRODUCT Split 78-key
28
29/* key matrix size */
30#define MATRIX_ROWS 8
31#define MATRIX_COLS 14
32
33#define BACKLIGHT_PIN D4
34#define BACKLIGHT_LEVELS 3
35#define BACKLIGHT_BREATHING
diff --git a/keyboards/spiderisland/split78/info.json b/keyboards/spiderisland/split78/info.json
new file mode 100644
index 000000000..7a96efe76
--- /dev/null
+++ b/keyboards/spiderisland/split78/info.json
@@ -0,0 +1,94 @@
1{
2 "keyboard_name": "Spider Island 78-key split",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 16,
6 "height": 6.25,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"x": 0, "y": 0},
11 {"x": 2, "y": 0},
12 {"x": 3, "y": 0},
13 {"x": 4, "y": 0},
14 {"x": 5, "y": 0},
15 {"x": 6.5, "y": 0},
16 {"x": 8.5, "y": 0},
17 {"x": 9.5, "y": 0},
18 {"x": 10.5, "y": 0},
19 {"x": 12, "y": 0},
20 {"x": 13, "y": 0},
21 {"x": 14, "y": 0},
22 {"x": 15, "y": 0},
23 {"x": 0, "y": 1.25},
24 {"x": 1, "y": 1.25},
25 {"x": 2, "y": 1.25},
26 {"x": 3, "y": 1.25},
27 {"x": 4, "y": 1.25},
28 {"x": 5, "y": 1.25},
29 {"x": 6, "y": 1.25},
30 {"x": 8, "y": 1.25},
31 {"x": 9, "y": 1.25},
32 {"x": 10, "y": 1.25},
33 {"x": 11, "y": 1.25},
34 {"x": 12, "y": 1.25},
35 {"x": 13, "y": 1.25},
36 {"x": 14, "y": 1.25, "w": 2},
37 {"x": 0, "y": 2.25, "w": 1.5},
38 {"x": 1.5, "y": 2.25},
39 {"x": 2.5, "y": 2.25},
40 {"x": 3.5, "y": 2.25},
41 {"x": 4.5, "y": 2.25},
42 {"x": 5.5, "y": 2.25},
43 {"x": 7.5, "y": 2.25},
44 {"x": 8.5, "y": 2.25},
45 {"x": 9.5, "y": 2.25},
46 {"x": 10.5, "y": 2.25},
47 {"x": 11.5, "y": 2.25},
48 {"x": 12.5, "y": 2.25},
49 {"x": 13.5, "y": 2.25},
50 {"x": 14.5, "y": 2.25, "w": 1.5},
51
52 {"x": 0, "y": 3.25, "w": 1.75},
53 {"x": 1.75, "y": 3.25},
54 {"x": 2.75, "y": 3.25},
55 {"x": 3.75, "y": 3.25},
56 {"x": 4.75, "y": 3.25},
57 {"x": 5.75, "y": 3.25},
58 {"x": 7.75, "y": 3.25},
59 {"x": 8.75, "y": 3.25},
60 {"x": 9.75, "y": 3.25},
61 {"x": 10.75, "y": 3.25},
62 {"x": 11.75, "y": 3.25},
63 {"x": 12.75, "y": 3.25},
64 {"x": 13.75, "y": 3.25, "w": 2.25},
65
66 {"x": 0, "y": 4.25, "w": 2.25},
67 {"x": 2.25, "y": 4.25},
68 {"x": 3.25, "y": 4.25},
69 {"x": 4.25, "y": 4.25},
70 {"x": 5.25, "y": 4.25},
71 {"x": 6.25, "y": 4.25},
72 {"x": 8.25, "y": 4.25},
73 {"x": 9.25, "y": 4.25},
74 {"x": 10.25, "y": 4.25},
75 {"x": 11.25, "y": 4.25},
76 {"x": 12.25, "y": 4.25, "w": 1.75},
77 {"x": 14, "y": 4.25},
78 {"x": 15, "y": 4.25},
79
80 {"x": 0, "y": 5.25, "w": 1.25},
81 {"x": 1.25, "y": 5.25, "w": 1.25},
82 {"x": 2.5, "y": 5.25, "w": 1.25},
83 {"x": 3.75, "y": 5.25, "w": 1.25},
84 {"x": 5, "y": 5.25, "w": 2.25},
85 {"x": 8.25, "y": 5.25, "w": 2.25},
86 {"x": 10.5, "y": 5.25, "w": 1.25},
87 {"x": 11.75, "y": 5.25, "w": 1.25},
88 {"x": 13, "y": 5.25},
89 {"x": 14, "y": 5.25},
90 {"x": 15, "y": 5.25}
91 ]
92 }
93 }
94}
diff --git a/keyboards/spiderisland/split78/keymaps/default/keymap.c b/keyboards/spiderisland/split78/keymaps/default/keymap.c
new file mode 100644
index 000000000..761648d95
--- /dev/null
+++ b/keyboards/spiderisland/split78/keymaps/default/keymap.c
@@ -0,0 +1,41 @@
1/* Copyright 2020 unrelenting.technology
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 [_BASE] = LAYOUT(
26 KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
27 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
28 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
29 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_SCLN, KC_ENT,
30 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH,
31 KC_LCTL, KC_LGUI, KC_LALT, TT(_FN), KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
32 ),
33 [_FN] = LAYOUT(
34 RESET, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24,
35 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, KC_DEL,
36 KC_NLCK, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
37 BL_TOGG, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
38 KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX, KC_SLSH, KC_PGUP, XXXXXXX,
39 XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P0, KC_PDOT, KC_PENT, KC_HOME, KC_PGDN, KC_END
40 )
41};
diff --git a/keyboards/spiderisland/split78/matrix.c b/keyboards/spiderisland/split78/matrix.c
new file mode 100644
index 000000000..b5c7028fd
--- /dev/null
+++ b/keyboards/spiderisland/split78/matrix.c
@@ -0,0 +1,155 @@
1/*
2Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include <string.h>
19#include <stdio.h>
20#include "quantum.h"
21#include "i2c_master.h"
22#include "split78.h"
23
24#define RIGHT_HALF
25
26
27void matrix_set_row_status(uint8_t row);
28
29
30#if defined(RIGHT_HALF)
31#define I2C_TIMEOUT 10
32#define MCP23018_TWI_ADDRESS 0b0100000
33#define TW_READ 1
34#define TW_WRITE 0
35#define TWI_ADDR_WRITE ( (MCP23018_TWI_ADDRESS<<1) | TW_WRITE )
36#define TWI_ADDR_READ ( (MCP23018_TWI_ADDRESS<<1) | TW_READ )
37#define IODIRA 0x00 // i/o direction register
38#define IODIRB 0x01
39#define IODIRA 0x00 // i/o direction register
40#define IODIRB 0x01
41#define GPPUA 0x0C // GPIO pull-up resistor register
42#define GPPUB 0x0D
43#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
44#define GPIOB 0x13
45#define OLATA 0x14 // output latch register
46#define OLATB 0x15
47#define MCP_ROWS_START 8
48
49static uint8_t mcp23018_init(void) {
50 uint8_t ret;
51 uint8_t data[3];
52 // set pin direction
53 // - unused : input : 1
54 // - input : input : 1
55 // - driving : output : 0
56 data[0] = IODIRA;
57 data[1] = 0b00000000; // IODIRA
58 data[2] = (0b11111111); // IODIRB
59
60 ret = i2c_transmit(TWI_ADDR_WRITE, (uint8_t *)data, 3, I2C_TIMEOUT);
61 if (ret) goto out; // make sure we got an ACK
62
63 // set pull-up
64 // - unused : on : 1
65 // - input : on : 1
66 // - driving : off : 0
67 data[0] = GPPUA;
68 data[1] = 0b00000000; // IODIRA
69 data[2] = (0b11111111); // IODIRB
70
71 ret = i2c_transmit(TWI_ADDR_WRITE, (uint8_t *)data, 3, I2C_TIMEOUT);
72 if (ret) goto out; // make sure we got an ACK
73
74 // set logical value (doesn't matter on inputs)
75 // - unused : hi-Z : 1
76 // - input : hi-Z : 1
77 // - driving : hi-Z : 1
78 data[0] = OLATA;
79 data[1] = 0b11111111; // IODIRA
80 data[2] = (0b11111111); // IODIRB
81
82 ret = i2c_transmit(TWI_ADDR_WRITE, (uint8_t *)data, 3, I2C_TIMEOUT);
83
84out:
85 return ret;
86}
87#endif
88
89void matrix_init_custom(void) {
90 // Set rows as output starting high
91 DDRB = 0xFF;
92 PORTB = 0xFF;
93
94 // Set columns as inputs with pull-up enabled
95 DDRA = 0x00;
96 PORTA = 0xFF;
97
98 // Initialize i2c communication
99 i2c_init();
100
101#if defined(RIGHT_HALF)
102 // Initialize the chip on the other half
103 mcp23018_init();
104#endif
105
106}
107
108bool matrix_scan_custom(matrix_row_t current_matrix[]) {
109 bool matrix_has_changed = false;
110
111 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
112 // Store last value of row prior to reading
113 matrix_row_t last_row_value = current_matrix[row];
114
115 matrix_row_t cols = 0;
116 // Select the row to scan
117 matrix_set_row_status(row);
118
119 matrix_io_delay();
120 //Set the local row
121
122#if defined(RIGHT_HALF)
123 // Initialize to 0x7F in case I2C read fails,
124 // as 0x75 would be no keys pressed
125 uint8_t data = 0x7F;
126 // Receive the columns from right half
127 i2c_receive(TWI_ADDR_WRITE, &data, 1, I2C_TIMEOUT);
128#endif
129
130 cols |= ((~(PINA | 0x80)) & 0x7F);
131#if defined(RIGHT_HALF)
132 cols |= (((~(data | 0x80)) & 0x7F) << 7);
133#endif
134
135 current_matrix[row] = cols;
136 matrix_has_changed |= (last_row_value != current_matrix[row]);
137 }
138
139 return matrix_has_changed;
140}
141
142void matrix_set_row_status(uint8_t row) {
143#if defined(RIGHT_HALF)
144 uint8_t txdata[3];
145
146 //Set the remote row on port A
147 txdata[0] = (GPIOA);
148 txdata[1] = ( 0xFF & ~(1<<row) );
149 i2c_transmit(TWI_ADDR_WRITE, (uint8_t *)txdata, 2, I2C_TIMEOUT);
150#endif
151
152 //Set the local row on port B
153 DDRB = (1 << row);
154 PORTB = ~(1 << row);
155}
diff --git a/keyboards/spiderisland/split78/readme.md b/keyboards/spiderisland/split78/readme.md
new file mode 100644
index 000000000..704ffcd26
--- /dev/null
+++ b/keyboards/spiderisland/split78/readme.md
@@ -0,0 +1,25 @@
1# SpiderIsland Split 78-key
2
3![Board Photo](https://i.imgur.com/N3DjdGql.jpg)
4[Image Gallery](https://imgur.com/a/0AUY8Ng)
5
6The 78 key split keyboard from [SpiderIsland on AliExpress](https://a.aliexpress.com/_dVJsSpR).
7Out of the box it runs ps2avrGB firmware, like [`split75`](../../wheatfield/split75/README.md).
8It is mistakenly called "87 key" on the AliExpress title and "104 key" (?!) in the caption inside the photo.
9
10This port is based on the `split75` port which was mostly done by [Michael L. Walker](https://github.com/walkerstop).
11
12* Keyboard Maintainer: [unrelenting.technology](https://github.com/myfreeweb)
13* Hardware Availability: https://a.aliexpress.com/_dVJsSpR
14
15Make example for this keyboard (after setting up your build environment):
16
17 make spiderisland/split78:default
18
19Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid))
20
21 make spiderisland/split78:default:flash
22
23**Reset Key**: Hold down the key located at the leftmost position in the top row, commonly programmed as Escape while plugging in the keyboard.
24
25See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/spiderisland/split78/rules.mk b/keyboards/spiderisland/split78/rules.mk
new file mode 100644
index 000000000..61015b97f
--- /dev/null
+++ b/keyboards/spiderisland/split78/rules.mk
@@ -0,0 +1,24 @@
1# MCU name
2MCU = atmega32a
3
4# Bootloader selection
5BOOTLOADER = bootloadHID
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = no # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
18RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
19WS2812_DRIVER = i2c
20
21# custom matrix setup
22CUSTOM_MATRIX = lite
23SRC += matrix.c
24QUANTUM_LIB_SRC += i2c_master.c
diff --git a/keyboards/spiderisland/split78/split78.c b/keyboards/spiderisland/split78/split78.c
new file mode 100644
index 000000000..030101274
--- /dev/null
+++ b/keyboards/spiderisland/split78/split78.c
@@ -0,0 +1,17 @@
1/* Copyright 2020 unrelenting.technology
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "split78.h"
diff --git a/keyboards/spiderisland/split78/split78.h b/keyboards/spiderisland/split78/split78.h
new file mode 100644
index 000000000..2f6252f0c
--- /dev/null
+++ b/keyboards/spiderisland/split78/split78.h
@@ -0,0 +1,36 @@
1/* Copyright 2020 unrelenting.technology
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "quantum.h"
20
21#define LAYOUT( \
22 l00, l01, l02, l03, l04, l05, r00, r01, r02, r03, r04, r05, r06, \
23 l06, l07, l08, l09, l10, l11, l12, r07, r08, r09, r10, r11, r12, r13, \
24 l13, l14, l15, l16, l17, l18, r14, r15, r16, r17, r18, r19, r20, r21, \
25 l19, l20, l21, l22, l23, l24, r22, r23, r24, r25, r26, r27, r28, \
26 l25, l26, l27, l28, l29, l30, r29, r30, r31, r32, r33, r34, r35, \
27 l31, l32, l33, l34, l35, r36, r37, r38, r39, r40, r41 \
28) { \
29 { l00, l06, l13, l19, l25, l31, KC_NO, r00, r07, r14, r22, r29, r21 }, \
30 { l01, l07, l14, l20, l26, l32, KC_NO, r01, r08, r15, r23, r30, r36 }, \
31 { l02, l08, l15, l21, l27, l33, KC_NO, r02, r09, r16, r24, r31, r37 }, \
32 { l03, l09, l16, l22, l28, l34, KC_NO, r03, r10, r17, r25, r32, r38 }, \
33 { l04, l10, l17, l23, l29, l35, KC_NO, r04, r11, r18, r27, r33, r39 }, \
34 { l05, l11, l18, l24, l30, l12, KC_NO, r05, r12, r19, r26, r34, r40 }, \
35 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, r06, r13, r20, r28, r35, r41 }, \
36}