]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/handwired/108key_trackpoint/config.h
a773a72b1aadb5109791563f7c02f11de17bb996
[qmk_firmware.git] / keyboards / handwired / 108key_trackpoint / config.h
1 #pragma once
2
3 #include "config_common.h"
4
5 #define VENDOR_ID       0x1234
6 #define PRODUCT_ID      0x5678
7 #define DEVICE_VER      0x0001
8 #define MANUFACTURER    QMK
9 #define PRODUCT         108Key-Trackpoint
10 #define DESCRIPTION     A 108 key ANSI keyboard with a trackpoint and three mouse buttons
11
12 #define MATRIX_ROWS 8
13 #define MATRIX_COLS 23
14
15 #ifdef PS2_USE_USART
16   #define PS2_CLOCK_PORT  PORTD
17   #define PS2_CLOCK_PIN   PIND
18   #define PS2_CLOCK_DDR   DDRD
19   #define PS2_CLOCK_BIT   5
20   #define PS2_DATA_PORT   PORTD
21   #define PS2_DATA_PIN    PIND
22   #define PS2_DATA_DDR    DDRD
23   #define PS2_DATA_BIT    2
24
25   /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
26   /* set DDR of CLOCK as input to be slave */
27   #define PS2_USART_INIT() do {   \
28       PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
29       PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
30       UCSR1C = ((1 << UMSEL10) |  \
31                 (3 << UPM10)   |  \
32                 (0 << USBS1)   |  \
33                 (3 << UCSZ10)  |  \
34                 (0 << UCPOL1));   \
35       UCSR1A = 0;                 \
36       UBRR1H = 0;                 \
37       UBRR1L = 0;                 \
38   } while (0)
39   #define PS2_USART_RX_INT_ON() do {  \
40       UCSR1B = ((1 << RXCIE1) |       \
41                 (1 << RXEN1));        \
42   } while (0)
43   #define PS2_USART_RX_POLL_ON() do { \
44       UCSR1B = (1 << RXEN1);          \
45   } while (0)
46   #define PS2_USART_OFF() do {    \
47       UCSR1C = 0;                 \
48       UCSR1B &= ~((1 << RXEN1) |  \
49                   (1 << TXEN1));  \
50   } while (0)
51   #define PS2_USART_RX_READY      (UCSR1A & (1<<RXC1))
52   #define PS2_USART_RX_DATA       UDR1
53   #define PS2_USART_ERROR         (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
54   #define PS2_USART_RX_VECT       USART1_RX_vect
55 #endif
56
57 #define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
58 #define MATRIX_COL_PINS { C0, C1, C2, C3, C4, C5, C6, C7, D0, D1, F0, D3, D4, F1, D6, D7, E0, E1, E2, E3, E4, E5, E6 }
59 #define UNUSED_PINS
60
61 /* COL2ROW or ROW2COL */
62 #define DIODE_DIRECTION COL2ROW
63
64 #define DEBOUNCING_DELAY 5
65
66 #define LOCKING_SUPPORT_ENABLE
67 #define LOCKING_RESYNC_ENABLE