logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

aw9523b.h (1807B)


  1. /**
  2. * @file aw9523b.h
  3. * @brief driver for aw9523b
  4. *
  5. * Copyright 2020 astro <yuleiz@gmail.com>
  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. #ifndef AW9523B_ADDR
  23. #define AW9523B_ADDR 0xB6
  24. #endif
  25. #define AW9523B_PWM_BASE 0x20
  26. #define AW9523B_P10_PWM 0x20
  27. #define AW9523B_P11_PWM 0x21
  28. #define AW9523B_P12_PWM 0x22
  29. #define AW9523B_P13_PWM 0x23
  30. #define AW9523B_P00_PWM 0x24
  31. #define AW9523B_P01_PWM 0x25
  32. #define AW9523B_P02_PWM 0x26
  33. #define AW9523B_P03_PWM 0x27
  34. #define AW9523B_P04_PWM 0x28
  35. #define AW9523B_P05_PWM 0x29
  36. #define AW9523B_P06_PWM 0x2A
  37. #define AW9523B_P07_PWM 0x2B
  38. #define AW9523B_P14_PWM 0x2C
  39. #define AW9523B_P15_PWM 0x2D
  40. #define AW9523B_P16_PWM 0x2E
  41. #define AW9523B_P17_PWM 0x2F
  42. #define AW9523B_PWM_SIZE 16
  43. typedef struct {
  44. uint8_t r;
  45. uint8_t g;
  46. uint8_t b;
  47. } aw9523b_led;
  48. extern const aw9523b_led g_aw9523b_leds[AW9523B_RGB_NUM];
  49. void aw9523b_init(uint8_t addr);
  50. void aw9523b_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
  51. void aw9523b_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
  52. void aw9523b_update_pwm_buffers(uint8_t addr);