@@ -43,8 +43,6 @@ This is a C header file that is one of the first things included, and will persi | |||
* generally who/whatever brand produced the board | |||
* `#define PRODUCT Board` | |||
* the name of the keyboard | |||
* `#define DESCRIPTION a keyboard` | |||
* a short description of what the keyboard is | |||
* `#define MATRIX_ROWS 5` | |||
* the number of rows in your keyboard's matrix | |||
* `#define MATRIX_COLS 15` |
@@ -67,7 +67,7 @@ El archivo `config.h` es donde configuras el hardware y el conjunto de caracter | |||
En la parte superior de `config.h` encontrarás ajustes relacionados con USB. Estos controlan la apariencia de tu teclado en el Sistema Operativo. Si no tienes una buena razón para cambiar debes dejar el `VENDOR_ID` como `0xFEED`. Para el `PRODUCT_ID` debes seleccionar un número que todavía no esté en uso. | |||
Cambia las líneas de `MANUFACTURER`, `PRODUCT`, y `DESCRIPTION` para reflejar con precisión tu teclado. | |||
Cambia las líneas de `MANUFACTURER` y `PRODUCT` para reflejar con precisión tu teclado. | |||
```c | |||
#define VENDOR_ID 0xFEED | |||
@@ -75,7 +75,6 @@ Cambia las líneas de `MANUFACTURER`, `PRODUCT`, y `DESCRIPTION` para reflejar c | |||
#define DEVICE_VER 0x0001 | |||
#define MANUFACTURER Tú | |||
#define PRODUCT mi_teclado_fantastico | |||
#define DESCRIPTION Un teclado personalizado | |||
``` | |||
?> Windows y macOS mostrarán el `MANUFACTURER` y `PRODUCT` en la lista de dispositivos USB. `lsusb` en Linux toma estos de la lista mantenida por el [Repositorio de ID USB](http://www.linux-usb.org/usb-ids.html) por defecto. `lsusb -v` mostrará los valores reportados por el dispositivo, y también están presentes en los registros del núcleo después de conectarlo. |
@@ -67,7 +67,7 @@ The `config.h` file is where you configure the hardware and feature set for your | |||
At the top of the `config.h` you'll find USB related settings. These control how your keyboard appears to the Operating System. If you don't have a good reason to change you should leave the `VENDOR_ID` as `0xFEED`. For the `PRODUCT_ID` you should pick a number that is not yet in use. | |||
Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard. | |||
Do change the `MANUFACTURER` and `PRODUCT` lines to accurately reflect your keyboard. | |||
```c | |||
#define VENDOR_ID 0xFEED | |||
@@ -75,7 +75,6 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r | |||
#define DEVICE_VER 0x0001 | |||
#define MANUFACTURER You | |||
#define PRODUCT my_awesome_keyboard | |||
#define DESCRIPTION A custom keyboard | |||
``` | |||
?> Windows and macOS will display the `MANUFACTURER` and `PRODUCT` in the list of USB devices. `lsusb` on Linux instead takes these from the list maintained by the [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. `lsusb -v` will show the values reported by the device, and they are also present in kernel logs after plugging it in. |
@@ -48,8 +48,6 @@ QMK での全ての利用可能な設定にはデフォルトがあります。 | |||
* 一般的に、誰もしくはどのブランドがボードを作成したか | |||
* `#define PRODUCT Board` | |||
* キーボードの名前 | |||
* `#define DESCRIPTION a keyboard` | |||
* キーボードの簡単な説明 | |||
* `#define MATRIX_ROWS 5` | |||
* キーボードのマトリックスの行の数 | |||
* `#define MATRIX_COLS 15` |
@@ -73,7 +73,7 @@ or open the directory in your favourite text editor. | |||
`config.h` の先頭には USB に関する設定があります。これらはキーボードが OS からどのように見えるかを制御しています。変更する理由がない場合は、`VENDOR_ID` を `0xFEED` のままにしておく必要があります。`PRODUCT_ID` にはまだ使用されていない番号を選ばなければいけません。 | |||
`MANUFACTURER`、 `PRODUCT`、 `DESCRIPTION` をキーボードにあった設定に変更します。 | |||
`MANUFACTURER`、 `PRODUCT` をキーボードにあった設定に変更します。 | |||
```c | |||
#define VENDOR_ID 0xFEED | |||
@@ -81,7 +81,6 @@ or open the directory in your favourite text editor. | |||
#define DEVICE_VER 0x0001 | |||
#define MANUFACTURER You | |||
#define PRODUCT my_awesome_keyboard | |||
#define DESCRIPTION A custom keyboard | |||
``` | |||
?> Windows や macOS では、`MANUFACTURER` と `PRODUCT` が USBデバイスのリストに表示されます。Linux 上の `lsusb` では、代わりにデフォルトで [USB ID Repository](http://www.linux-usb.org/usb-ids.html) によって維持されているリストからこれらを取得します。`lsusb -v` を使用するとデバイスから示された値を表示します。また、接続したときのカーネルログにも表示されます。 |
@@ -77,7 +77,6 @@ def _extract_config_h(info_data): | |||
'device_ver': config_c.get('DEVICE_VER'), | |||
'manufacturer': config_c.get('MANUFACTURER'), | |||
'product': config_c.get('PRODUCT'), | |||
'description': config_c.get('DESCRIPTION'), | |||
} | |||
return info_data |
@@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
#define DEVICE_VER 0x0001 | |||
#define MANUFACTURER %YOUR_NAME% | |||
#define PRODUCT %KEYBOARD% | |||
#define DESCRIPTION A custom keyboard | |||
/* key matrix size */ | |||
#define MATRIX_ROWS 2 |
@@ -25,7 +25,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
#define DEVICE_VER 0x0001 | |||
#define MANUFACTURER %YOUR_NAME% | |||
#define PRODUCT %KEYBOARD% | |||
#define DESCRIPTION A custom keyboard | |||
/* key matrix size */ | |||
#define MATRIX_ROWS 8 |
@@ -141,7 +141,6 @@ static void command_common_help(void) { | |||
static void print_version(void) { | |||
// print version & information | |||
print("\n\t- Version -\n"); | |||
print("DESC: " STR(DESCRIPTION) "\n"); | |||
print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " | |||
"PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " | |||
"VER: " STR(DEVICE_VER) "\n"); |
@@ -1,126 +0,0 @@ | |||
#---------------------------------------------------------------------------- | |||
# On command line: | |||
# | |||
# make all = Make software. | |||
# | |||
# make clean = Clean out built project files. | |||
# | |||
# make coff = Convert ELF to AVR COFF. | |||
# | |||
# make extcoff = Convert ELF to AVR Extended COFF. | |||
# | |||
# make program = Download the hex file to the device. | |||
# Please customize your programmer settings(PROGRAM_CMD) | |||
# | |||
# make teensy = Download the hex file to the device, using teensy_loader_cli. | |||
# (must have teensy_loader_cli installed). | |||
# | |||
# make dfu = Download the hex file to the device, using dfu-programmer (must | |||
# have dfu-programmer installed). | |||
# | |||
# make flip = Download the hex file to the device, using Atmel FLIP (must | |||
# have Atmel FLIP installed). | |||
# | |||
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer | |||
# (must have dfu-programmer installed). | |||
# | |||
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP | |||
# (must have Atmel FLIP installed). | |||
# | |||
# make debug = Start either simulavr or avarice as specified for debugging, | |||
# with avr-gdb or avr-insight as the front end for debugging. | |||
# | |||
# make filename.s = Just compile filename.c into the assembler code only. | |||
# | |||
# make filename.i = Create a preprocessed source file for use in submitting | |||
# bug reports to the GCC project. | |||
# | |||
# To rebuild project do "make clean" then "make all". | |||
#---------------------------------------------------------------------------- | |||
# Target file name (without extension). | |||
TARGET = usb_hid_test | |||
TMK_DIR = ../../.. | |||
# Directory keyboard dependent files exist | |||
TARGET_DIR = . | |||
# MCU name | |||
MCU = atmega32u4 | |||
# Processor frequency. | |||
# This will define a symbol, F_CPU, in all source code files equal to the | |||
# processor frequency in Hz. You can then use this symbol in your source code to | |||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done | |||
# automatically to create a 32-bit value in your source code. | |||
# | |||
# This will be an integer division of F_USB below, as it is sourced by | |||
# F_USB after it has run through any CPU prescalers. Note that this value | |||
# does not *change* the processor frequency - it should merely be updated to | |||
# reflect the processor speed set externally so that the code can use accurate | |||
# software delays. | |||
F_CPU = 16000000 | |||
# | |||
# LUFA specific | |||
# | |||
# Target architecture (see library "Board Types" documentation). | |||
ARCH = AVR8 | |||
# Input clock frequency. | |||
# This will define a symbol, F_USB, in all source code files equal to the | |||
# input clock frequency (before any prescaling is performed) in Hz. This value may | |||
# differ from F_CPU if prescaling is used on the latter, and is required as the | |||
# raw input clock is fed directly to the PLL sections of the AVR for high speed | |||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | |||
# at the end, this will be done automatically to create a 32-bit value in your | |||
# source code. | |||
# | |||
# If no clock division is performed on the input clock inside the AVR (via the | |||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | |||
F_USB = $(F_CPU) | |||
# Interrupt driven control endpoint task | |||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | |||
# Build Options | |||
# comment out to disable the options. | |||
# | |||
# Console for debug | |||
OPT_DEFS += -DCONSOLE_ENABLE | |||
# Boot Section Size in bytes | |||
# Teensy halfKay 512 | |||
# Atmel DFU loader 4096 | |||
# LUFA bootloader 4096 | |||
#OPT_DEFS += -DBOOT_SIZE=4096 | |||
SRC = test.cpp | |||
SRC += common/debug.c | |||
SRC += common/print.c | |||
CONFIG_H = config.h | |||
# Search Path | |||
VPATH += $(TARGET_DIR) | |||
VPATH += $(TMK_DIR) | |||
VPATH += $(TMK_DIR)/common | |||
# program Leonardo | |||
PROGRAM_CMD = avrdude -p$(MCU) -cavr109 -P$(DEV) -b57600 -Uflash:w:$(TARGET).hex | |||
include $(TMK_DIR)/protocol/usb_hid.mk | |||
include $(TMK_DIR)/protocol/lufa.mk | |||
include $(TMK_DIR)/rules.mk |
@@ -1,30 +0,0 @@ | |||
/* | |||
Copyright 2012 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/>. | |||
*/ | |||
#pragma once | |||
#define VENDOR_ID 0xFEED | |||
#define PRODUCT_ID 0xCAFE | |||
#define DEVICE_VER 0x0814 | |||
#define MANUFACTURER t.m.k. | |||
#define PRODUCT USB to USB keyboard converter | |||
#define DESCRIPTION Product from t.m.k. keyboard firmware project | |||
/* matrix size */ | |||
#define MATRIX_ROWS 32 | |||
#define MATRIX_COLS 8 |
@@ -1,92 +0,0 @@ | |||
#include <avr/io.h> | |||
#include <avr/wdt.h> | |||
#include <avr/power.h> | |||
#include <util/delay.h> | |||
#include <Arduino.h> | |||
// USB HID host | |||
#include "Usb.h" | |||
#include "hid.h" | |||
#include "hidboot.h" | |||
#include "parser.h" | |||
// LUFA | |||
#include "lufa.h" | |||
#include "debug.h" | |||
#include "leonardo_led.h" | |||
static USB usb_host; | |||
static HIDBoot<HID_PROTOCOL_KEYBOARD> kbd(&usb_host); | |||
static KBDReportParser kbd_parser; | |||
static void LUFA_setup(void) | |||
{ | |||
/* Disable watchdog if enabled by bootloader/fuses */ | |||
MCUSR &= ~(1 << WDRF); | |||
wdt_disable(); | |||
/* Disable clock division */ | |||
clock_prescale_set(clock_div_1); | |||
// Leonardo needs. Without this USB device is not recognized. | |||
USB_Disable(); | |||
USB_Init(); | |||
// for Console_Task | |||
USB_Device_EnableSOFEvents(); | |||
} | |||
static void HID_setup() | |||
{ | |||
// Arduino Timer startup: wiring.c | |||
init(); | |||
if (usb_host.Init() == -1) { | |||
debug("HID init: failed\n"); | |||
LED_TX_OFF; | |||
} | |||
_delay_ms(200); | |||
kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser); | |||
} | |||
int main(void) | |||
{ | |||
// LED for debug | |||
LED_TX_INIT; | |||
LED_TX_ON; | |||
print_enable = true; | |||
debug_enable = true; | |||
debug_matrix = true; | |||
debug_keyboard = true; | |||
debug_mouse = true; | |||
LUFA_setup(); | |||
sei(); | |||
// wait for startup of sendchar routine | |||
while (USB_DeviceState != DEVICE_STATE_Configured) ; | |||
if (debug_enable) { | |||
_delay_ms(1000); | |||
} | |||
HID_setup(); | |||
debug("init: done\n"); | |||
for (;;) { | |||
usb_host.Task(); | |||
#if !defined(INTERRUPT_CONTROL_ENDPOINT) | |||
// LUFA Task for control request | |||
USB_USBTask(); | |||
#endif | |||
} | |||
return 0; | |||
} |
@@ -67,7 +67,6 @@ Start Your Own Project | |||
#define PRODUCT_ID 0xBEEF | |||
#define MANUFACTURER t.m.k. | |||
#define PRODUCT Macway mod | |||
#define DESCRIPTION t.m.k. keyboard firmware for Macway mod | |||
#### 2. Keyboard matrix configuration | |||
#define MATRIX_ROWS 8 |