diff options
-rw-r--r-- | keyboards/sirius/uni660/config.h | 78 | ||||
-rw-r--r-- | keyboards/sirius/uni660/info.json | 12 | ||||
-rw-r--r-- | keyboards/sirius/uni660/keymaps/default/keymap.c | 11 | ||||
-rw-r--r-- | keyboards/sirius/uni660/keymaps/via/keymap.c | 35 | ||||
-rw-r--r-- | keyboards/sirius/uni660/keymaps/via/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/sirius/uni660/matrix.c | 160 | ||||
-rw-r--r-- | keyboards/sirius/uni660/readme.md | 13 | ||||
-rw-r--r-- | keyboards/sirius/uni660/rules.mk | 32 | ||||
-rw-r--r-- | keyboards/sirius/uni660/uni660.c | 35 | ||||
-rw-r--r-- | keyboards/sirius/uni660/uni660.h | 61 |
10 files changed, 438 insertions, 0 deletions
diff --git a/keyboards/sirius/uni660/config.h b/keyboards/sirius/uni660/config.h new file mode 100644 index 000000000..06f1c7810 --- /dev/null +++ b/keyboards/sirius/uni660/config.h | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "config_common.h" | ||
21 | |||
22 | /* USB Device descriptor parameter */ | ||
23 | |||
24 | #define VENDOR_ID 0x5352 // "SR" | ||
25 | #define PRODUCT_ID 0x0201 // Second Product First Version | ||
26 | #define DEVICE_VER 0x1912 // 2019.12 | ||
27 | #define MANUFACTURER SiRius | ||
28 | #define PRODUCT SiRius Uni660 | ||
29 | #define DESCRIPTION SiRius Uni660 | ||
30 | |||
31 | /* key matrix size */ | ||
32 | #define MATRIX_ROWS 5 | ||
33 | #define MATRIX_COLS 16 | ||
34 | |||
35 | /* define if matrix has ghost */ | ||
36 | //#define MATRIX_HAS_GHOST | ||
37 | |||
38 | /* number of backlight levels */ | ||
39 | //#define BACKLIGHT_LEVELS 3 | ||
40 | |||
41 | #define ONESHOT_TIMEOUT 500 | ||
42 | |||
43 | /* | ||
44 | * Feature disable options | ||
45 | * These options are also useful to firmware size reduction. | ||
46 | */ | ||
47 | |||
48 | /* disable debug print */ | ||
49 | //#define NO_DEBUG | ||
50 | |||
51 | /* disable print */ | ||
52 | //#define NO_PRINT | ||
53 | |||
54 | /* disable action features */ | ||
55 | //#define NO_ACTION_LAYER | ||
56 | //#define NO_ACTION_TAPPING | ||
57 | //#define NO_ACTION_ONESHOT | ||
58 | //#define NO_ACTION_MACRO | ||
59 | //#define NO_ACTION_FUNCTION | ||
60 | |||
61 | //UART settings for communication with the RF microcontroller | ||
62 | #define SERIAL_UART_BAUD 1000000 | ||
63 | #define SERIAL_UART_DATA UDR1 | ||
64 | #define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) | ||
65 | #define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) | ||
66 | #define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) | ||
67 | #define SERIAL_UART_INIT() do { \ | ||
68 | /* baud rate */ \ | ||
69 | UBRR1L = SERIAL_UART_UBRR; \ | ||
70 | /* baud rate */ \ | ||
71 | UBRR1H = SERIAL_UART_UBRR >> 8; \ | ||
72 | /* enable TX and RX */ \ | ||
73 | UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ | ||
74 | /* 8-bit data */ \ | ||
75 | UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ | ||
76 | } while(0) | ||
77 | |||
78 | #define DYNAMIC_KEYMAP_LAYER_COUNT 4 | ||
diff --git a/keyboards/sirius/uni660/info.json b/keyboards/sirius/uni660/info.json new file mode 100644 index 000000000..296626d06 --- /dev/null +++ b/keyboards/sirius/uni660/info.json | |||
@@ -0,0 +1,12 @@ | |||
1 | { | ||
2 | "keyboard_name": "Uni660", | ||
3 | "url": "", | ||
4 | "maintainer": "qmk", | ||
5 | "width": 12, | ||
6 | "height": 5.75, | ||
7 | "layouts": { | ||
8 | "LAYOUT": { | ||
9 | "layout": [{"x":0, "y":0.75}, {"x":1, "y":0.25}, {"x":2, "y":0}, {"x":3, "y":0.25}, {"x":4, "y":0.125}, {"x":7, "y":0.125}, {"x":8, "y":0.25}, {"x":9, "y":0}, {"x":10, "y":0.25}, {"x":11, "y":0.75}, {"x":0, "y":1.75}, {"x":1, "y":1.25}, {"x":2, "y":1}, {"x":3, "y":1.25}, {"x":4, "y":1.125}, {"x":7, "y":1.125}, {"x":8, "y":1.25}, {"x":9, "y":1}, {"x":10, "y":1.25}, {"x":11, "y":1.75}, {"x":0, "y":2.75}, {"x":1, "y":2.25}, {"x":2, "y":2}, {"x":3, "y":2.25}, {"x":4, "y":2.125}, {"x":7, "y":2.125}, {"x":8, "y":2.25}, {"x":9, "y":2}, {"x":10, "y":2.25}, {"x":11, "y":2.75}, {"x":1.5, "y":3.75}, {"x":2.5, "y":3.75}, {"x":3.5, "y":3.75}, {"x":4.5, "y":3.75}, {"x":6.5, "y":3.75}, {"x":7.5, "y":3.75}, {"x":8.5, "y":3.75}, {"x":9.5, "y":3.75}, {"x":1.5, "y":4.75}, {"x":2.5, "y":4.75}, {"x":3.5, "y":4.75}, {"x":4.5, "y":4.75}, {"x":6.5, "y":4.75}, {"x":7.5, "y":4.75}, {"x":8.5, "y":4.75}, {"x":9.5, "y":4.75}] | ||
10 | } | ||
11 | } | ||
12 | } | ||
diff --git a/keyboards/sirius/uni660/keymaps/default/keymap.c b/keyboards/sirius/uni660/keymaps/default/keymap.c new file mode 100644 index 000000000..336aa8410 --- /dev/null +++ b/keyboards/sirius/uni660/keymaps/default/keymap.c | |||
@@ -0,0 +1,11 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
4 | [0] = LAYOUT( /* Base */ | ||
5 | KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, | ||
6 | KC_F1, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, | ||
7 | KC_F2, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
8 | KC_F3, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
9 | KC_F4, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_DEL, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
10 | ), | ||
11 | }; | ||
diff --git a/keyboards/sirius/uni660/keymaps/via/keymap.c b/keyboards/sirius/uni660/keymaps/via/keymap.c new file mode 100644 index 000000000..61bac7e4d --- /dev/null +++ b/keyboards/sirius/uni660/keymaps/via/keymap.c | |||
@@ -0,0 +1,35 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
4 | [0] = LAYOUT( /* Base */ | ||
5 | KC_ESC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS, | ||
6 | KC_F1, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, | ||
7 | KC_F2, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, | ||
8 | KC_F3, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, | ||
9 | KC_F4, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_DEL, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT | ||
10 | ), | ||
11 | |||
12 | [1] = LAYOUT( /* Layer 1 */ | ||
13 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
14 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
15 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
16 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
17 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
18 | ), | ||
19 | |||
20 | [2] = LAYOUT( /* Layer 2 */ | ||
21 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
22 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
23 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
24 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
25 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
26 | ), | ||
27 | |||
28 | [3] = LAYOUT( /* Layer 3 */ | ||
29 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
30 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
31 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
32 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
33 | KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
34 | ), | ||
35 | }; | ||
diff --git a/keyboards/sirius/uni660/keymaps/via/rules.mk b/keyboards/sirius/uni660/keymaps/via/rules.mk new file mode 100644 index 000000000..1e5b99807 --- /dev/null +++ b/keyboards/sirius/uni660/keymaps/via/rules.mk | |||
@@ -0,0 +1 @@ | |||
VIA_ENABLE = yes | |||
diff --git a/keyboards/sirius/uni660/matrix.c b/keyboards/sirius/uni660/matrix.c new file mode 100644 index 000000000..3e231b33b --- /dev/null +++ b/keyboards/sirius/uni660/matrix.c | |||
@@ -0,0 +1,160 @@ | |||
1 | /* | ||
2 | Copyright 2012 Jun Wako | ||
3 | Copyright 2014 Jack Humbert | ||
4 | |||
5 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation, either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | #include <stdint.h> | ||
19 | #include <stdbool.h> | ||
20 | #if defined(__AVR__) | ||
21 | #include <avr/io.h> | ||
22 | #endif | ||
23 | #include "wait.h" | ||
24 | #include "print.h" | ||
25 | #include "debug.h" | ||
26 | #include "util.h" | ||
27 | #include "matrix.h" | ||
28 | #include "timer.h" | ||
29 | #include "debounce.h" | ||
30 | |||
31 | #if (MATRIX_COLS <= 8) | ||
32 | # define print_matrix_header() print("\nr/c 01234567\n") | ||
33 | # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) | ||
34 | # define matrix_bitpop(i) bitpop(matrix[i]) | ||
35 | # define ROW_SHIFTER ((uint8_t)1) | ||
36 | #elif (MATRIX_COLS <= 16) | ||
37 | # define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") | ||
38 | # define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) | ||
39 | # define matrix_bitpop(i) bitpop16(matrix[i]) | ||
40 | # define ROW_SHIFTER ((uint16_t)1) | ||
41 | #elif (MATRIX_COLS <= 32) | ||
42 | # define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") | ||
43 | # define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) | ||
44 | # define matrix_bitpop(i) bitpop32(matrix[i]) | ||
45 | # define ROW_SHIFTER ((uint32_t)1) | ||
46 | #endif | ||
47 | |||
48 | /* matrix state(1:on, 0:off) */ | ||
49 | static matrix_row_t matrix[MATRIX_ROWS]; | ||
50 | |||
51 | |||
52 | __attribute__ ((weak)) | ||
53 | void matrix_init_kb(void) { | ||
54 | matrix_init_user(); | ||
55 | } | ||
56 | |||
57 | __attribute__ ((weak)) | ||
58 | void matrix_scan_kb(void) { | ||
59 | matrix_scan_user(); | ||
60 | } | ||
61 | |||
62 | __attribute__ ((weak)) | ||
63 | void matrix_init_user(void) { | ||
64 | } | ||
65 | |||
66 | __attribute__ ((weak)) | ||
67 | void matrix_scan_user(void) { | ||
68 | } | ||
69 | |||
70 | inline | ||
71 | uint8_t matrix_rows(void) { | ||
72 | return MATRIX_ROWS; | ||
73 | } | ||
74 | |||
75 | inline | ||
76 | uint8_t matrix_cols(void) { | ||
77 | return MATRIX_COLS; | ||
78 | } | ||
79 | |||
80 | void matrix_init(void) { | ||
81 | debounce_init(MATRIX_ROWS); | ||
82 | matrix_init_quantum(); | ||
83 | } | ||
84 | |||
85 | uint8_t matrix_scan(void) | ||
86 | { | ||
87 | bool matrix_has_changed = false; | ||
88 | |||
89 | SERIAL_UART_INIT(); | ||
90 | |||
91 | uint32_t timeout = 0; | ||
92 | |||
93 | //the s character requests the RF slave to send the matrix | ||
94 | SERIAL_UART_DATA = 's'; | ||
95 | |||
96 | //trust the external keystates entirely, erase the last data | ||
97 | uint8_t uart_data[17] = {0}; | ||
98 | |||
99 | //there are 16 bytes corresponding to 16 columns, and an end byte | ||
100 | for (uint8_t i = 0; i < 17; i++) { | ||
101 | //wait for the serial data, timeout if it's been too long | ||
102 | //this only happened in testing with a loose wire, but does no | ||
103 | //harm to leave it in here | ||
104 | while(!SERIAL_UART_RXD_PRESENT){ | ||
105 | timeout++; | ||
106 | if (timeout > 10000){ | ||
107 | break; | ||
108 | } | ||
109 | } | ||
110 | uart_data[i] = SERIAL_UART_DATA; | ||
111 | } | ||
112 | |||
113 | //check for the end packet, the key state bytes use the LSBs, so 0xE0 | ||
114 | //will only show up here if the correct bytes were recieved | ||
115 | if (uart_data[10] == 0xE0) | ||
116 | { | ||
117 | //shifting and transferring the keystates to the QMK matrix variable | ||
118 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
119 | matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 8; | ||
120 | } | ||
121 | } | ||
122 | |||
123 | debounce(matrix, matrix, MATRIX_ROWS, matrix_has_changed); | ||
124 | |||
125 | matrix_scan_quantum(); | ||
126 | |||
127 | return matrix_has_changed; | ||
128 | } | ||
129 | |||
130 | inline | ||
131 | bool matrix_is_on(uint8_t row, uint8_t col) | ||
132 | { | ||
133 | return (matrix[row] & ((matrix_row_t)1<<col)); | ||
134 | } | ||
135 | |||
136 | inline | ||
137 | matrix_row_t matrix_get_row(uint8_t row) | ||
138 | { | ||
139 | return matrix[row]; | ||
140 | } | ||
141 | |||
142 | void matrix_print(void) | ||
143 | { | ||
144 | print_matrix_header(); | ||
145 | |||
146 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
147 | phex(row); print(": "); | ||
148 | print_matrix_row(row); | ||
149 | print("\n"); | ||
150 | } | ||
151 | } | ||
152 | |||
153 | uint8_t matrix_key_count(void) | ||
154 | { | ||
155 | uint8_t count = 0; | ||
156 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
157 | count += matrix_bitpop(i); | ||
158 | } | ||
159 | return count; | ||
160 | } | ||
diff --git a/keyboards/sirius/uni660/readme.md b/keyboards/sirius/uni660/readme.md new file mode 100644 index 000000000..c3d2dbc1b --- /dev/null +++ b/keyboards/sirius/uni660/readme.md | |||
@@ -0,0 +1,13 @@ | |||
1 | # Uni660 | ||
2 | |||
3 | The Uni660 is an ergonomic wireless keyboard designed by Sirius. | ||
4 | |||
5 | Join the KeyCommerce [Discord](https://discord.gg/GJ8bdM) | ||
6 | |||
7 | Make example: | ||
8 | |||
9 | make sirius/uni660:default | ||
10 | |||
11 | See 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). | ||
12 | |||
13 | To get the U2U into DFU flashing mode, insert the U2U into the computer and connect the  | ||
diff --git a/keyboards/sirius/uni660/rules.mk b/keyboards/sirius/uni660/rules.mk new file mode 100644 index 000000000..920d8a83d --- /dev/null +++ b/keyboards/sirius/uni660/rules.mk | |||
@@ -0,0 +1,32 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | # Teensy halfkay | ||
6 | # Pro Micro caterina | ||
7 | # Atmel DFU atmel-dfu | ||
8 | # LUFA DFU lufa-dfu | ||
9 | # QMK DFU qmk-dfu | ||
10 | # ATmega32A bootloadHID | ||
11 | # ATmega328P USBasp | ||
12 | BOOTLOADER = caterina | ||
13 | |||
14 | # Build Options | ||
15 | # comment out to disable the options. | ||
16 | # | ||
17 | BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration | ||
18 | MOUSEKEY_ENABLE = no # Mouse keys | ||
19 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
20 | CONSOLE_ENABLE = yes # Console for debug | ||
21 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
22 | CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge | ||
23 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
24 | # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | ||
25 | NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA | ||
26 | # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | ||
27 | # MIDI_ENABLE = yes # MIDI controls | ||
28 | UNICODE_ENABLE = yes # Unicode | ||
29 | # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID | ||
30 | |||
31 | # project specific files | ||
32 | SRC += matrix.c | ||
diff --git a/keyboards/sirius/uni660/uni660.c b/keyboards/sirius/uni660/uni660.c new file mode 100644 index 000000000..2144facc5 --- /dev/null +++ b/keyboards/sirius/uni660/uni660.c | |||
@@ -0,0 +1,35 @@ | |||
1 | #include "uni660.h" | ||
2 | |||
3 | void uart_init(void) { | ||
4 | SERIAL_UART_INIT(); | ||
5 | } | ||
6 | |||
7 | void led_init(void) { | ||
8 | setPinOutput(D1); // Pin to green, set as output | ||
9 | writePinHigh(D1); // Turn it off | ||
10 | setPinOutput(F4); // Pins to red and blue, set as output | ||
11 | setPinOutput(F5); | ||
12 | writePinHigh(F4); // Turn them off | ||
13 | writePinHigh(F5); | ||
14 | } | ||
15 | |||
16 | void matrix_init_kb(void) { | ||
17 | // put your keyboard start-up code here | ||
18 | // runs once when the firmware starts up | ||
19 | matrix_init_user(); | ||
20 | uart_init(); | ||
21 | led_init(); | ||
22 | } | ||
23 | |||
24 | /* | ||
25 | #ifdef SWAP_HANDS_ENABLE | ||
26 | __attribute__ ((weak)) | ||
27 | const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { | ||
28 | {{9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, | ||
29 | {{9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, | ||
30 | {{9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, | ||
31 | {{9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, | ||
32 | {{9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, | ||
33 | }; | ||
34 | #endif | ||
35 | */ | ||
diff --git a/keyboards/sirius/uni660/uni660.h b/keyboards/sirius/uni660/uni660.h new file mode 100644 index 000000000..81743adbd --- /dev/null +++ b/keyboards/sirius/uni660/uni660.h | |||
@@ -0,0 +1,61 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "quantum.h" | ||
4 | |||
5 | #define red_led_off writePinHigh(F5) | ||
6 | #define red_led_on writePinLow(F5) | ||
7 | #define blu_led_off writePinHigh(F4) | ||
8 | #define blu_led_on writePinLow(F4) | ||
9 | #define grn_led_off writePinHigh(D1) | ||
10 | #define grn_led_on writePinLow(D1) | ||
11 | |||
12 | #define set_led_off red_led_off; grn_led_off; blu_led_off | ||
13 | #define set_led_red red_led_on; grn_led_off; blu_led_off | ||
14 | #define set_led_blue red_led_off; grn_led_off; blu_led_on | ||
15 | #define set_led_green red_led_off; grn_led_on; blu_led_off | ||
16 | #define set_led_yellow red_led_on; grn_led_on; blu_led_off | ||
17 | #define set_led_magenta red_led_on; grn_led_off; blu_led_on | ||
18 | #define set_led_cyan red_led_off; grn_led_on; blu_led_on | ||
19 | #define set_led_white red_led_on; grn_led_on; blu_led_on | ||
20 | |||
21 | /* | ||
22 | #define LED_B 5 | ||
23 | #define LED_R 6 | ||
24 | #define LED_G 7 | ||
25 | |||
26 | #define all_leds_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G) | ||
27 | |||
28 | #define red_led_on PORTF |= (1<<LED_R) | ||
29 | #define red_led_off PORTF &= ~(1<<LED_R) | ||
30 | #define grn_led_on PORTF |= (1<<LED_G) | ||
31 | #define grn_led_off PORTF &= ~(1<<LED_G) | ||
32 | #define blu_led_on PORTF |= (1<<LED_B) | ||
33 | #define blu_led_off PORTF &= ~(1<<LED_B) | ||
34 | |||
35 | #define set_led_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G) | ||
36 | #define set_led_red PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_G) | (1<<LED_R) | ||
37 | #define set_led_blue PORTF = PORTF & ~(1<<LED_G) & ~(1<<LED_R) | (1<<LED_B) | ||
38 | #define set_led_green PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_R) | (1<<LED_G) | ||
39 | #define set_led_yellow PORTF = PORTF & ~(1<<LED_B) | (1<<LED_R) | (1<<LED_G) | ||
40 | #define set_led_magenta PORTF = PORTF & ~(1<<LED_G) | (1<<LED_R) | (1<<LED_B) | ||
41 | #define set_led_cyan PORTF = PORTF & ~(1<<LED_R) | (1<<LED_B) | (1<<LED_G) | ||
42 | #define set_led_white PORTF |= (1<<LED_B) | (1<<LED_R) | (1<<LED_G) | ||
43 | */ | ||
44 | |||
45 | // This a shortcut to help you visually see your layout. | ||
46 | // The first section contains all of the arguments | ||
47 | // The second converts the arguments into a two-dimensional array | ||
48 | #define LAYOUT( \ | ||
49 | k00, k01, k02, k03, k04, k05, k06, k46, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k3f,\ | ||
50 | k10, k11, k12, k13, k14, k15, k16, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k2f,\ | ||
51 | k20, k21, k22, k23, k24, k25, k26, k28, k29, k2a, k2b, k2c, k2d, k2e,\ | ||
52 | k30, k31, k32, k33, k34, k35, k36, k38, k39, k3a, k3b, k3c, k3d, k3e, \ | ||
53 | k40, k41, k42, k43, k44, k45, k48, k49, k4a, k4c, k4d, k4e, k4f \ | ||
54 | ) \ | ||
55 | { \ | ||
56 | { k00, k01, k02, k03, k04, k05, k06, KC_NO, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f }, \ | ||
57 | { k10, k11, k12, k13, k14, k15, k16, KC_NO, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f }, \ | ||
58 | { k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f }, \ | ||
59 | { k30, k31, k32, k33, k34, k35, k36, KC_NO, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f }, \ | ||
60 | { k40, k41, k42, k43, k44, k45, k46, KC_NO, k48, k49, k4a, KC_NO, k4c, k4d, k4e, k4f } \ | ||
61 | } | ||