aboutsummaryrefslogtreecommitdiff
path: root/docs/feature_ps2_mouse.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/feature_ps2_mouse.md')
-rw-r--r--docs/feature_ps2_mouse.md40
1 files changed, 11 insertions, 29 deletions
diff --git a/docs/feature_ps2_mouse.md b/docs/feature_ps2_mouse.md
index 776a33150..c980705ae 100644
--- a/docs/feature_ps2_mouse.md
+++ b/docs/feature_ps2_mouse.md
@@ -30,7 +30,7 @@ Note: This is not recommended, you may encounter jerky movement or unsent inputs
30 30
31In rules.mk: 31In rules.mk:
32 32
33```makefile 33```make
34PS2_MOUSE_ENABLE = yes 34PS2_MOUSE_ENABLE = yes
35PS2_USE_BUSYWAIT = yes 35PS2_USE_BUSYWAIT = yes
36``` 36```
@@ -39,14 +39,8 @@ In your keyboard config.h:
39 39
40```c 40```c
41#ifdef PS2_USE_BUSYWAIT 41#ifdef PS2_USE_BUSYWAIT
42# define PS2_CLOCK_PORT PORTD 42# define PS2_CLOCK_PIN D1
43# define PS2_CLOCK_PIN PIND 43# define PS2_DATA_PIN D2
44# define PS2_CLOCK_DDR DDRD
45# define PS2_CLOCK_BIT 1
46# define PS2_DATA_PORT PORTD
47# define PS2_DATA_PIN PIND
48# define PS2_DATA_DDR DDRD
49# define PS2_DATA_BIT 2
50#endif 44#endif
51``` 45```
52 46
@@ -56,7 +50,7 @@ The following example uses D2 for clock and D5 for data. You can use any INT or
56 50
57In rules.mk: 51In rules.mk:
58 52
59```makefile 53```make
60PS2_MOUSE_ENABLE = yes 54PS2_MOUSE_ENABLE = yes
61PS2_USE_INT = yes 55PS2_USE_INT = yes
62``` 56```
@@ -65,14 +59,8 @@ In your keyboard config.h:
65 59
66```c 60```c
67#ifdef PS2_USE_INT 61#ifdef PS2_USE_INT
68#define PS2_CLOCK_PORT PORTD 62#define PS2_CLOCK_PIN D2
69#define PS2_CLOCK_PIN PIND 63#define PS2_DATA_PIN D5
70#define PS2_CLOCK_DDR DDRD
71#define PS2_CLOCK_BIT 2
72#define PS2_DATA_PORT PORTD
73#define PS2_DATA_PIN PIND
74#define PS2_DATA_DDR DDRD
75#define PS2_DATA_BIT 5
76 64
77#define PS2_INT_INIT() do { \ 65#define PS2_INT_INIT() do { \
78 EICRA |= ((1<<ISC21) | \ 66 EICRA |= ((1<<ISC21) | \
@@ -102,8 +90,8 @@ PS2_USE_INT = yes
102In your keyboard config.h: 90In your keyboard config.h:
103 91
104```c 92```c
105#define PS2_CLOCK A8 93#define PS2_CLOCK_PIN A8
106#define PS2_DATA A9 94#define PS2_DATA_PIN A9
107``` 95```
108 96
109And in the chibios specifig halconf.h: 97And in the chibios specifig halconf.h:
@@ -118,7 +106,7 @@ To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data.
118 106
119In rules.mk: 107In rules.mk:
120 108
121```makefile 109```make
122PS2_MOUSE_ENABLE = yes 110PS2_MOUSE_ENABLE = yes
123PS2_USE_USART = yes 111PS2_USE_USART = yes
124``` 112```
@@ -127,14 +115,8 @@ In your keyboard config.h:
127 115
128```c 116```c
129#ifdef PS2_USE_USART 117#ifdef PS2_USE_USART
130#define PS2_CLOCK_PORT PORTD 118#define PS2_CLOCK_PIN D5
131#define PS2_CLOCK_PIN PIND 119#define PS2_DATA_PIN D2
132#define PS2_CLOCK_DDR DDRD
133#define PS2_CLOCK_BIT 5
134#define PS2_DATA_PORT PORTD
135#define PS2_DATA_PIN PIND
136#define PS2_DATA_DDR DDRD
137#define PS2_DATA_BIT 2
138 120
139/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ 121/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
140/* set DDR of CLOCK as input to be slave */ 122/* set DDR of CLOCK as input to be slave */