Explorar o código

Adding zeal60 rgb files with modifications

stanrc85 %!s(int64=6) %!d(string=hai) anos
pai
achega
3cfa24c684

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1964 - 0
users/stanrc85/rgb_backlight.c


+ 110 - 0
users/stanrc85/rgb_backlight.h

@@ -0,0 +1,110 @@
+/* Copyright 2017 Jason Williams (Wilba)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+#if RGB_BACKLIGHT_ENABLED
+#else
+#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0
+#endif // RGB_BACKLIGHT_ENABLED
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#include "quantum/color.h"
+
+typedef struct PACKED
+{
+	uint8_t h;
+	uint8_t s;
+} HS;
+
+typedef struct
+{
+	HS color;
+	uint8_t index;
+} backlight_config_indicator;
+
+typedef struct
+{
+	bool use_split_backspace:1;         // |
+	bool use_split_left_shift:1;        // |
+	bool use_split_right_shift:1;       // |
+	bool use_7u_spacebar:1;             // |
+	bool use_iso_enter:1;               // |
+	bool disable_when_usb_suspended:1;  // |
+	bool disable_hhkb_blocker_leds:1;   // |
+	bool __pad7:1;                      // 1 byte
+	uint8_t disable_after_timeout;      // 1 byte
+	uint8_t brightness;                 // 1 byte
+	uint8_t effect;                     // 1 byte
+	uint8_t effect_speed;				// 1 byte
+	HS color_1;                         // 2 bytes
+	HS color_2;                         // 2 bytes
+	backlight_config_indicator caps_lock_indicator;	// 3 bytes
+	backlight_config_indicator layer_1_indicator;	// 3 bytes
+	backlight_config_indicator layer_2_indicator;	// 3 bytes
+	backlight_config_indicator layer_3_indicator;	// 3 bytes
+	uint16_t alphas_mods[5];            // 10 bytes
+#if defined(RGB_BACKLIGHT_M6_B)
+	HS custom_color[6];                 // 12 bytes
+#endif
+} backlight_config;                // = 31 bytes (M6-B = 43 bytes)
+
+void backlight_config_load(void);
+void backlight_config_save(void);
+void backlight_config_set_value( uint8_t *data );
+void backlight_config_get_value( uint8_t *data );
+
+void backlight_init_drivers(void);
+
+void backlight_timer_init(void);
+void backlight_timer_enable(void);
+void backlight_timer_disable(void);
+
+void backlight_set_suspend_state(bool state);
+void backlight_set_indicator_state(uint8_t state);
+
+// This should not be called from an interrupt
+// (eg. from a timer interrupt).
+// Call this while idle (in between matrix scans).
+// If the buffer is dirty, it will update the driver with the buffer.
+void backlight_update_pwm_buffers(void);
+
+// Handle backlight specific keycodes
+bool process_record_backlight(uint16_t keycode, keyrecord_t *record);
+
+void backlight_set_key_hit(uint8_t row, uint8_t col);
+
+void backlight_effect_increase(void);
+void backlight_effect_decrease(void);
+void backlight_effect_speed_increase(void);
+void backlight_effect_speed_decrease(void);
+
+void backlight_brightness_increase(void);
+void backlight_brightness_decrease(void);
+
+void backlight_color_1_hue_increase(void);
+void backlight_color_1_hue_decrease(void);
+void backlight_color_1_sat_increase(void);
+void backlight_color_1_sat_decrease(void);
+void backlight_color_2_hue_increase(void);
+void backlight_color_2_hue_decrease(void);
+void backlight_color_2_sat_increase(void);
+void backlight_color_2_sat_decrease(void);
+
+void backlight_test_led( uint8_t index, bool red, bool green, bool blue );
+void backlight_debug_led(bool state);
+

+ 43 - 0
users/stanrc85/rgb_backlight_api.h

@@ -0,0 +1,43 @@
+/* Copyright 2017 Jason Williams (Wilba)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+enum backlight_config_value
+{
+	id_use_split_backspace = 0x01,
+	id_use_split_left_shift = 0x02,
+	id_use_split_right_shift = 0x03,
+	id_use_7u_spacebar = 0x04,
+	id_use_iso_enter = 0x05,
+	id_disable_hhkb_blocker_leds = 0x06,
+	id_disable_when_usb_suspended = 0x07,
+	id_disable_after_timeout = 0x08,
+	id_brightness = 0x09,
+	id_effect = 0x0A,
+	id_effect_speed = 0x0B,
+	id_color_1 = 0x0C,
+	id_color_2 = 0x0D,
+	id_caps_lock_indicator_color = 0x0E,
+	id_caps_lock_indicator_row_col = 0x0F,
+	id_layer_1_indicator_color = 0x10,
+	id_layer_1_indicator_row_col = 0x11,
+	id_layer_2_indicator_color = 0x12,
+	id_layer_2_indicator_row_col = 0x13,
+	id_layer_3_indicator_color = 0x14,
+	id_layer_3_indicator_row_col = 0x15,
+	id_alphas_mods = 0x16,
+	id_custom_color = 0x17
+};

+ 34 - 0
users/stanrc85/rgb_backlight_keycodes.h

@@ -0,0 +1,34 @@
+/* Copyright 2017 Jason Williams (Wilba)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#pragma once
+
+// This is hardcoded at 0x5F00 so it's well after keycode value SAFE_RANGE
+enum backlight_keycodes {
+	BR_INC = 0x5F00,	// backlight brightness increase
+	BR_DEC, 			// backlight brightness decrease
+	EF_INC, 			// backlight effect increase
+	EF_DEC,  			// backlight effect decrease
+	ES_INC,
+	ES_DEC,
+	H1_INC,
+	H1_DEC,
+	S1_INC,
+	S1_DEC,
+	H2_INC,
+	H2_DEC,
+	S2_INC,
+	S2_DEC
+};