summaryrefslogtreecommitdiff
path: root/keyboards/rubi
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/rubi')
-rw-r--r--keyboards/rubi/config.h17
-rw-r--r--keyboards/rubi/info.json46
-rw-r--r--keyboards/rubi/lib/oled.c4
-rw-r--r--keyboards/rubi/lib/oled.h4
-rw-r--r--keyboards/rubi/rubi.c5
-rw-r--r--keyboards/rubi/rubi.h39
6 files changed, 34 insertions, 81 deletions
diff --git a/keyboards/rubi/config.h b/keyboards/rubi/config.h
index d80fa7ec35..725e6e29f4 100644
--- a/keyboards/rubi/config.h
+++ b/keyboards/rubi/config.h
@@ -17,23 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
-
-/*
- * Keyboard Matrix Assignments
- *
- * Change this to how you wired your keyboard
- * COLS: AVR pins used for columns, left to right
- * ROWS: AVR pins used for rows, top to bottom
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
- * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
- *
- */
-#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6 }
-#define MATRIX_COL_PINS { B3, B2, B1, F7 }
-
-/* COL2ROW, ROW2COL */
-#define DIODE_DIRECTION COL2ROW
-
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
diff --git a/keyboards/rubi/info.json b/keyboards/rubi/info.json
index c9120a2f48..d61ef34548 100644
--- a/keyboards/rubi/info.json
+++ b/keyboards/rubi/info.json
@@ -8,6 +8,11 @@
"pid": "0x5242",
"device_version": "0.0.1"
},
+ "matrix_pins": {
+ "cols": ["B3", "B2", "B1", "F7"],
+ "rows": ["F0", "F1", "F4", "F5", "F6"]
+ },
+ "diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "D7", "pin_b": "D6"}
@@ -18,24 +23,29 @@
"layouts": {
"LAYOUT": {
"layout": [
- {"x":3, "y":0},
- {"x":0, "y":1.25},
- {"x":1, "y":1.25},
- {"x":2, "y":1.25},
- {"x":3, "y":1.25},
- {"x":0, "y":2.25},
- {"x":1, "y":2.25},
- {"x":2, "y":2.25},
- {"x":3, "y":2.25, "h":2},
- {"x":0, "y":3.25},
- {"x":1, "y":3.25},
- {"x":2, "y":3.25},
- {"x":0, "y":4.25},
- {"x":1, "y":4.25},
- {"x":2, "y":4.25},
- {"x":3, "y":4.25, "h":2},
- {"x":0, "y":5.25, "w":2},
- {"x":2, "y":5.25}
+ {"matrix": [2, 3], "x": 3, "y": 0},
+
+ {"matrix": [0, 0], "x": 0, "y": 1.25},
+ {"matrix": [0, 1], "x": 1, "y": 1.25},
+ {"matrix": [0, 2], "x": 2, "y": 1.25},
+ {"matrix": [0, 3], "x": 3, "y": 1.25},
+
+ {"matrix": [1, 0], "x": 0, "y": 2.25},
+ {"matrix": [1, 1], "x": 1, "y": 2.25},
+ {"matrix": [1, 2], "x": 2, "y": 2.25},
+ {"matrix": [1, 3], "x": 3, "y": 2.25, "h": 2},
+
+ {"matrix": [2, 0], "x": 0, "y": 3.25},
+ {"matrix": [2, 1], "x": 1, "y": 3.25},
+ {"matrix": [2, 2], "x": 2, "y": 3.25},
+
+ {"matrix": [3, 0], "x": 0, "y": 4.25},
+ {"matrix": [3, 1], "x": 1, "y": 4.25},
+ {"matrix": [3, 2], "x": 2, "y": 4.25},
+ {"matrix": [3, 3], "x": 3, "y": 4.25, "h": 2},
+
+ {"matrix": [4, 1], "x": 0, "y": 5.25, "w": 2},
+ {"matrix": [4, 2], "x": 2, "y": 5.25}
]
}
}
diff --git a/keyboards/rubi/lib/oled.c b/keyboards/rubi/lib/oled.c
index 9534cdd9b7..9297cddf0e 100644
--- a/keyboards/rubi/lib/oled.c
+++ b/keyboards/rubi/lib/oled.c
@@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include QMK_KEYBOARD_H
-#include "./lib/oled.h"
+#include "oled.h"
+#include "rubi.h"
bool process_record_user_oled(uint16_t keycode, keyrecord_t *record) {
return process_record_user(keycode, record);
diff --git a/keyboards/rubi/lib/oled.h b/keyboards/rubi/lib/oled.h
index 1737541c96..8af48c667b 100644
--- a/keyboards/rubi/lib/oled.h
+++ b/keyboards/rubi/lib/oled.h
@@ -17,6 +17,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
+#include <stdbool.h>
+#include <stdint.h>
+#include "progmem.h"
+
#define OLED_FRAME_TIMEOUT (1000 / 30) // 30 fps
#define OLED_LOGO_TIMEOUT 3000 // 3 sec
diff --git a/keyboards/rubi/rubi.c b/keyboards/rubi/rubi.c
index 50e5fcf782..b125ff34a5 100644
--- a/keyboards/rubi/rubi.c
+++ b/keyboards/rubi/rubi.c
@@ -72,8 +72,3 @@ bool led_update_kb(led_t led_state) {
}
return true;
}
-
-bool encoder_update_kb(uint8_t index, bool clockwise) {
- if (!encoder_update_user(index, clockwise)) { return false; }
- return true;
-}
diff --git a/keyboards/rubi/rubi.h b/keyboards/rubi/rubi.h
index 17454c8c79..e7c8ae137a 100644
--- a/keyboards/rubi/rubi.h
+++ b/keyboards/rubi/rubi.h
@@ -60,42 +60,3 @@ uint16_t handle_encoder_press(void);
void calcUpdate(void);
void calcInput(char input);
void calcOperands(void);
-
-/* This is a shortcut to help you visually see your layout.
- *
- * The first section contains all of the arguments representing the physical
- * layout of the board and position of the keys.
- *
- * The second converts the arguments into a two-dimensional array which
- * represents the switch matrix.
- */
-
-/* Rubi matrix layout
- * ,---------------.
- * | 23|
- * |---------------|
- * | 00| 01| 02| 03|
- * |---------------|
- * | 10| 11| 12| |
- * |-----------| 13|
- * | 20| 21| 22| |
- * |---------------|
- * | 30| 31| 32| |
- * |-----------| 33|
- * | 41 | 42| |
- * `---------------'
- */
-#define LAYOUT( \
- k23, \
- k00, k01, k02, k03, \
- k10, k11, k12, k13, \
- k20, k21, k22, \
- k30, k31, k32, k33, \
- k41, k42 \
-) { \
- { k00, k01, k02, k03 }, \
- { k10, k11, k12, k13 }, \
- { k20, k21, k22, k23 }, \
- { k30, k31, k32, k33 }, \
- { KC_NO, k41, k42, KC_NO } \
-}