summaryrefslogtreecommitdiff
path: root/keyboards/mechlovin/adelais/rgb_led
diff options
context:
space:
mode:
authormechlovin <57231893+mechlovin@users.noreply.github.com>2022-08-10 01:20:36 +0700
committerGitHub <noreply@github.com>2022-08-09 11:20:36 -0700
commit94b3efe92e192a20fda3cfa4fa0f200011bba924 (patch)
tree93988163a876610201b01a6c5daf5bcf653ea054 /keyboards/mechlovin/adelais/rgb_led
parent336c4904b52ec60b116fe18a1351b38b0a344ab7 (diff)
change Adelais En Ciel rev. 3 from STM32F303 to APM32F103 MCU (#16964)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/mechlovin/adelais/rgb_led')
-rw-r--r--keyboards/mechlovin/adelais/rgb_led/rev3/config.h17
-rw-r--r--keyboards/mechlovin/adelais/rgb_led/rev3/halconf.h4
-rw-r--r--keyboards/mechlovin/adelais/rgb_led/rev3/mcuconf.h14
-rw-r--r--keyboards/mechlovin/adelais/rgb_led/rev3/rev3.c48
-rw-r--r--keyboards/mechlovin/adelais/rgb_led/rev3/rules.mk14
5 files changed, 32 insertions, 65 deletions
diff --git a/keyboards/mechlovin/adelais/rgb_led/rev3/config.h b/keyboards/mechlovin/adelais/rgb_led/rev3/config.h
index c0817d6062..6efac57ee2 100644
--- a/keyboards/mechlovin/adelais/rgb_led/rev3/config.h
+++ b/keyboards/mechlovin/adelais/rgb_led/rev3/config.h
@@ -21,8 +21,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT Adelais En Ciel Rev3
#define MATRIX_ROW_PINS { A4, A3, C13, A1, A2}
-#define MATRIX_COL_PINS { B10, B11, B2, B1, B0, A6, A5, A14, A13, A15, B3, B4, B5, B8, B9 }
+#define MATRIX_COL_PINS { B10, B11, B2, B1, B0, A6, A5, A10, A9, A15, B3, B4, B5, B8, B9 }
+#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN A7
#define WS2812_SPI SPID1 // default: SPID1
#define WS2812_SPI_MOSI_PAL_MODE 5 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 5
@@ -40,7 +41,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
+#endif
+#ifdef RGB_MATRIX_ENABLE
//rgb matrix setting
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
@@ -52,13 +55,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DRIVER_ADDR_1 0b0110010
#define DRIVER_COUNT 1
#define DRIVER_LED_TOTAL 66
+
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
-#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
+#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
@@ -108,12 +112,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_MATRIX_DISABLE_KEYCODES
+#define I2C1_CLOCK_SPEED 400000
+#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
+
+#endif
+
+#ifdef ENCODER_ENABLE
#define ENCODERS_PAD_A { B12 }
#define ENCODERS_PAD_B { B13 }
#define ENCODER_RESOLUTION 4
-
#define TAP_CODE_DELAY 10
-
+#endif
#define LED_NUM_LOCK_PIN A0
#define LED_CAPS_LOCK_PIN C14
diff --git a/keyboards/mechlovin/adelais/rgb_led/rev3/halconf.h b/keyboards/mechlovin/adelais/rgb_led/rev3/halconf.h
index d001829d03..a97c4bbc21 100644
--- a/keyboards/mechlovin/adelais/rgb_led/rev3/halconf.h
+++ b/keyboards/mechlovin/adelais/rgb_led/rev3/halconf.h
@@ -18,9 +18,7 @@
#define HAL_USE_I2C TRUE
-#define PAL_USE_CALLBACKS FALSE
-
-#define PAL_USE_WAIT FALSE
+#define HAL_USE_SPI TRUE
#include_next <halconf.h>
diff --git a/keyboards/mechlovin/adelais/rgb_led/rev3/mcuconf.h b/keyboards/mechlovin/adelais/rgb_led/rev3/mcuconf.h
index 20d2a82c27..aa5ea7335b 100644
--- a/keyboards/mechlovin/adelais/rgb_led/rev3/mcuconf.h
+++ b/keyboards/mechlovin/adelais/rgb_led/rev3/mcuconf.h
@@ -18,18 +18,8 @@
#include_next <mcuconf.h>
-#undef STM32_GPT_USE_TIM15
-#define STM32_GPT_USE_TIM15 FALSE
-
-#undef STM32_I2C_USE_I2C1
-#define STM32_I2C_USE_I2C1 TRUE
-
-#undef STM32_PWM_USE_TIM3
-#define STM32_PWM_USE_TIM3 FALSE
-
#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE
-#undef STM32_SPI_USE_SPI2
-#define STM32_SPI_USE_SPI2 FALSE
-
+#undef STM32_I2C_USE_I2C1
+#define STM32_I2C_USE_I2C1 TRUE \ No newline at end of file
diff --git a/keyboards/mechlovin/adelais/rgb_led/rev3/rev3.c b/keyboards/mechlovin/adelais/rgb_led/rev3/rev3.c
index b20f897720..d9ea7993cf 100644
--- a/keyboards/mechlovin/adelais/rgb_led/rev3/rev3.c
+++ b/keyboards/mechlovin/adelais/rgb_led/rev3/rev3.c
@@ -94,8 +94,8 @@ led_config_t g_led_config = {
{ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
{17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, NO_LED},
{32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, NO_LED, 44, NO_LED},
- {45, NO_LED, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58},
- {59, NO_LED, 60, NO_LED, 61, NO_LED, 62, NO_LED, 63, NO_LED, 64, NO_LED, NO_LED, NO_LED, 65},
+ {45, 0, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58},
+ {59, 16, 60, 31, 61, NO_LED, 62, NO_LED, 63, NO_LED, 64, NO_LED, NO_LED, NO_LED, 65},
}, {
//LED Index to Physical Positon
{0,0}, { 17, 0}, { 34, 0 }, { 51, 0 }, { 69, 0}, { 86, 0}, {100, 0}, {103, 0}, { 120, 0}, { 138, 0}, { 155, 0}, { 172, 0}, { 189, 0}, {207, 0}, {215, 0}, {224, 0},
@@ -120,47 +120,3 @@ __attribute__((weak)) void rgb_matrix_indicators_user(void) {
#endif
-
-bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
- if (record->event.pressed) {
- switch(keycode) {
- #ifdef RGBLIGHT_ENABLE
- #ifdef RGB_MATRIX_ENABLE
- case KC_F13: // toggle rgb matrix
- rgb_matrix_toggle();
- return false;
- case KC_F14:
- rgb_matrix_step();
- return false;
- case KC_F15:
- rgb_matrix_increase_speed();
- return false;
- case KC_F16:
- rgb_matrix_decrease_speed();
- return false;
- case KC_F17:
- rgb_matrix_increase_hue();
- return false;
- case KC_F18:
- rgb_matrix_decrease_hue();
- return false;
- case KC_F19:
- rgb_matrix_increase_sat();
- return false;
- case KC_F20:
- rgb_matrix_decrease_sat();
- return false;
- case KC_F21:
- rgb_matrix_increase_val();
- return false;
- case KC_F22:
- rgb_matrix_decrease_val();
- return false;
- #endif
- #endif
- default:
- break;
- }
- }
- return true;
-} \ No newline at end of file
diff --git a/keyboards/mechlovin/adelais/rgb_led/rev3/rules.mk b/keyboards/mechlovin/adelais/rgb_led/rev3/rules.mk
index 904d20877b..3407a7b780 100644
--- a/keyboards/mechlovin/adelais/rgb_led/rev3/rules.mk
+++ b/keyboards/mechlovin/adelais/rgb_led/rev3/rules.mk
@@ -1,5 +1,19 @@
+# MCU name
+MCU = STM32F103
+
+# Bootloader selection
+BOOTLOADER = stm32duino
+
+# Build Options
+# change yes to no to disable
+#
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3741
RGBLIGHT_ENABLE = yes
ENCODER_ENABLE = yes
WS2812_DRIVER = spi
+CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
+
+# Enter lower-power sleep mode when on the ChibiOS idle thread
+OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE \ No newline at end of file