From: tmk Date: Sun, 5 Mar 2017 23:40:36 +0000 (+0900) Subject: fc660c: Emulates fc660c default keymap X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=5d7ee9d906ae100e9f10b0a8ef20545f1d8c58b1;p=max%2Ftmk_keyboard.git fc660c: Emulates fc660c default keymap --- diff --git a/keyboard/fc660c/README.md b/keyboard/fc660c/README.md index 365cbf7e..3b46dae9 100644 --- a/keyboard/fc660c/README.md +++ b/keyboard/fc660c/README.md @@ -8,11 +8,12 @@ Connector [datasheet](http://www.mouser.com/ds/2/185/DF14_catalog-939195.pdf) ### Pinouts +LV07A and LVC138A are 5V-tolerant, the keyboard will work only with 5V power. |Controller |Switch |Description |ATmega32u4 |-----------|--------|------------------------------------------|-------------- - | 1 | 20 | +Z7-LV07A-13-~CapsLED | - | 2 | 19 | +Z7-LV07A-11-~InsertLED | + | 1 | 20 | +Z7-LV07A-13-~CapsLED |PB6 + | 2 | 19 | +Z7-LV07A-11-~InsertLED |PB7 | 3 | 18 | +Z3-LVC138A-4-~G2A Z6-TP1684-5-~EN |PD7 | 4 | 17 | +Z3-LVC138A-3-A |PD4 | 5 | 16 | +Z3-LVC138A-3-B |PD5 @@ -26,11 +27,11 @@ Connector |13 | 8 | *Z2-AD5258-5-SDL(I2C) |PD0(TWI) |14 | 7 | *Z6-TP1684-2-KEY(i) |PC6 |15 | 6 | *Z6-TP1684-4-HYS(o) |PC7 - |16 | 5 | 5V | - |17 | 4 | 3.3V | - |18 | 3 | GND | - |19 | 2 | GND | - |20 | 1 | FG | + |16 | 5 | 5V |5V + |17 | 4 | 3.3V |5V + |18 | 3 | GND |GND + |19 | 2 | GND |GND + |20 | 1 | FG |GND ``` * 5V intferface @@ -39,6 +40,7 @@ Connector Key Matrix ---------- +Row5-7 has no key, you can omit scaning those. Topre original controller scans those rows for some reason. | |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |A |B |C |D |E |F | |----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----| @@ -56,3 +58,8 @@ Scan ---- Row: Drive(LVC138A) Col: Sense(4051) + + +Resources +--------- +- Pics https://imgur.com/a/4UKkZ diff --git a/keyboard/fc660c/actionmap.c b/keyboard/fc660c/actionmap.c index eefbc776..e153cc11 100644 --- a/keyboard/fc660c/actionmap.c +++ b/keyboard/fc660c/actionmap.c @@ -1,5 +1,7 @@ #include "action.h" #include "actionmap.h" +#include "hook.h" + #define AMAP( \ K13, K10, K11, K12, K14, K16, K17, K15, K1B, K18, K19, K1A, K1C, K1E, K1F, \ @@ -26,21 +28,59 @@ AC_NO, AC_NO, AC_NO, AC_NO, AC_NO, AC_NO, AC_NO, AC_NO } \ } -#define AC_L1 ACTION_LAYER_MOMENTARY(1) +#define AC_L3 ACTION_LAYER_MOMENTARY(3) +#define AC_L4 ACTION_LAYER_MOMENTARY(4) +#define AC_LS_2 ACTION_LAYER_MODS(2, MOD_LSFT) +#define AC_RS_2 ACTION_LAYER_MODS(2, MOD_RSFT) +#define AC_TGL1 ACTION_LAYER_TOGGLE(1) + +// emulates FC660C default keymap const action_t actionmaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { [0] = AMAP( \ ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP, \ - LCTL,LGUI,LALT, SPC, RALT,RCTL,L1, LEFT,DOWN,RGHT \ + LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ + LS_2,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RS_2,UP, \ + LCTL,LGUI,LALT, SPC, RALT,RCTL,L3, LEFT,DOWN,RGHT \ ), [1] = AMAP( \ + GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, \ + LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \ + LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP, \ + LCTL,LGUI,LALT, SPC, RALT,RCTL,L4, LEFT,DOWN,RGHT \ + ), + [2] = AMAP( \ + GRV, 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,TRNS \ + ), + [3] = AMAP( \ GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,TRNS,TRNS, TRNS, \ + CAPS,TGL1,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,TRNS,TRNS, TRNS, \ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,TRNS, TRNS,PGUP, \ - TRNS,TRNS,TRNS, TRNS, TRNS,APP, TRNS, HOME,PGDN,END \ - ) + TRNS,TRNS,TRNS, TRNS, TRNS,APP, L3, HOME,PGDN,END \ + ), + [4] = AMAP( \ + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, \ + CAPS,TGL1,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,TRNS,TRNS, TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,TRNS,TRNS, TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,TRNS, TRNS,PGUP, \ + TRNS,TRNS,TRNS, TRNS, TRNS,APP, L4, HOME,PGDN,END \ + ), }; + + +void hook_layer_change(uint32_t layer_state) +{ + // lights LED on Insert when layer 1 is enabled + if (layer_state & (1L<<1)) { + PORTB &= ~(1<<7); + } else { + PORTB |= (1<<7); + } +}