bm40rgb: add RGB Matrix support

This commit is contained in:
Richard 2020-07-26 17:48:51 +07:00 committed by Richard Goulter
parent 94552bbb79
commit 13acc2713f
No known key found for this signature in database
GPG Key ID: 27303675F13A25C5
3 changed files with 29 additions and 22 deletions

View File

@ -16,3 +16,25 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "bm40rgb.h" #include "bm40rgb.h"
led_config_t g_led_config = { {
// Key Matrix to LED Index
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
{ 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 },
{ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 },
{ 36, 37, 38, 39, 40, 41, NO_LED, 42, 43, 44, 45, 46},
}, {
// LED Index to Physical Position
{0, 0}, {20, 0}, {40, 0}, {61, 0}, {81, 0}, {101, 0}, {122, 0}, {142, 0}, {162, 0}, {183, 0}, {203, 0}, {224, 0},
{0, 21}, {20, 21}, {40, 21}, {61, 21}, {81, 21}, {101, 21}, {122, 21}, {142, 21}, {162, 21}, {183, 21}, {203, 21}, {224, 21},
{0, 42}, {20, 42}, {40, 42}, {61, 42}, {81, 42}, {101, 42}, {122, 42}, {142, 42}, {162, 42}, {183, 42}, {203, 42}, {224, 42},
{0, 64}, {20, 64}, {40, 64}, {61, 64}, {81, 64}, {111, 64}, {142, 64}, {162, 64}, {183, 64}, {203, 64}, {224, 64},
{220, 32}, {176, 32}, {132, 32}, {88, 32}, {44, 32}, {0, 32}
}, {
// LED Index to Flag
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2
} };

View File

@ -47,23 +47,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
#define RGB_DI_PIN E2 #define RGB_DI_PIN E2
#define DRIVER_LED_TOTAL 53
#ifdef RGB_DI_PIN #ifdef RGB_DI_PIN
#define RGBLED_NUM 54 #define RGB_MATRIX_KEYPRESSES // reacts to keypresses
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_LIMIT_VAL 180 /* The maximum brightness level */
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
#define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
// #define RGBLIGHT_EFFECT_BREATHING
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
// #define RGBLIGHT_EFFECT_SNAKE
// #define RGBLIGHT_EFFECT_KNIGHT
// #define RGBLIGHT_EFFECT_CHRISTMAS
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
// #define RGBLIGHT_EFFECT_RGB_TEST
// #define RGBLIGHT_EFFECT_ALTERNATING
#endif #endif

View File

@ -10,14 +10,13 @@ BOOTLOADER = atmel-dfu
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = no # Audio control and System control EXTRAKEY_ENABLE = no # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
@ -26,5 +25,7 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
KEY_LOCK_ENABLE = no # Enable KC_LOCK support KEY_LOCK_ENABLE = no # Enable KC_LOCK support
RGB_MATRIX_ENABLE = WS2812
LAYOUTS = ortho_4x12 planck_mit LAYOUTS = ortho_4x12 planck_mit
LAYOUTS_HAS_RGB = yes LAYOUTS_HAS_RGB = yes