From 4d3c2f9873fb8013041002537b3f97e478cc9853 Mon Sep 17 00:00:00 2001 From: Sadek Baroudi Date: Thu, 23 Nov 2023 22:15:20 -0800 Subject: [PATCH] added rgb and oled support for dweeeeep --- keyboards/fingerpunch/dweeeeep/config.h | 24 +++++++ keyboards/fingerpunch/dweeeeep/fp_build.json | 12 ++++ .../dweeeeep/keymaps/default/keymap.c | 62 +++++++++++++++++++ keyboards/fingerpunch/dweeeeep/rules.mk | 1 - 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 keyboards/fingerpunch/dweeeeep/fp_build.json diff --git a/keyboards/fingerpunch/dweeeeep/config.h b/keyboards/fingerpunch/dweeeeep/config.h index 52f02fbdee..9f1d60b582 100644 --- a/keyboards/fingerpunch/dweeeeep/config.h +++ b/keyboards/fingerpunch/dweeeeep/config.h @@ -2,6 +2,30 @@ #include "keyboards/fingerpunch/src/config_pre.h" +#define WS2812_DI_PIN D3 +#ifdef RGBLIGHT_ENABLE + #define RGBLED_NUM 36 + #define RGBLED_SPLIT {18, 18} + #define RGBLIGHT_HUE_STEP 16 + #define RGBLIGHT_SAT_STEP 16 + #define RGBLIGHT_VAL_STEP 16 + #define RGBLIGHT_LIMIT_VAL 150 /* 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 */ + #define RGBLIGHT_EFFECT_ALTERNATING + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_TWINKLE +#endif + +#ifdef OLED_ENABLE +#define OLED_DISPLAY_128X32 +#endif + #define MASTER_LEFT #include "keyboards/fingerpunch/src/config_post.h" diff --git a/keyboards/fingerpunch/dweeeeep/fp_build.json b/keyboards/fingerpunch/dweeeeep/fp_build.json new file mode 100644 index 0000000000..9b00c5c8f7 --- /dev/null +++ b/keyboards/fingerpunch/dweeeeep/fp_build.json @@ -0,0 +1,12 @@ +[ + { + "type" : "single", + "name" : "RGBLIGHT_ENABLE", + "user_input": "Do you have RGB?" + }, + { + "type" : "single", + "name" : "OLED_ENABLE", + "user_input": "Do you have an OLED?" + } +] \ No newline at end of file diff --git a/keyboards/fingerpunch/dweeeeep/keymaps/default/keymap.c b/keyboards/fingerpunch/dweeeeep/keymaps/default/keymap.c index 0a94e60552..80b6edd07c 100644 --- a/keyboards/fingerpunch/dweeeeep/keymaps/default/keymap.c +++ b/keyboards/fingerpunch/dweeeeep/keymaps/default/keymap.c @@ -125,3 +125,65 @@ layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_270; +} + + +// Commenting out logo as it takes up a lot of space :( +static void render_logo(void) { + // sweeeeep logo, 128x32px + static const char PROGMEM dweeeeep_logo[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x20, 0x20, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x18, 0x06, 0xc1, 0x20, 0x18, 0x06, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x30, 0x50, 0x48, 0x88, + 0x08, 0x08, 0x06, 0x01, 0x20, 0xd8, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x50, 0x48, 0x48, 0x44, 0xa2, 0x61, 0x11, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, + 0x01, 0x01, 0x02, 0x02, 0xc4, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x0c, 0x16, 0x23, 0x20, 0x20, + 0x18, 0x7e, 0x40, 0x78, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x60, 0x30, 0x18, + 0x10, 0x30, 0x70, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x86, 0x84, 0x80, + 0x44, 0x06, 0xc7, 0x03, 0x04, 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x09, 0x15, 0x02, + 0x16, 0x20, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x82, 0x01, 0xfe, + 0xc1, 0x02, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x08, 0x04, 0xfc, + 0x04, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x22, 0x10, 0xe3, + 0x13, 0x20, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x40, 0xcf, + 0x4c, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x20, 0x00, 0x3f, + 0x30, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x82, 0x01, 0xfe, + 0xc1, 0x02, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x0c, 0x08, 0xfc, 0x08, 0x0c, 0x08, + 0x0c, 0x08, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + +}; + oled_write_raw_P(dweeeeep_logo, sizeof(dweeeeep_logo)); + +} + +bool oled_task_user(void) { + // If you don't want to display the logo, switch + if (false) { + //render_status(); + } else if (true) { + render_logo(); + } else { + //render_logo_text(); + } + return true; +} + +#endif diff --git a/keyboards/fingerpunch/dweeeeep/rules.mk b/keyboards/fingerpunch/dweeeeep/rules.mk index 75eb8cde8e..3a3bac8a96 100644 --- a/keyboards/fingerpunch/dweeeeep/rules.mk +++ b/keyboards/fingerpunch/dweeeeep/rules.mk @@ -1,4 +1,3 @@ # This file intentionally left blank - include keyboards/fingerpunch/src/rules.mk