diff options
Diffstat (limited to 'quantum/split_common/serial.h')
-rw-r--r-- | quantum/split_common/serial.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/quantum/split_common/serial.h b/quantum/split_common/serial.h new file mode 100644 index 000000000..15fe4db7b --- /dev/null +++ b/quantum/split_common/serial.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef MY_SERIAL_H | ||
2 | #define MY_SERIAL_H | ||
3 | |||
4 | #include "config.h" | ||
5 | #include <stdbool.h> | ||
6 | |||
7 | /* TODO: some defines for interrupt setup */ | ||
8 | #define SERIAL_PIN_DDR DDRD | ||
9 | #define SERIAL_PIN_PORT PORTD | ||
10 | #define SERIAL_PIN_INPUT PIND | ||
11 | #define SERIAL_PIN_MASK _BV(PD0) | ||
12 | #define SERIAL_PIN_INTERRUPT INT0_vect | ||
13 | |||
14 | #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 | ||
15 | #define SERIAL_MASTER_BUFFER_LENGTH 1 | ||
16 | |||
17 | // Buffers for master - slave communication | ||
18 | extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; | ||
19 | extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; | ||
20 | |||
21 | void serial_master_init(void); | ||
22 | void serial_slave_init(void); | ||
23 | int serial_update_buffers(void); | ||
24 | bool serial_slave_data_corrupt(void); | ||
25 | |||
26 | #endif | ||