forked from tmk/tmk_keyboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
195 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FC660C controller | ||
================= | ||
2017/02/24 | ||
|
||
Connector | ||
--------- | ||
### Hirose DF14A-20P-1.25H | ||
[datasheet](http://www.mouser.com/ds/2/185/DF14_catalog-939195.pdf) | ||
|
||
### Pinouts | ||
|
||
|Controller |Switch |Description |ATmega32u4 | ||
|-----------|--------|------------------------------------------|-------------- | ||
| 1 | 20 | +Z7-LV07A-13-~CapsLED | | ||
| 2 | 19 | +Z7-LV07A-11-~InsertLED | | ||
| 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 | ||
| 6 | 15 | +Z3-LVC138A-3-C |PD6 | ||
| 7 | 14 | +Z7-LV07A-3 LV4051A-11-A |PB0 | ||
| 8 | 13 | +Z7-LV07A-1 LV4051A-10-B |PB1 | ||
| 9 | 12 | +Z7-LV07A-5 LV4051A-9-C |PB2 | ||
|10 | 11 | *Z5-LV4051A-6-~EN(Col 8-F) |PB3 | ||
|11 | 10 | *Z4-LV4051A-6-~EN(Col 0-7) |PB4 | ||
|12 | 9 | *Z2-AD5258-4-SDA(I2C) |PD1(TWI) | ||
|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 | | ||
|
||
``` | ||
* 5V intferface | ||
+ 3.3V interface | ||
``` | ||
|
||
|
||
Scan | ||
---- | ||
Row: Drive(LVC138A) | ||
Col: Sense(4051) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include "action.h" | ||
|
||
const action_t actionmaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { | ||
[0] = {}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright 2017 Jun Wako <wakojun@gmail.com> | ||
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/>. | ||
*/ | ||
|
||
#ifndef CONFIG_H | ||
#define CONFIG_H | ||
|
||
|
||
#define VENDOR_ID 0xFEED | ||
#define PRODUCT_ID 0x660C | ||
#define DEVICE_VER 0x0100 | ||
#define MANUFACTURER TMK. | ||
#define PRODUCT FC660C Alt Controller | ||
#define DESCRIPTION TMK. keyboard firmware for FC660C | ||
|
||
|
||
/* matrix size */ | ||
#define MATRIX_ROWS 8 | ||
#define MATRIX_COLS 16 | ||
|
||
|
||
/* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#ifndef FC660C_H | ||
#define FC660C_H | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
#include <avr/io.h> | ||
#include <avr/interrupt.h> | ||
#include <util/delay.h> | ||
|
||
|
||
// Timer resolution check | ||
#if (1000000/TIMER_RAW_FREQ > 20) | ||
# error "Timer resolution(>20us) is not enough for HHKB matrix scan tweak on V-USB." | ||
#endif | ||
|
||
|
||
/* | ||
* HHKB Matrix I/O | ||
* | ||
* row: HC4051[A,B,C] selects scan row0-7 | ||
* row-ext: [En0,En1] row extention for JP | ||
* col: LS145[A,B,C,D] selects scan col0-7 and enable(D) | ||
* key: on: 0/off: 1 | ||
* prev: hysteresis control: assert(1) when previous key state is on | ||
*/ | ||
|
||
|
||
/* | ||
* Pin configuration for ATMega32U4 | ||
* | ||
* Row: PD4-6, 7(~EN) | ||
* Col: PB0-2, 3(Z5 ~EN), 4(Z4 ~EN) | ||
* Key: PC6(pull-uped) | ||
* Hys: PC7 | ||
*/ | ||
static inline void KEY_ENABLE(void) { (PORTD &= ~(1<<7)); } | ||
static inline void KEY_UNABLE(void) { (PORTD |= (1<<7)); } | ||
static inline bool KEY_STATE(void) { return (PINC & (1<<6)); } | ||
static inline void KEY_HYS_ON(void) { (PORTC |= (1<<7)); } | ||
static inline void KEY_HYS_OFF(void) { (PORTC &= ~(1<<7)); } | ||
static inline void KEY_INIT(void) | ||
{ | ||
/* Col */ | ||
DDRB |= 0x1F; | ||
/* Key: input with pull-up */ | ||
DDRC &= ~(1<<6); | ||
PORTC |= (1<<6); | ||
/* Hys */ | ||
DDRC |= (1<<7); | ||
/* Row */ | ||
DDRD |= 0xF0; | ||
|
||
KEY_UNABLE(); | ||
KEY_HYS_OFF(); | ||
} | ||
static inline void SET_ROW(uint8_t ROW) | ||
{ | ||
// set row with unabling key | ||
PORTD = (PORTD & 0x0F) | (1<<7) | ((ROW & 0x07) << 4); | ||
} | ||
static inline void SET_COL(uint8_t COL) | ||
{ | ||
// |PB3(Z5 ~EN)|PB4(Z4 ~EN) | ||
// --------|-----------|----------- | ||
// Col:0-7 |high |low | ||
// Col:8-F |low |high | ||
PORTB = (PORTB & 0xE0) | ((COL & 0x08) ? 1<<4 : 1<<3) | (COL & 0x07); | ||
} | ||
|
||
#endif |