diff options
Diffstat (limited to 'drivers/led/apa102.h')
-rw-r--r-- | drivers/led/apa102.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/led/apa102.h b/drivers/led/apa102.h new file mode 100644 index 000000000..58cf020c1 --- /dev/null +++ b/drivers/led/apa102.h | |||
@@ -0,0 +1,41 @@ | |||
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 | #ifndef APA102_DEFAULT_BRIGHTNESS | ||
23 | # define APA102_DEFAULT_BRIGHTNESS 31 | ||
24 | #endif | ||
25 | |||
26 | #define APA102_MAX_BRIGHTNESS 31 | ||
27 | |||
28 | extern uint8_t apa102_led_brightness; | ||
29 | |||
30 | /* User Interface | ||
31 | * | ||
32 | * Input: | ||
33 | * start_led: An array of GRB data describing the LED colors | ||
34 | * num_leds: The number of LEDs to write | ||
35 | * | ||
36 | * The functions will perform the following actions: | ||
37 | * - Set the data-out pin as output | ||
38 | * - Send out the LED data | ||
39 | */ | ||
40 | void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds); | ||
41 | void apa102_set_brightness(uint8_t brightness); | ||