Skip to content

Commit

Permalink
djam add rgb matrix (qmk#19621)
Browse files Browse the repository at this point in the history
  • Loading branch information
myst729 authored and omikronik committed Jan 22, 2023
1 parent 4c9b570 commit 71b353f
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 5 deletions.
11 changes: 11 additions & 0 deletions keyboards/deng/djam/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,14 @@

#define BACKLIGHT_PIN B7
#define BACKLIGHT_LEVELS 5

#ifdef RGB_MATRIX_ENABLE
#define RGB_DI_PIN D5
#define RGB_MATRIX_LED_COUNT 31
#define RGB_MATRIX_KEYPRESSES
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
#endif
27 changes: 27 additions & 0 deletions keyboards/deng/djam/djam.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,30 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "djam.h"

#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
/* Key Matrix to LED Index */
{ 17, 16, 15, NO_LED, NO_LED, 7, 6, 5 },
{ 21, 17, 16, 15, 7, 6, 5, 1 },
{ 19, 18, 13, 11, 9, 4, 3, NO_LED }
},
{
/* LED Index to Physical Position */
// Switch LEDs
{224,14}, {224,24}, {224,33}, {212,57}, {192,57}, {192,38}, {172,38}, {152,38},
{152,57}, {142,57}, {132,57}, {112,57}, {92,57}, {82,57}, {72,57},
{72,38}, {52,38}, {32,38}, {32,57}, {12,57}, {0,33}, {0,24}, {0,14},
// Underglow LEDs
{0,0}, {92,0}, {132,0}, {224,0}, {222,64}, {172,64}, {72,64}, {2,64},
},
{
/* LED Index to Flag */
2, 4, 2, 4, 4, 4, 4, 4,
2, 4, 2, 4, 2, 4, 2,
4, 4, 4, 4, 4, 2, 4, 2,
2, 2, 2, 2, 2, 2, 2, 2
}
};
#endif
19 changes: 18 additions & 1 deletion keyboards/deng/djam/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,26 @@
*/
#include QMK_KEYBOARD_H

#define L1_SPC LT(1, KC_SPC)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌───┬───┬───┐ ┌───┬───┬───┐
* ┌───┤ S │ D │ F │ │ J │ K │ L ├───┐
* │ A ├───┼───┼───┤ DJAM ├───┼───┼───┤ ; │
* └───┤ Z │ X │ C │ │ N │ M │ , ├───┘
* ┌───┼───┼───┴─┬─┴─┬───────┬─┴─┬─┴───┼───┼───┐
* │ ← │ → │ │LSh│ SPACE │RSh│ │ ↑ │ ↓ │
* └───┴───┘ └───┴───────┴───┘ └───┴───┘
*/
[0] = LAYOUT(
KC_S, KC_D, KC_F, KC_J, KC_K, KC_L,
KC_A, KC_Z, KC_X, KC_C, KC_N, KC_M, KC_COMM, KC_SCLN,
KC_LEFT, KC_RGHT, BL_TOGG, KC_SPC, BL_STEP, KC_UP, KC_DOWN)
KC_LEFT, KC_RGHT, KC_LSFT, L1_SPC, KC_RSFT, KC_UP, KC_DOWN),

[1] = LAYOUT(
RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, RGB_RMOD,
_______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, RGB_MOD, RGB_TOG,
_______, _______, BL_TOGG, _______, BL_STEP, _______, _______)

};
19 changes: 15 additions & 4 deletions keyboards/deng/djam/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,27 @@
*/
#include QMK_KEYBOARD_H

#define L1_SPC LT(1, KC_SPC)

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌───┬───┬───┐ ┌───┬───┬───┐
* ┌───┤ S │ D │ F │ │ J │ K │ L ├───┐
* │ A ├───┼───┼───┤ DJAM ├───┼───┼───┤ ; │
* └───┤ Z │ X │ C │ │ N │ M │ , ├───┘
* ┌───┼───┼───┴─┬─┴─┬───────┬─┴─┬─┴───┼───┼───┐
* │ ← │ → │ │LSh│ SPACE │RSh│ │ ↑ │ ↓ │
* └───┴───┘ └───┴───────┴───┘ └───┴───┘
*/
[0] = LAYOUT(
KC_S, KC_D, KC_F, KC_J, KC_K, KC_L,
KC_A, KC_Z, KC_X, KC_C, KC_N, KC_M, KC_COMM, KC_SCLN,
KC_LEFT, KC_RGHT, BL_TOGG, KC_SPC, BL_STEP, KC_UP, KC_DOWN),
KC_LEFT, KC_RGHT, KC_LSFT, L1_SPC, KC_RSFT, KC_UP, KC_DOWN),

[1] = LAYOUT(
_______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______),
RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, RGB_RMOD,
_______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, RGB_MOD, RGB_TOG,
_______, _______, BL_TOGG, _______, BL_STEP, _______, _______),

[2] = LAYOUT(
_______, _______, _______, _______, _______, _______,
Expand Down
2 changes: 2 additions & 0 deletions keyboards/deng/djam/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
BACKLIGHT_DRIVER = pwm
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812

0 comments on commit 71b353f

Please sign in to comment.