aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/redox_w/config.h81
-rw-r--r--keyboards/redox_w/keymaps/default/keymap.c115
-rw-r--r--keyboards/redox_w/keymaps/default/readme.md1
-rw-r--r--keyboards/redox_w/keymaps/italian/keymap.c125
-rw-r--r--keyboards/redox_w/keymaps/italian/readme.md1
-rw-r--r--keyboards/redox_w/matrix.c162
-rw-r--r--keyboards/redox_w/readme.md34
-rw-r--r--keyboards/redox_w/redox_w.c42
-rw-r--r--keyboards/redox_w/redox_w.h40
-rw-r--r--keyboards/redox_w/rules.mk76
10 files changed, 677 insertions, 0 deletions
diff --git a/keyboards/redox_w/config.h b/keyboards/redox_w/config.h
new file mode 100644
index 000000000..810a236d9
--- /dev/null
+++ b/keyboards/redox_w/config.h
@@ -0,0 +1,81 @@
1/* Copyright 2017 Mattia Dal Ben
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x6060
25#define DEVICE_VER 0x0001
26#define MANUFACTURER Mattia Dal Ben
27#define PRODUCT Redox_wireless
28#define DESCRIPTION q.m.k. keyboard firmware for Redox-w
29
30/* key matrix size */
31#define MATRIX_ROWS 5
32#define MATRIX_COLS 14
33
34/* define if matrix has ghost */
35//#define MATRIX_HAS_GHOST
36
37/* number of backlight levels */
38//#define BACKLIGHT_LEVELS 3
39
40#define ONESHOT_TIMEOUT 500
41
42
43/* key combination for command */
44#define IS_COMMAND() ( \
45 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
46)
47
48/*
49 * Feature disable options
50 * These options are also useful to firmware size reduction.
51 */
52
53/* disable debug print */
54//#define NO_DEBUG
55
56/* disable print */
57//#define NO_PRINT
58
59/* disable action features */
60//#define NO_ACTION_LAYER
61//#define NO_ACTION_TAPPING
62//#define NO_ACTION_ONESHOT
63//#define NO_ACTION_MACRO
64//#define NO_ACTION_FUNCTION
65
66//UART settings for communication with the RF microcontroller
67#define SERIAL_UART_BAUD 1000000
68#define SERIAL_UART_DATA UDR1
69#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
70#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
71#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
72#define SERIAL_UART_INIT() do { \
73 /* baud rate */ \
74 UBRR1L = SERIAL_UART_UBRR; \
75 /* baud rate */ \
76 UBRR1H = SERIAL_UART_UBRR >> 8; \
77 /* enable TX and RX */ \
78 UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
79 /* 8-bit data */ \
80 UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
81 } while(0)
diff --git a/keyboards/redox_w/keymaps/default/keymap.c b/keyboards/redox_w/keymaps/default/keymap.c
new file mode 100644
index 000000000..9cfc1734e
--- /dev/null
+++ b/keyboards/redox_w/keymaps/default/keymap.c
@@ -0,0 +1,115 @@
1#include QMK_KEYBOARD_H
2
3extern keymap_config_t keymap_config;
4
5// Each layer gets a name for readability, which is then used in the keymap matrix below.
6// The underscores don't mean anything - you can have a layer called STUFF or any other name.
7// Layer names don't all need to be of the same length, obviously, and you can also skip them
8// entirely and just use numbers.
9#define _QWERTY 0
10#define _SYMB 1
11#define _NAV 2
12#define _ADJUST 3
13
14enum custom_keycodes {
15 QWERTY = SAFE_RANGE,
16 SYMB,
17 NAV,
18 ADJUST,
19};
20
21// Shortcut to make keymap more readable
22#define KC_BKSL KC_BSLASH
23#define SYM_L MO(_SYMB)
24
25#define KC_ALAS LALT_T(KC_PAST)
26#define KC_CTPL LCTL_T(KC_PSLS)
27
28#define KC_NAGR LT(_NAV, KC_GRV)
29#define KC_NAMI LT(_NAV, KC_MINS)
30
31#define KC_ADEN LT(_ADJUST, KC_END)
32#define KC_ADPU LT(_ADJUST, KC_PGUP)
33
34const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
35
36 [_QWERTY] = LAYOUT(
37 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
38 KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI ,
39 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
40 KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL ,
41 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
42 KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT ,
43 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
44 KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_BKSL ,KC_RSFT ,
45 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
46 KC_LGUI ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT
47 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
48 ),
49
50 [_SYMB] = LAYOUT(
51 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
52 _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX ,
53 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
54 _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX ,
55 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
56 _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX ,
57 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
58 _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX ,
59 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
60 _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX
61 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
62 ),
63
64 [_NAV] = LAYOUT(
65 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
66 _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
67 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
68 XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
69 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
70 XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX ,
71 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
72 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
73 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
74 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
75 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
76 ),
77
78 [_ADJUST] = LAYOUT(
79 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
80 XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX ,
81 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
82 XXXXXXX ,RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
83 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
84 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
85 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
86 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
87 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
88 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
89 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
90 )
91
92};
93
94void matrix_scan_user(void) {
95 uint8_t layer = biton32(layer_state);
96
97 switch (layer) {
98 case _QWERTY:
99 set_led_off;
100 break;
101 case _SYMB:
102 set_led_green;
103 break;
104 case _NAV:
105 set_led_blue;
106 break;
107 case _ADJUST:
108 set_led_red;
109 break;
110 default:
111 break;
112 }
113};
114
115
diff --git a/keyboards/redox_w/keymaps/default/readme.md b/keyboards/redox_w/keymaps/default/readme.md
new file mode 100644
index 000000000..32ab1253d
--- /dev/null
+++ b/keyboards/redox_w/keymaps/default/readme.md
@@ -0,0 +1 @@
# Default keymap for Redox Wireless
diff --git a/keyboards/redox_w/keymaps/italian/keymap.c b/keyboards/redox_w/keymaps/italian/keymap.c
new file mode 100644
index 000000000..6e23a32d4
--- /dev/null
+++ b/keyboards/redox_w/keymaps/italian/keymap.c
@@ -0,0 +1,125 @@
1#include QMK_KEYBOARD_H
2
3#include "keymap_italian.h"
4
5extern keymap_config_t keymap_config;
6
7// Each layer gets a name for readability, which is then used in the keymap matrix below.
8// The underscores don't mean anything - you can have a layer called STUFF or any other name.
9// Layer names don't all need to be of the same length, obviously, and you can also skip them
10// entirely and just use numbers.
11#define _QWERTY 0
12#define _SYMB 1
13#define _NAV 2
14#define _ADJUST 3
15
16enum custom_keycodes {
17 QWERTY = SAFE_RANGE,
18 SYMB,
19 NAV,
20 ADJUST,
21};
22
23// Shortcut to make keymap more readable
24#define KC_BKSL KC_BSLASH
25#define SYM_L MO(_SYMB)
26
27#define KC_ALAS LALT_T(KC_PAST)
28#define KC_CTPL LCTL_T(KC_PSLS)
29
30#define KC_NAGR LT(_NAV, KC_GRV)
31#define KC_NAMI LT(_NAV, KC_MINS)
32
33#define KC_ADEN LT(_ADJUST, KC_END)
34#define KC_ADPU LT(_ADJUST, KC_PGUP)
35
36// Italian specific shortcuts
37#define ALT_IACC RALT_T(IT_IACC)
38#define GUI_LESS LGUI_T(IT_LESS)
39
40#define IT_SHSL RSFT_T(KC_SLSH)
41#define IT_GRV RALT(KC_MINS)
42#define IT_TILD RALT(KC_EQL)
43
44const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45
46 [_QWERTY] = LAYOUT(
47 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
48 KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI ,
49 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
50 KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,IT_EACC ,
51 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
52 KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,IT_LBRC , IT_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,IT_OACC ,IT_AACC ,
53 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
54 KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,IT_UACC ,IT_SHSL ,
55 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
56 GUI_LESS,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , ALT_IACC, KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT
57 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
58 ),
59
60 [_SYMB] = LAYOUT(
61 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
62 _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX ,
63 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
64 _______ ,IT_EXLM ,IT_AT ,IT_LCBR ,IT_RCBR ,IT_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX ,
65 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
66 _______ ,IT_SHRP ,IT_DLR ,IT_LBRC ,IT_RBRC ,IT_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX ,
67 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
68 _______ ,IT_PERC ,IT_CRC ,IT_LPRN ,IT_RPRN ,IT_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX ,
69 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
70 _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX
71 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
72 ),
73
74 [_NAV] = LAYOUT(
75 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
76 _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,
77 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
78 XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
79 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
80 XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX ,
81 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
82 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
83 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
84 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
85 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
86 ),
87
88 [_ADJUST] = LAYOUT(
89 //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
90 XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX ,
91 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
92 XXXXXXX ,RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
93 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
94 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
95 //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
96 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
97 //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
98 XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
99 //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
100 )
101
102};
103
104void matrix_scan_user(void) {
105 uint8_t layer = biton32(layer_state);
106
107 switch (layer) {
108 case _QWERTY:
109 set_led_off;
110 break;
111 case _SYMB:
112 set_led_green;
113 break;
114 case _NAV:
115 set_led_blue;
116 break;
117 case _ADJUST:
118 set_led_red;
119 break;
120 default:
121 break;
122 }
123};
124
125
diff --git a/keyboards/redox_w/keymaps/italian/readme.md b/keyboards/redox_w/keymaps/italian/readme.md
new file mode 100644
index 000000000..a2b5ef707
--- /dev/null
+++ b/keyboards/redox_w/keymaps/italian/readme.md
@@ -0,0 +1 @@
# Italian keymap for Redox Wireless
diff --git a/keyboards/redox_w/matrix.c b/keyboards/redox_w/matrix.c
new file mode 100644
index 000000000..5e61103f2
--- /dev/null
+++ b/keyboards/redox_w/matrix.c
@@ -0,0 +1,162 @@
1/* Copyright 2017 Mattia Dal Ben
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include <stdint.h>
17#include <stdbool.h>
18#if defined(__AVR__)
19#include <avr/io.h>
20#endif
21#include "wait.h"
22#include "print.h"
23#include "debug.h"
24#include "util.h"
25#include "matrix.h"
26#include "timer.h"
27
28#if (MATRIX_COLS <= 8)
29# define print_matrix_header() print("\nr/c 01234567\n")
30# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
31# define matrix_bitpop(i) bitpop(matrix[i])
32# define ROW_SHIFTER ((uint8_t)1)
33#elif (MATRIX_COLS <= 16)
34# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
35# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
36# define matrix_bitpop(i) bitpop16(matrix[i])
37# define ROW_SHIFTER ((uint16_t)1)
38#elif (MATRIX_COLS <= 32)
39# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
40# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
41# define matrix_bitpop(i) bitpop32(matrix[i])
42# define ROW_SHIFTER ((uint32_t)1)
43#endif
44
45/* matrix state(1:on, 0:off) */
46static matrix_row_t matrix[MATRIX_ROWS];
47
48__attribute__ ((weak))
49void matrix_init_quantum(void) {
50 matrix_init_kb();
51}
52
53__attribute__ ((weak))
54void matrix_scan_quantum(void) {
55 matrix_scan_kb();
56}
57
58__attribute__ ((weak))
59void matrix_init_kb(void) {
60 matrix_init_user();
61}
62
63__attribute__ ((weak))
64void matrix_scan_kb(void) {
65 matrix_scan_user();
66}
67
68__attribute__ ((weak))
69void matrix_init_user(void) {
70}
71
72__attribute__ ((weak))
73void matrix_scan_user(void) {
74}
75
76inline
77uint8_t matrix_rows(void) {
78 return MATRIX_ROWS;
79}
80
81inline
82uint8_t matrix_cols(void) {
83 return MATRIX_COLS;
84}
85
86void matrix_init(void) {
87
88 matrix_init_quantum();
89}
90
91uint8_t matrix_scan(void)
92{
93 SERIAL_UART_INIT();
94
95 uint32_t timeout = 0;
96
97 //the s character requests the RF slave to send the matrix
98 SERIAL_UART_DATA = 's';
99
100 //trust the external keystates entirely, erase the last data
101 uint8_t uart_data[11] = {0};
102
103 //there are 14 bytes corresponding to 14 columns, and an end byte
104 for (uint8_t i = 0; i < 11; i++) {
105 //wait for the serial data, timeout if it's been too long
106 //this only happened in testing with a loose wire, but does no
107 //harm to leave it in here
108 while(!SERIAL_UART_RXD_PRESENT){
109 timeout++;
110 if (timeout > 10000){
111 break;
112 }
113 }
114 uart_data[i] = SERIAL_UART_DATA;
115 }
116
117 //check for the end packet, the key state bytes use the LSBs, so 0xE0
118 //will only show up here if the correct bytes were recieved
119 if (uart_data[10] == 0xE0)
120 {
121 //shifting and transferring the keystates to the QMK matrix variable
122 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
123 matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 7;
124 }
125 }
126
127
128 matrix_scan_quantum();
129 return 1;
130}
131
132inline
133bool matrix_is_on(uint8_t row, uint8_t col)
134{
135 return (matrix[row] & ((matrix_row_t)1<col));
136}
137
138inline
139matrix_row_t matrix_get_row(uint8_t row)
140{
141 return matrix[row];
142}
143
144void matrix_print(void)
145{
146 print_matrix_header();
147
148 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
149 phex(row); print(": ");
150 print_matrix_row(row);
151 print("\n");
152 }
153}
154
155uint8_t matrix_key_count(void)
156{
157 uint8_t count = 0;
158 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
159 count += matrix_bitpop(i);
160 }
161 return count;
162}
diff --git a/keyboards/redox_w/readme.md b/keyboards/redox_w/readme.md
new file mode 100644
index 000000000..83544a9fc
--- /dev/null
+++ b/keyboards/redox_w/readme.md
@@ -0,0 +1,34 @@
1Redox wireless
2=======
3
4<p align="center">
5<img src="https://github.com/mattdibi/redox-keyboard/raw/master/img/redox-logo.png" alt="Redox logo" width="600"/>
6</p>
7
8**Redox**: the **R**educed **E**rgo**dox** project. More information and building instruction [here](https://github.com/mattdibi/redox-keyboard).
9
10A wireless version of the Redox keyboard.
11
12- Keyboard Maintainer: [@mattdibi](https://github.com/mattdibi)
13- Hardware Supported: Redox-w rev1.0W PCB
14- Hardware Availability: Falbatech
15
16Make example for this keyboard (after setting up your build environment):
17
18```sh
19make redox_w:default
20```
21
22Example of flashing this keyboard:
23
24```sh
25make redox_w/rev1:default:avrdude
26```
27
28See 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).
29
30For nRF51822 firmware upload instruction and development see [the Redox wireless firmware repository](https://github.com/mattdibi/redox-w-firmware).
31
32## Redox-w Notes
33
34These configuration files were based off the [Mitosis](https://github.com/qmk/qmk_firmware/tree/master/keyboards/mitosis) and [Atreus](https://github.com/technomancy/atreus) keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported.
diff --git a/keyboards/redox_w/redox_w.c b/keyboards/redox_w/redox_w.c
new file mode 100644
index 000000000..75df91066
--- /dev/null
+++ b/keyboards/redox_w/redox_w.c
@@ -0,0 +1,42 @@
1#include "redox_w.h"
2
3void uart_init(void) {
4 SERIAL_UART_INIT();
5}
6
7void led_init(void) {
8 DDRD |= (1<<1);
9 PORTD |= (1<<1);
10 DDRF |= (1<<4) | (1<<5);
11 PORTF |= (1<<4) | (1<<5);
12}
13
14
15void matrix_init_kb(void) {
16 // put your keyboard start-up code here
17 // runs once when the firmware starts up
18 matrix_init_user();
19 uart_init();
20 led_init();
21}
22
23void matrix_scan_kb(void) {
24 // put your looping keyboard code here
25 // runs every cycle (a lot)
26 matrix_scan_user();
27}
28
29void led_set_kb(uint8_t usb_led) {
30
31}
32
33#ifdef ONEHAND_ENABLE
34__attribute__ ((weak))
35const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
36{{13, 0}, {12, 0}, {11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
37{{13, 1}, {12, 1}, {11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
38{{13, 2}, {12, 2}, {11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
39{{13, 3}, {12, 3}, {11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
40{{13, 4}, {12, 4}, {11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
41};
42#endif
diff --git a/keyboards/redox_w/redox_w.h b/keyboards/redox_w/redox_w.h
new file mode 100644
index 000000000..3adcb121d
--- /dev/null
+++ b/keyboards/redox_w/redox_w.h
@@ -0,0 +1,40 @@
1#pragma once
2
3#include "quantum.h"
4#include "matrix.h"
5#include "backlight.h"
6#include <stddef.h>
7
8#define red_led_off PORTF |= (1<<5)
9#define red_led_on PORTF &= ~(1<<5)
10#define blu_led_off PORTF |= (1<<4)
11#define blu_led_on PORTF &= ~(1<<4)
12#define grn_led_off PORTD |= (1<<1)
13#define grn_led_on PORTD &= ~(1<<1)
14
15#define set_led_off red_led_off; grn_led_off; blu_led_off
16#define set_led_red red_led_on; grn_led_off; blu_led_off
17#define set_led_blue red_led_off; grn_led_off; blu_led_on
18#define set_led_green red_led_off; grn_led_on; blu_led_off
19#define set_led_yellow red_led_on; grn_led_on; blu_led_off
20#define set_led_magenta red_led_on; grn_led_off; blu_led_on
21#define set_led_cyan red_led_off; grn_led_on; blu_led_on
22#define set_led_white red_led_on; grn_led_on; blu_led_on
23
24// This a shortcut to help you visually see your layout.
25// The first section contains all of the arguements
26// The second converts the arguments into a two-dimensional array
27#define LAYOUT( \
28 k00, k01, k02, k03, k04, k05, k08, k09, k10, k11, k12, k13, \
29 k14, k15, k16, k17, k18, k19, k06, k07, k22, k23, k24, k25, k26, k27, \
30 k28, k29, k30, k31, k32, k33, k20, k21, k36, k37, k38, k39, k40, k41, \
31 k42, k43, k44, k45, k46, k47, k34, k48, k49, k35, k50, k51, k52, k53, k54, k55, \
32 k56, k57, k58, k59, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 \
33) \
34{ \
35 { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13 }, \
36 { k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27 }, \
37 { k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41 }, \
38 { k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55 }, \
39 { k56, k57, k58, k59, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 } \
40}
diff --git a/keyboards/redox_w/rules.mk b/keyboards/redox_w/rules.mk
new file mode 100644
index 000000000..f2f73d5c5
--- /dev/null
+++ b/keyboards/redox_w/rules.mk
@@ -0,0 +1,76 @@
1
2OPT_DEFS += -DREDOX_W_PROMICRO
3INTERPHASE_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
4 avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
5
6# # project specific files
7SRC = matrix.c
8
9
10# MCU name
11#MCU = at90usb1287
12MCU = atmega32u4
13
14# Processor frequency.
15# This will define a symbol, F_CPU, in all source code files equal to the
16# processor frequency in Hz. You can then use this symbol in your source code to
17# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
18# automatically to create a 32-bit value in your source code.
19#
20# This will be an integer division of F_USB below, as it is sourced by
21# F_USB after it has run through any CPU prescalers. Note that this value
22# does not *change* the processor frequency - it should merely be updated to
23# reflect the processor speed set externally so that the code can use accurate
24# software delays.
25F_CPU = 16000000
26
27
28#
29# LUFA specific
30#
31# Target architecture (see library "Board Types" documentation).
32ARCH = AVR8
33
34# Input clock frequency.
35# This will define a symbol, F_USB, in all source code files equal to the
36# input clock frequency (before any prescaling is performed) in Hz. This value may
37# differ from F_CPU if prescaling is used on the latter, and is required as the
38# raw input clock is fed directly to the PLL sections of the AVR for high speed
39# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
40# at the end, this will be done automatically to create a 32-bit value in your
41# source code.
42#
43# If no clock division is performed on the input clock inside the AVR (via the
44# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
45F_USB = $(F_CPU)
46
47# Bootloader
48# This definition is optional, and if your keyboard supports multiple bootloaders of
49# different sizes, comment this out, and the correct address will be loaded
50# automatically (+60). See bootloader.mk for all options.
51BOOTLOADER = caterina
52
53# Interrupt driven control endpoint task(+60)
54OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
55
56# Build Options
57# comment out to disable the options.
58#
59#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
60MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
61EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
62CONSOLE_ENABLE = yes # Console for debug(+400)
63COMMAND_ENABLE = yes # Commands for debug and configuration
64CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge
65# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
66# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
67NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
68# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
69# MIDI_ENABLE = YES # MIDI controls
70UNICODE_ENABLE = YES # Unicode
71# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
72
73USB = /dev/ttyACM0
74
75# upload: build
76# $(REDOX_W_UPLOAD_COMMAND)