Rework RGBLight driver system (#22529)
This commit is contained in:
		
							parent
							
								
									2acb426b8e
								
							
						
					
					
						commit
						17f36a21bf
					
				
					 35 changed files with 125 additions and 87 deletions
				
			
		| 
						 | 
				
			
			@ -57,6 +57,7 @@ void housekeeping_task_kb(void) {
 | 
			
		|||
 | 
			
		||||
#ifdef RGBLIGHT_ENABLE
 | 
			
		||||
#include "rgblight.h"
 | 
			
		||||
#include "ws2812.h"
 | 
			
		||||
#include "i2c_master.h"
 | 
			
		||||
 | 
			
		||||
const aw9523b_led g_aw9523b_leds[AW9523B_RGB_NUM] = {
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +67,7 @@ const aw9523b_led g_aw9523b_leds[AW9523B_RGB_NUM] = {
 | 
			
		|||
    {AW9523B_P07_PWM, AW9523B_P06_PWM, AW9523B_P05_PWM},
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds)
 | 
			
		||||
void setleds_custom(rgb_led_t *start_led, uint16_t num_leds)
 | 
			
		||||
{
 | 
			
		||||
    uint8_t num = num_leds < AW9523B_RGB_NUM ? num_leds : AW9523B_RGB_NUM;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -77,6 +78,10 @@ void rgblight_call_driver(rgb_led_t *start_led, uint8_t num_leds)
 | 
			
		|||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const rgblight_driver_t rgblight_driver = {
 | 
			
		||||
    .setleds = setleds_custom,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
static uint16_t caps_lock_pin = DEF_PIN(TCA6424_PORT2, 3);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,6 +10,7 @@
 | 
			
		|||
  },
 | 
			
		||||
  "rgblight": {
 | 
			
		||||
    "led_count": 9,
 | 
			
		||||
    "driver": "custom",
 | 
			
		||||
    "animations": {
 | 
			
		||||
      "breathing": true,
 | 
			
		||||
      "rainbow_mood": true,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -46,3 +46,4 @@ CUSTOM_MATRIX = lite
 | 
			
		|||
# project specific files
 | 
			
		||||
SRC += matrix.c tca6424.c aw9523b.c
 | 
			
		||||
I2C_DRIVER_REQUIRED = yes
 | 
			
		||||
WS2812_DRIVER_REQUIRED = yes
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue