apa102.h (1284B)
1 /* Copyright 2020 Aldehir Rojas 2 * Copyright 2017 Mikkel (Duckle29) 3 * 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. 8 * 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. 13 * 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/>. 16 */ 17 18 #pragma once 19 20 #include "color.h" 21 22 #if defined(RGBLIGHT_APA102) 23 # define APA102_LED_COUNT RGBLIGHT_LED_COUNT 24 #elif defined(RGB_MATRIX_APA102) 25 # define APA102_LED_COUNT RGB_MATRIX_LED_COUNT 26 #endif 27 28 #ifndef APA102_DEFAULT_BRIGHTNESS 29 # define APA102_DEFAULT_BRIGHTNESS 31 30 #endif 31 32 #define APA102_MAX_BRIGHTNESS 31 33 34 void apa102_init(void); 35 void apa102_set_color(int index, uint8_t red, uint8_t green, uint8_t blue); 36 void apa102_set_color_all(uint8_t red, uint8_t green, uint8_t blue); 37 void apa102_flush(void); 38 39 void apa102_set_brightness(uint8_t brightness);