pana_m8: Fix unimap

This commit is contained in:
tmk 2017-08-06 09:29:36 +09:00
parent 353afe87cc
commit 13fe8ac87b
3 changed files with 61 additions and 21 deletions

View file

@ -1,10 +1,13 @@
Panasonic VP-0187A
==================
It is unknown keyboard from Panasonic
2017/08/06
6P6C connector
It is unknown keyboard from Panasonic with Hirose Cherry M8 and 6P6C connector.
Hirose Cheery M8 switches
Pictures:
http://imgur.com/a/GAZE7
Hirose Cheery M8 switches:
https://deskthority.net/wiki/Cherry_M8
@ -28,16 +31,25 @@ The keyboard is comprised of some of 4000 series IC without microcontroller.
||| |decoder|
||| ---------
||| |||||| col[0..7]
ABC vvvvvvv pull down
ABC TC4512 vvvvvvv pull down
---------- <----|+++++++|--100K--+
|data | <----|+++++++|--100K--+
STATE<--|selector| <----|+++++++|--100K--+
| 7 to 1 | <----|+++++++|--100K--+
---------- <----|+++++++|--100K--+
row[0..7] |
8x8 matrix -
GND
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
@ -60,14 +72,23 @@ Matrix
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 hi if any key is active while Reset is hi.
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.

View file

@ -21,25 +21,26 @@ void matrix_init(void)
debug_keyboard = true;
debug_matrix = true;
// PD0:Clock PD1:State PD2:Sense_All PD3:Reset(Scan_All)
DDRD = (1<<3) | (1<<0);
PORTD = (1<<2) | (1<<1);
// 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)
{
// Scan_all resets counter
// TODO: debouce & unplug detect
// Reset counters
RST_HI();
wait_us(10);
// TODO: cannot get reliable value from SENSE()
//uint8_t s = SENSE() | STATE();
//if (!SENSE()) return 0; // no activated key
RST_LO();
wait_us(10);
//if (!s) return 0;
// 8x8 matrix: row:sense, col:drive, key_on:hi
for (uint8_t col = 0; col < 8; col++) {
@ -53,7 +54,7 @@ uint8_t matrix_scan(void)
matrix[row] &= ~(1<<col);
}
// clock lo - next row
// proceed counter - next row
CLK_LO();
wait_us(10);
}

View file

@ -21,6 +21,8 @@
)
#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"))) = {
@ -30,10 +32,26 @@ const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
[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, ENT, UP, F3,
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,
SPC, DOWN, HOME
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
),
*/
};