diff options
| author | Danny Nguyen <danny@keeb.io> | 2017-12-20 10:58:28 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-01-25 00:58:59 -0500 |
| commit | 9a91b42e922ed152cb548c529233cf7f2b6d5183 (patch) | |
| tree | e51b8f46e9b06deee26b95d28fa1c726973f627e | |
| parent | c73514a2b7284df51b8c6acd416e3fcb01dcbdc7 (diff) | |
| download | qmk_firmware-9a91b42e922ed152cb548c529233cf7f2b6d5183.tar.gz qmk_firmware-9a91b42e922ed152cb548c529233cf7f2b6d5183.zip | |
Add Chocopad keyboard
| -rw-r--r-- | keyboards/chocopad/README.md | 14 | ||||
| -rw-r--r-- | keyboards/chocopad/chocopad.c | 1 | ||||
| -rw-r--r-- | keyboards/chocopad/chocopad.h | 32 | ||||
| -rw-r--r-- | keyboards/chocopad/config.h | 59 | ||||
| -rw-r--r-- | keyboards/chocopad/keymaps/default/config.h | 6 | ||||
| -rw-r--r-- | keyboards/chocopad/keymaps/default/keymap.c | 61 | ||||
| -rw-r--r-- | keyboards/chocopad/keymaps/default/rules.mk | 5 | ||||
| -rw-r--r-- | keyboards/chocopad/rules.mk | 56 |
8 files changed, 234 insertions, 0 deletions
diff --git a/keyboards/chocopad/README.md b/keyboards/chocopad/README.md new file mode 100644 index 000000000..ad0f6b356 --- /dev/null +++ b/keyboards/chocopad/README.md | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | Chocopad | ||
| 2 | ======== | ||
| 3 | |||
| 4 | A 4x4 macropad keyboard using Kailh PG1350 Lower Profile Choc switches. | ||
| 5 | |||
| 6 | Keyboard Maintainer: Keebio | ||
| 7 | Hardware Supported: Chocopad PCB, Arduino Pro Micro | ||
| 8 | Hardware Availability: [Keebio](https://keeb.io) | ||
| 9 | |||
| 10 | Make example for this keyboard (after setting up your build environment): | ||
| 11 | |||
| 12 | make chocopad:default | ||
| 13 | |||
| 14 | See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. | ||
diff --git a/keyboards/chocopad/chocopad.c b/keyboards/chocopad/chocopad.c new file mode 100644 index 000000000..f54753af5 --- /dev/null +++ b/keyboards/chocopad/chocopad.c | |||
| @@ -0,0 +1 @@ | |||
| #include "chocopad.h" | |||
diff --git a/keyboards/chocopad/chocopad.h b/keyboards/chocopad/chocopad.h new file mode 100644 index 000000000..329e2d56f --- /dev/null +++ b/keyboards/chocopad/chocopad.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #ifndef CHOCOPAD_H | ||
| 2 | #define CHOCOPAD_H | ||
| 3 | |||
| 4 | #include "quantum.h" | ||
| 5 | |||
| 6 | #define KEYMAP( \ | ||
| 7 | A1, A2, A3, A4, \ | ||
| 8 | B1, B2, B3, B4, \ | ||
| 9 | C1, C2, C3, C4, \ | ||
| 10 | D1, D2, D3, D4 \ | ||
| 11 | ) { \ | ||
| 12 | { A1, A2, A3, A4 }, \ | ||
| 13 | { B1, B2, B3, B4 }, \ | ||
| 14 | { C1, C2, C3, C4 }, \ | ||
| 15 | { D1, D2, D3, D4 } \ | ||
| 16 | } | ||
| 17 | |||
| 18 | // Used to create a keymap using only KC_ prefixed keys | ||
| 19 | #define KC_KEYMAP( \ | ||
| 20 | A1, A2, A3, A4, \ | ||
| 21 | B1, B2, B3, B4, \ | ||
| 22 | C1, C2, C3, C4, \ | ||
| 23 | D1, D2, D3, D4 \ | ||
| 24 | ) \ | ||
| 25 | KEYMAP( \ | ||
| 26 | KC_##A1, KC_##A2, KC_##A3, KC_##A4, \ | ||
| 27 | KC_##B1, KC_##B2, KC_##B3, KC_##B4, \ | ||
| 28 | KC_##C1, KC_##C2, KC_##C3, KC_##C4, \ | ||
| 29 | KC_##D1, KC_##D2, KC_##D3, KC_##D4 \ | ||
| 30 | ) | ||
| 31 | |||
| 32 | #endif | ||
diff --git a/keyboards/chocopad/config.h b/keyboards/chocopad/config.h new file mode 100644 index 000000000..bf861ccda --- /dev/null +++ b/keyboards/chocopad/config.h | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | #ifndef CONFIG_H | ||
| 2 | #define CONFIG_H | ||
| 3 | |||
| 4 | #include "config_common.h" | ||
| 5 | |||
| 6 | /* USB Device descriptor parameter */ | ||
| 7 | #define VENDOR_ID 0xCEEB | ||
| 8 | #define PRODUCT_ID 0x1144 | ||
| 9 | #define DEVICE_VER 0x0100 | ||
| 10 | #define MANUFACTURER Keebio | ||
| 11 | #define PRODUCT Chocopad | ||
| 12 | #define DESCRIPTION 4x4 macropad using Kailh Choc low-profile switches | ||
| 13 | |||
| 14 | /* key matrix size */ | ||
| 15 | #define MATRIX_ROWS 4 | ||
| 16 | #define MATRIX_COLS 4 | ||
| 17 | |||
| 18 | /* key matrix pins */ | ||
| 19 | #define MATRIX_ROW_PINS { D7, E6, B3, B2 } | ||
| 20 | #define MATRIX_COL_PINS { D2, D4, F6, F5 } | ||
| 21 | |||
| 22 | /* COL2ROW or ROW2COL */ | ||
| 23 | #define DIODE_DIRECTION COL2ROW | ||
| 24 | |||
| 25 | /* number of backlight levels */ | ||
| 26 | #define BACKLIGHT_PIN B5 | ||
| 27 | #define BACKLIGHT_LEVELS 6 | ||
| 28 | |||
| 29 | /* Set 0 if debouncing isn't needed */ | ||
| 30 | #define DEBOUNCING_DELAY 5 | ||
| 31 | |||
| 32 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 33 | #define LOCKING_SUPPORT_ENABLE | ||
| 34 | |||
| 35 | /* Locking resynchronize hack */ | ||
| 36 | #define LOCKING_RESYNC_ENABLE | ||
| 37 | |||
| 38 | /* key combination for command */ | ||
| 39 | #define IS_COMMAND() ( \ | ||
| 40 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 41 | ) | ||
| 42 | |||
| 43 | /* prevent stuck modifiers */ | ||
| 44 | #define PREVENT_STUCK_MODIFIERS | ||
| 45 | |||
| 46 | |||
| 47 | #ifdef RGB_DI_PIN | ||
| 48 | #define RGBLIGHT_ANIMATIONS | ||
| 49 | #define RGBLIGHT_HUE_STEP 8 | ||
| 50 | #define RGBLIGHT_SAT_STEP 8 | ||
| 51 | #define RGBLIGHT_VAL_STEP 8 | ||
| 52 | #endif | ||
| 53 | #define RGB_DI_PIN D3 | ||
| 54 | #define RGBLIGHT_TIMER | ||
| 55 | #define RGBLED_NUM 4 | ||
| 56 | #define ws2812_PORTREG PORTD | ||
| 57 | #define ws2812_DDRREG DDRD | ||
| 58 | |||
| 59 | #endif \ No newline at end of file | ||
diff --git a/keyboards/chocopad/keymaps/default/config.h b/keyboards/chocopad/keymaps/default/config.h new file mode 100644 index 000000000..7fa3bf328 --- /dev/null +++ b/keyboards/chocopad/keymaps/default/config.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef CONFIG_USER_H | ||
| 2 | #define CONFIG_USER_H | ||
| 3 | |||
| 4 | #include "../../config.h" | ||
| 5 | |||
| 6 | #endif | ||
diff --git a/keyboards/chocopad/keymaps/default/keymap.c b/keyboards/chocopad/keymaps/default/keymap.c new file mode 100644 index 000000000..c4536a1b4 --- /dev/null +++ b/keyboards/chocopad/keymaps/default/keymap.c | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | #include "chocopad.h" | ||
| 2 | |||
| 3 | #define _BASE 0 | ||
| 4 | #define _FN1 1 | ||
| 5 | #define _FN2 2 | ||
| 6 | |||
| 7 | #define KC_ KC_TRNS | ||
| 8 | #define _______ KC_TRNS | ||
| 9 | |||
| 10 | #define KC_X1 MO(_FN1) | ||
| 11 | #define KC_X2 MO(_FN2) | ||
| 12 | #define KC_RST RESET | ||
| 13 | #define KC_BSTP BL_STEP | ||
| 14 | #define KC_RTOG RGB_TOG | ||
| 15 | #define KC_RMOD RGB_MOD | ||
| 16 | #define KC_RHUI RGB_HUI | ||
| 17 | #define KC_RHUD RGB_HUD | ||
| 18 | #define KC_RSAI RGB_SAI | ||
| 19 | #define KC_RSAD RGB_SAD | ||
| 20 | #define KC_RVAI RGB_VAI | ||
| 21 | #define KC_RVAD RGB_VAD | ||
| 22 | |||
| 23 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 24 | |||
| 25 | [_BASE] = KC_KEYMAP( | ||
| 26 | //,----+----+----+----. | ||
| 27 | PGUP,HOME, UP ,END , | ||
| 28 | //|----+----+----+----| | ||
| 29 | PGDN,LEFT,DOWN,RGHT, | ||
| 30 | //|----+----+----+----| | ||
| 31 | X2 ,VOLU,MPLY,MPRV, | ||
| 32 | //|----+----+----+----| | ||
| 33 | X1 ,VOLD,MUTE,MNXT | ||
| 34 | //`----+----+----+----' | ||
| 35 | ), | ||
| 36 | |||
| 37 | [_FN1] = KC_KEYMAP( | ||
| 38 | //,----+----+----+----. | ||
| 39 | ESC , P7 , P8 , P9 , | ||
| 40 | //|----+----+----+----| | ||
| 41 | TAB , P4 , P5 , P6 , | ||
| 42 | //|----+----+----+----| | ||
| 43 | ENT , P1 , P2 , P3 , | ||
| 44 | //|----+----+----+----| | ||
| 45 | , P0 , P0 ,DOT | ||
| 46 | //`----+----+----+----' | ||
| 47 | ), | ||
| 48 | |||
| 49 | [_FN2] = KC_KEYMAP( | ||
| 50 | //,----+----+----+----. | ||
| 51 | RTOG,RHUI,RSAI,RVAI, | ||
| 52 | //|----+----+----+----| | ||
| 53 | RMOD,RHUD,RSAD,RVAD, | ||
| 54 | //|----+----+----+----| | ||
| 55 | , , ,RST , | ||
| 56 | //|----+----+----+----| | ||
| 57 | BSTP, , , | ||
| 58 | //`----+----+----+----' | ||
| 59 | ) | ||
| 60 | |||
| 61 | }; | ||
diff --git a/keyboards/chocopad/keymaps/default/rules.mk b/keyboards/chocopad/keymaps/default/rules.mk new file mode 100644 index 000000000..1e5761278 --- /dev/null +++ b/keyboards/chocopad/keymaps/default/rules.mk | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | RGBLIGHT_ENABLE = yes | ||
| 2 | |||
| 3 | ifndef QUANTUM_DIR | ||
| 4 | include ../../../../Makefile | ||
| 5 | endif | ||
diff --git a/keyboards/chocopad/rules.mk b/keyboards/chocopad/rules.mk new file mode 100644 index 000000000..cd9222a15 --- /dev/null +++ b/keyboards/chocopad/rules.mk | |||
| @@ -0,0 +1,56 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Processor frequency. | ||
| 5 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 6 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 7 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 8 | # automatically to create a 32-bit value in your source code. | ||
| 9 | # | ||
| 10 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 11 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 12 | # does not *change* the processor frequency - it should merely be updated to | ||
| 13 | # reflect the processor speed set externally so that the code can use accurate | ||
| 14 | # software delays. | ||
| 15 | F_CPU = 16000000 | ||
| 16 | |||
| 17 | # | ||
| 18 | # LUFA specific | ||
| 19 | # | ||
| 20 | # Target architecture (see library "Board Types" documentation). | ||
| 21 | ARCH = AVR8 | ||
| 22 | |||
| 23 | # Input clock frequency. | ||
| 24 | # This will define a symbol, F_USB, in all source code files equal to the | ||
| 25 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
| 26 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
| 27 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
| 28 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
| 29 | # at the end, this will be done automatically to create a 32-bit value in your | ||
| 30 | # source code. | ||
| 31 | # | ||
| 32 | # If no clock division is performed on the input clock inside the AVR (via the | ||
| 33 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
| 34 | F_USB = $(F_CPU) | ||
| 35 | |||
| 36 | # Interrupt driven control endpoint task(+60) | ||
| 37 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 38 | |||
| 39 | |||
| 40 | # Boot Section Size in *bytes* | ||
| 41 | OPT_DEFS += -DBOOTLOADER_SIZE=4096 | ||
| 42 | |||
| 43 | |||
| 44 | # Build Options | ||
| 45 | # comment out to disable the options. | ||
| 46 | # | ||
| 47 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 48 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 49 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 50 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 51 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 52 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 53 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 54 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
| 55 | AUDIO_ENABLE = no | ||
| 56 | RGBLIGHT_ENABLE = yes | ||
