pana_m8: Move keyboard to converter directory
This commit is contained in:
parent
13fe8ac87b
commit
64c8f2375c
5 changed files with 0 additions and 0 deletions
57
converter/pana_m8/Makefile
Normal file
57
converter/pana_m8/Makefile
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
TARGET ?= pana_m8
|
||||
TARGET_DIR ?= .
|
||||
TMK_DIR ?= ../../tmk_core
|
||||
|
||||
MCU ?= atmega32u4
|
||||
F_CPU ?= 16000000
|
||||
# Boot Section Size in *bytes*
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# LUFA specific
|
||||
ARCH ?= AVR8
|
||||
F_USB ?= $(F_CPU)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Build Options
|
||||
#BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration
|
||||
#MOUSEKEY_ENABLE ?= yes # Mouse keys
|
||||
#EXTRAKEY_ENABLE ?= yes # Audio control and System control
|
||||
CONSOLE_ENABLE ?= yes # Console for debug
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
#NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
#ACTIONMAP_ENABLE ?= yes # Use 16bit actionmap instead of 8bit keymap
|
||||
UNIMAP_ENABLE ?= yes # Universal keymap
|
||||
KEYMAP_SECTION_ENABLE ?= yes # fixed address keymap for keymap editor
|
||||
|
||||
|
||||
# List C source files
|
||||
SRC ?= pana_m8.c
|
||||
|
||||
CONFIG_H ?= config.h
|
||||
|
||||
|
||||
# Keymap file
|
||||
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
|
||||
KEYMAP_FILE = unimap
|
||||
else
|
||||
ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
|
||||
KEYMAP_FILE = actionmap
|
||||
else
|
||||
KEYMAP_FILE = keymap
|
||||
endif
|
||||
endif
|
||||
ifdef KEYMAP
|
||||
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
|
||||
else
|
||||
SRC := $(KEYMAP_FILE).c $(SRC)
|
||||
endif
|
||||
|
||||
|
||||
# Search Path
|
||||
VPATH += $(TARGET_DIR)
|
||||
VPATH += $(TMK_DIR)
|
||||
|
||||
include $(TMK_DIR)/protocol/lufa.mk
|
||||
include $(TMK_DIR)/common.mk
|
||||
include $(TMK_DIR)/rules.mk
|
||||
94
converter/pana_m8/README
Normal file
94
converter/pana_m8/README
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
Panasonic VP-0187A
|
||||
==================
|
||||
2017/08/06
|
||||
|
||||
It is unknown keyboard from Panasonic with Hirose Cherry M8 and 6P6C connector.
|
||||
|
||||
Pictures:
|
||||
http://imgur.com/a/GAZE7
|
||||
|
||||
Hirose Cheery M8 switches:
|
||||
https://deskthority.net/wiki/Cherry_M8
|
||||
|
||||
|
||||
|
||||
Scan
|
||||
----
|
||||
The keyboard is comprised of some of 4000 series IC without microcontroller.
|
||||
|
||||
|
||||
RST>-----------+---------------+
|
||||
| |
|
||||
TC4520 | TC4520 |
|
||||
--------- carry ---------
|
||||
CLK>--->|row |------>|col |
|
||||
|counter|Q3 |counter|
|
||||
--------- ---------
|
||||
Q012 Q012
|
||||
||| |||
|
||||
||| ABC TC4028
|
||||
||| ---------
|
||||
||| |decoder|
|
||||
||| ---------
|
||||
||| |||||| col[0..7]
|
||||
ABC TC4512 vvvvvvv pull down
|
||||
---------- <----|+++++++|--100K--+
|
||||
|data | <----|+++++++|--100K--+
|
||||
STATE<--|selector| <----|+++++++|--100K--+
|
||||
| 7 to 1 | <----|+++++++|--100K--+
|
||||
---------- <----|+++++++|--100K--+
|
||||
row[0..7] | 8x8 matrix |
|
||||
| -
|
||||
TC4078 | GND
|
||||
------ |
|
||||
SENSE<----| OR |========+ OR'd row[0..7]
|
||||
------
|
||||
|
||||
- TC4520BP - Dual Binary Up Counter
|
||||
- TC4028B - BCD-to-Decimal Decoder
|
||||
- TC4512BP - 8-Channel Data Selector
|
||||
- TC4081BP - Quad 2-Input AND Gate
|
||||
- TC4071BP - Quad 2-Input OR Gate
|
||||
- TC4078BP - 8-Input NOR/OR Gate
|
||||
|
||||
|
||||
Matrix
|
||||
------
|
||||
0 1 2 3 4 5 6 7
|
||||
--------------------------------------------------------------------
|
||||
0 ESC 1 2 3 4 5 6 7
|
||||
1 8 9 0 - ^ BS INS DEL
|
||||
2 TAB Q W E R T Y U
|
||||
3 I O P @ [ ] F2 F1
|
||||
4 CTRL A S D F G H J
|
||||
5 K L ; : RETURN UP F3 F4
|
||||
6 SHIFT Z X C V B N M
|
||||
7 SPACE , . / LEFT RIGHT DOWN HOME
|
||||
|
||||
|
||||
|
||||
6P6C connector pinout
|
||||
---------------------
|
||||
1. VCC
|
||||
2. Clock - sends clock to binary counter TC4520
|
||||
3. Key State - indicates hi if key selected by counter is active
|
||||
4. Sense - indicates lo if any key is active while Reset is hi.
|
||||
5. Reset - resets counter and drives all column
|
||||
6. GND
|
||||
|
||||
123456
|
||||
,--------.
|
||||
| |||||| |
|
||||
| |
|
||||
`--____--'
|
||||
plug
|
||||
|
||||
|
||||
Ping configuration
|
||||
------------------
|
||||
AVR ATmega32u4 is used as protocol converter.
|
||||
|
||||
PD0: Clock. Counter couts up at falling edge.
|
||||
PD1: Key State. Hi if selected key is activated.
|
||||
PD2: Sense. Lo if any key is activated while Reset is Hi.
|
||||
PD3: Reset. Resets counters at riging edge.
|
||||
32
converter/pana_m8/config.h
Normal file
32
converter/pana_m8/config.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0xFFFF
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER TMK.
|
||||
#define PRODUCT Panasonic Cherry M8
|
||||
#define DESCRIPTION TMK. keyboard firmware
|
||||
|
||||
|
||||
/* matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 8
|
||||
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||
|
||||
|
||||
/* period of tapping(ms) */
|
||||
#define TAPPING_TERM 300
|
||||
/* tap count needed for toggling a feature */
|
||||
#define TAPPING_TOGGLE 5
|
||||
/* Oneshot timeout(ms) */
|
||||
#define ONESHOT_TIMEOUT 300
|
||||
|
||||
/* Boot Magic salt key: Space */
|
||||
#define BOOTMAGIC_KEY_SALT KC_SPACE
|
||||
|
||||
#endif
|
||||
72
converter/pana_m8/pana_m8.c
Normal file
72
converter/pana_m8/pana_m8.c
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#include <avr/io.h>
|
||||
#include <avr/pgmspace.h>
|
||||
#include "matrix.h"
|
||||
#include "led.h"
|
||||
#include "wait.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define CLK_HI() (PORTD |= (1<<0))
|
||||
#define CLK_LO() (PORTD &= ~(1<<0))
|
||||
#define STATE() (PIND & (1<<1))
|
||||
#define RST_HI() (PORTD |= (1<<3))
|
||||
#define RST_LO() (PORTD &= ~(1<<3))
|
||||
#define SENSE() (PIND & (1<<2))
|
||||
|
||||
static matrix_row_t matrix[8] = {};
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
debug_enable = true;
|
||||
debug_keyboard = true;
|
||||
debug_matrix = true;
|
||||
|
||||
// PD0: Clock. Counter couts up at falling edge.
|
||||
// PD1: Key State. Hi if selected key is activated.
|
||||
// PD2: Sense. Lo if any key is activated while Reset is Hi.
|
||||
// PD3: Reset. Resets counters at riging edge.
|
||||
DDRD |= (1<<3) | (1<<0); // output
|
||||
DDRD &= ~((1<<2) | (1<<1)); // input
|
||||
PORTD &= ~((1<<3) | (1<<0)); // low
|
||||
PORTD |= (1<<2) | (1<<1); // pull-up
|
||||
|
||||
dprintf("init\n");
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
// TODO: debouce & unplug detect
|
||||
// Reset counters
|
||||
RST_HI();
|
||||
wait_us(10);
|
||||
RST_LO();
|
||||
wait_us(10);
|
||||
|
||||
// 8x8 matrix: row:sense, col:drive, key_on:hi
|
||||
for (uint8_t col = 0; col < 8; col++) {
|
||||
for (uint8_t row = 0; row < 8; row++) {
|
||||
CLK_HI();
|
||||
wait_us(10);
|
||||
|
||||
if (STATE()) {
|
||||
matrix[row] |= (1<<col);
|
||||
} else {
|
||||
matrix[row] &= ~(1<<col);
|
||||
}
|
||||
|
||||
// proceed counter - next row
|
||||
CLK_LO();
|
||||
wait_us(10);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void led_set(uint8_t usb_led)
|
||||
{
|
||||
}
|
||||
68
converter/pana_m8/unimap.c
Normal file
68
converter/pana_m8/unimap.c
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#include "unimap.h"
|
||||
#include "action.h"
|
||||
#include "actionmap.h"
|
||||
#include "hook.h"
|
||||
|
||||
|
||||
#define UMAP( \
|
||||
K29,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4C, K3A, \
|
||||
K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K35,K2F,K30, K3B, \
|
||||
K78,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K28, K52, K3C, \
|
||||
K79,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K50,K4F, K3D, \
|
||||
K2C, K51, K4A \
|
||||
) UNIMAP ( \
|
||||
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, \
|
||||
K29, K3A,K3B,K3C,K3D,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, \
|
||||
K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,NO, K2A, K49,K4A,NO, NO, NO, NO, NO, \
|
||||
K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, NO, K4C,NO, NO, NO, NO, NO, NO, \
|
||||
NO, K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, NO, K28, NO, NO, NO, NO, \
|
||||
K79,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, NO, NO, K52, NO, NO, NO, NO, \
|
||||
K78,NO, NO, NO, K2C, NO, NO, NO, NO, NO, NO, K50,K51,K4F, NO, NO, NO \
|
||||
)
|
||||
|
||||
#define AC_L1 ACTION_LAYER_MOMENTARY(1)
|
||||
#define AC_SPC1 ACTION_LAYER_TAP_KEY(1, KC_SPC)
|
||||
#define AC_AENT ACTION_MODS_TAP_KEY(MOD_LALT, KC_ENT)
|
||||
|
||||
#ifdef KEYMAP_SECTION_ENABLE
|
||||
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
|
||||
#else
|
||||
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
|
||||
#endif
|
||||
[0] = UMAP(
|
||||
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, DEL, F1,
|
||||
TAB, Q, W, E, R, T, Y, U, I, O, P, GRV, LBRC,RBRC, F2,
|
||||
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, AENT, UP, F3,
|
||||
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, LEFT,RGHT, F4,
|
||||
SPC1, DOWN, HOME
|
||||
),
|
||||
[1] = UMAP(
|
||||
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSLS, PSCR,PAUS, F5,
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGDN,UP, PGUP,TRNS,BSLS,TRNS,TRNS, F6,
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,LEFT,DOWN,RGHT,END, TRNS, LGUI, PGUP, F7,
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,END, F8,
|
||||
TRNS, PGDN, END
|
||||
),
|
||||
/*
|
||||
[2] = UMAP(
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS,
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS,
|
||||
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS,
|
||||
TRNS, TRNS, TRNS
|
||||
),
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
{ UNIMAP_ESC, UNIMAP_1, UNIMAP_2, UNIMAP_3, UNIMAP_4, UNIMAP_5, UNIMAP_6, UNIMAP_7 },
|
||||
{ UNIMAP_8, UNIMAP_9, UNIMAP_0, UNIMAP_MINS, UNIMAP_EQL, UNIMAP_BSPC, UNIMAP_INS, UNIMAP_DEL },
|
||||
{ UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_E, UNIMAP_R, UNIMAP_T, UNIMAP_Y, UNIMAP_U },
|
||||
{ UNIMAP_I, UNIMAP_O, UNIMAP_P, UNIMAP_GRV, UNIMAP_LBRC, UNIMAP_RBRC, UNIMAP_F2, UNIMAP_F1 },
|
||||
{ UNIMAP_LCTL, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_H, UNIMAP_J },
|
||||
{ UNIMAP_K, UNIMAP_L, UNIMAP_SCLN, UNIMAP_QUOT, UNIMAP_ENT, UNIMAP_UP, UNIMAP_F3, UNIMAP_F4 },
|
||||
{ UNIMAP_LSFT, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_N, UNIMAP_M },
|
||||
{ UNIMAP_SPC, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_LEFT, UNIMAP_RIGHT, UNIMAP_DOWN, UNIMAP_HOME }
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue