diff options
Diffstat (limited to 'keyboard/planck')
| -rw-r--r-- | keyboard/planck/config.h | 69 | ||||
| -rw-r--r-- | keyboard/planck/config_definitions.h | 51 | ||||
| -rw-r--r-- | keyboard/planck/planck.c | 6 |
3 files changed, 5 insertions, 121 deletions
diff --git a/keyboard/planck/config.h b/keyboard/planck/config.h index cc3a1741a..a4c711db8 100644 --- a/keyboard/planck/config.h +++ b/keyboard/planck/config.h | |||
| @@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 18 | #ifndef CONFIG_H | 18 | #ifndef CONFIG_H |
| 19 | #define CONFIG_H | 19 | #define CONFIG_H |
| 20 | 20 | ||
| 21 | #include "config_definitions.h" | 21 | #include "config_common.h" |
| 22 | 22 | ||
| 23 | /* USB Device descriptor parameter */ | 23 | /* USB Device descriptor parameter */ |
| 24 | #define VENDOR_ID 0xFEED | 24 | #define VENDOR_ID 0xFEED |
| @@ -58,73 +58,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 58 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | 58 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ |
| 59 | ) | 59 | ) |
| 60 | 60 | ||
| 61 | #ifdef BLUETOOTH_ENABLE | ||
| 62 | #ifdef __AVR_ATmega32U4__ | ||
| 63 | #define SERIAL_UART_BAUD 9600 | ||
| 64 | #define SERIAL_UART_DATA UDR1 | ||
| 65 | #define SERIAL_UART_UBRR ((F_CPU/(16UL*SERIAL_UART_BAUD))-1) | ||
| 66 | #define SERIAL_UART_RXD_VECT USART1_RX_vect | ||
| 67 | #define SERIAL_UART_TXD_READY (UCSR1A&(1<<UDRE1)) | ||
| 68 | #define SERIAL_UART_INIT() do { \ | ||
| 69 | UBRR1L = (uint8_t) SERIAL_UART_UBRR; /* baud rate */ \ | ||
| 70 | UBRR1H = (uint8_t) (SERIAL_UART_UBRR>>8); /* baud rate */ \ | ||
| 71 | UCSR1B = (1<<TXEN1); /* TX: enable */ \ | ||
| 72 | UCSR1C = (0<<UPM11) | (0<<UPM10) | /* parity: none(00), even(01), odd(11) */ \ | ||
| 73 | (0<<UCSZ12) | (1<<UCSZ11) | (1<<UCSZ10); /* data-8bit(011) */ \ | ||
| 74 | sei(); \ | ||
| 75 | } while(0) | ||
| 76 | #else | ||
| 77 | # error "USART configuration is needed." | ||
| 78 | #endif | ||
| 79 | |||
| 80 | |||
| 81 | // I'm fairly sure these aren't needed, but oh well - Jack | ||
| 82 | |||
| 83 | /* | ||
| 84 | * PS/2 Interrupt configuration | ||
| 85 | */ | ||
| 86 | #ifdef PS2_USE_INT | ||
| 87 | /* uses INT1 for clock line(ATMega32U4) */ | ||
| 88 | #define PS2_CLOCK_PORT PORTD | ||
| 89 | #define PS2_CLOCK_PIN PIND | ||
| 90 | #define PS2_CLOCK_DDR DDRD | ||
| 91 | #define PS2_CLOCK_BIT 1 | ||
| 92 | |||
| 93 | #define PS2_DATA_PORT PORTD | ||
| 94 | #define PS2_DATA_PIN PIND | ||
| 95 | #define PS2_DATA_DDR DDRD | ||
| 96 | #define PS2_DATA_BIT 0 | ||
| 97 | |||
| 98 | #define PS2_INT_INIT() do { \ | ||
| 99 | EICRA |= ((1<<ISC11) | \ | ||
| 100 | (0<<ISC10)); \ | ||
| 101 | } while (0) | ||
| 102 | #define PS2_INT_ON() do { \ | ||
| 103 | EIMSK |= (1<<INT1); \ | ||
| 104 | } while (0) | ||
| 105 | #define PS2_INT_OFF() do { \ | ||
| 106 | EIMSK &= ~(1<<INT1); \ | ||
| 107 | } while (0) | ||
| 108 | #define PS2_INT_VECT INT1_vect | ||
| 109 | #endif | ||
| 110 | |||
| 111 | /* | ||
| 112 | * PS/2 Busywait configuration | ||
| 113 | */ | ||
| 114 | #ifdef PS2_USE_BUSYWAIT | ||
| 115 | #define PS2_CLOCK_PORT PORTD | ||
| 116 | #define PS2_CLOCK_PIN PIND | ||
| 117 | #define PS2_CLOCK_DDR DDRD | ||
| 118 | #define PS2_CLOCK_BIT 1 | ||
| 119 | |||
| 120 | #define PS2_DATA_PORT PORTD | ||
| 121 | #define PS2_DATA_PIN PIND | ||
| 122 | #define PS2_DATA_DDR DDRD | ||
| 123 | #define PS2_DATA_BIT 0 | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #endif | ||
| 127 | |||
| 128 | /* | 61 | /* |
| 129 | * Feature disable options | 62 | * Feature disable options |
| 130 | * These options are also useful to firmware size reduction. | 63 | * These options are also useful to firmware size reduction. |
diff --git a/keyboard/planck/config_definitions.h b/keyboard/planck/config_definitions.h deleted file mode 100644 index 2ac311265..000000000 --- a/keyboard/planck/config_definitions.h +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | #ifndef CONFIG_DEFINITIONS_H | ||
| 2 | #define CONFIG_DEFINITIONS_H | ||
| 3 | |||
| 4 | #define B0 0x20 | ||
| 5 | #define B1 0x21 | ||
| 6 | #define B2 0x22 | ||
| 7 | #define B3 0x23 | ||
| 8 | #define B4 0x24 | ||
| 9 | #define B5 0x25 | ||
| 10 | #define B6 0x26 | ||
| 11 | #define B7 0x27 | ||
| 12 | #define C0 0x30 | ||
| 13 | #define C1 0x31 | ||
| 14 | #define C2 0x32 | ||
| 15 | #define C3 0x33 | ||
| 16 | #define C4 0x34 | ||
| 17 | #define C5 0x35 | ||
| 18 | #define C6 0x36 | ||
| 19 | #define C7 0x37 | ||
| 20 | #define D0 0x40 | ||
| 21 | #define D1 0x41 | ||
| 22 | #define D2 0x42 | ||
| 23 | #define D3 0x43 | ||
| 24 | #define D4 0x44 | ||
| 25 | #define D5 0x45 | ||
| 26 | #define D6 0x46 | ||
| 27 | #define D7 0x47 | ||
| 28 | #define E0 0x50 | ||
| 29 | #define E1 0x51 | ||
| 30 | #define E2 0x52 | ||
| 31 | #define E3 0x53 | ||
| 32 | #define E4 0x54 | ||
| 33 | #define E5 0x55 | ||
| 34 | #define E6 0x56 | ||
| 35 | #define E7 0x57 | ||
| 36 | #define F0 0x60 | ||
| 37 | #define F1 0x61 | ||
| 38 | #define F2 0x62 | ||
| 39 | #define F3 0x63 | ||
| 40 | #define F4 0x64 | ||
| 41 | #define F5 0x65 | ||
| 42 | #define F6 0x66 | ||
| 43 | #define F7 0x67 | ||
| 44 | |||
| 45 | #define COL2ROW 0x0 | ||
| 46 | #define ROW2COL 0x1 | ||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | #endif | ||
| 51 | |||
diff --git a/keyboard/planck/planck.c b/keyboard/planck/planck.c index 9809a824c..b62862af0 100644 --- a/keyboard/planck/planck.c +++ b/keyboard/planck/planck.c | |||
| @@ -1,14 +1,16 @@ | |||
| 1 | #include "planck.h" | 1 | #include "planck.h" |
| 2 | 2 | ||
| 3 | __attribute__ ((weak)) | ||
| 3 | void * matrix_init_user(void) { | 4 | void * matrix_init_user(void) { |
| 4 | 5 | ||
| 5 | }; | 6 | }; |
| 6 | 7 | ||
| 8 | __attribute__ ((weak)) | ||
| 7 | void * matrix_scan_user(void) { | 9 | void * matrix_scan_user(void) { |
| 8 | 10 | ||
| 9 | }; | 11 | }; |
| 10 | 12 | ||
| 11 | void *matrix_init_kb(void) { | 13 | void * matrix_init_kb(void) { |
| 12 | #ifdef BACKLIGHT_ENABLE | 14 | #ifdef BACKLIGHT_ENABLE |
| 13 | backlight_init_ports(); | 15 | backlight_init_ports(); |
| 14 | #endif | 16 | #endif |
| @@ -22,7 +24,7 @@ void *matrix_init_kb(void) { | |||
| 22 | } | 24 | } |
| 23 | }; | 25 | }; |
| 24 | 26 | ||
| 25 | void *matrix_scan_kb(void) { | 27 | void * matrix_scan_kb(void) { |
| 26 | if (matrix_scan_user) { | 28 | if (matrix_scan_user) { |
| 27 | (*matrix_scan_user)(); | 29 | (*matrix_scan_user)(); |
| 28 | } | 30 | } |
