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.

39 lines
1.2 KiB

  1. #pragma once
  2. #ifdef ISSI_ENABLE
  3. typedef struct ISSIDeviceStruct{
  4. uint8_t fn_dirty; // function registers need to be resent
  5. uint8_t fn_device_addr;
  6. uint8_t fn_register_addr;
  7. uint8_t fn_registers[13];
  8. uint8_t led_dirty; // LED data has changed and needs to be resent
  9. uint8_t led_device_addr;
  10. uint8_t led_register_addr;
  11. uint8_t led_ctrl[18];
  12. uint8_t led_blink_ctrl[18];
  13. uint8_t led_pwm[144];
  14. }ISSIDeviceStruct;
  15. extern ISSIDeviceStruct *issi_devices[];
  16. // Low level commands- 'device' is the 2-bit i2c id.
  17. void issi_init(void);
  18. void set_shutdown(uint8_t device, uint8_t shutdown);
  19. void writeRegister8(uint8_t device, uint8_t frame, uint8_t reg, uint8_t data);
  20. // Higher level, no device is given, but it is calculated from 'matrix'
  21. // Each device has 2 blocks, max of 4 devices:
  22. // Device | Block = Matrix
  23. // 0 A 0
  24. // 0 B 1
  25. // 1 A 2
  26. // 1 B 3
  27. // 2 A 4
  28. // 2 B 5
  29. // 3 A 6
  30. // 3 B 7
  31. void activateLED(uint8_t matrix, uint8_t cx, uint8_t cy, uint8_t pwm);
  32. void update_issi(uint8_t device_addr, uint8_t blocking);
  33. #endif