aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/handwired/trackpoint/README.md10
-rw-r--r--keyboards/handwired/trackpoint/config.h119
-rw-r--r--keyboards/handwired/trackpoint/keymaps/default/keymap.c4
-rw-r--r--keyboards/handwired/trackpoint/readme.md19
-rw-r--r--keyboards/handwired/trackpoint/trackpoint.h11
5 files changed, 83 insertions, 80 deletions
diff --git a/keyboards/handwired/trackpoint/README.md b/keyboards/handwired/trackpoint/README.md
deleted file mode 100644
index bbfcaab0c..000000000
--- a/keyboards/handwired/trackpoint/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
1# IBM Trackpoint demonstration
2
3This is just a simple demo to show how to integrate IBM Trackpoint in QMK.
4
5Wiring used in the demonstration:
6![Wiring example](http://imgur.com/8ghG2U8)
7
8Some documentation:
9* [How to wire IBM Trackpoint](https://github.com/alonswartz/trackpoint)
10* [QMK documentation](https://docs.qmk.fm/)
diff --git a/keyboards/handwired/trackpoint/config.h b/keyboards/handwired/trackpoint/config.h
index 22ec75f76..cecb6a509 100644
--- a/keyboards/handwired/trackpoint/config.h
+++ b/keyboards/handwired/trackpoint/config.h
@@ -1,70 +1,67 @@
1#ifndef CONFIG_H 1#pragma once
2 #define CONFIG_H
3 2
4 #include "config_common.h" 3#include "config_common.h"
5 4
6 #define VENDOR_ID 0x1234 5#define VENDOR_ID 0x1234
7 #define PRODUCT_ID 0x5678 6#define PRODUCT_ID 0x5678
8 #define DEVICE_VER 0x0001 7#define DEVICE_VER 0x0001
9 #define MANUFACTURER QMK 8#define MANUFACTURER QMK
10 #define PRODUCT TRACKPOINT-DEMO 9#define PRODUCT TRACKPOINT-DEMO
11 #define DESCRIPTION Simple demonstration for IBM Trackpoint integration 10#define DESCRIPTION Simple demonstration for IBM Trackpoint integration
12 11
13 #define MATRIX_ROWS 1 12#define MATRIX_ROWS 1
14 #define MATRIX_COLS 3 13#define MATRIX_COLS 3
15 14
16 #ifdef PS2_USE_USART 15#ifdef PS2_USE_USART
17 #define PS2_CLOCK_PORT PORTD 16 #define PS2_CLOCK_PORT PORTD
18 #define PS2_CLOCK_PIN PIND 17 #define PS2_CLOCK_PIN PIND
19 #define PS2_CLOCK_DDR DDRD 18 #define PS2_CLOCK_DDR DDRD
20 #define PS2_CLOCK_BIT 5 19 #define PS2_CLOCK_BIT 5
21 #define PS2_DATA_PORT PORTD 20 #define PS2_DATA_PORT PORTD
22 #define PS2_DATA_PIN PIND 21 #define PS2_DATA_PIN PIND
23 #define PS2_DATA_DDR DDRD 22 #define PS2_DATA_DDR DDRD
24 #define PS2_DATA_BIT 2 23 #define PS2_DATA_BIT 2
25 24
26 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ 25 /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
27 /* set DDR of CLOCK as input to be slave */ 26 /* set DDR of CLOCK as input to be slave */
28 #define PS2_USART_INIT() do { \ 27 #define PS2_USART_INIT() do { \
29 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \ 28 PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
30 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \ 29 PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
31 UCSR1C = ((1 << UMSEL10) | \ 30 UCSR1C = ((1 << UMSEL10) | \
32 (3 << UPM10) | \ 31 (3 << UPM10) | \
33 (0 << USBS1) | \ 32 (0 << USBS1) | \
34 (3 << UCSZ10) | \ 33 (3 << UCSZ10) | \
35 (0 << UCPOL1)); \ 34 (0 << UCPOL1)); \
36 UCSR1A = 0; \ 35 UCSR1A = 0; \
37 UBRR1H = 0; \ 36 UBRR1H = 0; \
38 UBRR1L = 0; \ 37 UBRR1L = 0; \
39 } while (0) 38 } while (0)
40 #define PS2_USART_RX_INT_ON() do { \ 39 #define PS2_USART_RX_INT_ON() do { \
41 UCSR1B = ((1 << RXCIE1) | \ 40 UCSR1B = ((1 << RXCIE1) | \
42 (1 << RXEN1)); \ 41 (1 << RXEN1)); \
43 } while (0) 42 } while (0)
44 #define PS2_USART_RX_POLL_ON() do { \ 43 #define PS2_USART_RX_POLL_ON() do { \
45 UCSR1B = (1 << RXEN1); \ 44 UCSR1B = (1 << RXEN1); \
46 } while (0) 45 } while (0)
47 #define PS2_USART_OFF() do { \ 46 #define PS2_USART_OFF() do { \
48 UCSR1C = 0; \ 47 UCSR1C = 0; \
49 UCSR1B &= ~((1 << RXEN1) | \ 48 UCSR1B &= ~((1 << RXEN1) | \
50 (1 << TXEN1)); \ 49 (1 << TXEN1)); \
51 } while (0) 50 } while (0)
52 #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1)) 51 #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
53 #define PS2_USART_RX_DATA UDR1 52 #define PS2_USART_RX_DATA UDR1
54 #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1))) 53 #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
55 #define PS2_USART_RX_VECT USART1_RX_vect 54 #define PS2_USART_RX_VECT USART1_RX_vect
56 #endif 55#endif
57
58 #define MATRIX_COL_PINS { F1, F4, F5 }
59 #define MATRIX_ROW_PINS { F0 }
60 #define UNUSED_PINS
61 56
62 /* COL2ROW or ROW2COL */ 57#define MATRIX_COL_PINS { F1, F4, F5 }
63 #define DIODE_DIRECTION COL2ROW 58#define MATRIX_ROW_PINS { F0 }
59#define UNUSED_PINS
64 60
65 #define DEBOUNCING_DELAY 5 61/* COL2ROW or ROW2COL */
62#define DIODE_DIRECTION COL2ROW
66 63
67 #define LOCKING_SUPPORT_ENABLE 64#define DEBOUNCING_DELAY 5
68 #define LOCKING_RESYNC_ENABLE
69 65
70#endif 66#define LOCKING_SUPPORT_ENABLE
67#define LOCKING_RESYNC_ENABLE
diff --git a/keyboards/handwired/trackpoint/keymaps/default/keymap.c b/keyboards/handwired/trackpoint/keymaps/default/keymap.c
index 22e46d98a..60da30092 100644
--- a/keyboards/handwired/trackpoint/keymaps/default/keymap.c
+++ b/keyboards/handwired/trackpoint/keymaps/default/keymap.c
@@ -1,7 +1,7 @@
1#include "trackpoint.h" 1#include QMK_KEYBOARD_H
2 2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 [0] = KEYMAP( 4 [0] = LAYOUT(
5 KC_BTN1, KC_BTN3, KC_BTN2 \ 5 KC_BTN1, KC_BTN3, KC_BTN2 \
6 ) 6 )
7}; 7};
diff --git a/keyboards/handwired/trackpoint/readme.md b/keyboards/handwired/trackpoint/readme.md
new file mode 100644
index 000000000..e1302fbb7
--- /dev/null
+++ b/keyboards/handwired/trackpoint/readme.md
@@ -0,0 +1,19 @@
1# IBM Trackpoint demonstration
2
3This is just a simple demo to show how to integrate IBM Trackpoint in QMK.
4
5Wiring used in the demonstration:
6![Wiring example](https://i.imgur.com/8ghG2U8.png)
7
8Some documentation:
9
10- [How to wire IBM Trackpoint](https://github.com/alonswartz/trackpoint)
11
12Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
13Hardware Supported: Teensy
14
15Make example for this keyboard (after setting up your build environment):
16
17 make handwired/trackpoint:default
18
19See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/handwired/trackpoint/trackpoint.h b/keyboards/handwired/trackpoint/trackpoint.h
index b5d73d7db..a26000d52 100644
--- a/keyboards/handwired/trackpoint/trackpoint.h
+++ b/keyboards/handwired/trackpoint/trackpoint.h
@@ -1,13 +1,10 @@
1#ifndef TRACKPOINT_H 1#pragma once
2#define TRACKPOINT_H
3 2
4#include "quantum.h" 3#include "quantum.h"
5 4
6#define KEYMAP( \ 5#define LAYOUT( \
7 k00, k01, k02 \ 6 k00, k01, k02 \
8) \ 7) \
9{ \ 8{ \
10 { k00, k01, k02} \ 9 { k00, k01, k02} \
11} 10}
12
13#endif