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