aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArda Kılıçdağı <ardakilicdagi@gmail.com>2019-10-22 05:27:26 +0300
committerDrashna Jaelre <drashna@live.com>2019-10-21 19:27:26 -0700
commitf033d8113d627c6950dc87936dfdb70e2b1ebf5f (patch)
tree7ff43c3a23cd38cfa1930546fde7a669e43033b1
parent267be40793457722cb8a7ab0b3c6c5654e433f9e (diff)
downloadqmk_firmware-f033d8113d627c6950dc87936dfdb70e2b1ebf5f.tar.gz
qmk_firmware-f033d8113d627c6950dc87936dfdb70e2b1ebf5f.zip
[Keyboard] 40percentclub 4 pack macropad keyboard (#7088)
* 4 pack macropad layout added * Update keyboards/40percentclub/4pack/keymaps/default/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/40percentclub/4pack/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/40percentclub/4pack/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/40percentclub/4pack/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Update keyboards/40percentclub/4pack/readme.md Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * remove unnecessary comments, remove firmware impact numbers, align comments * remove unnecessary readme paragraphs * pinout changed with direct pins instead of matrix * typo fixed on led method name * leds are now handled by backlight feture, led.c removed, info.json added, flash instructions updated
-rw-r--r--keyboards/40percentclub/4pack/4pack.c54
-rw-r--r--keyboards/40percentclub/4pack/4pack.h33
-rw-r--r--keyboards/40percentclub/4pack/config.h257
-rw-r--r--keyboards/40percentclub/4pack/info.json12
-rw-r--r--keyboards/40percentclub/4pack/keymaps/default/config.h19
-rw-r--r--keyboards/40percentclub/4pack/keymaps/default/keymap.c26
-rw-r--r--keyboards/40percentclub/4pack/keymaps/default/readme.md1
-rw-r--r--keyboards/40percentclub/4pack/readme.md17
-rw-r--r--keyboards/40percentclub/4pack/rules.mk33
9 files changed, 452 insertions, 0 deletions
diff --git a/keyboards/40percentclub/4pack/4pack.c b/keyboards/40percentclub/4pack/4pack.c
new file mode 100644
index 000000000..98f22a65a
--- /dev/null
+++ b/keyboards/40percentclub/4pack/4pack.c
@@ -0,0 +1,54 @@
1/* Copyright 2019 Arda Kilicdagi
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 "4pack.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
22void matrix_init_kb(void) {
23 // put your keyboard start-up code here
24 // runs once when the firmware starts up
25
26 setPinOutput(F4); // cathodes
27 setPinOutput(F5); // cathodes
28
29 // Do the rest
30 matrix_init_user();
31}
32
33/*
34void matrix_scan_kb(void) {
35 // put your looping keyboard code here
36 // runs every cycle (a lot)
37
38 matrix_scan_user();
39}
40
41bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
42 // put your per-action keyboard code here
43 // runs for every action, just before processing by the firmware
44
45 return process_record_user(keycode, record);
46}
47
48void led_set_kb(uint8_t usb_led) {
49 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
50
51 led_set_user(usb_led);
52}
53
54*/
diff --git a/keyboards/40percentclub/4pack/4pack.h b/keyboards/40percentclub/4pack/4pack.h
new file mode 100644
index 000000000..1340300ac
--- /dev/null
+++ b/keyboards/40percentclub/4pack/4pack.h
@@ -0,0 +1,33 @@
1/* Copyright 2019 Arda Kilicdagi
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 k00, k01, k02, k03 \
30) \
31{ \
32 { k00, k01, k02, k03 }, \
33}
diff --git a/keyboards/40percentclub/4pack/config.h b/keyboards/40percentclub/4pack/config.h
new file mode 100644
index 000000000..33b5df6d5
--- /dev/null
+++ b/keyboards/40percentclub/4pack/config.h
@@ -0,0 +1,257 @@
1/*
2Copyright 2019 Arda Kilicdagi
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 0x0000
25#define DEVICE_VER 0x0001
26#define MANUFACTURER 40percentclub
27#define PRODUCT 4pack
28#define DESCRIPTION A 1x4 custom macropad
29
30/* key matrix size */
31#define MATRIX_ROWS 1
32#define MATRIX_COLS 4
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 { B0 } // B0 equivalents the ground pin
45// #define MATRIX_COL_PINS { E6, D7, C6, D4 }
46#define DIRECT_PINS { \
47 { E6, D7, C6, D4 } \
48}
49#define UNUSED_PINS
50
51/* COL2ROW, ROW2COL*/
52#define DIODE_DIRECTION COL2ROW
53
54
55/*
56 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
57 */
58// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
59
60// #define BACKLIGHT_PIN B7
61// #define BACKLIGHT_BREATHING
62// #define BACKLIGHT_LEVELS 3
63#define BACKLIGHT_LED_COUNT 2
64#undef BACKLIGHT_PIN
65#define BACKLIGHT_PINS { F6, F7 }
66
67
68// #define RGB_DI_PIN E2
69// #ifdef RGB_DI_PIN
70// #define RGBLED_NUM 16
71// #define RGBLIGHT_HUE_STEP 8
72// #define RGBLIGHT_SAT_STEP 8
73// #define RGBLIGHT_VAL_STEP 8
74// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
75// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
76// /*== all animations enable ==*/
77// #define RGBLIGHT_ANIMATIONS
78// /*== or choose animations ==*/
79// #define RGBLIGHT_EFFECT_BREATHING
80// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
81// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
82// #define RGBLIGHT_EFFECT_SNAKE
83// #define RGBLIGHT_EFFECT_KNIGHT
84// #define RGBLIGHT_EFFECT_CHRISTMAS
85// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
86// #define RGBLIGHT_EFFECT_RGB_TEST
87// #define RGBLIGHT_EFFECT_ALTERNATING
88// /*== customize breathing effect ==*/
89// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
90// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
91// /*==== use exp() and sin() ====*/
92// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
93// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
94// #endif
95
96/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
97#define DEBOUNCE 5
98
99/* define if matrix has ghost (lacks anti-ghosting diodes) */
100//#define MATRIX_HAS_GHOST
101
102/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
103#define LOCKING_SUPPORT_ENABLE
104/* Locking resynchronize hack */
105#define LOCKING_RESYNC_ENABLE
106
107/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
108 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
109 */
110// #define GRAVE_ESC_CTRL_OVERRIDE
111
112/*
113 * Force NKRO
114 *
115 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
116 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
117 * makefile for this to work.)
118 *
119 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
120 * until the next keyboard reset.
121 *
122 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
123 * fully operational during normal computer usage.
124 *
125 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
126 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
127 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
128 * power-up.
129 *
130 */
131//#define FORCE_NKRO
132
133/*
134 * Magic Key Options
135 *
136 * Magic keys are hotkey commands that allow control over firmware functions of
137 * the keyboard. They are best used in combination with the HID Listen program,
138 * found here: https://www.pjrc.com/teensy/hid_listen.html
139 *
140 * The options below allow the magic key functionality to be changed. This is
141 * useful if your keyboard/keypad is missing keys and you want magic key support.
142 *
143 */
144
145/* key combination for magic key command */
146/* defined by default; to change, uncomment and set to the combination you want */
147// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
148
149/* control how magic key switches layers */
150//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
151//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
152//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
153
154/* override magic key keymap */
155//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
156//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
157//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
158//#define MAGIC_KEY_HELP H
159//#define MAGIC_KEY_HELP_ALT SLASH
160//#define MAGIC_KEY_DEBUG D
161//#define MAGIC_KEY_DEBUG_MATRIX X
162//#define MAGIC_KEY_DEBUG_KBD K
163//#define MAGIC_KEY_DEBUG_MOUSE M
164//#define MAGIC_KEY_VERSION V
165//#define MAGIC_KEY_STATUS S
166//#define MAGIC_KEY_CONSOLE C
167//#define MAGIC_KEY_LAYER0 0
168//#define MAGIC_KEY_LAYER0_ALT GRAVE
169//#define MAGIC_KEY_LAYER1 1
170//#define MAGIC_KEY_LAYER2 2
171//#define MAGIC_KEY_LAYER3 3
172//#define MAGIC_KEY_LAYER4 4
173//#define MAGIC_KEY_LAYER5 5
174//#define MAGIC_KEY_LAYER6 6
175//#define MAGIC_KEY_LAYER7 7
176//#define MAGIC_KEY_LAYER8 8
177//#define MAGIC_KEY_LAYER9 9
178//#define MAGIC_KEY_BOOTLOADER B
179//#define MAGIC_KEY_BOOTLOADER_ALT ESC
180//#define MAGIC_KEY_LOCK CAPS
181//#define MAGIC_KEY_EEPROM E
182//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
183//#define MAGIC_KEY_NKRO N
184//#define MAGIC_KEY_SLEEP_LED Z
185
186/*
187 * Feature disable options
188 * These options are also useful to firmware size reduction.
189 */
190
191/* disable debug print */
192//#define NO_DEBUG
193
194/* disable print */
195//#define NO_PRINT
196
197/* disable action features */
198//#define NO_ACTION_LAYER
199//#define NO_ACTION_TAPPING
200//#define NO_ACTION_ONESHOT
201//#define NO_ACTION_MACRO
202//#define NO_ACTION_FUNCTION
203
204/*
205 * MIDI options
206 */
207
208/* Prevent use of disabled MIDI features in the keymap */
209//#define MIDI_ENABLE_STRICT 1
210
211/* enable basic MIDI features:
212 - MIDI notes can be sent when in Music mode is on
213*/
214//#define MIDI_BASIC
215
216/* enable advanced MIDI features:
217 - MIDI notes can be added to the keymap
218 - Octave shift and transpose
219 - Virtual sustain, portamento, and modulation wheel
220 - etc.
221*/
222//#define MIDI_ADVANCED
223
224/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
225//#define MIDI_TONE_KEYCODE_OCTAVES 1
226
227/*
228 * HD44780 LCD Display Configuration
229 */
230/*
231#define LCD_LINES 2 //< number of visible lines of the display
232#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
233
234#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
235
236#if LCD_IO_MODE
237#define LCD_PORT PORTB //< port for the LCD lines
238#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
239#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
240#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
241#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
242#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
243#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
244#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
245#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
246#define LCD_RS_PORT LCD_PORT //< port for RS line
247#define LCD_RS_PIN 3 //< pin for RS line
248#define LCD_RW_PORT LCD_PORT //< port for RW line
249#define LCD_RW_PIN 2 //< pin for RW line
250#define LCD_E_PORT LCD_PORT //< port for Enable line
251#define LCD_E_PIN 1 //< pin for Enable line
252#endif
253*/
254
255/* Bootmagic Lite key configuration */
256// #define BOOTMAGIC_LITE_ROW 0
257// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/40percentclub/4pack/info.json b/keyboards/40percentclub/4pack/info.json
new file mode 100644
index 000000000..8dd164e4b
--- /dev/null
+++ b/keyboards/40percentclub/4pack/info.json
@@ -0,0 +1,12 @@
1{
2 "keyboard_name": "4pack",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 4,
6 "height": 1,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}]
10 }
11 }
12} \ No newline at end of file
diff --git a/keyboards/40percentclub/4pack/keymaps/default/config.h b/keyboards/40percentclub/4pack/keymaps/default/config.h
new file mode 100644
index 000000000..c76819ce5
--- /dev/null
+++ b/keyboards/40percentclub/4pack/keymaps/default/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2019 Arda Kilicdagi
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/40percentclub/4pack/keymaps/default/keymap.c b/keyboards/40percentclub/4pack/keymaps/default/keymap.c
new file mode 100644
index 000000000..19264651b
--- /dev/null
+++ b/keyboards/40percentclub/4pack/keymaps/default/keymap.c
@@ -0,0 +1,26 @@
1/* Copyright 2019 Arda Kilicdagi
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
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT( /* Base */
21 KC_A, KC_S, KC_D, KC_F
22 ),
23};
24
25
26void matrix_init_user(void) { }
diff --git a/keyboards/40percentclub/4pack/keymaps/default/readme.md b/keyboards/40percentclub/4pack/keymaps/default/readme.md
new file mode 100644
index 000000000..00bf43cb9
--- /dev/null
+++ b/keyboards/40percentclub/4pack/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for 4pack
diff --git a/keyboards/40percentclub/4pack/readme.md b/keyboards/40percentclub/4pack/readme.md
new file mode 100644
index 000000000..5fcfbf892
--- /dev/null
+++ b/keyboards/40percentclub/4pack/readme.md
@@ -0,0 +1,17 @@
1# 4 Pack
2
3![4pack](https://i.imgur.com/rioXXq5l.jpg)
4
5A 4-key macropad PCB with its switch and LED pins wired directly to microcontroller IO pins.
6
7You can find the main blog post about this macropad [here](http://www.40percent.club/2017/07/4-pack.html), also the Gerber files and other documentation is located [here](https://git.40percent.club/di0ib/Misc/src/branch/master/4pack).
8
9Keyboard Maintainer: [Arda Kilicdagi](http://github.com/ardakilic), [The QMK Community](https://github.com/qmk)
10Hardware Supported: 4 Pack PCB, Pro Micro
11Hardware Availability: [40percent.club](https://git.40percent.club/di0ib/Misc/src/branch/master/4pack)
12
13Make example for this macropad (after setting up your build environment):
14
15 make 40percentclub/4pack:default:flash
16
17See 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/40percentclub/4pack/rules.mk b/keyboards/40percentclub/4pack/rules.mk
new file mode 100644
index 000000000..a0c9d34f5
--- /dev/null
+++ b/keyboards/40percentclub/4pack/rules.mk
@@ -0,0 +1,33 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = caterina
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = no # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25NKRO_ENABLE = no # USB Nkey Rollover
26BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
27RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29UNICODE_ENABLE = no # Unicode
30BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
31AUDIO_ENABLE = no # Audio output on port C6
32FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
33HD44780_ENABLE = no # Enable support for HD44780 based LCDs