diff options
Diffstat (limited to 'keyboards/planck/light')
| -rw-r--r-- | keyboards/planck/light/config.h | 19 | ||||
| -rw-r--r-- | keyboards/planck/light/light.c | 141 | ||||
| -rw-r--r-- | keyboards/planck/light/light.h | 4 | ||||
| -rw-r--r-- | keyboards/planck/light/rules.mk | 4 |
4 files changed, 156 insertions, 12 deletions
diff --git a/keyboards/planck/light/config.h b/keyboards/planck/light/config.h index 71c924904..17c015ed0 100644 --- a/keyboards/planck/light/config.h +++ b/keyboards/planck/light/config.h | |||
| @@ -24,5 +24,22 @@ | |||
| 24 | 24 | ||
| 25 | #define NO_USB_STARTUP_CHECK | 25 | #define NO_USB_STARTUP_CHECK |
| 26 | 26 | ||
| 27 | #define PLANCK_MIT_LAYOUT | ||
| 27 | 28 | ||
| 28 | #endif \ No newline at end of file | 29 | // This is a 7-bit address, that gets left-shifted and bit 0 |
| 30 | // set to 0 for write, 1 for read (as per I2C protocol) | ||
| 31 | // The address will vary depending on your wiring: | ||
| 32 | // 0b1110100 AD <-> GND | ||
| 33 | // 0b1110111 AD <-> VCC | ||
| 34 | // 0b1110101 AD <-> SCL | ||
| 35 | // 0b1110110 AD <-> SDA | ||
| 36 | #define DRIVER_ADDR_1 0b1110100 | ||
| 37 | #define DRIVER_ADDR_2 0b1110110 | ||
| 38 | |||
| 39 | #define DRIVER_COUNT 2 | ||
| 40 | #define DRIVER_1_LED_TOTAL 25 | ||
| 41 | #define DRIVER_2_LED_TOTAL 24 | ||
| 42 | #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL | ||
| 43 | |||
| 44 | |||
| 45 | #endif | ||
diff --git a/keyboards/planck/light/light.c b/keyboards/planck/light/light.c index 96261616c..cef57c5e6 100644 --- a/keyboards/planck/light/light.c +++ b/keyboards/planck/light/light.c | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jack Humbert |
| 2 | * Copyright 2017 Jack Humbert | ||
| 3 | * | 2 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -17,6 +16,127 @@ | |||
| 17 | 16 | ||
| 18 | #include "light.h" | 17 | #include "light.h" |
| 19 | 18 | ||
| 19 | const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { | ||
| 20 | /* Refer to IS31 manual for these locations | ||
| 21 | * driver | ||
| 22 | * | R location | ||
| 23 | * | | G location | ||
| 24 | * | | | B location | ||
| 25 | * | | | | */ | ||
| 26 | {0, C1_3, C2_3, C3_3}, | ||
| 27 | {0, C1_4, C2_4, C3_4}, | ||
| 28 | {0, C1_5, C2_5, C3_5}, | ||
| 29 | {0, C1_11, C2_11, C3_11}, | ||
| 30 | {0, C1_12, C2_12, C3_12}, | ||
| 31 | {0, C1_13, C2_13, C3_13}, | ||
| 32 | {1, C1_3, C2_3, C3_3}, | ||
| 33 | {1, C1_4, C2_4, C3_4}, | ||
| 34 | {1, C1_5, C2_5, C3_5}, | ||
| 35 | {1, C1_11, C2_11, C3_11}, | ||
| 36 | {1, C1_12, C2_12, C3_12}, | ||
| 37 | {1, C1_13, C2_13, C3_13}, | ||
| 38 | |||
| 39 | {0, C1_6, C2_6, C3_6}, | ||
| 40 | {0, C1_7, C2_7, C3_7}, | ||
| 41 | {0, C1_8, C2_8, C3_8}, | ||
| 42 | {0, C1_14, C2_14, C3_14}, | ||
| 43 | {0, C1_15, C2_15, C3_15}, | ||
| 44 | {0, C1_16, C2_16, C3_16}, | ||
| 45 | {1, C1_6, C2_6, C3_6}, | ||
| 46 | {1, C1_7, C2_7, C3_7}, | ||
| 47 | {1, C1_8, C2_8, C3_8}, | ||
| 48 | {1, C1_14, C2_14, C3_14}, | ||
| 49 | {1, C1_15, C2_15, C3_15}, | ||
| 50 | {1, C1_16, C2_16, C3_16}, | ||
| 51 | |||
| 52 | {0, C9_1, C8_1, C7_1}, | ||
| 53 | {0, C9_2, C8_2, C7_2}, | ||
| 54 | {0, C9_3, C8_3, C7_3}, | ||
| 55 | {0, C9_9, C8_9, C7_9}, | ||
| 56 | {0, C9_10, C8_10, C7_10}, | ||
| 57 | {0, C9_11, C8_11, C7_11}, | ||
| 58 | {1, C9_1, C8_1, C7_1}, | ||
| 59 | {1, C9_2, C8_2, C7_2}, | ||
| 60 | {1, C9_3, C8_3, C7_3}, | ||
| 61 | {1, C9_9, C8_9, C7_9}, | ||
| 62 | {1, C9_10, C8_10, C7_10}, | ||
| 63 | {1, C9_11, C8_11, C7_11}, | ||
| 64 | |||
| 65 | {0, C9_4, C8_4, C7_4}, | ||
| 66 | {0, C9_5, C8_5, C7_5}, | ||
| 67 | {0, C9_6, C8_6, C7_6}, | ||
| 68 | {0, C9_12, C8_12, C7_12}, | ||
| 69 | {0, C9_13, C8_13, C7_13}, | ||
| 70 | {0, C9_14, C8_14, C7_14}, | ||
| 71 | {0, C9_15, C8_15, C6_14}, // middle 2u switch | ||
| 72 | {1, C9_4, C8_4, C7_4}, | ||
| 73 | {1, C9_5, C8_5, C7_5}, | ||
| 74 | {1, C9_6, C8_6, C7_6}, | ||
| 75 | {1, C9_12, C8_12, C7_12}, | ||
| 76 | {1, C9_13, C8_13, C7_13}, | ||
| 77 | {1, C9_14, C8_14, C7_14} | ||
| 78 | }; | ||
| 79 | |||
| 80 | const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | ||
| 81 | |||
| 82 | /*{row | col << 4} | ||
| 83 | | {x=0..224, y=0..64} | ||
| 84 | | | modifier | ||
| 85 | | | | */ | ||
| 86 | {{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, | ||
| 87 | {{0|(1<<4)}, {20.36*1, 21.33*0}, 0}, | ||
| 88 | {{0|(2<<4)}, {20.36*2, 21.33*0}, 0}, | ||
| 89 | {{0|(3<<4)}, {20.36*3, 21.33*0}, 0}, | ||
| 90 | {{0|(4<<4)}, {20.36*4, 21.33*0}, 0}, | ||
| 91 | {{0|(5<<4)}, {20.36*5, 21.33*0}, 0}, | ||
| 92 | {{0|(6<<4)}, {20.36*6, 21.33*0}, 0}, | ||
| 93 | {{0|(7<<4)}, {20.36*7, 21.33*0}, 0}, | ||
| 94 | {{0|(8<<4)}, {20.36*8, 21.33*0}, 0}, | ||
| 95 | {{0|(9<<4)}, {20.36*9, 21.33*0}, 0}, | ||
| 96 | {{0|(10<<4)}, {20.36*10,21.33*0}, 0}, | ||
| 97 | {{0|(11<<4)}, {20.36*11,21.33*0}, 1}, | ||
| 98 | |||
| 99 | {{1|(0<<4)}, {20.36*0, 21.33*1}, 1}, | ||
| 100 | {{1|(1<<4)}, {20.36*1, 21.33*1}, 0}, | ||
| 101 | {{1|(2<<4)}, {20.36*2, 21.33*1}, 0}, | ||
| 102 | {{1|(3<<4)}, {20.36*3, 21.33*1}, 0}, | ||
| 103 | {{1|(4<<4)}, {20.36*4, 21.33*1}, 0}, | ||
| 104 | {{1|(5<<4)}, {20.36*5, 21.33*1}, 0}, | ||
| 105 | {{1|(6<<4)}, {20.36*6, 21.33*1}, 0}, | ||
| 106 | {{1|(7<<4)}, {20.36*7, 21.33*1}, 0}, | ||
| 107 | {{1|(8<<4)}, {20.36*8, 21.33*1}, 0}, | ||
| 108 | {{1|(9<<4)}, {20.36*9, 21.33*1}, 0}, | ||
| 109 | {{1|(10<<4)}, {20.36*10,21.33*1}, 0}, | ||
| 110 | {{1|(11<<4)}, {20.36*11,21.33*1}, 1}, | ||
| 111 | |||
| 112 | {{2|(0<<4)}, {20.36*0, 21.33*2}, 1}, | ||
| 113 | {{2|(1<<4)}, {20.36*1, 21.33*2}, 0}, | ||
| 114 | {{2|(2<<4)}, {20.36*2, 21.33*2}, 0}, | ||
| 115 | {{2|(3<<4)}, {20.36*3, 21.33*2}, 0}, | ||
| 116 | {{2|(4<<4)}, {20.36*4, 21.33*2}, 0}, | ||
| 117 | {{2|(5<<4)}, {20.36*5, 21.33*2}, 0}, | ||
| 118 | {{2|(6<<4)}, {20.36*6, 21.33*2}, 0}, | ||
| 119 | {{2|(7<<4)}, {20.36*7, 21.33*2}, 0}, | ||
| 120 | {{2|(8<<4)}, {20.36*8, 21.33*2}, 0}, | ||
| 121 | {{2|(9<<4)}, {20.36*9, 21.33*2}, 0}, | ||
| 122 | {{2|(10<<4)}, {20.36*10,21.33*2}, 0}, | ||
| 123 | {{2|(11<<4)}, {20.36*11,21.33*2}, 1}, | ||
| 124 | |||
| 125 | {{3|(0<<4)}, {20.36*0, 21.33*3}, 1}, | ||
| 126 | {{3|(1<<4)}, {20.36*1, 21.33*3}, 1}, | ||
| 127 | {{3|(2<<4)}, {20.36*2, 21.33*3}, 1}, | ||
| 128 | {{3|(3<<4)}, {20.36*3, 21.33*3}, 1}, | ||
| 129 | {{3|(4<<4)}, {20.36*4, 21.33*3}, 1}, | ||
| 130 | {{3|(5<<4)}, {20.36*5, 21.33*3}, 0}, | ||
| 131 | {{3|(5<<4)}, {20.36*5.5,21.33*3}, 0}, | ||
| 132 | {{3|(6<<4)}, {20.36*6, 21.33*3}, 0}, | ||
| 133 | {{3|(7<<4)}, {20.36*7, 21.33*3}, 1}, | ||
| 134 | {{3|(8<<4)}, {20.36*8, 21.33*3}, 1}, | ||
| 135 | {{3|(9<<4)}, {20.36*9, 21.33*3}, 1}, | ||
| 136 | {{3|(10<<4)}, {20.36*10,21.33*3}, 1}, | ||
| 137 | {{3|(11<<4)}, {20.36*11,21.33*3}, 1} | ||
| 138 | }; | ||
| 139 | |||
| 20 | void matrix_init_kb(void) { | 140 | void matrix_init_kb(void) { |
| 21 | 141 | ||
| 22 | // Turn status LED on | 142 | // Turn status LED on |
| @@ -27,13 +147,22 @@ void matrix_init_kb(void) { | |||
| 27 | } | 147 | } |
| 28 | 148 | ||
| 29 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) | 149 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) |
| 30 | { | 150 | { |
| 31 | return process_record_user(keycode, record); | 151 | return process_record_user(keycode, record); |
| 32 | } | 152 | } |
| 33 | 153 | ||
| 34 | uint16_t backlight_task_counter = 0; | ||
| 35 | |||
| 36 | void matrix_scan_kb(void) | 154 | void matrix_scan_kb(void) |
| 37 | { | 155 | { |
| 38 | matrix_scan_user(); | 156 | matrix_scan_user(); |
| 39 | } \ No newline at end of file | 157 | } |
| 158 | |||
| 159 | void suspend_power_down_kb(void) | ||
| 160 | { | ||
| 161 | rgb_matrix_set_suspend_state(true); | ||
| 162 | } | ||
| 163 | |||
| 164 | void suspend_wakeup_init_kb(void) | ||
| 165 | { | ||
| 166 | rgb_matrix_set_suspend_state(false); | ||
| 167 | } | ||
| 168 | |||
diff --git a/keyboards/planck/light/light.h b/keyboards/planck/light/light.h index 111f19865..a395f30e8 100644 --- a/keyboards/planck/light/light.h +++ b/keyboards/planck/light/light.h | |||
| @@ -1,5 +1,4 @@ | |||
| 1 | /* Copyright 2017 Jason Williams | 1 | /* Copyright 2017 Jack Humbert |
| 2 | * Copyright 2017 Jack Humbert | ||
| 3 | * | 2 | * |
| 4 | * This program is free software: you can redistribute it and/or modify | 3 | * This program is free software: you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by | 4 | * it under the terms of the GNU General Public License as published by |
| @@ -19,5 +18,6 @@ | |||
| 19 | #define LIGHT_H | 18 | #define LIGHT_H |
| 20 | 19 | ||
| 21 | #include "planck.h" | 20 | #include "planck.h" |
| 21 | #include "rgb_matrix.h" | ||
| 22 | 22 | ||
| 23 | #endif \ No newline at end of file | 23 | #endif \ No newline at end of file |
diff --git a/keyboards/planck/light/rules.mk b/keyboards/planck/light/rules.mk index 3d7006b52..c10b8fd1d 100644 --- a/keyboards/planck/light/rules.mk +++ b/keyboards/planck/light/rules.mk | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | MIDI_ENABLE = yes | 1 | MIDI_ENABLE = yes |
| 2 | AUDIO_ENABLE = yes # Audio output on port C6 | 2 | AUDIO_ENABLE = yes # Audio output on port C6 |
| 3 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | 3 | RGB_MATRIX_ENABLE = yes |
| 4 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 5 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
| 6 | 4 | ||
| 7 | MCU = at90usb1286 \ No newline at end of file | 5 | MCU = at90usb1286 \ No newline at end of file |
