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.3 KiB

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