aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIneiev <ineiev@gnu.org>2016-07-25 13:07:39 +0300
committerIneiev <ineiev@gnu.org>2016-09-09 08:13:00 +0000
commit15e5439fdf80205f79f731e81b8602c9f8c22f47 (patch)
tree3c131ed30f7eb763d787091d786edde355221b29
parent8466024adba814619aeae1c3d293221b042ec33b (diff)
downloadmiguel-15e5439fdf80205f79f731e81b8602c9f8c22f47.tar.gz
miguel-15e5439fdf80205f79f731e81b8602c9f8c22f47.tar.bz2
add Mitsumi matrix
-rw-r--r--firmware/configure.ac6
-rw-r--r--firmware/keytab-mit.h68
2 files changed, 71 insertions, 3 deletions
diff --git a/firmware/configure.ac b/firmware/configure.ac
index 40e6285..6f23b4e 100644
--- a/firmware/configure.ac
+++ b/firmware/configure.ac
@@ -63,11 +63,11 @@ AC_SUBST([AVR_MCU],[$with_avr_mcu])
AC_MSG_CHECKING([for keyboard matrix])
AC_ARG_WITH([matrix],
[AS_HELP_STRING([--with-matrix],
- [Matrix variant [gb]])],,[with_matrix=gb])
+ [Matrix variant (gb|mit) [gb]])],,[with_matrix=gb])
AC_MSG_RESULT([$with_matrix])
-AS_CASE([$with_matrix], [gb], [
-AC_CONFIG_FILES([keytab.h:keytab-gb.h])
+AS_CASE([$with_matrix], [gb|mit], [
+AC_CONFIG_FILES([keytab.h:keytab-$with_matrix.h])
],
[AC_MSG_ERROR([unknown matrix variant $with_matrix])])
diff --git a/firmware/keytab-mit.h b/firmware/keytab-mit.h
new file mode 100644
index 0000000..7ce425f
--- /dev/null
+++ b/firmware/keytab-mit.h
@@ -0,0 +1,68 @@
+/* Keyboard controller: scancode table for Mitsumi KFK-EA4XT.
+
+Copyright (C) 2016 Ineiev <ineiev@gnu.org>, super V 93
+
+This file is a part of miguel the keyboard controller.
+
+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 3 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 <https://www.gnu.org/licenses/>.*/
+
+/* The lower half of the table is hardcoded to save PROGMEM space
+ (100 bytes). */
+enum keytab_constants { KEYTAB_SIZE = 1 << 7 };
+PROGMEM static const unsigned char keytab[KEYTAB_SIZE] =
+{
+ 0x46, 0x03, 0xE6, 0x03, 0xE2, 0x03, 0x03, 0x47,
+ 0x25, 0x2E, 0x03, 0x36, 0x3F, 0x0E, 0x30, 0x0C,
+ 0x1F, 0x3A, 0x03, 0x1B, 0x03, 0x16, 0x39, 0x1A,
+ 0x43, 0x42, 0x2C, 0x28, 0x3E, 0x31, 0x2A, 0x03,
+ 0x03, 0x03, 0x03, 0xE5, 0x03, 0x03, 0xE1, 0x03,
+ 0x26, 0x41, 0x03, 0x37, 0x03, 0x0F, 0x40, 0x12,
+ 0x45, 0x49, 0x4F, 0x54, 0x62, 0x5A, 0x5D, 0x60,
+ 0x27, 0x2D, 0x38, 0x03, 0x34, 0x33, 0x2F, 0x13,
+ 0x44, 0x4C, 0x51, 0x53, 0x03, 0x59, 0x5C, 0x5F,
+ 0x03, 0xE0, 0x03, 0xE4, 0x03, 0x03, 0x03, 0x03,
+ 0x24, 0x23, 0x11, 0x10, 0x0B, 0x0D, 0x1C, 0x18,
+ 0x20, 0x3B, 0x65, 0x06, 0x3D, 0x07, 0x3C, 0x08,
+ 0x1E, 0x35, 0x03, 0x1D, 0x29, 0x04, 0x2B, 0x14,
+ 0x4D, 0x4A, 0x50, 0x03, 0x52, 0x58, 0x03, 0x57,
+ 0x21, 0x22, 0x05, 0x19, 0x0A, 0x09, 0x17, 0x15,
+ 0x4E, 0x4B, 0x56, 0x55, 0x63, 0x5B, 0x5E, 0x61,
+};
+static unsigned char
+scan_to_code (unsigned char x)
+{
+ if (x < KEYTAB_SIZE)
+ memcpy_P (&x, keytab + x, 1);
+ else if (x == 0x81)
+ x = 0xE7;
+ else if (x == 0xC1)
+ x = 0xE3;
+ else
+ x = 0x03;
+ return x;
+}
+#define UNUSED_COLUMNS (10)
+PROGMEM const unsigned char unused_columns[UNUSED_COLUMNS] =
+{
+ 17 - PROBE_E1 + PROBE_E2,
+ 18 - PROBE_E1 + PROBE_E2,
+ 20 - PROBE_E1 + PROBE_E2,
+ 21 - PROBE_E1 + PROBE_E2,
+ 22 - PROBE_E1 + PROBE_E2,
+ 25 - PROBE_E1 + PROBE_E2,
+ 26 - PROBE_E1 + PROBE_E2,
+ 28 - PROBE_E1 + PROBE_E2,
+ 29 - PROBE_E1 + PROBE_E2,
+ 30 - PROBE_E1 + PROBE_E2
+};

Return to:

Send suggestions and report system problems to the System administrator.