From 755e4d8b00a4f9be0c50c2b005d063b94c528f8c Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 19 Nov 2013 03:39:15 +0900 Subject: Add PS/2 mouse configure to onekey --- keyboard/onekey/config.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 'keyboard/onekey/config.h') diff --git a/keyboard/onekey/config.h b/keyboard/onekey/config.h index c5bc64de9c..8403c9b65b 100644 --- a/keyboard/onekey/config.h +++ b/keyboard/onekey/config.h @@ -67,4 +67,89 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION + +/* PS/2 mouse */ +#define PS2_MOUSE_DEBUG +#ifdef PS2_USE_BUSYWAIT +# define PS2_CLOCK_PORT PORTD +# define PS2_CLOCK_PIN PIND +# define PS2_CLOCK_DDR DDRD +# define PS2_CLOCK_BIT 1 +# define PS2_DATA_PORT PORTD +# define PS2_DATA_PIN PIND +# define PS2_DATA_DDR DDRD +# define PS2_DATA_BIT 2 +#endif + + +#ifdef PS2_USE_INT +/* uses INT1 for clock line(ATMega32U4) */ +#define PS2_CLOCK_PORT PORTD +#define PS2_CLOCK_PIN PIND +#define PS2_CLOCK_DDR DDRD +#define PS2_CLOCK_BIT 1 +#define PS2_DATA_PORT PORTD +#define PS2_DATA_PIN PIND +#define PS2_DATA_DDR DDRD +#define PS2_DATA_BIT 2 + +#define PS2_INT_INIT() do { \ + EICRA |= ((1<