Make the left keyboard half send the state of the keys to the right half via I2C and make the right half send the relevant scancodes to the host via USB.

This commit is contained in:
László Monda
2016-10-12 03:03:59 +02:00
parent cbe8c953a0
commit 80ddf397fd
6 changed files with 139 additions and 45 deletions

19
left/src/i2c.h Normal file
View File

@@ -0,0 +1,19 @@
#ifndef __I2C_H__
#define __I2C_H__
// Macros:
#define I2C_BUS_BASEADDR I2C0
#define I2C_BUS_CLK_SRC I2C0_CLK_SRC
#define I2C_BUS_BAUD_RATE 100000 // 100 kHz works even with a 20 meter long bridge cable.
#define I2C_BUS_MUX kPORT_MuxAlt2
#define I2C_BUS_SDA_PORT PORTB
#define I2C_BUS_SDA_CLOCK kCLOCK_PortB
#define I2C_BUS_SDA_PIN 4
#define I2C_BUS_SCL_PORT PORTB
#define I2C_BUS_SCL_CLOCK kCLOCK_PortB
#define I2C_BUS_SCL_PIN 3
#endif