aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorworthlessowl <53881082+worthlessowl@users.noreply.github.com>2019-10-02 11:26:39 +0700
committerDrashna Jaelre <drashna@live.com>2019-10-01 21:26:39 -0700
commit0c5b3826d15015ec8aaee0b87a7a485f17158c6b (patch)
treec7e46788d5a259c6b00825c92bd3feffff5a0eb1
parentda5b4ec7332d305dc6a2b07c1ac74aa3088f8bd5 (diff)
downloadqmk_firmware-0c5b3826d15015ec8aaee0b87a7a485f17158c6b.tar.gz
qmk_firmware-0c5b3826d15015ec8aaee0b87a7a485f17158c6b.zip
[Keyboard] Add Owlet60 Keyboard to qmk_firmware/keyboards/handwired (#6803)
* first commit, skeleton code, not sure if working * Owlet 60 working firmware, json not sure * use json from kle to qmk converter * deleted temporary text from owlet60.h * owlet60 working oled and led firmware * moved owlet60 to handwired * updated readme.md * Revert "owlet60 working oled and led firmware" This reverts commit 27f9465aabd62d9ee445b477a02af348160532c1. * Revert "moved owlet60 to handwired" This reverts commit 9b8e8344fc303ddc4dcc3b023d4e9d05b89d5800. * revert changes, moved owlet60 to handwired, updated copyright blurb * fixed readme.md * removed duplicate items * resolve merge artifact * Update keyboards/handwired/owlet60/readme.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * check out merge artifacts with qmk master * Update keyboards/handwired/owlet60/matrix.c Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/handwired/owlet60/matrix.c Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/handwired/owlet60/matrix.c Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/handwired/owlet60/matrix.c Co-Authored-By: fauxpark <fauxpark@gmail.com> * removed redundant rule on oled_testing/rules.mk, refactored mux switching code on matrix.c
-rw-r--r--keyboards/handwired/owlet60/config.h250
-rw-r--r--keyboards/handwired/owlet60/info.json13
-rw-r--r--keyboards/handwired/owlet60/keymaps/default/config.h19
-rw-r--r--keyboards/handwired/owlet60/keymaps/default/keymap.c74
-rw-r--r--keyboards/handwired/owlet60/keymaps/default/readme.md1
-rw-r--r--keyboards/handwired/owlet60/keymaps/oled_testing/config.h22
-rw-r--r--keyboards/handwired/owlet60/keymaps/oled_testing/customfont.c20
-rw-r--r--keyboards/handwired/owlet60/keymaps/oled_testing/keymap.c107
-rw-r--r--keyboards/handwired/owlet60/keymaps/oled_testing/readme.md1
-rw-r--r--keyboards/handwired/owlet60/keymaps/oled_testing/rules.mk1
-rw-r--r--keyboards/handwired/owlet60/matrix.c315
-rw-r--r--keyboards/handwired/owlet60/owlet60.c53
-rw-r--r--keyboards/handwired/owlet60/owlet60.h63
-rw-r--r--keyboards/handwired/owlet60/readme.md13
-rw-r--r--keyboards/handwired/owlet60/rules.mk48
15 files changed, 1000 insertions, 0 deletions
diff --git a/keyboards/handwired/owlet60/config.h b/keyboards/handwired/owlet60/config.h
new file mode 100644
index 000000000..29fd0b1e5
--- /dev/null
+++ b/keyboards/handwired/owlet60/config.h
@@ -0,0 +1,250 @@
1/*
2Copyright 2019 worthlessowl
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 0xDA19
25#define DEVICE_VER 0x0001
26#define MANUFACTURER worthlessowl
27#define PRODUCT Owlet60
28#define DESCRIPTION TGR Alice inspired 65 or 60 percent keyboard
29
30/* key matrix size */
31#define MATRIX_ROWS 9
32#define MATRIX_COLS 8
33
34/*
35 * Keyboard Matrix Assignments
36 *
37 * Change this to how you wired your keyboard
38 * COLS: AVR pins used for columns, left to right
39 * ROWS: AVR pins used for rows, top to bottom
40 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
41 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
42 *
43*/
44#define MATRIX_ROW_PINS {B5, F4, F5, F6, F7, B1, B3, B2, B6}
45#define MATRIX_COL_SELECT_PINS {D7, B4, E6}
46#define MATRIX_COL_DATA_PIN {C6}
47#define MATRIX_COL_PINS {}
48
49/* COL2ROW, ROW2COL*/
50#define DIODE_DIRECTION COL2ROW
51
52/*
53 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
54 */
55//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
56
57//#define BACKLIGHT_PIN D3
58//#define BACKLIGHT_BREATHING
59//#define BACKLIGHT_LEVELS 3
60
61#define RGB_DI_PIN D0
62#ifdef RGB_DI_PIN
63 #define RGBLED_NUM 8
64 #define RGBLIGHT_HUE_STEP 8
65 #define RGBLIGHT_SAT_STEP 8
66 #define RGBLIGHT_VAL_STEP 8
67 #define RGBLIGHT_LIMIT_VAL 128 /* The maximum brightness level */
68 #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
69/*== all animations enable ==*/
70 #define RGBLIGHT_ANIMATIONS
71// /*== or choose animations ==*/
72// #define RGBLIGHT_EFFECT_BREATHING
73// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
74// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
75// #define RGBLIGHT_EFFECT_SNAKE
76// #define RGBLIGHT_EFFECT_KNIGHT
77// #define RGBLIGHT_EFFECT_CHRISTMAS
78// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
79// #define RGBLIGHT_EFFECT_RGB_TEST
80// #define RGBLIGHT_EFFECT_ALTERNATING
81// /*== customize breathing effect ==*/
82// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
83// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
84// /*==== use exp() and sin() ====*/
85// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
86// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
87#endif
88
89/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
90#define DEBOUNCE 9
91
92/* define if matrix has ghost (lacks anti-ghosting diodes) */
93//#define MATRIX_HAS_GHOST
94
95/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
96//#define LOCKING_SUPPORT_ENABLE
97/* Locking resynchronize hack */
98//#define LOCKING_RESYNC_ENABLE
99
100/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
101 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
102 */
103// #define GRAVE_ESC_CTRL_OVERRIDE
104
105/*
106 * Force NKRO
107 *
108 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
109 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
110 * makefile for this to work.)
111 *
112 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
113 * until the next keyboard reset.
114 *
115 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
116 * fully operational during normal computer usage.
117 *
118 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
119 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
120 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
121 * power-up.
122 *
123 */
124//#define FORCE_NKRO
125
126/*
127 * Magic Key Options
128 *
129 * Magic keys are hotkey commands that allow control over firmware functions of
130 * the keyboard. They are best used in combination with the HID Listen program,
131 * found here: https://www.pjrc.com/teensy/hid_listen.html
132 *
133 * The options below allow the magic key functionality to be changed. This is
134 * useful if your keyboard/keypad is missing keys and you want magic key support.
135 *
136 */
137
138/* key combination for magic key command */
139/* defined by default; to change, uncomment and set to the combination you want */
140// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
141
142/* control how magic key switches layers */
143//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
144//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
145//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
146
147/* override magic key keymap */
148//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
149//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
150//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
151//#define MAGIC_KEY_HELP H
152//#define MAGIC_KEY_HELP_ALT SLASH
153//#define MAGIC_KEY_DEBUG D
154//#define MAGIC_KEY_DEBUG_MATRIX X
155//#define MAGIC_KEY_DEBUG_KBD K
156//#define MAGIC_KEY_DEBUG_MOUSE M
157//#define MAGIC_KEY_VERSION V
158//#define MAGIC_KEY_STATUS S
159//#define MAGIC_KEY_CONSOLE C
160//#define MAGIC_KEY_LAYER0 0
161//#define MAGIC_KEY_LAYER0_ALT GRAVE
162//#define MAGIC_KEY_LAYER1 1
163//#define MAGIC_KEY_LAYER2 2
164//#define MAGIC_KEY_LAYER3 3
165//#define MAGIC_KEY_LAYER4 4
166//#define MAGIC_KEY_LAYER5 5
167//#define MAGIC_KEY_LAYER6 6
168//#define MAGIC_KEY_LAYER7 7
169//#define MAGIC_KEY_LAYER8 8
170//#define MAGIC_KEY_LAYER9 9
171//#define MAGIC_KEY_BOOTLOADER B
172//#define MAGIC_KEY_BOOTLOADER_ALT ESC
173//#define MAGIC_KEY_LOCK CAPS
174//#define MAGIC_KEY_EEPROM E
175//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
176//#define MAGIC_KEY_NKRO N
177//#define MAGIC_KEY_SLEEP_LED Z
178
179/*
180 * Feature disable options
181 * These options are also useful to firmware size reduction.
182 */
183
184/* disable debug print */
185//#define NO_DEBUG
186
187/* disable print */
188//#define NO_PRINT
189
190/* disable action features */
191//#define NO_ACTION_LAYER
192//#define NO_ACTION_TAPPING
193//#define NO_ACTION_ONESHOT
194//#define NO_ACTION_MACRO
195//#define NO_ACTION_FUNCTION
196
197/*
198 * MIDI options
199 */
200
201/* Prevent use of disabled MIDI features in the keymap */
202//#define MIDI_ENABLE_STRICT 1
203
204/* enable basic MIDI features:
205 - MIDI notes can be sent when in Music mode is on
206*/
207//#define MIDI_BASIC
208
209/* enable advanced MIDI features:
210 - MIDI notes can be added to the keymap
211 - Octave shift and transpose
212 - Virtual sustain, portamento, and modulation wheel
213 - etc.
214*/
215//#define MIDI_ADVANCED
216
217/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
218//#define MIDI_TONE_KEYCODE_OCTAVES 1
219
220/*
221 * HD44780 LCD Display Configuration
222 */
223/*
224#define LCD_LINES 2 //< number of visible lines of the display
225#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
226
227#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
228
229#if LCD_IO_MODE
230#define LCD_PORT PORTB //< port for the LCD lines
231#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
232#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
233#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
234#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
235#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
236#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
237#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
238#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
239#define LCD_RS_PORT LCD_PORT //< port for RS line
240#define LCD_RS_PIN 3 //< pin for RS line
241#define LCD_RW_PORT LCD_PORT //< port for RW line
242#define LCD_RW_PIN 2 //< pin for RW line
243#define LCD_E_PORT LCD_PORT //< port for Enable line
244#define LCD_E_PIN 1 //< pin for Enable line
245#endif
246*/
247
248/* Bootmagic Lite key configuration */
249// #define BOOTMAGIC_LITE_ROW 0
250// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/handwired/owlet60/info.json b/keyboards/handwired/owlet60/info.json
new file mode 100644
index 000000000..ea9437ee7
--- /dev/null
+++ b/keyboards/handwired/owlet60/info.json
@@ -0,0 +1,13 @@
1{"keyboard_name": "Owlet60",
2 "url": "https://https://qmk.fm/keyboards/",
3 "maintainer": "qmk",
4 "width": 19.5,
5 "height": 5,
6 "layouts": {
7 "LAYOUT_owlet60_full_bsp": {
8 "key_count": 72,
9 "layout": [{"label":"1", "x":0.5, "y":0}, {"label":"~", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9.75, "y":0}, {"label":"*", "x":10.75, "y":0}, {"label":"(", "x":11.75, "y":0}, {"label":")", "x":12.75, "y":0}, {"label":"_", "x":13.75, "y":0}, {"label":"+", "x":14.75, "y":0}, {"label":"Backspace", "x":15.75, "y":0, "w":2}, {"label":"PgUp", "x":17.75, "y":0}, {"label":"2", "x":0.25, "y":1}, {"label":"Tab", "x":1.75, "y":1, "w":1.5}, {"label":"Q", "x":3.25, "y":1}, {"label":"W", "x":4.25, "y":1}, {"label":"E", "x":5.25, "y":1}, {"label":"R", "x":6.25, "y":1}, {"label":"T", "x":7.25, "y":1}, {"label":"Y", "x":9.5, "y":1}, {"label":"U", "x":10.5, "y":1}, {"label":"I", "x":11.5, "y":1}, {"label":"O", "x":12.5, "y":1}, {"label":"P", "x":13.5, "y":1}, {"label":"{", "x":14.5, "y":1}, {"label":"}", "x":15.5, "y":1}, {"label":"|", "x":16.5, "y":1, "w":1.5}, {"label":"PgDn", "x":18, "y":1}, {"label":"3", "x":0, "y":2}, {"label":"Caps Lock", "x":1.5, "y":2, "w":1.75}, {"label":"A", "x":3.25, "y":2}, {"label":"S", "x":4.25, "y":2}, {"label":"D", "x":5.25, "y":2}, {"label":"F", "x":6.25, "y":2}, {"label":"G", "x":7.25, "y":2}, {"label":"H", "x":10, "y":2}, {"label":"J", "x":11, "y":2}, {"label":"K", "x":12, "y":2}, {"label":"L", "x":13, "y":2}, {"label":":", "x":14, "y":2}, {"label":"\"", "x":15, "y":2}, {"label":"Enter", "x":16, "y":2, "w":2.25}, {"label":"Home", "x":18.25, "y":2}, {"label":"Shift", "x":1.25, "y":3, "w":2.25}, {"label":"Z", "x":3.5, "y":3}, {"label":"X", "x":4.5, "y":3}, {"label":"C", "x":5.5, "y":3}, {"label":"V", "x":6.5, "y":3}, {"label":"B", "x":7.5, "y":3}, {"label":"B", "x":9.75, "y":3}, {"label":"N", "x":10.75, "y":3}, {"label":"M", "x":11.75, "y":3}, {"label":"<", "x":12.75, "y":3}, {"label":">", "x":13.75, "y":3}, {"label":"?", "x":14.75, "y":3}, {"label":"Shift", "x":15.75, "y":3, "w":1.75}, {"label":"Up", "x":17.5, "y":3}, {"label":"End", "x":18.5, "y":3}, {"label":"Ctrl", "x":1.25, "y":4, "w":1.5}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":2}, {"label":"Fn", "x":8, "y":4, "w":1.25}, {"x":9.75, "y":4, "w":2.75}, {"label":"Alt", "x":12.5, "y":4, "w":1.5}, {"label":"Left", "x":16.5, "y":4}, {"label":"Down", "x":17.5, "y":4}, {"label":"Right", "x":18.5, "y":4}]
10 }
11 }
12}
13 \ No newline at end of file
diff --git a/keyboards/handwired/owlet60/keymaps/default/config.h b/keyboards/handwired/owlet60/keymaps/default/config.h
new file mode 100644
index 000000000..f662fe7c9
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/default/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2019 worthlessowl
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// place overrides here
diff --git a/keyboards/handwired/owlet60/keymaps/default/keymap.c b/keyboards/handwired/owlet60/keymaps/default/keymap.c
new file mode 100644
index 000000000..c850d1ff7
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/default/keymap.c
@@ -0,0 +1,74 @@
1/* Copyright 2019 worthlessowl
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 the keycodes used by our macros in process_record_user
19enum custom_keycodes {
20 QMKBEST = SAFE_RANGE,
21 QMKURL
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 [0] = LAYOUT_owlet60_full_bsp(
26 KC_1, KC_ESC, 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, KC_PGUP, \
27 KC_2, 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, KC_PGDOWN, \
28 KC_3, KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_HOME, \
29 KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \
30 KC_LCTRL, KC_LALT, KC_SPC, MO(1),KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT \
31 ),
32
33 [1] = LAYOUT_owlet60_full_bsp(
34 KC_NO, 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, KC_TRNS, RGB_TOG, \
35 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, RGB_MOD, \
36 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, RGB_VAI, \
37 KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_N, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_TRNS, RGB_VAD, \
38 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
39 )
40};
41
42bool process_record_user(uint16_t keycode, keyrecord_t *record) {
43 switch (keycode) {
44 case QMKBEST:
45 if (record->event.pressed) {
46 // when keycode QMKBEST is pressed
47 SEND_STRING("QMK is the best thing ever!");
48 } else {
49 // when keycode QMKBEST is released
50 }
51 break;
52 case QMKURL:
53 if (record->event.pressed) {
54 // when keycode QMKURL is pressed
55 SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
56 } else {
57 // when keycode QMKURL is released
58 }
59 break;
60 }
61 return true;
62}
63
64void matrix_init_user(void) {
65
66}
67
68void matrix_scan_user(void) {
69
70}
71
72void led_set_user(uint8_t usb_led) {
73
74}
diff --git a/keyboards/handwired/owlet60/keymaps/default/readme.md b/keyboards/handwired/owlet60/keymaps/default/readme.md
new file mode 100644
index 000000000..1d177ae10
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for owlet60 \ No newline at end of file
diff --git a/keyboards/handwired/owlet60/keymaps/oled_testing/config.h b/keyboards/handwired/owlet60/keymaps/oled_testing/config.h
new file mode 100644
index 000000000..884d36b69
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/oled_testing/config.h
@@ -0,0 +1,22 @@
1/* Copyright 2019 worthlessowl
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// place overrides here
20
21
22#define OLED_FONT_H "customfont.c"
diff --git a/keyboards/handwired/owlet60/keymaps/oled_testing/customfont.c b/keyboards/handwired/owlet60/keymaps/oled_testing/customfont.c
new file mode 100644
index 000000000..b7ad73bfa
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/oled_testing/customfont.c
@@ -0,0 +1,20 @@
1#pragma once
2
3#ifdef __AVR__
4# include <avr/io.h>
5# include <avr/pgmspace.h>
6#elif defined(ESP8266)
7# include <pgmspace.h>
8#else
9# define PROGMEM
10#endif
11
12// Helidox 8x6 font with QMK Firmware Logo
13// Online editor: http://teripom.x0.com/
14
15static const unsigned char font[] PROGMEM = {
160x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x5b,0x4f,0x5b,0x3e,0x00,0x3e,0x6b,0x4f,0x6b,0x3e,0x00,0x1c,0x3e,0x7c,0x3e,0x1c,0x00,0x18,0x3c,0x7e,0x3c,0x18,0x00,0x1c,0x57,0x7d,0x57,0x1c,0x00,0x1c,0x5e,0x7f,0x5e,0x1c,0x00,0x00,0x18,0x3c,0x18,0x00,0x00,0xff,0xe7,0xc3,0xe7,0xff,0x00,0x00,0x18,0x24,0x18,0x00,0x00,0xff,0xe7,0xdb,0xe7,0xff,0x00,0x30,0x48,0x3a,0x06,0x0e,0x00,0x26,0x29,0x79,0x29,0x26,0x00,0x40,0x7f,0x05,0x05,0x07,0x00,0x40,0x7f,0x05,0x25,0x3f,0x00,0x5a,0x3c,0xe7,0x3c,0x5a,0x00,0x7f,0x3e,0x1c,0x1c,0x08,0x00,0x08,0x1c,0x1c,0x3e,0x7f,0x00,0x14,0x22,0x7f,0x22,0x14,0x00,0x5f,0x5f,0x00,0x5f,0x5f,0x00,0x06,0x09,0x7f,0x01,0x7f,0x00,0x00,0x66,0x89,0x95,0x6a,0x00,0x60,0x60,0x60,0x60,0x60,0x00,0x94,0xa2,0xff,0xa2,0x94,0x00,0x08,0x04,0x7e,0x04,0x08,0x00,0x10,0x20,0x7e,0x20,0x10,0x00,0x08,0x08,0x2a,0x1c,0x08,0x00,0x08,0x1c,0x2a,0x08,0x08,0x00,0x1e,0x10,0x10,0x10,0x10,0x00,0x0c,0x1e,0x0c,0x1e,0x0c,0x00,0x30,0x38,0x3e,0x38,0x30,0x00,0x06,0x0e,0x3e,0x0e,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x00,0x07,0x00,0x07,0x00,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x24,0x2a,0x7f,0x2a,0x12,0x00,0x23,0x13,0x08,0x64,0x62,0x00,0x36,0x49,0x56,0x20,0x50,0x00,0x00,0x08,0x07,0x03,0x00,0x00,0x00,0x1c,0x22,0x41,0x00,0x00,0x00,0x41,0x22,0x1c,0x00,0x00,0x2a,0x1c,0x7f,0x1c,0x2a,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x80,0x70,0x30,0x00,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x00,0x3e,0x51,0x49,0x45,0x3e,0x00,0x00,0x42,0x7f,0x40,0x00,0x00,0x72,0x49,0x49,0x49,0x46,0x00,0x21,0x41,0x49,0x4d,0x33,0x00,0x18,0x14,0x12,0x7f,0x10,0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x3c,0x4a,0x49,0x49,0x31,0x00,0x41,0x21,0x11,0x09,0x07,0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x46,0x49,0x49,0x29,0x1e,0x00,0x00,0x00,0x14,0x00,0x00,0x00,0x00,0x40,0x34,0x00,0x00,0x00,0x00,0x08,0x14,0x22,0x41,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x41,0x22,0x14,0x08,0x00,0x02,0x01,0x59,0x09,0x06,0x00,0x3e,0x41,0x5d,0x59,0x4e,0x00,0x7c,0x12,0x11,0x12,0x7c,0x00,0x7f,0x49,0x49,0x49,
170x36,0x00,0x3e,0x41,0x41,0x41,0x22,0x00,0x7f,0x41,0x41,0x41,0x3e,0x00,0x7f,0x49,0x49,0x49,0x41,0x00,0x7f,0x09,0x09,0x09,0x01,0x00,0x3e,0x41,0x41,0x51,0x73,0x00,0x7f,0x08,0x08,0x08,0x7f,0x00,0x00,0x41,0x7f,0x41,0x00,0x00,0x20,0x40,0x41,0x3f,0x01,0x00,0x7f,0x08,0x14,0x22,0x41,0x00,0x7f,0x40,0x40,0x40,0x40,0x00,0x7f,0x02,0x1c,0x02,0x7f,0x00,0x7f,0x04,0x08,0x10,0x7f,0x00,0x3e,0x41,0x41,0x41,0x3e,0x00,0x7f,0x09,0x09,0x09,0x06,0x00,0x3e,0x41,0x51,0x21,0x5e,0x00,0x7f,0x09,0x19,0x29,0x46,0x00,0x26,0x49,0x49,0x49,0x32,0x00,0x03,0x01,0x7f,0x01,0x03,0x00,0x3f,0x40,0x40,0x40,0x3f,0x00,0x1f,0x20,0x40,0x20,0x1f,0x00,0x3f,0x40,0x38,0x40,0x3f,0x00,0x63,0x14,0x08,0x14,0x63,0x00,0x03,0x04,0x78,0x04,0x03,0x00,0x61,0x59,0x49,0x4d,0x43,0x00,0x00,0x7f,0x41,0x41,0x41,0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00,0x41,0x41,0x41,0x7f,0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x40,0x40,0x40,0x40,0x40,0x00,0x00,0x03,0x07,0x08,0x00,0x00,0x20,0x54,0x54,0x78,0x40,0x00,0x7f,0x28,0x44,0x44,0x38,0x00,0x38,0x44,0x44,0x44,0x28,0x00,0x38,0x44,0x44,0x28,0x7f,0x00,0x38,0x54,0x54,0x54,0x18,0x00,0x00,0x08,0x7e,0x09,0x02,0x00,0x18,0xa4,0xa4,0x9c,0x78,0x00,0x7f,0x08,0x04,0x04,0x78,0x00,0x00,0x44,0x7d,0x40,0x00,0x00,0x20,0x40,0x40,0x3d,0x00,0x00,0x7f,0x10,0x28,0x44,0x00,0x00,0x00,0x41,0x7f,0x40,0x00,0x00,0x7c,0x04,0x78,0x04,0x78,0x00,0x7c,0x08,0x04,0x04,0x78,0x00,0x38,0x44,0x44,0x44,0x38,0x00,0xfc,0x18,0x24,0x24,0x18,0x00,0x18,0x24,0x24,0x18,0xfc,0x00,0x7c,0x08,0x04,0x04,0x08,0x00,0x48,0x54,0x54,0x54,0x24,0x00,0x04,0x04,0x3f,0x44,0x24,0x00,0x3c,0x40,0x40,0x20,0x7c,0x00,0x1c,0x20,0x40,0x20,0x1c,0x00,0x3c,0x40,0x30,0x40,0x3c,0x00,0x44,0x28,0x10,0x28,0x44,0x00,0x4c,0x90,0x90,0x90,0x7c,0x00,0x44,0x64,0x54,0x4c,0x44,0x00,0x00,0x08,0x36,0x41,0x00,0x00,0x00,0x00,0x77,0x00,0x00,0x00,0x00,0x41,0x36,0x08,0x00,0x00,0x02,0x01,0x02,0x04,0x02,0x00,0x3c,0x26,0x23,0x26,0x3c,0x00,0x00,0x00,0x00,0x80,0xe0,0xe0,0xe0,0xe0,0x60,0x60,0xe0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x04,0x0c,0x1c,0x1c,0x1c,0x18,0x38,0x38,0x78,0x70,0x70,0xf0,0xa0,0xa0,0x08,
180x18,0x18,0x18,0x1c,0x1c,0x1c,0x1c,0x1c,0x18,0x18,0x18,0xf8,0xf8,0xfc,0xf0,0x10,0x10,0x00,0x00,0x80,0xe0,0xf8,0xf0,0x70,0x70,0x70,0x70,0x60,0x60,0xe0,0xe0,0xe0,0xe0,0xe0,0xe0,0xc0,0xc0,0xc0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xf8,0xfc,0xfe,0xde,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xf0,0xf8,0xfc,0x3e,0x1e,0x06,0x01,0x00,0x00,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x00,0x80,0xc0,0xe0,0x7e,0x5b,0x4f,0x5b,0xfe,0xc0,0x00,0x00,0xc0,0x00,0xdc,0xd7,0xde,0xde,0xde,0xd7,0xdc,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x7f,0xff,0xf3,0xe0,0xc0,0xc0,0xc0,0xf3,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x20,0x70,0x78,0x78,0xf8,0xf8,0xdc,0xcc,0x8c,0x84,0x07,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff,0xff,0x00,0x00,0x00,0xc0,0xfc,0xff,0x1f,0x03,0x01,0x00,0x00,0xc0,0xe0,0xfc,0x7f,0x1f,0x0f,0x03,0x80,0xe0,0xfc,0xff,0x1f,0x03,0x00,0x00,0x00,0x00,0x00,0xe0,0xfc,0xff,0x3f,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x07,0x0f,0x0f,0x0f,0x0e,0x1e,0x1e,0x0e,0x0c,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x69,0x69,0x6f,0x26,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x0f,0x1f,0x3f,0x3c,0x78,0x70,0x60,0x00,0x00,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x7f,0x41,0x41,0x41,0x7f,0x00,0x30,0x7b,0x7f,0x78,0x30,0x20,0x20,0x30,0x78,0x7f,0x3b,0x00,0x03,0x00,0x0f,0x7f,0x0f,0x0f,0x0f,0x7f,0x0f,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x03,0x03,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x38,0x38,0x1c,0x1c,0x0e,0x0e,0x07,0x03,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x07,0x03,0x01,0x00,
190x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x0e,0x0f,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x07,0x03,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
20};
diff --git a/keyboards/handwired/owlet60/keymaps/oled_testing/keymap.c b/keyboards/handwired/owlet60/keymaps/oled_testing/keymap.c
new file mode 100644
index 000000000..3493a9d6c
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/oled_testing/keymap.c
@@ -0,0 +1,107 @@
1/* Copyright 2019 worthlessowl
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 the keycodes used by our macros in process_record_user
19enum custom_keycodes {
20 QMKBEST = SAFE_RANGE,
21 QMKURL
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 [0] = LAYOUT_owlet60_full_bsp(
26 KC_1, KC_ESC, 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, KC_PGUP, \
27 KC_2, 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, KC_PGDOWN, \
28 KC_3, KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_HOME, \
29 KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END, \
30 KC_LCTRL, KC_LALT, KC_SPC, MO(1),KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT \
31 ),
32
33 [1] = LAYOUT_owlet60_full_bsp(
34 KC_NO, 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, KC_TRNS, RGB_TOG, \
35 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, RGB_MOD, \
36 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, RGB_VAI, \
37 KC_TRNS,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_N, KC_NO, KC_NO,KC_NO, KC_NO, KC_NO, KC_TRNS, RGB_VAD, \
38 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
39 )
40};
41
42bool process_record_user(uint16_t keycode, keyrecord_t *record) {
43 switch (keycode) {
44 case QMKBEST:
45 if (record->event.pressed) {
46 // when keycode QMKBEST is pressed
47 SEND_STRING("QMK is the best thing ever!");
48 } else {
49 // when keycode QMKBEST is released
50 }
51 break;
52 case QMKURL:
53 if (record->event.pressed) {
54 // when keycode QMKURL is pressed
55 SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
56 } else {
57 // when keycode QMKURL is released
58 }
59 break;
60 }
61 return true;
62}
63
64void matrix_init_user(void) {
65
66}
67
68void matrix_scan_user(void) {
69
70}
71
72void led_set_user(uint8_t usb_led) {
73
74}
75
76#ifdef OLED_DRIVER_ENABLE
77oled_rotation_t oled_init_user(oled_rotation_t rotation) {
78 //return OLED_ROTATION_180;
79 return OLED_ROTATION_180;
80}
81void oled_task_user(void) {
82 // Host Keyboard Layer Status
83 /*oled_write_P(PSTR("Lyr: "), false);
84 switch (get_highest_layer(layer_state)) {
85 case 0:
86 oled_write_P(PSTR("Alpha\n"), false);
87 break;
88 case 1:
89 oled_write_P(PSTR("FN\n"), false);
90 break;
91 default:
92 // Or use the write_ln shortcut over adding '\n' to the end of your string
93 oled_write_ln_P(PSTR("Undefined"), false);
94 }
95
96 uint8_t led_usb_state = host_keyboard_leds();
97 oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
98 */
99
100 static const char PROGMEM qmk_logo[] = {
101 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
102 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
103 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
104
105 oled_write_P(qmk_logo, false);
106}
107#endif
diff --git a/keyboards/handwired/owlet60/keymaps/oled_testing/readme.md b/keyboards/handwired/owlet60/keymaps/oled_testing/readme.md
new file mode 100644
index 000000000..1d177ae10
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/oled_testing/readme.md
@@ -0,0 +1 @@
# The default keymap for owlet60 \ No newline at end of file
diff --git a/keyboards/handwired/owlet60/keymaps/oled_testing/rules.mk b/keyboards/handwired/owlet60/keymaps/oled_testing/rules.mk
new file mode 100644
index 000000000..48a51b225
--- /dev/null
+++ b/keyboards/handwired/owlet60/keymaps/oled_testing/rules.mk
@@ -0,0 +1 @@
OLED_DRIVER_ENABLE = yes \ No newline at end of file
diff --git a/keyboards/handwired/owlet60/matrix.c b/keyboards/handwired/owlet60/matrix.c
new file mode 100644
index 000000000..8ecce4eb1
--- /dev/null
+++ b/keyboards/handwired/owlet60/matrix.c
@@ -0,0 +1,315 @@
1/*
2Copyright 2019 worthlessowl
3based on work by:
4Jun Wako <wakojun@gmail.com>
5Cole Markham <cole@ccmcomputing.net>
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/*
20 * scan matrix
21 */
22#include <stdint.h>
23#include <stdbool.h>
24#include "owlet60.h"
25#include "wait.h"
26#include "print.h"
27#include "debug.h"
28#include "util.h"
29#include "matrix.h"
30#include "config.h"
31#include "timer.h"
32
33#if (MATRIX_COLS <= 8)
34# define print_matrix_header() print("\nr/c 01234567\n")
35# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
36# define matrix_bitpop(i) bitpop(matrix[i])
37# define ROW_SHIFTER ((uint8_t)1)
38#elif (MATRIX_COLS <= 16)
39# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
40# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
41# define matrix_bitpop(i) bitpop16(matrix[i])
42# define ROW_SHIFTER ((uint16_t)1)
43#elif (MATRIX_COLS <= 32)
44# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
45# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
46# define matrix_bitpop(i) bitpop32(matrix[i])
47# define ROW_SHIFTER ((uint32_t)1)
48#endif
49
50static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
51static const uint8_t col_select_pins[3] = MATRIX_COL_SELECT_PINS;
52static const uint8_t dat_pin = MATRIX_COL_DATA_PIN;
53
54/* matrix state(1:on, 0:off) */
55static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values
56static matrix_row_t matrix[MATRIX_ROWS]; //raw values
57
58/* 2d array containing binary representation of its index */
59static const uint8_t num_in_binary[8][3] = {
60 {0, 0, 0},
61 {0, 0, 1},
62 {0, 1, 0},
63 {0, 1, 1},
64 {1, 0, 0},
65 {1, 0, 1},
66 {1, 1, 0},
67 {1, 1, 1},
68};
69
70static void select_col_analog(uint8_t col);
71static void mux_pin_control(const uint8_t binary[]);
72void debounce_init(uint8_t num_rows);
73void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed);
74
75
76__attribute__ ((weak))
77void matrix_init_user(void) {}
78
79__attribute__ ((weak))
80void matrix_scan_user(void) {}
81
82__attribute__ ((weak))
83void matrix_init_kb(void) {
84 matrix_init_user();
85}
86
87__attribute__ ((weak))
88void matrix_scan_kb(void) {
89 matrix_scan_user();
90}
91
92inline
93uint8_t matrix_rows(void)
94{
95 return MATRIX_ROWS;
96}
97
98inline
99uint8_t matrix_cols(void)
100{
101 return MATRIX_COLS;
102}
103
104inline
105bool matrix_is_on(uint8_t row, uint8_t col)
106{
107 return (matrix[row] & ((matrix_row_t)1<<col));
108}
109
110inline
111matrix_row_t matrix_get_row(uint8_t row)
112{
113 // Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
114 // switch blocker installed and the switch is always pressed.
115#ifdef MATRIX_MASKED
116 return matrix[row] & matrix_mask[row];
117#else
118 return matrix[row];
119#endif
120}
121
122void matrix_print(void)
123{
124 print_matrix_header();
125
126 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
127 phex(row); print(": ");
128 print_matrix_row(row);
129 print("\n");
130 }
131}
132
133uint8_t matrix_key_count(void)
134{
135 uint8_t count = 0;
136 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
137 count += matrix_bitpop(i);
138 }
139 return count;
140}
141
142// uses standard row code
143static void select_row(uint8_t row)
144{
145 setPinOutput(row_pins[row]);
146 writePinLow(row_pins[row]);
147}
148
149static void unselect_row(uint8_t row)
150{
151 setPinInputHigh(row_pins[row]);
152}
153
154static void unselect_rows(void)
155{
156 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
157 setPinInputHigh(row_pins[x]);
158 }
159}
160
161static void init_pins(void) { // still need some fixing, this might not work
162 unselect_rows(); // with the loop
163 /*
164 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
165 setPinInputHigh(col_pins[x]);
166 }
167 */
168 setPinInputHigh(dat_pin);
169}
170
171static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
172{
173 // Store last value of row prior to reading
174 matrix_row_t last_row_value = current_matrix[current_row];
175
176 // Clear data in matrix row
177 current_matrix[current_row] = 0;
178
179 // Select row and wait for row selecton to stabilize
180 select_row(current_row);
181 wait_us(30);
182
183 // For each col...
184 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
185
186 // Select the col pin to read (active low)
187 select_col_analog(col_index);
188 wait_us(30);
189 uint8_t pin_state = readPin(dat_pin);
190
191 // Populate the matrix row with the state of the col pin
192 current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
193 }
194
195 // Unselect row
196 unselect_row(current_row);
197
198 return (last_row_value != current_matrix[current_row]);
199}
200
201
202void matrix_init(void) {
203
204 // initialize key pins
205 init_pins();
206
207 // initialize matrix state: all keys off
208 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
209 raw_matrix[i] = 0;
210 matrix[i] = 0;
211 }
212
213 debounce_init(MATRIX_ROWS);
214
215 matrix_init_quantum();
216
217 setPinInput(D5);
218 writePinLow(D5);
219
220 setPinInput(B0);
221 writePinLow(B0);
222}
223
224// modified for per col read matrix scan
225uint8_t matrix_scan(void)
226{
227 bool changed = false;
228
229 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
230 changed |= read_cols_on_row(raw_matrix, current_row);
231 }
232
233 debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
234
235 matrix_scan_quantum();
236 return (uint8_t)changed;
237}
238
239/*
240uint8_t matrix_scan(void)
241{
242 bool changed = false;
243
244#if (DIODE_DIRECTION == COL2ROW)
245 // Set row, read cols
246 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
247 changed |= read_cols_on_row(raw_matrix, current_row);
248 }
249#endif
250
251 debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
252
253 matrix_scan_quantum();
254 return (uint8_t)changed;
255}
256*/
257
258static void select_col_analog(uint8_t col) {
259 switch(col) {
260
261 case 0:
262 mux_pin_control(num_in_binary[0]);
263 break;
264 case 1:
265 mux_pin_control(num_in_binary[1]);
266 break;
267 case 2:
268 mux_pin_control(num_in_binary[2]);
269 break;
270 case 3:
271 mux_pin_control(num_in_binary[3]);
272 break;
273 case 4:
274 mux_pin_control(num_in_binary[4]);
275 break;
276 case 5:
277 mux_pin_control(num_in_binary[5]);
278 break;
279 case 6:
280 mux_pin_control(num_in_binary[6]);
281 break;
282 case 7:
283 mux_pin_control(num_in_binary[7]);
284 break;
285 default:
286 break;
287 }
288}
289
290static void mux_pin_control(const uint8_t binary[]) {
291 // set pin0
292 setPinOutput(col_select_pins[0]);
293 if(binary[0] == 0) {
294 writePinLow(col_select_pins[0]);
295 }
296 else {
297 writePinHigh(col_select_pins[0]);
298 }
299 // set pin1
300 setPinOutput(col_select_pins[1]);
301 if(binary[1] == 0) {
302 writePinLow(col_select_pins[1]);
303 }
304 else {
305 writePinHigh(col_select_pins[1]);
306 }
307 // set pin2
308 setPinOutput(col_select_pins[2]);
309 if(binary[2] == 0) {
310 writePinLow(col_select_pins[2]);
311 }
312 else {
313 writePinHigh(col_select_pins[2]);
314 }
315}
diff --git a/keyboards/handwired/owlet60/owlet60.c b/keyboards/handwired/owlet60/owlet60.c
new file mode 100644
index 000000000..42d24a291
--- /dev/null
+++ b/keyboards/handwired/owlet60/owlet60.c
@@ -0,0 +1,53 @@
1/* Copyright 2019 worthlessowl
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 "owlet60.h"
17
18// Optional override functions below.
19// You can leave any or all of these undefined.
20// These are only required if you want to perform custom actions.
21
22
23/*
24void matrix_init_kb(void) {
25 // put your keyboard start-up code here
26 // runs once when the firmware starts up
27
28 matrix_init_user();
29
30}
31
32void matrix_scan_kb(void) {
33 // put your looping keyboard code here
34 // runs every cycle (a lot)
35
36 matrix_scan_user();
37 oled_task_user();
38}
39
40bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
41 // put your per-action keyboard code here
42 // runs for every action, just before processing by the firmware
43
44 return process_record_user(keycode, record);
45}
46
47void led_set_kb(uint8_t usb_led) {
48 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
49
50 led_set_user(usb_led);
51}
52
53*/
diff --git a/keyboards/handwired/owlet60/owlet60.h b/keyboards/handwired/owlet60/owlet60.h
new file mode 100644
index 000000000..3a21e75d4
--- /dev/null
+++ b/keyboards/handwired/owlet60/owlet60.h
@@ -0,0 +1,63 @@
1/* Copyright 2019 worthlessowl
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#pragma once
17
18#include "quantum.h"
19
20/* This a shortcut to help you visually see your layout.
21 *
22 * The first section contains all of the arguments representing the physical
23 * layout of the board and position of the keys.
24 *
25 * The second converts the arguments into a two-dimensional array which
26 * represents the switch matrix.
27 */
28#define LAYOUT_owlet60_all( \
29 k50, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, \
30 k51, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
31 k52, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
32 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
33 k40, k41, k42, k43, k44, k45, k46, k47, k48 \
34) { \
35 { k07, k11, k13, k15, k50, k19, k1b, k1d}, \
36 { k17, k21, k23, k25, k51, k29, k2b, k3d}, \
37 { k27, k31, k33, k35, k52, k39, k3b, k47}, \
38 { k37, k41, k42, k43, k40, k45, k46, k48}, \
39 { k38, k32, k34, k44, k30, k3a, k3c, k3e}, \
40 { k28, k22, k24, k36, k20, k2a, k2c, k2d}, \
41 { k18, k12, k14, k26, k10, k1a, k1c, k1e}, \
42 { k08, k02, k04, k16, k00, k0a, k0c, k0f}, \
43 { k09, k03, k05, k06, k01, k0b, k0d, k0e} \
44}
45
46// swap col 1 with col 5, rearrange col 8
47#define LAYOUT_owlet60_full_bsp( \
48 k50, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0f, \
49 k51, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
50 k52, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
51 k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
52 k40, k41, k42, k43, k44, k45, k46, k47, k48 \
53) { \
54 { k50, k11, k13, k15, k07, k19, k1b, k1d}, \
55 { k51, k21, k23, k25, k17, k29, k2b, k3d}, \
56 { k52, k31, k33, k35, k27, k39, k3b, k47}, \
57 { k40, k41, k42, k43, k37, k45, k46, k48}, \
58 { k30, k32, k34, k44, k38, k3a, k3c, k3e}, \
59 { k20, k22, k24, k36, k28, k2a, k2c, k2d}, \
60 { k10, k12, k14, k26, k18, k1a, k1c, k1e}, \
61 { k00, k02, k04, k16, k08, k0a, k0c, k0f}, \
62 { k01, k03, k05, k06, k09, k0b, k0d, KC_NO} \
63}
diff --git a/keyboards/handwired/owlet60/readme.md b/keyboards/handwired/owlet60/readme.md
new file mode 100644
index 000000000..05439e7eb
--- /dev/null
+++ b/keyboards/handwired/owlet60/readme.md
@@ -0,0 +1,13 @@
1# owlet60
2
3Owlet60, a TGR Alice inspired 60%-65% keyboard. Powered with a Pro Micro and 4051 mux multiplexed matrix. PCB can be permanently snapped off for a 60% layout.
4
5Keyboard Maintainer: [worthlessowl](https://github.com/worthlessowl)
6Hardware Supported: Owlet60 PCB, standard Pro Micro
7Hardware Availability: Keyboard is running on a local pre order as of 24 September 2019, limited quantity
8
9Make example for this keyboard (after setting up your build environment):
10
11 make handwired/owlet60:default
12
13See 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/handwired/owlet60/rules.mk b/keyboards/handwired/owlet60/rules.mk
new file mode 100644
index 000000000..6d8bdfd1c
--- /dev/null
+++ b/keyboards/handwired/owlet60/rules.mk
@@ -0,0 +1,48 @@
1SRC += matrix.c
2
3# MCU name
4MCU = atmega32u4
5
6
7# Bootloader selection
8# Teensy halfkay
9# Pro Micro caterina
10# Atmel DFU atmel-dfu
11# LUFA DFU lufa-dfu
12# QMK DFU qmk-dfu
13# atmega32a bootloadHID
14BOOTLOADER = caterina
15
16
17# If you don't know the bootloader type, then you can specify the
18# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
19# Teensy halfKay 512
20# Teensy++ halfKay 1024
21# Atmel DFU loader 4096
22# LUFA bootloader 4096
23# USBaspLoader 2048
24# OPT_DEFS += -DBOOTLOADER_SIZE=4096
25
26
27# Build Options
28# change yes to no to disable
29#
30BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
31MOUSEKEY_ENABLE = no # Mouse keys(+4700)
32EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
33CONSOLE_ENABLE = no # Console for debug(+400)
34COMMAND_ENABLE = no # Commands for debug and configuration
35# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
36SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
37# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
38NKRO_ENABLE = yes # USB Nkey Rollover
39BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
40RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
41MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
42UNICODE_ENABLE = no # Unicode
43BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
44AUDIO_ENABLE = no # Audio output on port C6
45FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
46HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
47CUSTOM_MATRIX = yes
48OLED_DRIVER_ENABLE = no \ No newline at end of file