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.

41 lines
1.3 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. #ifndef APA102_DEFAULT_BRIGHTNESS
  20. # define APA102_DEFAULT_BRIGHTNESS 31
  21. #endif
  22. #define APA102_MAX_BRIGHTNESS 31
  23. extern uint8_t apa102_led_brightness;
  24. /* User Interface
  25. *
  26. * Input:
  27. * start_led: An array of GRB data describing the LED colors
  28. * num_leds: The number of LEDs to write
  29. *
  30. * The functions will perform the following actions:
  31. * - Set the data-out pin as output
  32. * - Send out the LED data
  33. */
  34. void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds);
  35. void apa102_set_brightness(uint8_t brightness);