Эх сурвалжийг харах

Remove keyboard level ws2812 spi drivers (#7694)

Joel Challis 5 жил өмнө
parent
commit
6c8e205fc0

+ 2 - 5
keyboards/cannonkeys/an_c/config.h

@@ -49,11 +49,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 14
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 14
 #define WS2812_SPI SPID2
 
 // Backlight config starts after VIA's EEPROM usage,

+ 1 - 0
keyboards/cannonkeys/an_c/rules.mk

@@ -21,6 +21,7 @@ NKRO_ENABLE = yes	    # USB Nkey Rollover
 CUSTOM_MATRIX = no # Custom matrix file
 # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 
 LAYOUTS = 60_ansi 60_tsangan_hhkb
 

+ 0 - 13
keyboards/cannonkeys/bluepill/keyboard.c

@@ -14,20 +14,7 @@
 #endif
 
 void matrix_init_kb(void){
-      /* MOSI pin*/
-    palSetPadMode(GPIOB, 15, PAL_MODE_STM32_ALTERNATE_PUSHPULL);
     LED_ON();
     wait_ms(500);
     LED_OFF();
-
-#ifdef RGBLIGHT_ENABLE
-    leds_init();
-#endif
-}
-
-void matrix_scan_kb(void)
-{
-  #ifdef RGBLIGHT_ENABLE
-    rgblight_task();
-  #endif
 }

+ 0 - 20
keyboards/cannonkeys/bluepill/ws2812.h

@@ -1,20 +0,0 @@
-#pragma once
-
-#include "hal.h"
-#include "color.h"
-
-
-void set_leds_color_rgb(LED_TYPE color);
-void set_led_color_rgb(LED_TYPE color, int pos);
-void leds_init(void);
-
-
- // This is what users will use to interface with this
-void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
-void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
-
-
-void WS2812_init(void);
-void WS2812_set_color( uint8_t index, uint8_t red, uint8_t green, uint8_t blue );
-void WS2812_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
-void WS2812_send_colors(void);

+ 2 - 5
keyboards/cannonkeys/instant60/config.h

@@ -49,11 +49,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 14
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 14
 #define WS2812_SPI SPID2
 
 // Backlight config starts after VIA's EEPROM usage,

+ 1 - 0
keyboards/cannonkeys/instant60/rules.mk

@@ -21,6 +21,7 @@ NKRO_ENABLE = yes	    # USB Nkey Rollover
 CUSTOM_MATRIX = no # Custom matrix file
 # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 
 LAYOUTS = 60_ansi 60_tsangan_hhkb
 

+ 2 - 6
keyboards/cannonkeys/ortho48/config.h

@@ -52,14 +52,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 9
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 9
 #define WS2812_SPI SPID2
 
-
 /*
  * Feature disable options
  *  These options are also useful to firmware size reduction.

+ 1 - 0
keyboards/cannonkeys/ortho48/rules.mk

@@ -22,6 +22,7 @@ SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
 NKRO_ENABLE = yes	    # USB Nkey Rollover
 BACKLIGHT_ENABLE = yes
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 
 LAYOUTS = ortho_4x12
 

+ 2 - 6
keyboards/cannonkeys/ortho60/config.h

@@ -52,14 +52,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 16
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 16
 #define WS2812_SPI SPID2
 
-
 /*
  * Feature disable options
  *  These options are also useful to firmware size reduction.

+ 1 - 0
keyboards/cannonkeys/ortho60/rules.mk

@@ -22,6 +22,7 @@ SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
 NKRO_ENABLE = yes	      # USB Nkey Rollover
 BACKLIGHT_ENABLE = yes
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 
 LAYOUTS = ortho_5x12
 

+ 2 - 6
keyboards/cannonkeys/ortho75/config.h

@@ -55,14 +55,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 16
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 16
 #define WS2812_SPI SPID2
 
-
 /*
  * Feature disable options
  *  These options are also useful to firmware size reduction.

+ 1 - 0
keyboards/cannonkeys/ortho75/rules.mk

@@ -22,6 +22,7 @@ SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
 NKRO_ENABLE = yes	      # USB Nkey Rollover
 BACKLIGHT_ENABLE = yes
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 ENCODER_ENABLE = yes
 
 LAYOUTS = ortho_5x15

+ 2 - 6
keyboards/cannonkeys/practice60/config.h

@@ -52,14 +52,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 9
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 9
 #define WS2812_SPI SPID2
 
-
 /*
  * Feature disable options
  *  These options are also useful to firmware size reduction.

+ 1 - 0
keyboards/cannonkeys/practice60/rules.mk

@@ -22,6 +22,7 @@ SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
 NKRO_ENABLE = yes	      # USB Nkey Rollover
 BACKLIGHT_ENABLE = yes
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 
 LAYOUTS = 60_ansi
 

+ 2 - 6
keyboards/cannonkeys/practice65/config.h

@@ -52,14 +52,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 20
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 20
 #define WS2812_SPI SPID2
 
-
 /*
  * Feature disable options
  *  These options are also useful to firmware size reduction.

+ 1 - 1
keyboards/cannonkeys/practice65/rules.mk

@@ -22,7 +22,7 @@ SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
 NKRO_ENABLE = yes	      # USB Nkey Rollover
 BACKLIGHT_ENABLE = yes
 RGBLIGHT_ENABLE = yes
-
+WS2812_DRIVER = spi
 
 # Enter lower-power sleep mode when on the ChibiOS idle thread
 OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

+ 2 - 5
keyboards/cannonkeys/savage65/config.h

@@ -49,11 +49,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 20
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 20
 #define WS2812_SPI SPID2
 
 // Backlight config starts after VIA's EEPROM usage,

+ 1 - 1
keyboards/cannonkeys/savage65/rules.mk

@@ -21,7 +21,7 @@ NKRO_ENABLE = yes	    # USB Nkey Rollover
 CUSTOM_MATRIX = no # Custom matrix file
 # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason
 RGBLIGHT_ENABLE = yes
-
+WS2812_DRIVER = spi
 
 # Enter lower-power sleep mode when on the ChibiOS idle thread
 OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

+ 0 - 16
keyboards/cannonkeys/stm32f072/keyboard.c

@@ -5,8 +5,6 @@
 #include "util.h"
 #include "quantum.h"
 
-#include "ws2812.h"
-
 #include "raw_hid.h"
 #include "dynamic_keymap.h"
 #include "tmk_core/common/eeprom.h"
@@ -58,25 +56,11 @@ void matrix_init_kb(void){
 	via_init_kb();
 	via_eeprom_set_valid(true);
 #endif // VIA_ENABLE
-      /* MOSI pin*/
-#ifdef RGBLIGHT_ENABLE
-    palSetPadMode(PORT_WS2812, PIN_WS2812, PAL_MODE_ALTERNATE(0));
-    wait_ms(500);
-    leds_init();
-#endif
     backlight_init_ports();
 
     matrix_init_board();
 }
 
-void matrix_scan_kb(void)
-{
-  #ifdef RGBLIGHT_ENABLE
-    rgblight_task();
-  #endif
-    matrix_scan_user();
-}
-
 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
   switch (keycode) {
     case BL_INC:

+ 0 - 19
keyboards/cannonkeys/stm32f072/ws2812.h

@@ -1,19 +0,0 @@
-#pragma once
-
-#include "hal.h"
-#include "color.h"
-
-void set_leds_color_rgb(LED_TYPE color);
-void set_led_color_rgb(LED_TYPE color, int pos);
-void leds_init(void);
-
-
- // This is what users will use to interface with this
-void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
-void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
-
-
-void WS2812_init(void);
-void WS2812_set_color( uint8_t index, uint8_t red, uint8_t green, uint8_t blue );
-void WS2812_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
-void WS2812_send_colors(void);

+ 3 - 5
keyboards/cannonkeys/tmov2/config.h

@@ -49,12 +49,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 22
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 22
 #define WS2812_SPI SPID2
+#define WS2812_SPI_MOSI_PAL_MODE 0
 
 // Backlight config starts after VIA's EEPROM usage,
 // dynamic keymaps start after this.

+ 1 - 1
keyboards/cannonkeys/tmov2/rules.mk

@@ -21,7 +21,7 @@ NKRO_ENABLE = yes	    # USB Nkey Rollover
 CUSTOM_MATRIX = no # Custom matrix file
 # BACKLIGHT_ENABLE = yes # This is broken on 072 right now
 RGBLIGHT_ENABLE = yes
-
+WS2812_DRIVER = spi
 
 # Enter lower-power sleep mode when on the ChibiOS idle thread
 OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE

+ 2 - 5
keyboards/projectkb/alice/config.h

@@ -49,11 +49,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define LOCKING_RESYNC_ENABLE
 
 #define RGBLIGHT_ANIMATIONS
-
-#define WS2812_LED_N 14
-#define RGBLED_NUM WS2812_LED_N
-#define PORT_WS2812     GPIOB
-#define PIN_WS2812      15
+#define RGB_DI_PIN B15
+#define RGBLED_NUM 14
 #define WS2812_SPI SPID2
 
 // Backlight config starts after VIA's EEPROM usage,

+ 1 - 0
keyboards/projectkb/alice/rules.mk

@@ -21,6 +21,7 @@ NKRO_ENABLE = yes	    # USB Nkey Rollover
 CUSTOM_MATRIX = no # Custom matrix file
 # BACKLIGHT_ENABLE = yes # This is broken on 072 for some reason
 RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = spi
 
 # RAW_ENABLE = yes
 # DYNAMIC_KEYMAP_ENABLE = yes