From 882432f780699a4eef98059b76ac1ec08a976bda Mon Sep 17 00:00:00 2001 From: Sadek Baroudi Date: Sat, 21 Aug 2021 04:00:30 -0700 Subject: [PATCH] added support for rgb matrix on the barobord --- bin/build-barobord-rgb-matrix.sh | 7 +++ keyboards/xoiviox/barobord/barobord.c | 18 +++++++ keyboards/xoiviox/barobord/config.h | 8 +++- keyboards/xoiviox/barobord/rules-oled.mk | 5 ++ keyboards/xoiviox/barobord/rules-pimoroni.mk | 5 ++ .../xoiviox/barobord/rules-rgb-matrix.mk | 48 +++++++++++++++++++ 6 files changed, 90 insertions(+), 1 deletion(-) create mode 100755 bin/build-barobord-rgb-matrix.sh create mode 100644 keyboards/xoiviox/barobord/rules-rgb-matrix.mk diff --git a/bin/build-barobord-rgb-matrix.sh b/bin/build-barobord-rgb-matrix.sh new file mode 100755 index 0000000000..dff9dcc432 --- /dev/null +++ b/bin/build-barobord-rgb-matrix.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# TODO: consolidate all the build files into one + +cp keyboards/xoiviox/barobord/rules-rgb-matrix.mk keyboards/xoiviox/barobord/rules.mk +make xoiviox/barobord:sadekbaroudi ; cp .build/xoiviox_barobord_sadekbaroudi* /mnt/c/Users/sadek/Google\ Drive/qmk-keyboards/barobord-rgb-matrix/ ; +rm keyboards/xoiviox/barobord/rules.mk diff --git a/keyboards/xoiviox/barobord/barobord.c b/keyboards/xoiviox/barobord/barobord.c index a57bb9d305..a5b83be537 100644 --- a/keyboards/xoiviox/barobord/barobord.c +++ b/keyboards/xoiviox/barobord/barobord.c @@ -14,3 +14,21 @@ * along with this program. If not, see . */ #include "barobord.h" +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 0, 6, 7,13,14,25,26,32,33,39}, + { 1, 5, 8,12,15,24,27,31,34,38}, + { 2, 4, 9,11,16,23,28,30,35,37}, + { 3,10,17,18,19,20,21,22,29,36} +}, { + {1, 1}, {3, 0}, {5, 0}, {6, 1}, {7, 2}, {10, 2}, {11, 1}, {12, 0}, {14, 0}, {16, 1}, + {1, 2}, {2, 1}, {4, 1}, {6, 2}, {7, 2}, {10, 2}, {11, 2}, {13, 1}, {15, 1}, {16, 2}, + {0, 3}, {2, 2}, {2, 3}, {5, 4}, {6, 6}, {11, 6}, {12, 4}, {15, 3}, {15, 2}, {17, 3}, + {1, 4}, {4, 4}, {4, 6}, {5, 7}, {6, 8}, {11, 8}, {12, 7}, {13, 6}, {13, 4}, {16, 4}, +}, { + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 +} }; +#endif diff --git a/keyboards/xoiviox/barobord/config.h b/keyboards/xoiviox/barobord/config.h index 70d75caab7..0801ff62e3 100644 --- a/keyboards/xoiviox/barobord/config.h +++ b/keyboards/xoiviox/barobord/config.h @@ -51,7 +51,7 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 16 #define RGBLIGHT_SAT_STEP 16 #define RGBLIGHT_VAL_STEP 16 - #define RGBLIGHT_LIMIT_VAL 128 /* The maximum brightness level */ + #define RGBLIGHT_LIMIT_VAL 112 /* The maximum brightness level for RGBLIGHT_ENABLE */ #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ // /*== all animations enable ==*/ #define RGBLIGHT_ANIMATIONS @@ -73,6 +73,12 @@ along with this program. If not, see . // #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 #endif +#ifdef RGB_MATRIX_ENABLE + #define DRIVER_LED_TOTAL 40 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 112 /* The maximum brightness level for RGB_MATRIX */ + #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set +#endif + #define ENCODERS_PAD_A {B4 , D6} #define ENCODERS_PAD_B {D7 , D4} diff --git a/keyboards/xoiviox/barobord/rules-oled.mk b/keyboards/xoiviox/barobord/rules-oled.mk index b8e65b8709..af660f5f6b 100644 --- a/keyboards/xoiviox/barobord/rules-oled.mk +++ b/keyboards/xoiviox/barobord/rules-oled.mk @@ -23,7 +23,12 @@ 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 NKRO_ENABLE = no # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality + +# Either do RGBLIGHT_ENABLE or RGB_MATRIX_ENABLE and RGB_MATRIX_DRIVER RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +#RGB_MATRIX_ENABLE = yes +#RGB_MATRIX_DRIVER = WS2812 + MIDI_ENABLE = no # MIDI support UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/xoiviox/barobord/rules-pimoroni.mk b/keyboards/xoiviox/barobord/rules-pimoroni.mk index 0e3a3bcbd7..63b7ce4566 100644 --- a/keyboards/xoiviox/barobord/rules-pimoroni.mk +++ b/keyboards/xoiviox/barobord/rules-pimoroni.mk @@ -23,7 +23,12 @@ 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 NKRO_ENABLE = no # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality + +# Either do RGBLIGHT_ENABLE or RGB_MATRIX_ENABLE and RGB_MATRIX_DRIVER RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +#RGB_MATRIX_ENABLE = yes +#RGB_MATRIX_DRIVER = WS2812 + MIDI_ENABLE = no # MIDI support UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/xoiviox/barobord/rules-rgb-matrix.mk b/keyboards/xoiviox/barobord/rules-rgb-matrix.mk new file mode 100644 index 0000000000..3f956a8e9f --- /dev/null +++ b/keyboards/xoiviox/barobord/rules-rgb-matrix.mk @@ -0,0 +1,48 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +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 +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality + +# Either do RGBLIGHT_ENABLE or RGB_MATRIX_ENABLE and RGB_MATRIX_DRIVER +#RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 + +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +#ENCODER_ENABLE = yes + +# If you don't have pimoroni trackball +#OLED_DRIVER_ENABLE = yes # this can be yes or no depending on if you have an OLED +MOUSEKEY_ENABLE = yes # Mouse keys + +# If you have pimoroni trackball +#OLED_DRIVER_ENABLE = yes # this must be yes since it uses the I2C for pimoroni +#PIMORONI_TRACKBALL_ENABLE = yes +# unfortunately, these two take up a lot of space, so you may need to disable macros :'( +#EXTRAFLAGS += -flto +#MOUSEKEY_ENABLE = no \ No newline at end of file