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.

78 lines
2.6 KiB

  1. /* Copyright 2017 Jason Williams
  2. * Copyright 2018 Jack Humbert
  3. * Copyright 2018 Yiancar
  4. * Copyright 2020 MelGeek
  5. * Copyright 2021 MasterSpoon
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #pragma once
  21. #include <stdint.h>
  22. #include <stdbool.h>
  23. #include "progmem.h"
  24. // Which variant header file to use
  25. #ifdef IS31FL3742A
  26. # include "is31fl3742.h"
  27. #elif defined(IS31FL3743A)
  28. # include "is31fl3743.h"
  29. #elif defined(IS31FL3745)
  30. # include "is31fl3745.h"
  31. #elif defined(IS31FL3746A)
  32. # include "is31fl3746.h"
  33. #endif
  34. #ifdef RGB_MATRIX_ENABLE
  35. typedef struct is31_led {
  36. uint8_t driver;
  37. uint8_t r;
  38. uint8_t g;
  39. uint8_t b;
  40. } __attribute__((packed)) is31_led;
  41. #elif defined(LED_MATRIX_ENABLE)
  42. typedef struct is31_led {
  43. uint8_t driver;
  44. uint8_t v;
  45. } __attribute__((packed)) is31_led;
  46. #endif
  47. #ifdef ISSI_MANUAL_SCALING
  48. extern const is31_led __flash g_is31_scaling[];
  49. void IS31FL_set_manual_scaling_buffer(void);
  50. #endif
  51. extern const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL];
  52. void IS31FL_write_single_register(uint8_t addr, uint8_t reg, uint8_t data);
  53. bool IS31FL_write_multi_registers(uint8_t addr, uint8_t *source_buffer, uint8_t buffer_size, uint8_t transfer_size, uint8_t start_reg_addr);
  54. void IS31FL_unlock_register(uint8_t addr, uint8_t page);
  55. void IS31FL_common_init(uint8_t addr, uint8_t ssr);
  56. void IS31FL_common_update_pwm_register(uint8_t addr, uint8_t index);
  57. void IS31FL_common_update_scaling_register(uint8_t addr, uint8_t index);
  58. #ifdef RGB_MATRIX_ENABLE
  59. // RGB Matrix Specific scripts
  60. void IS31FL_RGB_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
  61. void IS31FL_RGB_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
  62. void IS31FL_RGB_set_scaling_buffer(uint8_t index, bool red, bool green, bool blue);
  63. #elif defined(LED_MATRIX_ENABLE)
  64. // LED Matrix Specific scripts
  65. void IS31FL_simple_set_scaling_buffer(uint8_t index, bool value);
  66. void IS31FL_simple_set_brightness(int index, uint8_t value);
  67. void IS31FL_simple_set_brigntness_all(uint8_t value);
  68. #endif