2 Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "i2c_master.h"
22 #ifdef RGBLIGHT_ENABLE
23 extern rgblight_config_t rgblight_config;
25 void rgblight_set(void) {
26 if (!rgblight_config.enable) {
27 for (uint8_t i = 0; i < RGBLED_NUM; i++) {
35 i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
39 void matrix_init_kb(void) {
40 #ifdef RGBLIGHT_ENABLE
41 if (rgblight_config.enable) {
43 i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
46 // call user level keymaps, if any
50 void matrix_scan_kb(void) {
51 #ifdef RGBLIGHT_ENABLE
55 /* Nothing else for now. */
58 __attribute__ ((weak))
59 void matrix_scan_user(void) {
62 void backlight_init_ports(void) {
63 // initialize pins D0, D1, D4 and D6 as output
69 // turn backlight LEDs on
76 void backlight_set(uint8_t level) {
78 // turn backlight LEDs off
84 // turn backlight LEDs on