aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonksoffunk <monksoffunk@users.noreply.github.com>2021-03-15 04:55:59 +0900
committerGitHub <noreply@github.com>2021-03-15 06:55:59 +1100
commit45e6bb7add65d4fd733feb2ae1a059782d7f2cfc (patch)
tree3bc8d438205cad99ffbae78e0628e8fc53084958
parent7b7689d30796c977b95197091c16e8bb97000101 (diff)
downloadqmk_firmware-45e6bb7add65d4fd733feb2ae1a059782d7f2cfc.tar.gz
qmk_firmware-45e6bb7add65d4fd733feb2ae1a059782d7f2cfc.zip
Add Cassette42 (#10562)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/cassette42/cassette42.c16
-rw-r--r--keyboards/cassette42/cassette42.h34
-rw-r--r--keyboards/cassette42/common/glcdfont.c233
-rw-r--r--keyboards/cassette42/common/oled_helper.c25
-rw-r--r--keyboards/cassette42/common/oled_helper.h22
-rw-r--r--keyboards/cassette42/config.h52
-rw-r--r--keyboards/cassette42/info.json12
-rw-r--r--keyboards/cassette42/keymaps/default/keymap.c174
-rw-r--r--keyboards/cassette42/keymaps/default/readme.md1
-rw-r--r--keyboards/cassette42/readme.md15
-rw-r--r--keyboards/cassette42/rules.mk26
11 files changed, 610 insertions, 0 deletions
diff --git a/keyboards/cassette42/cassette42.c b/keyboards/cassette42/cassette42.c
new file mode 100644
index 000000000..f5ca2b8a9
--- /dev/null
+++ b/keyboards/cassette42/cassette42.c
@@ -0,0 +1,16 @@
1/* Copyright 2019 monksoffunk
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 "cassette42.h"
diff --git a/keyboards/cassette42/cassette42.h b/keyboards/cassette42/cassette42.h
new file mode 100644
index 000000000..32a686f3d
--- /dev/null
+++ b/keyboards/cassette42/cassette42.h
@@ -0,0 +1,34 @@
1/* Copyright 2019 monksoffunk
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( \
29 k10, k11, \
30 k00, k01, k02, k03\
31) \
32{ \
33 { k00, k01, k02, k03, k10, k11 }, \
34}
diff --git a/keyboards/cassette42/common/glcdfont.c b/keyboards/cassette42/common/glcdfont.c
new file mode 100644
index 000000000..dcffc7195
--- /dev/null
+++ b/keyboards/cassette42/common/glcdfont.c
@@ -0,0 +1,233 @@
1// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0.
2// See gfxfont.h for newer custom bitmap font info.
3
4#include "progmem.h"
5
6// Standard ASCII 5x7 font
7
8static const unsigned char font[] PROGMEM = {
90x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
110x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00,
120x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00,
130x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00,
140x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00,
150x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00,
160x00, 0x18, 0x3C, 0x18, 0x00, 0x00,
170xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00,
180x00, 0x18, 0x24, 0x18, 0x00, 0x00,
190xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00,
200x30, 0x48, 0x3A, 0x06, 0x0E, 0x00,
210x26, 0x29, 0x79, 0x29, 0x26, 0x00,
220x40, 0x7F, 0x05, 0x05, 0x07, 0x00,
230x40, 0x7F, 0x05, 0x25, 0x3F, 0x00,
240x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00,
250x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00,
260x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00,
270x14, 0x22, 0x7F, 0x22, 0x14, 0x00,
280x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00,
290x06, 0x09, 0x7F, 0x01, 0x7F, 0x00,
300x00, 0x66, 0x89, 0x95, 0x6A, 0x00,
310x60, 0x60, 0x60, 0x60, 0x60, 0x00,
320x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00,
330x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
340x10, 0x20, 0x7E, 0x20, 0x10, 0x00,
350x08, 0x08, 0x2A, 0x1C, 0x08, 0x00,
360x08, 0x1C, 0x2A, 0x08, 0x08, 0x00,
370x1E, 0x10, 0x10, 0x10, 0x10, 0x00,
380x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
390x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
400x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
410x00, 0x00, 0x00, 0x00, 0x00, 0x00,
420x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
430x00, 0x07, 0x00, 0x07, 0x00, 0x00,
440x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,
450x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,
460x23, 0x13, 0x08, 0x64, 0x62, 0x00,
470x36, 0x49, 0x56, 0x20, 0x50, 0x00,
480x00, 0x08, 0x07, 0x03, 0x00, 0x00,
490x00, 0x1C, 0x22, 0x41, 0x00, 0x00,
500x00, 0x41, 0x22, 0x1C, 0x00, 0x00,
510x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00,
520x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
530x00, 0x80, 0x70, 0x30, 0x00, 0x00,
540x08, 0x08, 0x08, 0x08, 0x08, 0x00,
550x00, 0x00, 0x60, 0x60, 0x00, 0x00,
560x20, 0x10, 0x08, 0x04, 0x02, 0x00,
570x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,
580x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
590x72, 0x49, 0x49, 0x49, 0x46, 0x00,
600x21, 0x41, 0x49, 0x4D, 0x33, 0x00,
610x18, 0x14, 0x12, 0x7F, 0x10, 0x00,
620x27, 0x45, 0x45, 0x45, 0x39, 0x00,
630x3C, 0x4A, 0x49, 0x49, 0x31, 0x00,
640x41, 0x21, 0x11, 0x09, 0x07, 0x00,
650x36, 0x49, 0x49, 0x49, 0x36, 0x00,
660x46, 0x49, 0x49, 0x29, 0x1E, 0x00,
670x00, 0x00, 0x14, 0x00, 0x00, 0x00,
680x00, 0x40, 0x34, 0x00, 0x00, 0x00,
690x00, 0x08, 0x14, 0x22, 0x41, 0x00,
700x14, 0x14, 0x14, 0x14, 0x14, 0x00,
710x00, 0x41, 0x22, 0x14, 0x08, 0x00,
720x02, 0x01, 0x59, 0x09, 0x06, 0x00,
730x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00,
740x7C, 0x12, 0x11, 0x12, 0x7C, 0x00,
750x7F, 0x49, 0x49, 0x49, 0x36, 0x00,
760x3E, 0x41, 0x41, 0x41, 0x22, 0x00,
770x7F, 0x41, 0x41, 0x41, 0x3E, 0x00,
780x7F, 0x49, 0x49, 0x49, 0x41, 0x00,
790x7F, 0x09, 0x09, 0x09, 0x01, 0x00,
800x3E, 0x41, 0x41, 0x51, 0x73, 0x00,
810x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,
820x00, 0x41, 0x7F, 0x41, 0x00, 0x00,
830x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
840x7F, 0x08, 0x14, 0x22, 0x41, 0x00,
850x7F, 0x40, 0x40, 0x40, 0x40, 0x00,
860x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00,
870x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,
880x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,
890x7F, 0x09, 0x09, 0x09, 0x06, 0x00,
900x3E, 0x41, 0x51, 0x21, 0x5E, 0x00,
910x7F, 0x09, 0x19, 0x29, 0x46, 0x00,
920x26, 0x49, 0x49, 0x49, 0x32, 0x00,
930x03, 0x01, 0x7F, 0x01, 0x03, 0x00,
940x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,
950x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,
960x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,
970x63, 0x14, 0x08, 0x14, 0x63, 0x00,
980x03, 0x04, 0x78, 0x04, 0x03, 0x00,
990x61, 0x59, 0x49, 0x4D, 0x43, 0x00,
1000x00, 0x7F, 0x41, 0x41, 0x41, 0x00,
1010x02, 0x04, 0x08, 0x10, 0x20, 0x00,
1020x00, 0x41, 0x41, 0x41, 0x7F, 0x00,
1030x04, 0x02, 0x01, 0x02, 0x04, 0x00,
1040x40, 0x40, 0x40, 0x40, 0x40, 0x00,
1050x00, 0x03, 0x07, 0x08, 0x00, 0x00,
1060x20, 0x54, 0x54, 0x78, 0x40, 0x00,
1070x7F, 0x28, 0x44, 0x44, 0x38, 0x00,
1080x38, 0x44, 0x44, 0x44, 0x28, 0x00,
1090x38, 0x44, 0x44, 0x28, 0x7F, 0x00,
1100x38, 0x54, 0x54, 0x54, 0x18, 0x00,
1110x00, 0x08, 0x7E, 0x09, 0x02, 0x00,
1120x18, 0x24, 0x24, 0x1C, 0x38, 0x00,
1130x7F, 0x08, 0x04, 0x04, 0x78, 0x00,
1140x00, 0x44, 0x7D, 0x40, 0x00, 0x00,
1150x20, 0x40, 0x40, 0x3D, 0x00, 0x00,
1160x7F, 0x10, 0x28, 0x44, 0x00, 0x00,
1170x00, 0x41, 0x7F, 0x40, 0x00, 0x00,
1180x7C, 0x04, 0x78, 0x04, 0x78, 0x00,
1190x7C, 0x08, 0x04, 0x04, 0x78, 0x00,
1200x38, 0x44, 0x44, 0x44, 0x38, 0x00,
1210x7C, 0x18, 0x24, 0x24, 0x18, 0x00,
1220x18, 0x24, 0x24, 0x18, 0x7C, 0x00,
1230x7C, 0x08, 0x04, 0x04, 0x08, 0x00,
1240x48, 0x54, 0x54, 0x54, 0x24, 0x00,
1250x04, 0x04, 0x3F, 0x44, 0x24, 0x00,
1260x3C, 0x40, 0x40, 0x20, 0x7C, 0x00,
1270x1C, 0x20, 0x40, 0x20, 0x1C, 0x00,
1280x3C, 0x40, 0x30, 0x40, 0x3C, 0x00,
1290x44, 0x28, 0x10, 0x28, 0x44, 0x00,
1300x4C, 0x90, 0x90, 0x90, 0x7C, 0x00,
1310x44, 0x64, 0x54, 0x4C, 0x44, 0x00,
1320x00, 0x08, 0x36, 0x41, 0x00, 0x00,
1330x00, 0x00, 0x77, 0x00, 0x00, 0x00,
1340x00, 0x41, 0x36, 0x08, 0x00, 0x00,
1350x02, 0x01, 0x02, 0x04, 0x02, 0x00,
1360x3C, 0x26, 0x23, 0x26, 0x3C, 0x00,
1370x00, 0x00, 0x00, 0xFE, 0x01, 0x19,
1380x05, 0xC1, 0x21, 0x31, 0xD1, 0x11,
1390x11, 0x11, 0x11, 0x11, 0x11, 0xD1,
1400x31, 0x21, 0xC1, 0x01, 0x01, 0x01,
1410xFE, 0x00, 0x00, 0x00, 0x00, 0x00,
1420x00, 0x00, 0x3E, 0x3E, 0xFF, 0xFF,
1430xFF, 0xFF, 0xFF, 0x3E, 0x3E, 0x3E,
1440xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE,
1450x00, 0x00, 0x3E, 0xFF, 0xFF, 0xFF,
1460xFF, 0xFF, 0xFF, 0x3E, 0xBE, 0xBE,
1470xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0x7E,
1480x00, 0x00, 0xF8, 0xF8, 0xF8, 0x00,
1490xF8, 0xF8, 0xF8, 0x00, 0xF8, 0xF8,
1500xF8, 0xF8, 0x00, 0x00, 0x00, 0xFF,
1510xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
1520xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
1530xE0, 0xE0, 0xE0, 0x00, 0x00, 0x00,
1540xC0, 0xF0, 0xFE, 0x7E, 0x1E, 0xFE,
1550xFE, 0xFE, 0xFE, 0x00, 0x00, 0xF0,
1560xFC, 0xFC, 0xFE, 0x1E, 0x9E, 0xFE,
1570xFC, 0xFC, 0xF0, 0x00, 0x00, 0x00,
1580xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC,
1590xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00,
1600x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E,
1610x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00,
1620x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B,
1630x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00,
1640xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE,
1650xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00,
1660x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1670x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1680x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1690x00, 0x00, 0x00, 0x3F, 0x40, 0x60,
1700x50, 0x48, 0x69, 0x4B, 0x4A, 0x4A,
1710x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A,
1720x4B, 0x69, 0x48, 0x50, 0x60, 0x40,
1730x3F, 0x00, 0x00, 0x00, 0x00, 0x00,
1740x00, 0x00, 0x7C, 0x7C, 0x7F, 0x7F,
1750x7F, 0x3F, 0x1F, 0x00, 0x7C, 0x7C,
1760x7F, 0x7F, 0x7F, 0x3F, 0x1F, 0x07,
1770x00, 0x00, 0x00, 0x0F, 0x3F, 0x7F,
1780x7F, 0x7F, 0x7F, 0x7C, 0x7D, 0x7D,
1790x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7C,
1800x00, 0x00, 0x7B, 0x7B, 0x7B, 0x78,
1810x7B, 0x7B, 0x7B, 0x78, 0x7F, 0x7F,
1820x7F, 0x3F, 0x00, 0x00, 0x00, 0x7F,
1830x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x03,
1840x03, 0x03, 0x03, 0x03, 0x03, 0x03,
1850x03, 0x03, 0x03, 0x00, 0x00, 0x06,
1860x07, 0x07, 0x07, 0x07, 0x00, 0x7F,
1870x7F, 0x7F, 0x7F, 0x00, 0x00, 0x00,
1880x41, 0x73, 0x78, 0x7E, 0x7F, 0x7F,
1890x7F, 0x7B, 0x78, 0x00, 0x00, 0x00,
1900x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F,
1910x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00,
1920x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F,
1930x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00,
1940x30, 0x7B, 0x7F, 0x78, 0x30, 0x20,
1950x20, 0x30, 0x78, 0x7F, 0x3B, 0x00,
1960x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F,
1970x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00,
1980x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1990x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2000x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2010x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2020x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2030x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2040x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2050x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2060x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2070x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2080x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2090x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2100x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2110x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2120x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2130x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2140x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2150x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2160x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2170x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2180x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2190x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2200x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2210x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2220x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2230x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2240x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2250x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2260x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2270x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2280x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2290x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2300x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2310x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2320x00, 0x00, 0x00, 0x00, 0x00, 0x00
233};
diff --git a/keyboards/cassette42/common/oled_helper.c b/keyboards/cassette42/common/oled_helper.c
new file mode 100644
index 000000000..de908f128
--- /dev/null
+++ b/keyboards/cassette42/common/oled_helper.c
@@ -0,0 +1,25 @@
1#ifdef OLED_DRIVER_ENABLE
2# include QMK_KEYBOARD_H
3# include <stdio.h>
4# include <string.h>
5
6void render_logo(void) {
7 static const char PROGMEM logo[] = {0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0};
8 oled_write_P(logo, false);
9}
10
11# ifdef RGBLIGHT_ENABLE
12extern rgblight_config_t rgblight_config;
13static char led_buf[24] = "LED state ready.\n";
14rgblight_config_t rgblight_config_bak;
15
16void update_led_status(void) {
17 if (rgblight_config_bak.enable != rgblight_config.enable || rgblight_config_bak.mode != rgblight_config.mode || rgblight_config_bak.hue != rgblight_config.hue || rgblight_config_bak.sat != rgblight_config.sat || rgblight_config_bak.val != rgblight_config.val) {
18 snprintf(led_buf, sizeof(led_buf) - 1, "%c H%2d S%2d V%2d MODE%2d", rgblight_config.enable ? '*' : '.', (uint8_t)(rgblight_config.hue / RGBLIGHT_HUE_STEP), (uint8_t)(rgblight_config.sat / RGBLIGHT_SAT_STEP), (uint8_t)(rgblight_config.val / RGBLIGHT_VAL_STEP), (uint8_t)rgblight_config.mode);
19 rgblight_config_bak = rgblight_config;
20 }
21}
22
23void render_led_status(void) { oled_write(led_buf, false); }
24# endif
25#endif
diff --git a/keyboards/cassette42/common/oled_helper.h b/keyboards/cassette42/common/oled_helper.h
new file mode 100644
index 000000000..6c2680664
--- /dev/null
+++ b/keyboards/cassette42/common/oled_helper.h
@@ -0,0 +1,22 @@
1#ifdef OLED_DRIVER_ENABLE
2
3void render_logo(void);
4
5# define RENDER_LOGO(a) render_logo(a)
6
7# ifdef RGBLIGHT_ENABLE
8void update_led_status(void);
9void render_led_status(void);
10# define UPDATE_LED_STATUS() update_led_status()
11# define RENDER_LED_STATUS(a) render_led_status(a)
12# else
13# define UPDATE_LED_STATUS()
14# define RENDER_LED_STATUS(a)
15# endif
16
17#else
18# define RENDER_LOGO(a)
19# define UPDATE_LED_STATUS()
20# define RENDER_LED_STATUS(a)
21
22#endif \ No newline at end of file
diff --git a/keyboards/cassette42/config.h b/keyboards/cassette42/config.h
new file mode 100644
index 000000000..1729c31fb
--- /dev/null
+++ b/keyboards/cassette42/config.h
@@ -0,0 +1,52 @@
1/*
2Copyright 2019 monksoffunk
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
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0xCA42
26#define DEVICE_VER 0x0001
27#define MANUFACTURER monksoffunk
28#define PRODUCT cassette42
29
30/* key matrix size */
31#define MATRIX_ROWS 1
32#define MATRIX_COLS 6
33
34#define DIRECT_PINS {{ B4, F6, F5, F4, B5, F7 }}
35#define UNUSED_PINS
36
37#define ENCODERS_PAD_A { B6, B3 }
38#define ENCODERS_PAD_B { B2, B1 }
39#define ENCODER_RESOLUTION 4
40
41#define RGB_DI_PIN D3
42#ifdef RGB_DI_PIN
43# define RGBLED_NUM 5
44# define RGBLIGHT_HUE_STEP 8
45# define RGBLIGHT_SAT_STEP 8
46# define RGBLIGHT_VAL_STEP 8
47# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
48# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
49# define RGBLIGHT_ANIMATIONS
50#endif
51
52#define OLED_FONT_H "keyboards/cassette42/common/glcdfont.c"
diff --git a/keyboards/cassette42/info.json b/keyboards/cassette42/info.json
new file mode 100644
index 000000000..f792797ec
--- /dev/null
+++ b/keyboards/cassette42/info.json
@@ -0,0 +1,12 @@
1{
2 "keyboard_name": "cassette42",
3 "url": "http://www.sho-k.co.uk/tech/1246.html",
4 "maintainer": "monksoffunk",
5 "width": 4,
6 "height": 2.75,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [{"x":0.5, "y":0.75}, {"x":2.5, "y":0.75}, {"x":0, "y":1.75}, {"x":1, "y":1.75}, {"x":2, "y":1.75}, {"x":3, "y":1.75}]
10 }
11 }
12} \ No newline at end of file
diff --git a/keyboards/cassette42/keymaps/default/keymap.c b/keyboards/cassette42/keymaps/default/keymap.c
new file mode 100644
index 000000000..2f53c1d6c
--- /dev/null
+++ b/keyboards/cassette42/keymaps/default/keymap.c
@@ -0,0 +1,174 @@
1/* Copyright 2019 monksoffunk
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#include "common/oled_helper.h"
19
20// Defines the keycodes used by our macros in process_record_user
21enum custom_keycodes {
22 RGBRST = SAFE_RANGE,
23 WRTROM,
24};
25
26enum layer_number {
27 _AUDIO = 0,
28 _HUE,
29 _SAT,
30 _VAL,
31 _MODE,
32};
33
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35 // LAYOUT(LeftEncoder, RightEncoder, LeftSwitch, CenterLeftSwitch, CenterRightSwitch, RightSwitch)
36 [_AUDIO] = LAYOUT(KC_MUTE, KC_ENT, LT(_HUE, KC_MPRV), LT(_SAT, KC_MPLY), LT(_VAL, KC_MNXT), LT(_MODE, KC_SPC)),
37 [_HUE] = LAYOUT(RGB_TOG, RGBRST, _______, _______, RGB_HUD, RGB_HUI),
38 [_SAT] = LAYOUT(_______, _______, _______, _______, RGB_SAD, RGB_SAI),
39 [_VAL] = LAYOUT(_______, _______, RGB_VAD, RGB_VAI, _______, RGB_VAI),
40 [_MODE] = LAYOUT(_______, WRTROM, RGB_RMOD, RGB_MOD, RGB_MOD, _______),
41};
42
43bool process_record_user(uint16_t keycode, keyrecord_t *record) {
44 switch (keycode) {
45 case WRTROM:
46#ifdef RGBLIGHT_ENABLE
47 if (record->event.pressed) {
48 eeconfig_update_rgblight_current();
49 }
50#endif
51 return false;
52 break;
53
54 case RGBRST:
55#ifdef RGBLIGHT_ENABLE
56 if (record->event.pressed) {
57 eeconfig_update_rgblight_default();
58 rgblight_enable();
59 }
60#endif
61 return false;
62 break;
63 }
64 return true;
65}
66
67#ifdef OLED_DRIVER_ENABLE
68# include <stdio.h>
69# include <string.h>
70
71// assign the right code to your layers for OLED display
72# define L_AUDIO 0
73# define L_HUE (1 << _HUE)
74# define L_SAT (1 << _SAT)
75# define L_VAL (1 << _VAL)
76# define L_MODE (1 << _MODE)
77
78void render_status(void) {
79 render_logo();
80 // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
81 switch (layer_state) {
82 case L_AUDIO:
83 oled_write_P(PSTR("audio control\n"), false);
84 break;
85 case L_HUE:
86 oled_write_P(PSTR("rgb HUE control\n"), false);
87 break;
88 case L_SAT:
89 oled_write_P(PSTR("rgb SAT control\n"), false);
90 break;
91 case L_VAL:
92 oled_write_P(PSTR("rgb VAL control\n"), false);
93 break;
94 case L_MODE:
95 oled_write_P(PSTR("rgb MODE control\n"), false);
96 break;
97 default:
98 break;
99 }
100 UPDATE_LED_STATUS();
101 RENDER_LED_STATUS();
102}
103
104void oled_task_user(void) {
105 if (is_keyboard_master()) {
106 render_status();
107 } else {
108 render_logo();
109 }
110}
111#endif
112
113void led_set_user(uint8_t usb_led) {}
114
115void encoder_update_user(uint8_t index, bool clockwise) {
116 oled_on();
117 if (index == 0) { /* left encoder */
118 switch (layer_state) {
119 case L_AUDIO:
120 if (clockwise) {
121 tap_code(KC_VOLU);
122 } else {
123 tap_code(KC_VOLD);
124 }
125 break;
126
127 case L_HUE:
128#ifdef RGBLIGHT_ENABLE
129 if (clockwise) {
130 rgblight_increase_hue_noeeprom();
131 } else {
132 rgblight_decrease_hue_noeeprom();
133 }
134#endif
135 break;
136
137 case L_SAT:
138#ifdef RGBLIGHT_ENABLE
139 if (clockwise) {
140 rgblight_increase_sat_noeeprom();
141 } else {
142 rgblight_decrease_sat_noeeprom();
143 }
144#endif
145 break;
146
147 case L_VAL:
148#ifdef RGBLIGHT_ENABLE
149 if (clockwise) {
150 rgblight_increase_val_noeeprom();
151 } else {
152 rgblight_decrease_val_noeeprom();
153 }
154#endif
155 break;
156
157 case L_MODE:
158#ifdef RGBLIGHT_ENABLE
159 if (clockwise) {
160 rgblight_step_noeeprom();
161 } else {
162 rgblight_step_reverse_noeeprom();
163 }
164#endif
165 break;
166 }
167 } else if (index == 1) { /* right encoder */
168 if (clockwise) {
169 tap_code(KC_DOWN);
170 } else {
171 tap_code(KC_UP);
172 }
173 }
174}
diff --git a/keyboards/cassette42/keymaps/default/readme.md b/keyboards/cassette42/keymaps/default/readme.md
new file mode 100644
index 000000000..cf1a7bc43
--- /dev/null
+++ b/keyboards/cassette42/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for cassette42 \ No newline at end of file
diff --git a/keyboards/cassette42/readme.md b/keyboards/cassette42/readme.md
new file mode 100644
index 000000000..2ba9a661b
--- /dev/null
+++ b/keyboards/cassette42/readme.md
@@ -0,0 +1,15 @@
1# Cassette42
2
3![cassette42](https://pbs.twimg.com/media/D63q5S0UcAE9Rfj?format=jpg&name=large)
4
5An audio control pad with 4 switches and 2 rotary encoders.
6
7* Keyboard Maintainer: [monksoffunk](https://github.com/monksoffunk) [@monksoffunkJP](https://twitter.com/monksoffunkJP)
8* Hardware Supported: Cassette 42 PCB
9* Hardware Availability: [Yushakobo Shop](https://yushakobo.jp/shop/cassette42/)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make cassette42:default
14
15See 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/cassette42/rules.mk b/keyboards/cassette42/rules.mk
new file mode 100644
index 000000000..4fd8e384b
--- /dev/null
+++ b/keyboards/cassette42/rules.mk
@@ -0,0 +1,26 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = no # 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
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23ENCODER_ENABLE = yes
24OLED_DRIVER_ENABLE = yes
25
26SRC += ./common/oled_helper.c