You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.4 KiB

  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. #pragma once
  18. #include "color.h"
  19. #if defined(RGBLIGHT_APA102)
  20. # define APA102_LED_COUNT RGBLIGHT_LED_COUNT
  21. #elif defined(RGB_MATRIX_APA102)
  22. # define APA102_LED_COUNT RGB_MATRIX_LED_COUNT
  23. #endif
  24. #ifndef APA102_DEFAULT_BRIGHTNESS
  25. # define APA102_DEFAULT_BRIGHTNESS 31
  26. #endif
  27. #define APA102_MAX_BRIGHTNESS 31
  28. void apa102_init(void);
  29. /* User Interface
  30. *
  31. * Input:
  32. * start_led: An array of GRB data describing the LED colors
  33. * num_leds: The number of LEDs to write
  34. *
  35. * The functions will perform the following actions:
  36. * - Set the data-out pin as output
  37. * - Send out the LED data
  38. */
  39. void apa102_setleds(rgb_led_t *start_led, uint16_t num_leds);
  40. void apa102_set_brightness(uint8_t brightness);