summaryrefslogtreecommitdiff
path: root/keyboards/wekey/we27/we27.c
diff options
context:
space:
mode:
authorUy Bui <uybv.cntt@gmail.com>2021-07-20 14:26:26 +0900
committerGitHub <noreply@github.com>2021-07-19 22:26:26 -0700
commit125691558398c4bfff93b457147b2802365cbd3f (patch)
tree1e4ea53de60bef8b57c441f752b52f9518409bc3 /keyboards/wekey/we27/we27.c
parent35ee990bd0293efbd5746671f1e58cec262a066b (diff)
[Keyboard] Add we27 numpad (#13137)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/wekey/we27/we27.c')
-rw-r--r--keyboards/wekey/we27/we27.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/keyboards/wekey/we27/we27.c b/keyboards/wekey/we27/we27.c
new file mode 100644
index 0000000000..2765e6f3bd
--- /dev/null
+++ b/keyboards/wekey/we27/we27.c
@@ -0,0 +1,58 @@
+/* Copyright 2021 @wekey
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * 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 "we27.h"
+#include "encoder_actions.h"
+
+#ifdef RGB_MATRIX_ENABLE
+
+#define __ NO_LED
+
+led_config_t g_led_config = { {
+ { 0, 1, 2, 3, 4 },
+ { 9, 8, 7, 6, 5 },
+ { 10, 11, 12, 13, 14 },
+ { 18, 17, 16, 15, __ },
+ { 19, 20, 21, 22, 23 },
+ { 26, 25, __, 24, __ }
+}, {
+ {0,1},{56,1},{112,1},{168,1},{224,1},
+ {0,16},{56,16},{112,16},{168,16},{224,16},
+ {0,28},{56,28},{112,28},{168,28},{224,28},
+ {0,40},{56,40},{112,40},{168,40},
+ {0,52},{56,52},{112,52},{168,52},{224,52},
+ {0,64},{56,64},{168,64}
+}, {
+ 1, 1, 1, 1, 1,
+ 1, 1, 4, 4, 4,
+ 1, 4, 4, 4, 4,
+ 1, 4, 4, 4,
+ 1, 4, 4, 4, 4,
+ 1, 4, 4
+} };
+
+#endif
+
+void matrix_scan_kb(void) {
+ encoder_action_unregister();
+ matrix_scan_user();
+}
+
+bool encoder_update_kb(uint8_t index, bool clockwise) {
+ if (!encoder_update_user(index, clockwise)) { return false; }
+ encoder_action_register(index, clockwise);
+ return true;
+};