diff options
| author | XScorpion2 <rcalt2vt@gmail.com> | 2019-04-14 20:50:35 -0400 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-04-14 17:50:35 -0700 |
| commit | 5fcd744ddba591829a129560992b2e43fb615d4d (patch) | |
| tree | 33b78133af1563f5dfa1e125a37f86e30a7df1cb /quantum/rgb_matrix_drivers.c | |
| parent | d7ba190cd9b90bce3a00dfa2a9afe4b3bf0a1dbb (diff) | |
| download | qmk_firmware-5fcd744ddba591829a129560992b2e43fb615d4d.tar.gz qmk_firmware-5fcd744ddba591829a129560992b2e43fb615d4d.zip | |
Features/ws2812 matrix driver (#5418)
* WS2812 driver implementation for RGB Matrix
* Added driver configuration docs
Diffstat (limited to 'quantum/rgb_matrix_drivers.c')
| -rw-r--r-- | quantum/rgb_matrix_drivers.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c index 3b7d58483..3814dd61f 100644 --- a/quantum/rgb_matrix_drivers.c +++ b/quantum/rgb_matrix_drivers.c | |||
| @@ -97,4 +97,25 @@ const rgb_matrix_driver_t rgb_matrix_driver = { | |||
| 97 | }; | 97 | }; |
| 98 | #endif | 98 | #endif |
| 99 | 99 | ||
| 100 | #elif defined(WS2812) | ||
| 101 | |||
| 102 | extern LED_TYPE led[RGBLED_NUM]; | ||
| 103 | |||
| 104 | static void flush( void ) | ||
| 105 | { | ||
| 106 | // Assumes use of RGB_DI_PIN | ||
| 107 | ws2812_setleds(led, RGBLED_NUM); | ||
| 108 | } | ||
| 109 | |||
| 110 | static void init( void ) | ||
| 111 | { | ||
| 112 | |||
| 113 | } | ||
| 114 | |||
| 115 | const rgb_matrix_driver_t rgb_matrix_driver = { | ||
| 116 | .init = init, | ||
| 117 | .flush = flush, | ||
| 118 | .set_color = ws2812_setled, | ||
| 119 | .set_color_all = ws2812_setled_all, | ||
| 120 | }; | ||
| 100 | #endif | 121 | #endif |
