1 /* Copyright 2018 Jason Williams (Wilba)
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 // Simple interface option.
24 // If these aren't defined, just define them to make it compile
28 #define DRIVER_COUNT 2
31 #ifndef DRIVER_LED_TOTAL
32 #define DRIVER_LED_TOTAL 96
36 typedef struct is31_led {
41 } __attribute__((packed)) is31_led;
43 extern const is31_led g_is31_leds[DRIVER_LED_TOTAL];
45 void IS31FL3736_init( uint8_t addr );
46 void IS31FL3736_write_register( uint8_t addr, uint8_t reg, uint8_t data );
47 void IS31FL3736_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer );
49 void IS31FL3736_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
50 void IS31FL3736_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
52 void IS31FL3736_set_led_control_register( uint8_t index, bool red, bool green, bool blue );
54 void IS31FL3736_mono_set_brightness( int index, uint8_t value );
55 void IS31FL3736_mono_set_brightness_all( uint8_t value );
56 void IS31FL3736_mono_set_led_control_register( uint8_t index, bool enabled );
58 // This should not be called from an interrupt
59 // (eg. from a timer interrupt).
60 // Call this while idle (in between matrix scans).
61 // If the buffer is dirty, it will update the driver with the buffer.
62 void IS31FL3736_update_pwm_buffers( uint8_t addr1, uint8_t addr2 );
63 void IS31FL3736_update_led_control_registers( uint8_t addr1, uint8_t addr2 );