1 /* Copyright 2017 Jason Williams
2 * Copyright 2018 Jack Humbert
3 * Copyright 2018 Yiancar
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef IS31FL3737_DRIVER_H
20 #define IS31FL3737_DRIVER_H
25 typedef struct is31_led {
30 } __attribute__((packed)) is31_led;
32 extern const is31_led g_is31_leds[DRIVER_LED_TOTAL];
34 void IS31FL3737_init(uint8_t addr);
35 void IS31FL3737_write_register(uint8_t addr, uint8_t reg, uint8_t data);
36 void IS31FL3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
38 void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
39 void IS31FL3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
41 void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue);
43 // This should not be called from an interrupt
44 // (eg. from a timer interrupt).
45 // Call this while idle (in between matrix scans).
46 // If the buffer is dirty, it will update the driver with the buffer.
47 void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2);
48 void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2);
206 #endif // IS31FL3737_DRIVER_H