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.

42 lines
1.2 KiB

  1. #pragma once
  2. #include "matrix.h"
  3. #define ROWS_PER_HAND (MATRIX_ROWS/2)
  4. typedef struct _Serial_s2m_buffer_t {
  5. // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack
  6. matrix_row_t smatrix[ROWS_PER_HAND];
  7. } Serial_s2m_buffer_t;
  8. typedef struct _Serial_m2s_buffer_t {
  9. #ifdef BACKLIGHT_ENABLE
  10. uint8_t backlight_level;
  11. #endif
  12. #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT)
  13. rgblight_config_t rgblight_config; //not yet use
  14. //
  15. // When MCUs on both sides drive their respective RGB LED chains,
  16. // it is necessary to synchronize, so it is necessary to communicate RGB information.
  17. // In that case, define the RGBLIGHT_SPLIT macro.
  18. //
  19. // Otherwise, if the master side MCU drives both sides RGB LED chains,
  20. // there is no need to communicate.
  21. #endif
  22. uint8_t current_layer;
  23. uint8_t nlock_led;
  24. uint8_t clock_led;
  25. uint8_t slock_led;
  26. } Serial_m2s_buffer_t;
  27. extern volatile Serial_s2m_buffer_t serial_s2m_buffer;
  28. extern volatile Serial_m2s_buffer_t serial_m2s_buffer;
  29. void transport_master_init(void);
  30. void transport_slave_init(void);
  31. // returns false if valid data not received from slave
  32. bool transport_master(matrix_row_t matrix[]);
  33. void transport_slave(matrix_row_t matrix[]);