]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/handwired/trackpoint/config.h
Update keyboards/kbdfans/kbd67/readme.md
[qmk_firmware.git] / keyboards / handwired / trackpoint / config.h
1 #ifndef CONFIG_H
2     #define CONFIG_H
3
4     #include "config_common.h"
5
6     #define VENDOR_ID       0x1234
7     #define PRODUCT_ID      0x5678
8     #define DEVICE_VER      0x0001
9     #define MANUFACTURER    QMK
10     #define PRODUCT         TRACKPOINT-DEMO
11     #define DESCRIPTION     Simple demonstration for IBM Trackpoint integration
12
13     #define MATRIX_ROWS 1
14     #define MATRIX_COLS 3
15
16     #ifdef PS2_USE_USART
17         #define PS2_CLOCK_PORT  PORTD
18         #define PS2_CLOCK_PIN   PIND
19         #define PS2_CLOCK_DDR   DDRD
20         #define PS2_CLOCK_BIT   5
21         #define PS2_DATA_PORT   PORTD
22         #define PS2_DATA_PIN    PIND
23         #define PS2_DATA_DDR    DDRD
24         #define PS2_DATA_BIT    2
25
26         /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
27         /* set DDR of CLOCK as input to be slave */
28         #define PS2_USART_INIT() do {   \
29             PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
30             PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
31             UCSR1C = ((1 << UMSEL10) |  \
32                       (3 << UPM10)   |  \
33                       (0 << USBS1)   |  \
34                       (3 << UCSZ10)  |  \
35                       (0 << UCPOL1));   \
36             UCSR1A = 0;                 \
37             UBRR1H = 0;                 \
38             UBRR1L = 0;                 \
39         } while (0)
40         #define PS2_USART_RX_INT_ON() do {  \
41             UCSR1B = ((1 << RXCIE1) |       \
42                       (1 << RXEN1));        \
43         } while (0)
44         #define PS2_USART_RX_POLL_ON() do { \
45             UCSR1B = (1 << RXEN1);          \
46         } while (0)
47         #define PS2_USART_OFF() do {    \
48             UCSR1C = 0;                 \
49             UCSR1B &= ~((1 << RXEN1) |  \
50                         (1 << TXEN1));  \
51         } while (0)
52         #define PS2_USART_RX_READY      (UCSR1A & (1<<RXC1))
53         #define PS2_USART_RX_DATA       UDR1
54         #define PS2_USART_ERROR         (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
55         #define PS2_USART_RX_VECT       USART1_RX_vect
56     #endif
57
58     #define MATRIX_COL_PINS { F1, F4, F5 }
59     #define MATRIX_ROW_PINS { F0 }
60     #define UNUSED_PINS
61
62     /* COL2ROW or ROW2COL */
63     #define DIODE_DIRECTION COL2ROW
64
65     #define DEBOUNCING_DELAY 5
66
67     #define LOCKING_SUPPORT_ENABLE
68     #define LOCKING_RESYNC_ENABLE
69
70 #endif