diff options
author | Aldehir Rojas <hello@aldehir.com> | 2020-12-29 18:28:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-30 00:28:49 +0000 |
commit | 4f2f21dc05c70451593ba83ed7a0956c771850c2 (patch) | |
tree | 266942c390a6b8d78d6f7c2994039a5f8b2eba98 /keyboards/handwired | |
parent | 7dd99f2b22a34143c0443154d9cd97540443b096 (diff) |
Rewrite APA102 support (#10894)
* Rewrite APA102 support
The APA102 source was broken by commit 16a15c1cfcbfd0feb2c2cf1383676747e2f97d73 as it did not include the
quantum header. This commit addresses that, as well as other issues with
transferring bytes over the SPI interface, i.e. it was not setting the
clock pin back to low after sending a bit.
The deviation when sending the end frame is kept, but updated to the
latest from the referenced project.
Finally, these changes expose the global LED brightness parameter
of the APA102. Brightness values are configurable through
`APA102_DEFAULT_BRIGHTNESS` and `APA102_MAX_BRIGHTNESS`.
* Fix typo in led brightness extern
* Move driver out of AVR directory and add delay for ARM
* Experimental APA102 support on AVR and ARM
Co-authored-by: Alde Rojas <hello@alde.io>
* Refactor apa102_send_byte() calls to a loop
* Implement io_wait function for ARM
* Move APA102 drivers to own directory, fix copyright notice
* Add APA102 keymap to handwired/onekey
* Simplify RGBLIGHT_ENABLE/DRIVER option handling
Co-authored-by: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>
Diffstat (limited to 'keyboards/handwired')
-rw-r--r-- | keyboards/handwired/onekey/elite_c/config.h | 1 | ||||
-rw-r--r-- | keyboards/handwired/onekey/keymaps/apa102/config.h | 5 | ||||
-rw-r--r-- | keyboards/handwired/onekey/keymaps/apa102/keymap.c | 14 | ||||
-rw-r--r-- | keyboards/handwired/onekey/keymaps/apa102/rules.mk | 2 | ||||
-rw-r--r-- | keyboards/handwired/onekey/promicro/config.h | 1 | ||||
-rw-r--r-- | keyboards/handwired/onekey/proton_c/config.h | 1 |
6 files changed, 24 insertions, 0 deletions
diff --git a/keyboards/handwired/onekey/elite_c/config.h b/keyboards/handwired/onekey/elite_c/config.h index 167373cd39..02c81ce743 100644 --- a/keyboards/handwired/onekey/elite_c/config.h +++ b/keyboards/handwired/onekey/elite_c/config.h @@ -25,5 +25,6 @@ #define BACKLIGHT_PIN B6 #define RGB_DI_PIN F6 +#define RGB_CI_PIN B1 #define ADC_PIN F6 diff --git a/keyboards/handwired/onekey/keymaps/apa102/config.h b/keyboards/handwired/onekey/keymaps/apa102/config.h new file mode 100644 index 0000000000..aeb22a261b --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/apa102/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define RGBLED_NUM 40 +#define APA102_DEFAULT_BRIGHTNESS 5 +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/handwired/onekey/keymaps/apa102/keymap.c b/keyboards/handwired/onekey/keymaps/apa102/keymap.c new file mode 100644 index 0000000000..700755a452 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/apa102/keymap.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H +#include "apa102.h" // Only needed if you want to use the global brightness function + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_1x1(RGB_MOD) +}; + +void keyboard_post_init_user(void) { + apa102_set_brightness(5); + + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL); +} diff --git a/keyboards/handwired/onekey/keymaps/apa102/rules.mk b/keyboards/handwired/onekey/keymaps/apa102/rules.mk new file mode 100644 index 0000000000..70932cb751 --- /dev/null +++ b/keyboards/handwired/onekey/keymaps/apa102/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +RGBLIGHT_DRIVER = APA102 diff --git a/keyboards/handwired/onekey/promicro/config.h b/keyboards/handwired/onekey/promicro/config.h index 167373cd39..02c81ce743 100644 --- a/keyboards/handwired/onekey/promicro/config.h +++ b/keyboards/handwired/onekey/promicro/config.h @@ -25,5 +25,6 @@ #define BACKLIGHT_PIN B6 #define RGB_DI_PIN F6 +#define RGB_CI_PIN B1 #define ADC_PIN F6 diff --git a/keyboards/handwired/onekey/proton_c/config.h b/keyboards/handwired/onekey/proton_c/config.h index 3ba4ba6499..a364bbee34 100644 --- a/keyboards/handwired/onekey/proton_c/config.h +++ b/keyboards/handwired/onekey/proton_c/config.h @@ -28,5 +28,6 @@ #define BACKLIGHT_PAL_MODE 2 #define RGB_DI_PIN A0 +#define RGB_CI_PIN B13 #define ADC_PIN A0 |