From 78a0adfbb4d2c4e12f93f2a62ded0020d406243e Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 2 Jun 2024 12:42:24 +1000 Subject: [docs] Organize driver & feature docs into subfolders (#23848) Co-authored-by: Nick Brassel --- docs/features/ps2_mouse.md | 349 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 349 insertions(+) create mode 100644 docs/features/ps2_mouse.md (limited to 'docs/features/ps2_mouse.md') diff --git a/docs/features/ps2_mouse.md b/docs/features/ps2_mouse.md new file mode 100644 index 0000000000..90f4cca827 --- /dev/null +++ b/docs/features/ps2_mouse.md @@ -0,0 +1,349 @@ +# PS/2 Mouse Support {#ps2-mouse-support} + +Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device. + +To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest from a Thinkpad keyboard), identify the function of each pin of the module, and make the necessary circuitry between controller and Trackpoint module. For more information, please refer to [Trackpoint Hardware](https://deskthority.net/wiki/TrackPoint_Hardware) page on Deskthority Wiki. + +There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended). + +## The Circuitry between Trackpoint and Controller {#the-circuitry-between-trackpoint-and-controller} + +To get the things working, a 4.7K drag is needed between the two lines DATA and CLK and the line 5+. + +``` + + DATA ----------+--------- PIN + | + 4.7K + | +MODULE 5+ --------+--+--------- PWR CONTROLLER + | + 4.7K + | + CLK ------+------------ PIN +``` + + +## Busywait Version {#busywait-version} + +Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible. + +In rules.mk: + +```make +PS2_MOUSE_ENABLE = yes +PS2_ENABLE = yes +PS2_DRIVER = busywait +``` + +In your keyboard config.h: + +```c +#ifdef PS2_DRIVER_BUSYWAIT +# define PS2_CLOCK_PIN D1 +# define PS2_DATA_PIN D2 +#endif +``` + +### Interrupt Version (AVR/ATMega32u4) {#interrupt-version-avr} + +The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data. + +In rules.mk: + +```make +PS2_MOUSE_ENABLE = yes +PS2_ENABLE = yes +PS2_DRIVER = interrupt +``` + +In your keyboard config.h: + +```c +#ifdef PS2_DRIVER_INTERRUPT +#define PS2_CLOCK_PIN D2 +#define PS2_DATA_PIN D5 + +#define PS2_INT_INIT() do { \ + EICRA |= ((1<