Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9456832a3b | ||
|
|
78e060f55a | ||
|
|
c53d4ecf32 | ||
|
|
6a165c41cb | ||
|
|
387c486e57 | ||
|
|
a624c439a4 | ||
|
|
fba9971555 | ||
|
|
310b2f1be4 | ||
|
|
1fed214490 | ||
|
|
f4c1e066ba | ||
|
|
4b7d46ced0 | ||
|
|
cabe4dfa72 | ||
|
|
5279571e41 | ||
|
|
9398c11b51 | ||
|
|
89c528e443 | ||
|
|
8f333138f5 | ||
|
|
35c4dbe688 | ||
|
|
c3200aa8fc | ||
|
|
6052aa499e | ||
|
|
2fe288d01d | ||
|
|
b6e23f974b | ||
|
|
174a15d07d | ||
|
|
5ab0eeb513 |
No files matched your search
@@ -78,7 +78,7 @@ This is a C header file that is one of the first things included, and will persi
|
|||||||
* `#define BACKLIGHT_PIN B7`
|
* `#define BACKLIGHT_PIN B7`
|
||||||
* pin of the backlight
|
* pin of the backlight
|
||||||
* `#define BACKLIGHT_LEVELS 3`
|
* `#define BACKLIGHT_LEVELS 3`
|
||||||
* number of levels your backlight will have (maximum 15 excluding off)
|
* number of levels your backlight will have (maximum 31 excluding off)
|
||||||
* `#define BACKLIGHT_BREATHING`
|
* `#define BACKLIGHT_BREATHING`
|
||||||
* enables backlight breathing
|
* enables backlight breathing
|
||||||
* `#define BREATHING_PERIOD 6`
|
* `#define BREATHING_PERIOD 6`
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ void oled_task_user(void) {
|
|||||||
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|
||||||
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|
||||||
|`OLED_FONT_START` |`0` |The starting characer index for custom fonts |
|
|`OLED_FONT_START` |`0` |The starting characer index for custom fonts |
|
||||||
|`OLED_FONT_END` |`224` |The ending characer index for custom fonts |
|
|`OLED_FONT_END` |`223` |The ending characer index for custom fonts |
|
||||||
|`OLED_FONT_WIDTH` |`6` |The font width |
|
|`OLED_FONT_WIDTH` |`6` |The font width |
|
||||||
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|
||||||
|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|
|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
|
|||||||
* `#define BACKLIGHT_PIN B7`
|
* `#define BACKLIGHT_PIN B7`
|
||||||
* バックライトのピン
|
* バックライトのピン
|
||||||
* `#define BACKLIGHT_LEVELS 3`
|
* `#define BACKLIGHT_LEVELS 3`
|
||||||
* バックライトのレベル数 (off を除いて最大15)
|
* バックライトのレベル数 (off を除いて最大31)
|
||||||
* `#define BACKLIGHT_BREATHING`
|
* `#define BACKLIGHT_BREATHING`
|
||||||
* バックライトのブレスを有効にします
|
* バックライトのブレスを有効にします
|
||||||
* `#define BREATHING_PERIOD 6`
|
* `#define BREATHING_PERIOD 6`
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ To configure a keyboard where each switch is connected to a separate pin and gro
|
|||||||
|
|
||||||
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
|
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
|
||||||
|
|
||||||
`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
|
`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 31, and they are computed automatically from this number.
|
||||||
|
|
||||||
## `/keyboards/<keyboard>/Makefile`
|
## `/keyboards/<keyboard>/Makefile`
|
||||||
|
|
||||||
|
|||||||
+40
-14
@@ -3,30 +3,41 @@
|
|||||||
* [构建你的第一个固件](zh-cn/newbs_building_firmware.md)
|
* [构建你的第一个固件](zh-cn/newbs_building_firmware.md)
|
||||||
* [刷新固件](zh-cn/newbs_flashing.md)
|
* [刷新固件](zh-cn/newbs_flashing.md)
|
||||||
* [测试和调试](zh-cn/newbs_testing_debugging.md)
|
* [测试和调试](zh-cn/newbs_testing_debugging.md)
|
||||||
* [Git最佳实践](zh-cn/newbs_best_practices.md)
|
* [Git最佳实践](zh-cn/newbs_git_best_practices.md)
|
||||||
|
* [使用你分叉(fork)的主分支(master)](zh-cn/newbs_git_using_your_master_branch.md)
|
||||||
|
* [解决合并冲突](zh-cn/newbs_git_resolving_merge_conflicts.md)
|
||||||
|
* [重新同步一个分支](zh-cn/newbs_git_resynchronize_a_branch.md)
|
||||||
* [学习资源](zh-cn/newbs_learn_more_resources.md)
|
* [学习资源](zh-cn/newbs_learn_more_resources.md)
|
||||||
|
|
||||||
* [QMK基础](zh-cn/README.md)
|
* [QMK基础](zh-cn/README.md)
|
||||||
* [QMK简介](zh-cn/getting_started_introduction.md)
|
* [QMK简介](zh-cn/getting_started_introduction.md)
|
||||||
* [向QMK贡献](zh-cn/contributing.md)
|
* [QMK命令行工具](zh-cn/cli.md)
|
||||||
|
* [QMK命令行工具配置](zh-cn/cli_configuration.md)
|
||||||
|
* [向QMK贡献代码](zh-cn/contributing.md)
|
||||||
* [如何使用Github](zh-cn/getting_started_github.md)
|
* [如何使用Github](zh-cn/getting_started_github.md)
|
||||||
* [获得帮助](zh-cn/getting_started_getting_help.md)
|
* [获得帮助](zh-cn/getting_started_getting_help.md)
|
||||||
|
|
||||||
* [问题解答](zh-cn/faq.md)
|
* [非兼容性修改](zh-cn/breaking_changes.md)
|
||||||
|
* [我的PR已经被标记为非兼容性修改](zh-cn/breaking_changes_instructions.md)
|
||||||
|
* [2019年8月30日](zh-cn/ChangeLog/20190830.md)
|
||||||
|
|
||||||
|
* [问题与解答](zh-cn/faq.md)
|
||||||
* [一般问题](zh-cn/faq_general.md)
|
* [一般问题](zh-cn/faq_general.md)
|
||||||
* [构建/编译](zh-cn/faq_build.md)
|
* [构建/编译](zh-cn/faq_build.md)
|
||||||
* [调试/故障排除](zh-cn/faq_debug.md)
|
* [调试/故障排除](zh-cn/faq_debug.md)
|
||||||
* [键盘映射](zh-cn/faq_keymap.md)
|
* [布局](zh-cn/faq_keymap.md)
|
||||||
|
* [Zadig驱动安装](zh-cn/driver_installation_zadig.md)
|
||||||
|
|
||||||
* 详细指南
|
* 详细指南
|
||||||
* [安装构建工具](zh-cn/getting_started_build_tools.md)
|
* [安装构建工具](zh-cn/getting_started_build_tools.md)
|
||||||
* [vagrant指南](zh-cn/getting_started_vagrant.md)
|
* [vagrant指南](zh-cn/getting_started_vagrant.md)
|
||||||
* [构建/编译指令](zh-cn/getting_started_make_guide.md)
|
* [构建/编译指南](zh-cn/getting_started_make_guide.md)
|
||||||
* [刷新固件](zh-cn/flashing.md)
|
* [刷新固件](zh-cn/flashing.md)
|
||||||
* [定制功能](zh-cn/custom_quantum_functions.md)
|
* [定制功能](zh-cn/custom_quantum_functions.md)
|
||||||
* [映射概述](zh-cn/keymap.md)
|
* [布局概述](zh-cn/keymap.md)
|
||||||
|
|
||||||
* [硬件](zh-cn/hardware.md)
|
* [硬件](zh-cn/hardware.md)
|
||||||
|
* [兼容的单片机](zh-cn/compatible_microcontrollers.md)
|
||||||
* [AVR处理器](zh-cn/hardware_avr.md)
|
* [AVR处理器](zh-cn/hardware_avr.md)
|
||||||
* [驱动](zh-cn/hardware_drivers.md)
|
* [驱动](zh-cn/hardware_drivers.md)
|
||||||
|
|
||||||
@@ -34,13 +45,16 @@
|
|||||||
* [键盘指南](zh-cn/hardware_keyboard_guidelines.md)
|
* [键盘指南](zh-cn/hardware_keyboard_guidelines.md)
|
||||||
* [配置选项](zh-cn/config_options.md)
|
* [配置选项](zh-cn/config_options.md)
|
||||||
* [键码](zh-cn/keycodes.md)
|
* [键码](zh-cn/keycodes.md)
|
||||||
* [记录最佳实践](zh-cn/documentation_best_practices.md)
|
* [代码书写规范 - C](zh-cn/coding_conventions_c.md)
|
||||||
|
* [代码书写规范 - Python](zh-cn/coding_conventions_python.md)
|
||||||
|
* [文档书写规范](zh-cn/documentation_best_practices.md)
|
||||||
* [文档模板](zh-cn/documentation_templates.md)
|
* [文档模板](zh-cn/documentation_templates.md)
|
||||||
* [术语表](zh-cn/reference_glossary.md)
|
* [术语表](zh-cn/reference_glossary.md)
|
||||||
* [单元测试](zh-cn/unit_testing.md)
|
* [单元测试](zh-cn/unit_testing.md)
|
||||||
* [有用的功能](zh-cn/ref_functions.md)
|
* [实用函数](zh-cn/ref_functions.md)
|
||||||
* [配置器支持](zh-cn/reference_configurator_support.md)
|
* [配置器支持](zh-cn/reference_configurator_support.md)
|
||||||
* [info.json 格式](zh-cn/reference_info_json.md)
|
* [info.json 格式](zh-cn/reference_info_json.md)
|
||||||
|
* [Python 命令行开发](zh-cn/cli_development.md)
|
||||||
|
|
||||||
* [特性](zh-cn/features.md)
|
* [特性](zh-cn/features.md)
|
||||||
* [基本键码](zh-cn/keycodes_basic.md)
|
* [基本键码](zh-cn/keycodes_basic.md)
|
||||||
@@ -54,22 +68,27 @@
|
|||||||
* [热改键](zh-cn/feature_bootmagic.md)
|
* [热改键](zh-cn/feature_bootmagic.md)
|
||||||
* [组合](zh-cn/feature_combo)
|
* [组合](zh-cn/feature_combo)
|
||||||
* [命令](zh-cn/feature_command.md)
|
* [命令](zh-cn/feature_command.md)
|
||||||
|
* [消抖 API](zh-cn/feature_debounce_type.md)
|
||||||
* [拨动开关](zh-cn/feature_dip_switch.md)
|
* [拨动开关](zh-cn/feature_dip_switch.md)
|
||||||
* [动态宏指令](zh-cn/feature_dynamic_macros.md)
|
* [动态宏指令](zh-cn/feature_dynamic_macros.md)
|
||||||
* [编码器](zh-cn/feature_encoders.md)
|
* [编码器](zh-cn/feature_encoders.md)
|
||||||
* [重音号Esc复合键](zh-cn/feature_grave_esc.md)
|
* [重音号Esc复合键](zh-cn/feature_grave_esc.md)
|
||||||
|
* [触摸反馈](zh-cn/feature_haptic_feedback.md)
|
||||||
|
* [HD44780 LCD控制器](zh-cn/feature_hd44780.md)
|
||||||
* [自锁键](zh-cn/feature_key_lock.md)
|
* [自锁键](zh-cn/feature_key_lock.md)
|
||||||
* [布局](zh-cn/feature_layouts.md)
|
* [布局](zh-cn/feature_layouts.md)
|
||||||
* [前导键](zh-cn/feature_leader_key.md)
|
* [前导键](zh-cn/feature_leader_key.md)
|
||||||
* [LED阵列](zh-cn/feature_led_matrix.md)
|
* [LED阵列](zh-cn/feature_led_matrix.md)
|
||||||
* [宏指令](zh-cn/feature_macros.md)
|
* [宏指令](zh-cn/feature_macros.md)
|
||||||
* [鼠标键](zh-cn/feature_mouse_keys.md)
|
* [鼠标键](zh-cn/feature_mouse_keys.md)
|
||||||
|
* [OLED驱动](zh-cn/feature_oled_driver.md)
|
||||||
* [一键功能](zh-cn/feature_advanced_keycodes.md#one-shot-keys)
|
* [一键功能](zh-cn/feature_advanced_keycodes.md#one-shot-keys)
|
||||||
* [指针设备](zh-cn/feature_pointing_device.md)
|
* [指针设备](zh-cn/feature_pointing_device.md)
|
||||||
* [PS/2鼠标](zh-cn/feature_ps2_mouse.md)
|
* [PS/2鼠标](zh-cn/feature_ps2_mouse.md)
|
||||||
* [RGB灯光](zh-cn/feature_rgblight.md)
|
* [RGB灯光](zh-cn/feature_rgblight.md)
|
||||||
* [RGB矩阵](zh-cn/feature_rgb_matrix.md)
|
* [RGB矩阵](zh-cn/feature_rgb_matrix.md)
|
||||||
* [空格候补换挡](zh-cn/feature_space_cadet.md)
|
* [空格候补换挡](zh-cn/feature_space_cadet.md)
|
||||||
|
* [分体键盘](zh-cn/feature_split_keyboard.md)
|
||||||
* [速录机](zh-cn/feature_stenography.md)
|
* [速录机](zh-cn/feature_stenography.md)
|
||||||
* [换手](zh-cn/feature_swap_hands.md)
|
* [换手](zh-cn/feature_swap_hands.md)
|
||||||
* [多击键](zh-cn/feature_tap_dance.md)
|
* [多击键](zh-cn/feature_tap_dance.md)
|
||||||
@@ -79,28 +98,35 @@
|
|||||||
* [用户空间](zh-cn/feature_userspace.md)
|
* [用户空间](zh-cn/feature_userspace.md)
|
||||||
* [速度键](zh-cn/feature_velocikey.md)
|
* [速度键](zh-cn/feature_velocikey.md)
|
||||||
|
|
||||||
* 针对制造者和定制者
|
* 制造和定制者指南
|
||||||
* [手工连线指南](zh-cn/hand_wire.md)
|
* [手工连线指南](zh-cn/hand_wire.md)
|
||||||
* [ISP刷新指南](zh-cn/isp_flashing_guide.md)
|
* [ISP刷新指南](zh-cn/isp_flashing_guide.md)
|
||||||
* [ARM调试指南](zh-cn/arm_debugging.md)
|
* [ARM调试指南](zh-cn/arm_debugging.md)
|
||||||
* [I2C驱动](zh-cn/i2c_driver.md)
|
* [ADC设备](zh-cn/adc_driver.md)
|
||||||
* [GPIO控制器](zh-cn/internals_gpio_control.md)
|
* [I2C设备](zh-cn/i2c_driver.md)
|
||||||
|
* [WS2812设备](zh-cn/ws2812_driver.md)
|
||||||
|
* [EEPROM设备](zh-cn/eeprom_driver.md)
|
||||||
|
* [GPIO控制](zh-cn/internals_gpio_control.md)
|
||||||
|
* [自定义键盘矩阵](zh-cn/custom_matrix.md)
|
||||||
* [Proton C转换](zh-cn/proton_c_conversion.md)
|
* [Proton C转换](zh-cn/proton_c_conversion.md)
|
||||||
|
|
||||||
* 深入了解
|
* 深入了解
|
||||||
* [键盘如何工作](zh-cn/how_keyboards_work.md)
|
* [键盘工作原理](zh-cn/how_keyboards_work.md)
|
||||||
* [理解QMK](zh-cn/understanding_qmk.md)
|
* [深入了解QMK](zh-cn/understanding_qmk.md)
|
||||||
|
|
||||||
* 其他话题
|
* 其他话题
|
||||||
* [使用Eclipse开发QMK](zh-cn/other_eclipse.md)
|
* [使用Eclipse开发QMK](zh-cn/other_eclipse.md)
|
||||||
* [使用VSCode开发QMK](zh-cn/other_vscode.md)
|
* [使用VSCode开发QMK](zh-cn/other_vscode.md)
|
||||||
* [支持](zh-cn/support.md)
|
* [支持](zh-cn/support.md)
|
||||||
|
* [翻译QMK文档](zh-cn/translating.md)
|
||||||
|
|
||||||
* QMK 内构 (正在编写)
|
* QMK 内构 (正在编写)
|
||||||
* [定义](zh-cn/internals_defines.md)
|
* [定义](zh-cn/internals_defines.md)
|
||||||
* [输入回调寄存器](zh-cn/internals_input_callback_reg.md)
|
* [输入回调寄存器](zh-cn/internals_input_callback_reg.md)
|
||||||
* [Midi设备](zh-cn/internals_midi_device.md)
|
* [Midi设备](zh-cn/internals_midi_device.md)
|
||||||
* [Midi设备设置过程](zh-cn/internals_midi_device_setup_process.md)
|
* [Midi设备配置过程](zh-cn/internals_midi_device_setup_process.md)
|
||||||
* [Midi工具库](zh-cn/internals_midi_util.md)
|
* [Midi工具库](zh-cn/internals_midi_util.md)
|
||||||
* [发送函数](zh-cn/internals_send_functions.md)
|
* [发送函数](zh-cn/internals_send_functions.md)
|
||||||
* [Sysex工具](zh-cn/internals_sysex_tools.md)
|
* [Sysex工具](zh-cn/internals_sysex_tools.md)
|
||||||
|
<!--fromen:20200126-6:03AM(GMT+8)-->
|
||||||
|
<!--cn:20200211-11:04AM(GMT+8)-->
|
||||||
@@ -6,7 +6,6 @@ tmk_core/protocol/lufa
|
|||||||
tmk_core/protocol/midi
|
tmk_core/protocol/midi
|
||||||
tmk_core/protocol/midi/bytequeue
|
tmk_core/protocol/midi/bytequeue
|
||||||
tmk_core/protocol/midi/Config
|
tmk_core/protocol/midi/Config
|
||||||
tmk_core/protocol/pjrc
|
|
||||||
tmk_core/protocol/usb_hid
|
tmk_core/protocol/usb_hid
|
||||||
tmk_core/protocol/vusb
|
tmk_core/protocol/vusb
|
||||||
tmk_core/tool
|
tmk_core/tool
|
||||||
|
|||||||
@@ -392,6 +392,8 @@ void oled_write_char(const char data, bool invert) {
|
|||||||
static uint8_t oled_temp_buffer[OLED_FONT_WIDTH];
|
static uint8_t oled_temp_buffer[OLED_FONT_WIDTH];
|
||||||
memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH);
|
memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH);
|
||||||
|
|
||||||
|
_Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array");
|
||||||
|
|
||||||
// set the reder buffer data
|
// set the reder buffer data
|
||||||
uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index
|
uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index
|
||||||
if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) {
|
if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) {
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#endif
|
#endif
|
||||||
// unsigned char value of the last character in the font file
|
// unsigned char value of the last character in the font file
|
||||||
#if !defined(OLED_FONT_END)
|
#if !defined(OLED_FONT_END)
|
||||||
# define OLED_FONT_END 224
|
# define OLED_FONT_END 223
|
||||||
#endif
|
#endif
|
||||||
// Font render width
|
// Font render width
|
||||||
#if !defined(OLED_FONT_WIDTH)
|
#if !defined(OLED_FONT_WIDTH)
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#undef RGBLED_NUM
|
|
||||||
#define RGBLED_NUM 16
|
|
||||||
|
|
||||||
#define QMK_ESC_OUTPUT F4
|
|
||||||
#define QMK_ESC_INPUT D3
|
|
||||||
#define QMK_LED B0
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#include QMK_KEYBOARD_H
|
|
||||||
|
|
||||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
|
||||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
|
||||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
|
||||||
// entirely and just use numbers.
|
|
||||||
#define _BASE 0
|
|
||||||
#define _FN1 1
|
|
||||||
|
|
||||||
enum custom_keycodes {
|
|
||||||
QWERTY = SAFE_RANGE,
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
[_BASE] = LAYOUT_60_ansi(
|
|
||||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
|
||||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
|
||||||
KC_LCTL, KC_LGUI, KC_LALT , KC_SPC, KC_RALT, KC_APP, MO(_FN1), KC_RCTL
|
|
||||||
),
|
|
||||||
|
|
||||||
[_FN1] = LAYOUT_60_ansi(
|
|
||||||
KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
|
|
||||||
RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
||||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
||||||
BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
||||||
KC_GRV, _______, _______, _______, _______, KC_RGUI, _______, _______
|
|
||||||
)
|
|
||||||
};
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
BOOTLOADER = qmk-dfu
|
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 Ryota Goto
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xA103
|
||||||
|
#define PRODUCT_ID 0x0002
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER ai03 Design Studio
|
||||||
|
#define PRODUCT Polaris
|
||||||
|
#define DESCRIPTION Basic 60% keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 14
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B1, B2, B3, F0, F1 }
|
||||||
|
#define MATRIX_COL_PINS { F4, F7, F5, F6, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
#define BACKLIGHT_PIN B7
|
||||||
|
#define BACKLIGHT_BREATHING
|
||||||
|
#define BACKLIGHT_LEVELS 5
|
||||||
|
|
||||||
|
#define RGB_DI_PIN D2
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLED_NUM 14
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#define RGBLIGHT_LIMIT_VAL 200 /* The maximum brightness level */
|
||||||
|
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
|
/*== all animations enable ==*/
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
// /*== or choose animations ==*/
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHING
|
||||||
|
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||||
|
// #define RGBLIGHT_EFFECT_SNAKE
|
||||||
|
// #define RGBLIGHT_EFFECT_KNIGHT
|
||||||
|
// #define RGBLIGHT_EFFECT_CHRISTMAS
|
||||||
|
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||||
|
// #define RGBLIGHT_EFFECT_RGB_TEST
|
||||||
|
// #define RGBLIGHT_EFFECT_ALTERNATING
|
||||||
|
// /*== customize breathing effect ==*/
|
||||||
|
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||||
|
// /*==== use exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
/* defined by default; to change, uncomment and set to the combination you want */
|
||||||
|
// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||||
|
|
||||||
|
/* control how magic key switches layers */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP H
|
||||||
|
//#define MAGIC_KEY_HELP_ALT SLASH
|
||||||
|
//#define MAGIC_KEY_DEBUG D
|
||||||
|
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||||
|
//#define MAGIC_KEY_DEBUG_KBD K
|
||||||
|
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||||
|
//#define MAGIC_KEY_VERSION V
|
||||||
|
//#define MAGIC_KEY_STATUS S
|
||||||
|
//#define MAGIC_KEY_CONSOLE C
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER1 1
|
||||||
|
//#define MAGIC_KEY_LAYER2 2
|
||||||
|
//#define MAGIC_KEY_LAYER3 3
|
||||||
|
//#define MAGIC_KEY_LAYER4 4
|
||||||
|
//#define MAGIC_KEY_LAYER5 5
|
||||||
|
//#define MAGIC_KEY_LAYER6 6
|
||||||
|
//#define MAGIC_KEY_LAYER7 7
|
||||||
|
//#define MAGIC_KEY_LAYER8 8
|
||||||
|
//#define MAGIC_KEY_LAYER9 9
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER B
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/* Bootmagic Lite key configuration */
|
||||||
|
// #define BOOTMAGIC_LITE_ROW 0
|
||||||
|
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Polaris",
|
||||||
|
"url": "https://kb.ai03.me/projects/polaris.html",
|
||||||
|
"maintainer": "ai03",
|
||||||
|
"width": 15,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_all": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"~", "x":0, "y":0},
|
||||||
|
{"label":"!", "x":1, "y":0},
|
||||||
|
{"label":"@", "x":2, "y":0},
|
||||||
|
{"label":"#", "x":3, "y":0},
|
||||||
|
{"label":"$", "x":4, "y":0},
|
||||||
|
{"label":"%", "x":5, "y":0},
|
||||||
|
{"label":"^", "x":6, "y":0},
|
||||||
|
{"label":"&", "x":7, "y":0},
|
||||||
|
{"label":"*", "x":8, "y":0},
|
||||||
|
{"label":"(", "x":9, "y":0},
|
||||||
|
{"label":")", "x":10, "y":0},
|
||||||
|
{"label":"_", "x":11, "y":0},
|
||||||
|
{"label":"+", "x":12, "y":0},
|
||||||
|
{"label":"Backspace", "x":13, "y":0},
|
||||||
|
{"label":"Delete", "x":14, "y":0},
|
||||||
|
{"label":"Tab", "x":0, "y":1, "w":1.5},
|
||||||
|
{"label":"Q", "x":1.5, "y":1},
|
||||||
|
{"label":"W", "x":2.5, "y":1},
|
||||||
|
{"label":"E", "x":3.5, "y":1},
|
||||||
|
{"label":"R", "x":4.5, "y":1},
|
||||||
|
{"label":"T", "x":5.5, "y":1},
|
||||||
|
{"label":"Y", "x":6.5, "y":1},
|
||||||
|
{"label":"U", "x":7.5, "y":1},
|
||||||
|
{"label":"I", "x":8.5, "y":1},
|
||||||
|
{"label":"O", "x":9.5, "y":1},
|
||||||
|
{"label":"P", "x":10.5, "y":1},
|
||||||
|
{"label":"{", "x":11.5, "y":1},
|
||||||
|
{"label":"}", "x":12.5, "y":1},
|
||||||
|
{"label":"|", "x":13.5, "y":1, "w":1.5},
|
||||||
|
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"A", "x":1.75, "y":2},
|
||||||
|
{"label":"S", "x":2.75, "y":2},
|
||||||
|
{"label":"D", "x":3.75, "y":2},
|
||||||
|
{"label":"F", "x":4.75, "y":2},
|
||||||
|
{"label":"G", "x":5.75, "y":2},
|
||||||
|
{"label":"H", "x":6.75, "y":2},
|
||||||
|
{"label":"J", "x":7.75, "y":2},
|
||||||
|
{"label":"K", "x":8.75, "y":2},
|
||||||
|
{"label":"L", "x":9.75, "y":2},
|
||||||
|
{"label":":", "x":10.75, "y":2},
|
||||||
|
{"label":"\"", "x":11.75, "y":2},
|
||||||
|
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
|
||||||
|
{"label":"Shift", "x":0, "y":3, "w":1.25},
|
||||||
|
{"label":"|", "x":1.25, "y":3},
|
||||||
|
{"label":"Z", "x":2.25, "y":3},
|
||||||
|
{"label":"X", "x":3.25, "y":3},
|
||||||
|
{"label":"C", "x":4.25, "y":3},
|
||||||
|
{"label":"V", "x":5.25, "y":3},
|
||||||
|
{"label":"B", "x":6.25, "y":3},
|
||||||
|
{"label":"N", "x":7.25, "y":3},
|
||||||
|
{"label":"M", "x":8.25, "y":3},
|
||||||
|
{"label":"<", "x":9.25, "y":3},
|
||||||
|
{"label":">", "x":10.25, "y":3},
|
||||||
|
{"label":"?", "x":11.25, "y":3},
|
||||||
|
{"label":"Shift", "x":12.25, "y":3, "w":1.75},
|
||||||
|
{"label":"Print Screen", "x":14, "y":3},
|
||||||
|
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
|
||||||
|
{"label":"Win", "x":1.25, "y":4, "w":1.25},
|
||||||
|
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
|
||||||
|
{"x":3.75, "y":4, "w":2.25},
|
||||||
|
{"x":6, "y":4, "w":1.25},
|
||||||
|
{"x":7.25, "y":4, "w":2.75},
|
||||||
|
{"label":"Alt", "x":10, "y":4, "w":1.25},
|
||||||
|
{"label":"Win", "x":11.25, "y":4, "w":1.25},
|
||||||
|
{"label":"Menu", "x":12.5, "y":4, "w":1.25},
|
||||||
|
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"LAYOUT_60_tsangan_hhkb": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"~", "x":0, "y":0},
|
||||||
|
{"label":"!", "x":1, "y":0},
|
||||||
|
{"label":"@", "x":2, "y":0},
|
||||||
|
{"label":"#", "x":3, "y":0},
|
||||||
|
{"label":"$", "x":4, "y":0},
|
||||||
|
{"label":"%", "x":5, "y":0},
|
||||||
|
{"label":"^", "x":6, "y":0},
|
||||||
|
{"label":"&", "x":7, "y":0},
|
||||||
|
{"label":"*", "x":8, "y":0},
|
||||||
|
{"label":"(", "x":9, "y":0},
|
||||||
|
{"label":")", "x":10, "y":0},
|
||||||
|
{"label":"_", "x":11, "y":0},
|
||||||
|
{"label":"+", "x":12, "y":0},
|
||||||
|
{"label":"Backspace", "x":13, "y":0},
|
||||||
|
{"label":"Delete", "x":14, "y":0},
|
||||||
|
{"label":"Tab", "x":0, "y":1, "w":1.5},
|
||||||
|
{"label":"Q", "x":1.5, "y":1},
|
||||||
|
{"label":"W", "x":2.5, "y":1},
|
||||||
|
{"label":"E", "x":3.5, "y":1},
|
||||||
|
{"label":"R", "x":4.5, "y":1},
|
||||||
|
{"label":"T", "x":5.5, "y":1},
|
||||||
|
{"label":"Y", "x":6.5, "y":1},
|
||||||
|
{"label":"U", "x":7.5, "y":1},
|
||||||
|
{"label":"I", "x":8.5, "y":1},
|
||||||
|
{"label":"O", "x":9.5, "y":1},
|
||||||
|
{"label":"P", "x":10.5, "y":1},
|
||||||
|
{"label":"{", "x":11.5, "y":1},
|
||||||
|
{"label":"}", "x":12.5, "y":1},
|
||||||
|
{"label":"|", "x":13.5, "y":1, "w":1.5},
|
||||||
|
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"A", "x":1.75, "y":2},
|
||||||
|
{"label":"S", "x":2.75, "y":2},
|
||||||
|
{"label":"D", "x":3.75, "y":2},
|
||||||
|
{"label":"F", "x":4.75, "y":2},
|
||||||
|
{"label":"G", "x":5.75, "y":2},
|
||||||
|
{"label":"H", "x":6.75, "y":2},
|
||||||
|
{"label":"J", "x":7.75, "y":2},
|
||||||
|
{"label":"K", "x":8.75, "y":2},
|
||||||
|
{"label":"L", "x":9.75, "y":2},
|
||||||
|
{"label":":", "x":10.75, "y":2},
|
||||||
|
{"label":"\"", "x":11.75, "y":2},
|
||||||
|
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
|
||||||
|
{"label":"Shift", "x":0, "y":3, "w":2.25},
|
||||||
|
{"label":"Z", "x":2.25, "y":3},
|
||||||
|
{"label":"X", "x":3.25, "y":3},
|
||||||
|
{"label":"C", "x":4.25, "y":3},
|
||||||
|
{"label":"V", "x":5.25, "y":3},
|
||||||
|
{"label":"B", "x":6.25, "y":3},
|
||||||
|
{"label":"N", "x":7.25, "y":3},
|
||||||
|
{"label":"M", "x":8.25, "y":3},
|
||||||
|
{"label":"<", "x":9.25, "y":3},
|
||||||
|
{"label":">", "x":10.25, "y":3},
|
||||||
|
{"label":"?", "x":11.25, "y":3},
|
||||||
|
{"label":"Shift", "x":12.25, "y":3, "w":1.75},
|
||||||
|
{"label":"Print Screen", "x":14, "y":3},
|
||||||
|
{"label":"Ctrl", "x":0, "y":4, "w":1.5},
|
||||||
|
{"label":"Win", "x":1.5, "y":4},
|
||||||
|
{"label":"Alt", "x":2.5, "y":4, "w":1.5},
|
||||||
|
{"x":4, "y":4, "w":7},
|
||||||
|
{"label":"Alt", "x":11, "y":4, "w":1.5},
|
||||||
|
{"label":"Win", "x":12.5, "y":4},
|
||||||
|
{"label":"Ctrl", "x":13.5, "y":4, "w":1.5}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/* Copyright 2019 Ryota Goto
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum layer_names {
|
||||||
|
_BASE,
|
||||||
|
_FN
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT_all( /* Base */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL
|
||||||
|
),
|
||||||
|
[_FN] = LAYOUT_all( /* FN */
|
||||||
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC,
|
||||||
|
_______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
|
||||||
|
_______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
|
||||||
|
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default keymap for Polaris
|
||||||
|
|
||||||
|
Fits just about everything on two layers.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2019 Ryota Goto
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum layer_names {
|
||||||
|
_BASE,
|
||||||
|
_FN
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT_60_tsangan_hhkb( /* Base */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
|
||||||
|
),
|
||||||
|
[_FN] = LAYOUT_60_tsangan_hhkb( /* FN */
|
||||||
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC,
|
||||||
|
_______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
|
||||||
|
_______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
|
||||||
|
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default_ansi_tsangan keymap for Polaris
|
||||||
|
|
||||||
|
Simplified down to the basic ANSI Tsangan layouts for ease of configuration.
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
/* Copyright 2019 Ryota Goto
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum layer_names {
|
||||||
|
_BASE,
|
||||||
|
_FN
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT_all( /* Base */
|
||||||
|
BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_BSPC, KC_DEL,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL
|
||||||
|
),
|
||||||
|
[_FN] = LAYOUT_all( /* FN */
|
||||||
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC,
|
||||||
|
_______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
|
||||||
|
_______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
|
||||||
|
_______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# The PCB testing keymap for Polaris
|
||||||
|
|
||||||
|
LED control keys are placed on the numrow.
|
||||||
|
Mainly for factory testing use only.
|
||||||
|
|
||||||
|
ESC = Backlight Toggle
|
||||||
|
1 = Backlight Step
|
||||||
|
|
||||||
|
5 = RGB Toggle
|
||||||
|
6 = RGB Mode Cycle
|
||||||
|
7 = RGB Hue Increase
|
||||||
|
8 = RGB Hue Decrease
|
||||||
|
9 = RGB Saturation Increase
|
||||||
|
0 = RGB Saturation Decrease
|
||||||
|
MINS = RGB Value Increase
|
||||||
|
EQL = RGB Value Decrease
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
/* Copyright 2019 Ryota Goto
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum layer_names {
|
||||||
|
_BASE,
|
||||||
|
_FN,
|
||||||
|
_EXTRA_ONE,
|
||||||
|
_EXTRA_TWO
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT_all( /* Base */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RALT, KC_RGUI, KC_RCTL
|
||||||
|
),
|
||||||
|
[_FN] = LAYOUT_all( /* FN */
|
||||||
|
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_BSPC,
|
||||||
|
_______, _______, _______, KC_PGUP, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, BL_STEP,
|
||||||
|
_______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
|
||||||
|
_______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
[_EXTRA_ONE] = LAYOUT_all( /* Layer 3 */
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
[_EXTRA_TWO] = LAYOUT_all( /* Layer 3 */
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The via keymap for Polaris
|
||||||
|
|
||||||
|
For via configurator use
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
/* Copyright 2019 Ryota Goto
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include "polaris.h"
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/* Copyright 2019 Ryota Goto
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
/* This a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT_all( \
|
||||||
|
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, \
|
||||||
|
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
|
||||||
|
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \
|
||||||
|
K400, K401, K402, K404, K406, K408, K410, K411, K412, K413 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \
|
||||||
|
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \
|
||||||
|
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \
|
||||||
|
{ K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_60_tsangan_hhkb( \
|
||||||
|
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, \
|
||||||
|
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
|
||||||
|
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \
|
||||||
|
K400, K401, K402, K406, K411, K412, K413 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \
|
||||||
|
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \
|
||||||
|
{ K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \
|
||||||
|
{ K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, K412, K413 } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Polaris
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A basic 60% keyboard
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [ai03](https://github.com/ai03-2725)
|
||||||
|
* Hardware Supported: Polaris PCB/case
|
||||||
|
* Hardware Availability: Will be posted [here](https://kb.ai03.me/projects/polaris.html)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make ai03/polaris:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# ATmega32A bootloadHID
|
||||||
|
# ATmega328P USBasp
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
|
||||||
|
LAYOUTS = 60_tsangan_hhkb
|
||||||
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define VENDOR_ID 0xCDCD
|
#define VENDOR_ID 0xCDCD
|
||||||
#define PRODUCT_ID 0x5337
|
#define PRODUCT_ID 0x5337
|
||||||
#define DEVICE_VER 0x0001
|
#define DEVICE_VER 0x0001
|
||||||
#define MANUFACTURER shens
|
#define MANUFACTURER shensmobile
|
||||||
#define PRODUCT Boardwalk
|
#define PRODUCT Boardwalk
|
||||||
#define DESCRIPTION QMK keyboard firmware for Boardwalk
|
#define DESCRIPTION QMK keyboard firmware for Boardwalk
|
||||||
|
|
||||||
|
|||||||
@@ -16,147 +16,53 @@
|
|||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
// Layer shorthand
|
// Layer shorthand
|
||||||
enum layer {
|
enum layer_names {
|
||||||
_1U,
|
_BASE,
|
||||||
_FN,
|
_FN,
|
||||||
_HHKB,
|
|
||||||
_7U,
|
|
||||||
_2UARROW,
|
|
||||||
_625UARROW,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
/* 1uGrid
|
/* Base Layer
|
||||||
* .-----------------------------------------------------------------------------------------------------------------------------.
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
||||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
* | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | SPACE | RIGHT | DOWN | UP | RIGHT |
|
* | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | RCTRL |
|
||||||
* '-----------------------------------------------------------------------------------------------------------------------------'
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
*/
|
*/
|
||||||
|
[_BASE] = LAYOUT_ortho_5x14(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL
|
||||||
|
),
|
||||||
|
|
||||||
[_1U] = LAYOUT_ortho_5x14(
|
/* Function Layer
|
||||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
* | | | MENU | | | | | | | | | | PRT SC | |
|
||||||
KC_LCTL, KC_LGUI, MO(1), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL \
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
),
|
* | | | | | | | | | | | | | | RESET |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = LAYOUT_ortho_5x14(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
/* HHKB
|
|
||||||
* .-----------------------------------------------------------------------------------------------------------------------------.
|
|
||||||
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
|
||||||
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
|
||||||
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
|
||||||
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
|
||||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
|
||||||
* | | LCTRL | FN | LALT | LGUI | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | |
|
|
||||||
* '-----------------------------------------------------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
[_HHKB] = LAYOUT_ortho_hhkb(
|
|
||||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
|
||||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
|
||||||
KC_LCTL, MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* 7u HHKB
|
|
||||||
* .-----------------------------------------------------------------------------------------------------------------------------.
|
|
||||||
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
|
||||||
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
|
||||||
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
|
||||||
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
|
||||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
|
||||||
* | | LCTRL | LALT | SPACE | RALT | FN | |
|
|
||||||
* '-----------------------------------------------------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
[_7U] = LAYOUT_ortho_7u(
|
|
||||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
|
||||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
|
||||||
KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(1) \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* 2x2u Space with Arrows
|
|
||||||
* .-----------------------------------------------------------------------------------------------------------------------------.
|
|
||||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
|
||||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
|
||||||
* | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
|
||||||
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
|
|
||||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
|
||||||
* | LCTRL | LGUI | FN | LALT | SPACE | SPACE | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT |
|
|
||||||
* '-----------------------------------------------------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
[_2UARROW] = LAYOUT_2u_arrow(
|
|
||||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_QUOT, \
|
|
||||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSLS, KC_ENT, KC_PGUP, \
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
|
|
||||||
KC_LCTL, KC_LGUI, MO(1), KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* 6.25u Space with Arrows
|
|
||||||
* .-----------------------------------------------------------------------------------------------------------------------------.
|
|
||||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
|
||||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
|
||||||
* | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
|
||||||
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
|
|
||||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
|
||||||
* | LCTRL | LGUI | LALT | SPACE | FN | RCTRL | LEFT | DOWN | RIGHT |
|
|
||||||
* '-----------------------------------------------------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
[_625UARROW] = LAYOUT_625u_arrow(
|
|
||||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_QUOT, \
|
|
||||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSLS, KC_ENT, KC_PGUP, \
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
|
|
||||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
|
||||||
),
|
|
||||||
|
|
||||||
/* FUNCTION
|
|
||||||
* .-----------------------------------------------------------------------------------------------------------------------------.
|
|
||||||
* | | | | | | | | | | | | | | |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
|
||||||
* | | | | | | | | | | | | | | |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
|
||||||
* | | | | | | | | | | | | | | |
|
|
||||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
|
||||||
* | | | | | | | | | | | | | | |
|
|
||||||
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
|
||||||
* | | | | | | | | | | | | | | |
|
|
||||||
* '-----------------------------------------------------------------------------------------------------------------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
[_FN] = LAYOUT_ortho_5x14(
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
enum layer {
|
||||||
|
_BASE,
|
||||||
|
_FN,
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Base Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | LCTRL | LGUI | FN | LALT | SPACE | SPACE | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_BASE] = LAYOUT_2u_arrow(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
|
||||||
|
KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Function Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | MENU | | | | | | | | PRT SC | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | HOME |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | MUTE | VOL DN | VOL UP | | | | END |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | RESET | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = LAYOUT_2u_arrow(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_END,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default_2u_arrow keymap for Boardwalk
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
enum layer {
|
||||||
|
_BASE,
|
||||||
|
_FN,
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Base Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | LCTRL | LGUI | LALT | SPACE | FN | RCTRL | LEFT | DOWN | RIGHT |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_BASE] = LAYOUT_625u_arrow(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Function Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | MENU | | | | | | | | PRT SC | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | HOME |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | MUTE | VOL DN | VOL UP | | | | END |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | RESET | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = LAYOUT_625u_arrow(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_END,
|
||||||
|
_______, _______, _______, _______, _______, RESET, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default_625u_arrow keymap for Boardwalk
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
enum layer {
|
||||||
|
_BASE,
|
||||||
|
_FN,
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Base Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
||||||
|
* '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
|
||||||
|
* | LCTRL | LALT | SPACE | RALT | FN |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_BASE] = LAYOUT_ortho_7u(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(_FN)
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Function Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | MENU | | | | | | | | | | PRT SC | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | RESET |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
|
||||||
|
* '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
|
||||||
|
* | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = LAYOUT_ortho_7u(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
|
||||||
|
_______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default_ortho_7u keymap for Boardwalk
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
enum layer {
|
||||||
|
_BASE,
|
||||||
|
_FN,
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Base Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
||||||
|
* '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
|
||||||
|
* | LCTRL | FN | LALT | LGUI | SPACE | SPACE | LEFT | DOWN | UP | RIGHT |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_BASE] = LAYOUT_ortho_hhkb(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Function Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | MENU | | | | | | | | | | PRT SC | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | RESET |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
|
||||||
|
* '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = LAYOUT_ortho_hhkb(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default_ortho_hhkb keymap for Boardwalk
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
enum layer_names {
|
||||||
|
_BASE,
|
||||||
|
_FN,
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Base Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | RCTRL |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_BASE] = LAYOUT_ortho_5x14(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Function Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | MENU | | | | | | | | | | PRT SC | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | RESET |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = LAYOUT_ortho_5x14(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Empty Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[2] = LAYOUT_ortho_5x14(
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Empty Layer
|
||||||
|
* .-----------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[3] = LAYOUT_ortho_5x14(
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The via keymap for Boardwalk
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
|
LTO_ENABLE = yes
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
# Boardwalk
|
# Boardwalk
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The Boardwalk is a 60% ortholinear keyboard, designed around Ergodox keycap sets and to fit into many standard 60% cases. The project was inspired by OLKB’s Atomic keyboard, which used larger 2u mods, but u/shensmobile
|
The Boardwalk is a 60% ortholinear keyboard, designed around Ergodox keycap sets and to fit into many standard 60% cases. The project was inspired by OLKB’s Atomic keyboard, which used larger 2u mods, but u/shensmobile
|
||||||
decided to switch to 1.5u keys so that Ergodox sets would provide excellent compatibility. The rest of the board can be covered using standard key sizes from 60% sets.
|
decided to switch to 1.5u keys so that Ergodox sets would provide excellent compatibility. The rest of the board can be covered using standard key sizes from 60% sets.
|
||||||
|
|
||||||
Keyboard Maintainer: QMK Community
|
* Keyboard Maintainer: QMK Community
|
||||||
Hardware Supported: Boardwalk Ortholinear PCB
|
* Hardware Supported: Boardwalk Ortholinear PCB
|
||||||
Hardware Availability: [panc.co](https://www.panc.co/boardwalk-group-buy.html)
|
* Hardware Availability: [panc.co](https://www.panc.co/boardwalk-group-buy.html)
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
|||||||
@@ -11,26 +11,16 @@
|
|||||||
#define DESCRIPTION A PCB for the CM Storm switch tester utilizing a Teensy 2.0.
|
#define DESCRIPTION A PCB for the CM Storm switch tester utilizing a Teensy 2.0.
|
||||||
|
|
||||||
/* key matrix size */
|
/* key matrix size */
|
||||||
#define MATRIX_ROWS 1
|
#define MATRIX_ROWS 2
|
||||||
#define MATRIX_COLS 6
|
#define MATRIX_COLS 3
|
||||||
|
|
||||||
/*
|
/* Keyboard Matrix Assignments */
|
||||||
* Keyboard Matrix Assignments
|
#define DIRECT_PINS { \
|
||||||
*
|
{ F7, F6, F1 }, \
|
||||||
* Change this to how you wired your keyboard
|
{ F5, F4, F0 } \
|
||||||
* COLS: AVR pins used for columns, left to right
|
}
|
||||||
* ROWS: AVR pins used for rows, top to bottom
|
|
||||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
|
||||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#define MATRIX_ROW_PINS { }
|
|
||||||
#define MATRIX_COL_PINS { F7, F6, F1, F5, F4, F0 }
|
|
||||||
#define UNUSED_PINS
|
#define UNUSED_PINS
|
||||||
|
|
||||||
/* COL2ROW, ROW2COL*/
|
|
||||||
#define DIODE_DIRECTION COL2ROW
|
|
||||||
|
|
||||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
#define DEBOUNCE 5
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#define LAYOUT( \
|
#define LAYOUT( \
|
||||||
K00, K01, K02, \
|
K00, K01, K02, \
|
||||||
K03, K04, K05 \
|
K03, K04, K05 \
|
||||||
) { \
|
) \
|
||||||
{ K00, K01, K02, K03, K04, K05 }, \
|
{ \
|
||||||
|
{ K00, K01, K02 }, \
|
||||||
|
{ K03, K04, K05 } \
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
|
inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
#define EE_HANDS
|
#define EE_HANDS
|
||||||
|
|
||||||
/* Limit max RGB LED current to avoid tripping controller fuse. */
|
/* Limit max RGB LED current to avoid tripping controller fuse. */
|
||||||
|
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
|
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/* Copyright 2020 MechMerlin <[email protected]>
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* layer 0: qwerty */
|
||||||
|
[0] = LAYOUT_all(\
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \
|
||||||
|
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_all(\
|
||||||
|
_______, RGB_TOG, RGB_MOD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
[2] = LAYOUT_all(\
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
[3] = LAYOUT_all(\
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
# Default Eagle Layout
|
||||||
|
|
||||||
|
This is the default implement layout for Duck Eagle V2.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
* Default QWERTY layer
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
|
LTO_ENABLE = yes
|
||||||
@@ -628,4 +628,31 @@
|
|||||||
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, KC_NO }, \
|
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, KC_NO }, \
|
||||||
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, k4c, k4d, k4e } \
|
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, k4c, k4d, k4e } \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* LAYOUT_60_iso_4th_row_all_1u
|
||||||
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │
|
||||||
|
* │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │
|
||||||
|
* ├───┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┤
|
||||||
|
* │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3c │3d │3e │
|
||||||
|
* ├───┴┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤
|
||||||
|
* │40 │41 │43 │46 │4a │4b │4c │4d │4e │
|
||||||
|
* └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘
|
||||||
|
*/
|
||||||
|
#define LAYOUT_60_iso_4th_row_all_1u( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \
|
||||||
|
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
|
||||||
|
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \
|
||||||
|
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
|
||||||
|
k40, k41, k43, k46, k4a, k4b, k4c, k4d, k4e \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \
|
||||||
|
{ k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \
|
||||||
|
{ k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
|
||||||
|
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \
|
||||||
|
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -92,6 +92,10 @@
|
|||||||
"LAYOUT_60_abnt2": {
|
"LAYOUT_60_abnt2": {
|
||||||
"key_count": 63,
|
"key_count": 63,
|
||||||
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"\u00a8", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"`", "x":11.5, "y":1}, {"label":"{", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":"\u00c7", "x":10.75, "y":2}, {"label":"^", "x":11.75, "y":2}, {"label":"}", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":":", "x":11.25, "y":3}, {"label":"?", "x":12.25, "y":3}, {"label":"Shift", "x":13.25, "y":3, "w":1.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"\u00a8", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"`", "x":11.5, "y":1}, {"label":"{", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":"\u00c7", "x":10.75, "y":2}, {"label":"^", "x":11.75, "y":2}, {"label":"}", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":":", "x":11.25, "y":3}, {"label":"?", "x":12.25, "y":3}, {"label":"Shift", "x":13.25, "y":3, "w":1.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||||
}
|
},
|
||||||
|
"LAYOUT_60_iso_4th_row_all_1u": {
|
||||||
|
"key_count": 65,
|
||||||
|
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// LAYERS
|
||||||
|
#define _QWERTY 0 // QWERTY layer
|
||||||
|
#define _QW _QWERTY
|
||||||
|
|
||||||
|
#define _FUNCTION 1 // Function layer
|
||||||
|
#define _FN _FUNCTION
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[_QWERTY] = LAYOUT_60_iso_4th_row_all_1u(
|
||||||
|
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||||
|
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,
|
||||||
|
MO(_FN), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
|
||||||
|
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INS, KC_UP, KC_DEL,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_CAPS, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
[_FUNCTION] = LAYOUT_60_iso_4th_row_all_1u(
|
||||||
|
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
||||||
|
_______, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX,
|
||||||
|
_______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, XXXXXXX, KC_PGUP, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_HOME, KC_PGDN, KC_END
|
||||||
|
),
|
||||||
|
};
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
DZ60 iso layout with 4th row (Z row) having all 1u size keys.
|
||||||
|
|
||||||
|
### _QWERTY:
|
||||||
|
Base iso qwerty layer with arrow keys
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------------.
|
||||||
|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | |
|
||||||
|
|---------------------------------------------------------------------------------- Enter +
|
||||||
|
| Fn | A | S | D | F | G | H | J | K | L | ; | ' | # | |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
|Shift| \ | Z | X | C | V | B | N | M | , | . | / | Ins | Up | Del |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| Ctrl | Os | Alt | Space |Caps | Fn |Left |Down |Right|
|
||||||
|
`-----------------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### _FUNCTION
|
||||||
|
Layer with function keys, media keys and rgb keys
|
||||||
|
```
|
||||||
|
FN Layer
|
||||||
|
,-----------------------------------------------------------------------------------------.
|
||||||
|
| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| | | Up | | | | | | | |PSRC | | | |
|
||||||
|
|---------------------------------------------------------------------------------- +
|
||||||
|
| |Left |Down |Right| | | | | | | | | | |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| | | | | | |MPrev|MNext|Mute |VolUp|VolDn|MPlay| |PgUp | |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| | | | | | |Home |PGDn | End |
|
||||||
|
`-----------------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#include QMK_KEYBOARD_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Each layer gets a name for readability.
|
|
||||||
* The underscores don't mean anything - you can
|
|
||||||
* have a layer called STUFF or any other name.
|
|
||||||
* Layer names don't all need to be of the same
|
|
||||||
* length, and you can also skip them entirely
|
|
||||||
* and just use numbers.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#define BL 0 // Base Layer
|
|
||||||
#define FL 1 // Function Layer
|
|
||||||
#define ML 2 // Macro Layer
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
|
|
||||||
[BL] = LAYOUT_60_ansi_split(
|
|
||||||
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
|
||||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
|
||||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(FL), KC_SPC, KC_RALT, KC_RGUI, MO(ML), KC_RCTL),
|
|
||||||
|
|
||||||
[FL] = LAYOUT_60_ansi_split(
|
|
||||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL,
|
|
||||||
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET,
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______,
|
|
||||||
_______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, KC_DEL, KC_END, KC_PGDN, _______,
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
|
||||||
|
|
||||||
|
|
||||||
[ML] = LAYOUT_60_ansi_split(
|
|
||||||
_______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______,
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
|
||||||
|
|
||||||
};
|
|
||||||
+17
-6
@@ -1,5 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2011 Jun Wako <wakojun@gmail.com>
|
This is the c configuration file for the keymap
|
||||||
|
|
||||||
|
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||||
|
Copyright 2015 Jack Humbert
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,11 +18,19 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PJRC_H
|
#pragma once
|
||||||
#define PJRC_H
|
|
||||||
|
|
||||||
#include "host_driver.h"
|
|
||||||
|
|
||||||
host_driver_t *pjrc_driver(void);
|
/* Use I2C or Serial, not both */
|
||||||
|
|
||||||
#endif
|
#define USE_SERIAL
|
||||||
|
// #define USE_I2C
|
||||||
|
|
||||||
|
/* Select hand configuration */
|
||||||
|
|
||||||
|
#define MASTER_LEFT
|
||||||
|
// #define MASTER_RIGHT
|
||||||
|
// #define EE_HANDS
|
||||||
|
|
||||||
|
#undef TAPPING_TERM
|
||||||
|
#define TAPPING_TERM 300
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_3key_2us(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_PGUP, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
|
||||||
|
LCA_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_PGDN, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_GRV, KC_SPC, LT(1,KC_DEL), KC_HOME, KC_END, KC_BSLS, KC_LEFT, KC_RGHT, KC_DOWN, KC_UP
|
||||||
|
),
|
||||||
|
[1] = LAYOUT_3key_2us(
|
||||||
|
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F12, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_HOME), LSFT(KC_END), KC_TRNS, LALT(LSFT(KC_LEFT)), LALT(LSFT(KC_RIGHT)), LALT(LSFT(KC_DOWN)), LALT(LSFT(KC_UP))
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[["KC_ESC", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_EQL", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_BSPC", "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_PGUP", "KC_LBRC", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_ENT", "LCA_T(KC_CAPS)", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_PGDN", "KC_RBRC", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_LSFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_SLSH", "KC_RSFT", "KC_LCTL", "KC_LGUI", "KC_LALT", "MO(1)", "KC_GRV", "KC_SPC", "LT(1,KC_DEL)", "KC_HOME", "KC_END", "KC_BSLS", "KC_LEFT", "KC_RGHT", "KC_DOWN", "KC_UP"], ["KC_TRNS", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F12", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_PSCR", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "LSFT(KC_HOME)", "LSFT(KC_END)", "KC_TRNS", "LALT(LSFT(KC_LEFT))", "LALT(LSFT(KC_RIGHT))", "LALT(LSFT(KC_DOWN))", "LALT(LSFT(KC_UP))"]]
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Generated Keymap Layout
|
||||||
|
|
||||||
|
This layout was generated by the QMK API. You can find the JSON data used to
|
||||||
|
generate this keymap in the file layers.json.
|
||||||
|
|
||||||
|
To make use of this file you will need follow the following steps:
|
||||||
|
|
||||||
|
* Download or Clone QMK Firmware: <https://github.com/qmk/qmk_firmware/>
|
||||||
|
* Extract QMK Firmware to a location on your hard drive
|
||||||
|
* Copy this folder into `keyboards/ergodash/rev1/keymaps/`
|
||||||
|
* You are now ready to compile or use your keymap with the source
|
||||||
|
|
||||||
|
More information can be found in the QMK docs: <https://docs.qmk.fm>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
BACKLIGHT_ENABLE = no
|
||||||
|
RGBLIGHT_ENABLE = no
|
||||||
|
AUDIO_ENABLE = no
|
||||||
Executable
+97
@@ -0,0 +1,97 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 Josh Johnson
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x8F73
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Josh Johnson
|
||||||
|
#define PRODUCT Hub16
|
||||||
|
#define DESCRIPTION Macro Pad with USB Hub and Encoders
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 4
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS \
|
||||||
|
{ F0, C7, C6, B6, E6}
|
||||||
|
#define MATRIX_COL_PINS \
|
||||||
|
{ F4, F1, D5, D3 }
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
#define RGB_DI_PIN D1
|
||||||
|
// #ifdef RGB_DI_PIN
|
||||||
|
#define RGBLED_NUM 11
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||||
|
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
|
// /*== all animations enable ==*/
|
||||||
|
// #define RGBLIGHT_ANIMATIONS
|
||||||
|
// /*== or choose animations ==*/
|
||||||
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||||
|
#define RGBLIGHT_EFFECT_SNAKE
|
||||||
|
#define RGBLIGHT_EFFECT_KNIGHT
|
||||||
|
// #define RGBLIGHT_EFFECT_CHRISTMAS
|
||||||
|
// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||||
|
// #define RGBLIGHT_EFFECT_RGB_TEST
|
||||||
|
// #define RGBLIGHT_EFFECT_ALTERNATING
|
||||||
|
// /*== customize breathing effect ==*/
|
||||||
|
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||||
|
// /*==== use exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 20
|
||||||
|
|
||||||
|
/* ENCODER THINGS */
|
||||||
|
|
||||||
|
// #define NUMBER_OF_ENCODERS 2
|
||||||
|
#define ENCODERS_PAD_A \
|
||||||
|
{ F6, B4 }
|
||||||
|
#define ENCODERS_PAD_B \
|
||||||
|
{ F5, B5 }
|
||||||
|
|
||||||
|
/* Tap Dance timing */
|
||||||
|
#define TAPPING_TERM 200
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
Regular → Executable
+3
-3
@@ -1,4 +1,5 @@
|
|||||||
/*
|
/* Copyright 2019 Josh Johnson
|
||||||
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
* the Free Software Foundation, either version 2 of the License, or
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
@@ -12,5 +13,4 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
#include "hub16.h"
|
||||||
#pragma once
|
|
||||||
Executable
+42
@@ -0,0 +1,42 @@
|
|||||||
|
/* Copyright 2019 Josh Johnson
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
#define ___ KC_NO
|
||||||
|
|
||||||
|
/* This a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT( \
|
||||||
|
k40, k41, \
|
||||||
|
k00, k01, k02, k03, \
|
||||||
|
k10, k11, k12, k13, \
|
||||||
|
k20, k21, k22, k23, \
|
||||||
|
k30, k31, k32, k33 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, }, \
|
||||||
|
{ k10, k11, k12, k13, }, \
|
||||||
|
{ k20, k21, k22, k23, }, \
|
||||||
|
{ k30, k31, k32, k33, }, \
|
||||||
|
{ k40, k41, ___, ___, } \
|
||||||
|
}
|
||||||
|
|
||||||
Executable
+96
@@ -0,0 +1,96 @@
|
|||||||
|
/* Copyright 2019 Josh Johnson
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Function key we are 'wrapping' usual key presses in
|
||||||
|
#define KC_WRAP KC_F24
|
||||||
|
|
||||||
|
// Tap Dance Declarations
|
||||||
|
enum { TD_TO_LED = 0, TD_TO_DEFAULT = 1 };
|
||||||
|
|
||||||
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
// Tap once for HID, twice to toggle layer 1
|
||||||
|
[TD_TO_LED] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 1),
|
||||||
|
[TD_TO_DEFAULT] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 0)};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT( /* Base */
|
||||||
|
KC_S, KC_V,
|
||||||
|
KC_A, KC_B, KC_C, KC_D,
|
||||||
|
KC_E, KC_F, KC_G, KC_H,
|
||||||
|
KC_I, KC_J, KC_K, KC_L,
|
||||||
|
KC_M, KC_N, KC_O, TD(TD_TO_LED)
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT( /* LED Control */
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
_______, RGB_MOD, RGB_RMOD, RGB_TOG,
|
||||||
|
RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI,
|
||||||
|
RGB_SAD, RGB_SAI, _______, _______,
|
||||||
|
_______, _______, RESET, TD(TD_TO_DEFAULT)
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Keyboard is setup to 'warp' the pressed key with F24,
|
||||||
|
// allowing for easy differentiation from a real keyboard.
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (index == 0) { /* Left Encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
register_code(KC_WRAP);
|
||||||
|
tap_code(KC_R);
|
||||||
|
unregister_code(KC_WRAP);
|
||||||
|
} else {
|
||||||
|
register_code(KC_WRAP);
|
||||||
|
tap_code(KC_Q);
|
||||||
|
unregister_code(KC_WRAP);
|
||||||
|
}
|
||||||
|
} else if (index == 1) { /* Right Encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
register_code(KC_WRAP);
|
||||||
|
tap_code(KC_U);
|
||||||
|
unregister_code(KC_WRAP);
|
||||||
|
} else {
|
||||||
|
register_code(KC_WRAP);
|
||||||
|
tap_code(KC_T);
|
||||||
|
unregister_code(KC_WRAP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Below stolen from TaranVH (https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/F24/keymap.c)
|
||||||
|
// Shoutout to drashna on the QMK discord for basically writing this for me.... :P
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
static uint8_t f24_tracker;
|
||||||
|
switch (keycode) {
|
||||||
|
case KC_A ... KC_F23:
|
||||||
|
case KC_EXECUTE ... KC_EXSEL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
register_code(KC_WRAP);
|
||||||
|
f24_tracker++;
|
||||||
|
register_code(keycode);
|
||||||
|
} else {
|
||||||
|
unregister_code(keycode);
|
||||||
|
f24_tracker--;
|
||||||
|
if (!f24_tracker) {
|
||||||
|
unregister_code(KC_WRAP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
Executable
+63
@@ -0,0 +1,63 @@
|
|||||||
|
/* Copyright 2019 Josh Johnson
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
// Function key we are 'wrapping' usual key presses in
|
||||||
|
#define KC_WRAP KC_F24
|
||||||
|
|
||||||
|
// Tap Dance Declarations
|
||||||
|
enum { TD_TO_LED = 0, TD_TO_DEFAULT = 1 };
|
||||||
|
|
||||||
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
// Tap once for HID, twice to toggle layer 1
|
||||||
|
[TD_TO_LED] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 1),
|
||||||
|
[TD_TO_DEFAULT] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 0)};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT( /* Base */
|
||||||
|
KC_S, KC_V,
|
||||||
|
KC_A, KC_B, KC_C, KC_D,
|
||||||
|
KC_E, KC_F, KC_G, KC_H,
|
||||||
|
KC_I, KC_J, KC_K, KC_L,
|
||||||
|
KC_M, KC_N, KC_O, TD(TD_TO_LED)
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT( /* LED Control */
|
||||||
|
KC_NO, KC_NO,
|
||||||
|
_______, RGB_MOD, RGB_RMOD, RGB_TOG,
|
||||||
|
RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI,
|
||||||
|
RGB_SAD, RGB_SAI, _______, _______,
|
||||||
|
_______, _______, RESET, TD(TD_TO_DEFAULT)
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Keyboard is setup to 'warp' the pressed key with F24,
|
||||||
|
// allowing for easy differentiation from a real keyboard.
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (index == 0) { /* Left Encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_R);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_Q);
|
||||||
|
}
|
||||||
|
} else if (index == 1) { /* Right Encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_U);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar
|
||||||
|
|
||||||
|
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/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include "wait.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "debounce.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// Encoder things
|
||||||
|
#define SWITCH_1 F7
|
||||||
|
#define SWITCH_2 D7
|
||||||
|
static bool read_encoder_values(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DIRECT_PINS
|
||||||
|
static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* matrix state(1:on, 0:off) */
|
||||||
|
static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
|
||||||
|
static matrix_row_t matrix[MATRIX_ROWS]; // debounced values
|
||||||
|
|
||||||
|
// helper functions
|
||||||
|
|
||||||
|
inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); }
|
||||||
|
|
||||||
|
inline matrix_row_t matrix_get_row(uint8_t row) {
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// matrix code
|
||||||
|
|
||||||
|
#ifdef DIRECT_PINS
|
||||||
|
|
||||||
|
static void init_pins(void) {
|
||||||
|
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||||
|
pin_t pin = direct_pins[row][col];
|
||||||
|
if (pin != NO_PIN) {
|
||||||
|
setPinInputHigh(pin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||||
|
matrix_row_t last_row_value = current_matrix[current_row];
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||||
|
pin_t pin = direct_pins[current_row][col_index];
|
||||||
|
if (pin != NO_PIN) {
|
||||||
|
current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
static void select_row(uint8_t row) {
|
||||||
|
setPinOutput(row_pins[row]);
|
||||||
|
writePinLow(row_pins[row]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); }
|
||||||
|
|
||||||
|
static void unselect_rows(void) {
|
||||||
|
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
setPinInputHigh(row_pins[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void init_pins(void) {
|
||||||
|
unselect_rows();
|
||||||
|
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||||
|
setPinInputHigh(col_pins[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[current_row];
|
||||||
|
|
||||||
|
// Clear data in matrix row
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
// Select row and wait for row selecton to stabilize
|
||||||
|
select_row(current_row);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each col...
|
||||||
|
for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||||
|
// Select the col pin to read (active low)
|
||||||
|
uint8_t pin_state = readPin(col_pins[col_index]);
|
||||||
|
|
||||||
|
// Populate the matrix row with the state of the col pin
|
||||||
|
current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect row
|
||||||
|
unselect_row(current_row);
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
static void select_col(uint8_t col) {
|
||||||
|
setPinOutput(col_pins[col]);
|
||||||
|
writePinLow(col_pins[col]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); }
|
||||||
|
|
||||||
|
static void unselect_cols(void) {
|
||||||
|
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||||
|
setPinInputHigh(col_pins[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void init_pins(void) {
|
||||||
|
unselect_cols();
|
||||||
|
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
setPinInputHigh(row_pins[x]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
|
||||||
|
bool matrix_changed = false;
|
||||||
|
|
||||||
|
// Select col and wait for col selecton to stabilize
|
||||||
|
select_col(current_col);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each row...
|
||||||
|
for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[row_index];
|
||||||
|
|
||||||
|
// Check row pin state
|
||||||
|
if (readPin(row_pins[row_index]) == 0) {
|
||||||
|
// Pin LO, set col bit
|
||||||
|
current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
|
||||||
|
} else {
|
||||||
|
// Pin HI, clear col bit
|
||||||
|
current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the matrix changed state
|
||||||
|
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) {
|
||||||
|
matrix_changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect col
|
||||||
|
unselect_col(current_col);
|
||||||
|
|
||||||
|
return matrix_changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
// initialize key pins
|
||||||
|
init_pins();
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
raw_matrix[i] = 0;
|
||||||
|
matrix[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
debounce_init(MATRIX_ROWS);
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void) {
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
changed |= read_cols_on_row(raw_matrix, current_row);
|
||||||
|
}
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
// Set col, read rows
|
||||||
|
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||||
|
changed |= read_rows_on_col(raw_matrix, current_col);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
|
||||||
|
|
||||||
|
// Read encoder switches, already debounced
|
||||||
|
changed |= read_encoder_values(matrix, 4);
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return (uint8_t)changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Customisations for the encoders
|
||||||
|
void matrix_init_kb(void){
|
||||||
|
setPinInput(SWITCH_1);
|
||||||
|
setPinInput(SWITCH_2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_encoder_values(matrix_row_t current_matrix[], uint8_t current_row) {
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[current_row];
|
||||||
|
|
||||||
|
// Clear data in matrix row
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
// Debounce the encoder buttons using a shift register
|
||||||
|
static uint8_t btn_1_array;
|
||||||
|
static uint8_t btn_2_array;
|
||||||
|
bool btn_1_rising = 0;
|
||||||
|
bool btn_2_rising = 0;
|
||||||
|
btn_1_array <<= 1;
|
||||||
|
btn_2_array <<= 1;
|
||||||
|
btn_1_array |= readPin(SWITCH_1);
|
||||||
|
btn_2_array |= readPin(SWITCH_2);
|
||||||
|
(btn_1_array == 0b01111111) ? (btn_1_rising = 1) : (btn_1_rising = 0);
|
||||||
|
(btn_2_array == 0b01111111) ? (btn_2_rising = 1) : (btn_2_rising = 0);
|
||||||
|
|
||||||
|
// Populate the matrix row with the state of the encoder
|
||||||
|
current_matrix[current_row] |= btn_1_rising ? (1 << 0) : 0;
|
||||||
|
current_matrix[current_row] |= btn_2_rising ? (1 << 1) : 0;
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
||||||
Executable
+15
@@ -0,0 +1,15 @@
|
|||||||
|
# Hub16
|
||||||
|
|
||||||
|
Hub16 is a 16 Key Macro Pad with inbuilt USB 2.0 hub and dual rotary encoders.
|
||||||
|
|
||||||
|
For more information regarding the keyboard, please visit the [Hub16 Webpage](https://www.joshajohnson.com/hub16-keyboard/) or [GitHub Repo](https://github.com/joshajohnson/Hub16).
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [Josh Johnson](https://github.com/joshajohnson)
|
||||||
|
* Hardware Supported: Hub16 PCB (atmega32u4)
|
||||||
|
* Hardware Availability: [Josh Johnson](https://www.joshajohnson.com/hub16-keyboard/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make hub16:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
Executable
+38
@@ -0,0 +1,38 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# ATmega32A bootloadHID
|
||||||
|
# ATmega328P USBasp
|
||||||
|
BOOTLOADER = caterina
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
CUSTOM_MATRIX = yes # Custom scanning of matrix
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
ENCODER_ENABLE = yes # Rotary Encoder support
|
||||||
|
TAP_DANCE_ENABLE = yes # Support for tap dancing
|
||||||
|
|
||||||
|
SRC = matrix.c
|
||||||
@@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "config_common.h"
|
#include "config_common.h"
|
||||||
|
|
||||||
/* USB Device descriptor parameter */
|
/* USB Device descriptor parameter */
|
||||||
#define VENDOR_ID 0xFEED
|
#define VENDOR_ID 0x6964 // ID
|
||||||
#define PRODUCT_ID 0x0000
|
#define PRODUCT_ID 0x0075
|
||||||
#define DEVICE_VER 0x0001
|
#define DEVICE_VER 0x0001
|
||||||
#define MANUFACTURER You
|
#define MANUFACTURER Generic
|
||||||
#define PRODUCT idobo
|
#define PRODUCT Idobo
|
||||||
#define DESCRIPTION A custom keyboard
|
#define DESCRIPTION A custom keyboard
|
||||||
|
|
||||||
/* key matrix size */
|
/* key matrix size */
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/* Copyright 2020 IFo Hancroft
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[0] = LAYOUT_ortho_5x15(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_ortho_5x15(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
|
),
|
||||||
|
|
||||||
|
[2] = LAYOUT_ortho_5x15(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
|
),
|
||||||
|
|
||||||
|
[3] = LAYOUT_ortho_5x15(
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
|
),
|
||||||
|
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
@@ -8,7 +8,7 @@ Firmware here originally appeared on qmkeyboard.cn
|
|||||||
|
|
||||||
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||||
Hardware Supported: IDOBO PCB
|
Hardware Supported: IDOBO PCB
|
||||||
Hardware Availability: [IDOBO on Massdrop](https://www.massdrop.com/buy/xd75-aluminum-mechanical-keyboard)
|
Hardware Availability: [IDOBO on Drop](https://drop.com/buy/id75-hot-swappable-ortholinear-keyboard-kit)
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
/* Copyright 2019 dnsnrk
|
||||||
|
* 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
|
||||||
|
|
||||||
|
/* place overrides here */
|
||||||
|
#undef QMK_KEYS_PER_SCAN
|
||||||
|
#define QMK_KEYS_PER_SCAN 4
|
||||||
|
#undef DEBOUNCE
|
||||||
|
#define DEBOUNCE 8
|
||||||
|
#undef TAPPING_TOGGLE
|
||||||
|
#define TAPPING_TOGGLE 2
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
/* Copyright 2019 dnsnrk
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define RC_ENT RCTL_T(KC_ENT)
|
||||||
|
#define LC_CPS LCTL_T(KC_CAPS)
|
||||||
|
|
||||||
|
enum {
|
||||||
|
_LAYER0 = 0,
|
||||||
|
_LAYER1,
|
||||||
|
_LAYER2
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_LAYER0] = LAYOUT_65_ansi_blocker( /* Base Layer */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GRV,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, KC_PGUP,
|
||||||
|
LC_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, RC_ENT, KC_PGDN,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, TT(2),
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, TT(1), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
|
[_LAYER1] = LAYOUT_65_ansi_blocker( /* FN, RGB Controls */
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_POWER,
|
||||||
|
_______, RGB_TOG, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME,
|
||||||
|
_______, RGB_RMOD, RGB_SPD, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______, RGB_VAI, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI),
|
||||||
|
[_LAYER2] = LAYOUT_65_ansi_blocker( /* Media, Programming */
|
||||||
|
_______, KC_BRMD, KC_BRMU, _______, _______, _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC__MUTE, KC_VOLD, KC_VOLU, KC_EJCT, _______,
|
||||||
|
_______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______)
|
||||||
|
};
|
||||||
|
|
||||||
|
void set_hsv_at(HSV hsv, uint8_t index);
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rgb_matrix_indicators_user(void) {
|
||||||
|
if (rgb_matrix_config.enable) {
|
||||||
|
HSV hsv = rgb_matrix_config.hsv;
|
||||||
|
if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
|
||||||
|
HSV hsv_inv_hue = {hsv.h + 128, hsv.s, hsv.v};
|
||||||
|
set_hsv_at(hsv_inv_hue, 30);
|
||||||
|
}
|
||||||
|
// indicate which higher layer is currently active on which key
|
||||||
|
HSV hsv1 = {hsv.h - 64, hsv.s, hsv.v};
|
||||||
|
HSV hsv2 = {hsv.h + 64, hsv.s, hsv.v};
|
||||||
|
// except when we are in any animated LED mode
|
||||||
|
if (rgb_matrix_config.mode < RGB_MATRIX_BREATHING || rgb_matrix_config.mode > RGB_MATRIX_JELLYBEAN_RAINDROPS) {
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
for (uint8_t col = 0; col < MATRIX_COLS; col++) {
|
||||||
|
keypos_t pos = {col, row};
|
||||||
|
uint8_t key_layer = layer_switch_get_layer(pos);
|
||||||
|
uint8_t key_led = g_led_config.matrix_co[row][col];
|
||||||
|
if (key_led != NO_LED) {
|
||||||
|
switch(key_layer) {
|
||||||
|
case _LAYER2:
|
||||||
|
set_hsv_at(hsv2, key_led);
|
||||||
|
break;
|
||||||
|
case _LAYER1:
|
||||||
|
set_hsv_at(hsv1, key_led);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sticky layer indicators regardless of RGB mode. Hardcoded for lack of better idea.
|
||||||
|
set_hsv_at(hsv1, 63);
|
||||||
|
set_hsv_at(hsv2, 57);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_hsv_at(HSV hsv, uint8_t index) {
|
||||||
|
RGB rgb = hsv_to_rgb(hsv);
|
||||||
|
rgb_matrix_set_color(index, rgb.r, rgb.g, rgb.b);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
# dnsnrk's KDB67 MKII Layout
|
||||||
|
|
||||||
|
* This is a three layer layout wih some consolidated functionality in the second and third layer.
|
||||||
|
* The keyboard is mostly used on macOS, but also on Linux and therefore it can swap ALT/CMD.
|
||||||
|
* There are additional CTRL keys for left and right when caps lock or enter key is held.
|
||||||
|
* Layers can be toggled (tap twice) or actived momentarily (hold).
|
||||||
|
* There are 2 seperate FN keys to activate layer 1 and 2 separately, indicated by different RGB colors.
|
||||||
|
* The main custom feature is using RGB to indicate the current active layer for each key. This is best achieved in solid color RGB modes.
|
||||||
|
|
||||||
|
## Layer 0
|
||||||
|
|
||||||
|
This is the base QUERTY layer.
|
||||||
|
|
||||||
|
* Grave is provided in the top right corner.
|
||||||
|
* Caps lock is tapped once on and off and indicated by hue inverted LED when on.
|
||||||
|
* Caps lock and enter become CTRL when held.
|
||||||
|
* Primary Fn in the last row activates layer 1, indicated by hue shifted LED color.
|
||||||
|
* Secondary Fn right to the up arrow key activates layer 2, indicated by 2nd hue shifted LED color.
|
||||||
|
* Toggle layers by tapping Fn twice or switch on by holding Fn.
|
||||||
|
|
||||||
|
## Layer 1
|
||||||
|
|
||||||
|
This layer activates function keys and provides RGB controls. Keys acting on this layer are indicated by an LED color matching the current Fn key's LED color.
|
||||||
|
|
||||||
|
* Number keys become equivalent function keys.
|
||||||
|
* ESC becomes Grave.
|
||||||
|
* Grave becomes POWER (very useful on macOS only).
|
||||||
|
* Q toggles RGB.
|
||||||
|
* WASD for navigating through RGB modes and adjusting speed.
|
||||||
|
* <> control RGB saturation.
|
||||||
|
* Arrow keys shift hue and adjust brightness.
|
||||||
|
* PgUp, PgDown become HOME and END respectively.
|
||||||
|
* Backspace acts as delete, pipe as insert.
|
||||||
|
|
||||||
|
## Layer 2
|
||||||
|
|
||||||
|
This layer comprises most macOS media keys at the top row and some additional programming options. Keys acting on this layer are indicated by an LED color matching the current Fn key's LED color.
|
||||||
|
|
||||||
|
* N, M swap ALT/CMD for (N)ormal or (M)acOS.
|
||||||
|
* E resets (E)EPROM.
|
||||||
|
* R (R)esets keyboard.
|
||||||
@@ -13,4 +13,5 @@
|
|||||||
#define RGBLED_NUM 17
|
#define RGBLED_NUM 17
|
||||||
|
|
||||||
/* Set up RGB lighting so it works with either side as master. */
|
/* Set up RGB lighting so it works with either side as master. */
|
||||||
|
#undef RGBLED_SPLIT
|
||||||
#define RGBLED_SPLIT { 8, 9 }
|
#define RGBLED_SPLIT { 8, 9 }
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
#define DESCRIPTION Expanded Ergo Keyboard
|
#define DESCRIPTION Expanded Ergo Keyboard
|
||||||
|
|
||||||
/* key matrix size */
|
/* key matrix size */
|
||||||
#define MATRIX_ROWS 5
|
#define MATRIX_ROWS 4
|
||||||
#define MATRIX_COLS 15
|
#define MATRIX_COLS 14
|
||||||
|
|
||||||
/* key matrix pins */
|
/* key matrix pins */
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -571,7 +571,7 @@ class MILC(object):
|
|||||||
|
|
||||||
# Move the new config file into place atomically
|
# Move the new config file into place atomically
|
||||||
if os.path.getsize(tmpfile.name) > 0:
|
if os.path.getsize(tmpfile.name) > 0:
|
||||||
os.rename(tmpfile.name, str(self.config_file))
|
os.replace(tmpfile.name, str(self.config_file))
|
||||||
else:
|
else:
|
||||||
self.log.warning('Config file saving failed, not replacing %s with %s.', str(self.config_file), tmpfile.name)
|
self.log.warning('Config file saving failed, not replacing %s with %s.', str(self.config_file), tmpfile.name)
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def flash(cli):
|
|||||||
print_bootloader_help()
|
print_bootloader_help()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
elif cli.args.keymap and not cli.args.keyboard:
|
elif cli.config.flash.keymap and not cli.config.flash.keyboard:
|
||||||
# If only a keymap was given but no keyboard, suggest listing keyboards
|
# If only a keymap was given but no keyboard, suggest listing keyboards
|
||||||
cli.echo('usage: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
|
cli.echo('usage: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
|
||||||
cli.log.error('run \'qmk list_keyboards\' to find out the supported keyboards')
|
cli.log.error('run \'qmk list_keyboards\' to find out the supported keyboards')
|
||||||
@@ -70,7 +70,7 @@ def flash(cli):
|
|||||||
|
|
||||||
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
|
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
|
||||||
|
|
||||||
elif cli.args.keyboard and cli.args.keymap:
|
elif cli.config.flash.keyboard and cli.config.flash.keymap:
|
||||||
# Generate the make command for a specific keyboard/keymap.
|
# Generate the make command for a specific keyboard/keymap.
|
||||||
command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, cli.args.bootloader)
|
command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, cli.args.bootloader)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ define GENERATE_MSG_AVAILABLE_KEYMAPS
|
|||||||
endef
|
endef
|
||||||
MSG_AVAILABLE_KEYMAPS = $(eval $(call GENERATE_MSG_AVAILABLE_KEYMAPS))$(MSG_AVAILABLE_KEYMAPS_ACTUAL)
|
MSG_AVAILABLE_KEYMAPS = $(eval $(call GENERATE_MSG_AVAILABLE_KEYMAPS))$(MSG_AVAILABLE_KEYMAPS_ACTUAL)
|
||||||
|
|
||||||
MSG_CHECK_FILESIZE = Checking file size of $(TARGET).hex
|
MSG_CHECK_FILESIZE = Checking file size of $(TARGET).$(FIRMWARE_FORMAT)
|
||||||
MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n
|
MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n
|
||||||
MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n
|
MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n
|
||||||
MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n
|
MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n
|
||||||
|
|||||||
@@ -90,13 +90,15 @@ void action_exec(keyevent_t event) {
|
|||||||
|
|
||||||
keyrecord_t record = {.event = event};
|
keyrecord_t record = {.event = event};
|
||||||
|
|
||||||
#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
|
#ifndef NO_ACTION_ONESHOT
|
||||||
|
# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
|
||||||
if (has_oneshot_layer_timed_out()) {
|
if (has_oneshot_layer_timed_out()) {
|
||||||
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
|
||||||
}
|
}
|
||||||
if (has_oneshot_mods_timed_out()) {
|
if (has_oneshot_mods_timed_out()) {
|
||||||
clear_oneshot_mods();
|
clear_oneshot_mods();
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_ACTION_TAPPING
|
#ifndef NO_ACTION_TAPPING
|
||||||
|
|||||||
@@ -43,13 +43,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
# include "mousekey.h"
|
# include "mousekey.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PROTOCOL_PJRC
|
|
||||||
# include "usb_keyboard.h"
|
|
||||||
# ifdef EXTRAKEY_ENABLE
|
|
||||||
# include "usb_extra.h"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PROTOCOL_VUSB
|
#ifdef PROTOCOL_VUSB
|
||||||
# include "usbdrv.h"
|
# include "usbdrv.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -165,9 +158,6 @@ static void print_version(void) {
|
|||||||
/* build options */
|
/* build options */
|
||||||
print("OPTIONS:"
|
print("OPTIONS:"
|
||||||
|
|
||||||
#ifdef PROTOCOL_PJRC
|
|
||||||
" PJRC"
|
|
||||||
#endif
|
|
||||||
#ifdef PROTOCOL_LUFA
|
#ifdef PROTOCOL_LUFA
|
||||||
" LUFA"
|
" LUFA"
|
||||||
#endif
|
#endif
|
||||||
@@ -217,20 +207,6 @@ static void print_status(void) {
|
|||||||
print_val_hex8(keymap_config.nkro);
|
print_val_hex8(keymap_config.nkro);
|
||||||
#endif
|
#endif
|
||||||
print_val_hex32(timer_read32());
|
print_val_hex32(timer_read32());
|
||||||
|
|
||||||
#ifdef PROTOCOL_PJRC
|
|
||||||
print_val_hex8(UDCON);
|
|
||||||
print_val_hex8(UDIEN);
|
|
||||||
print_val_hex8(UDINT);
|
|
||||||
print_val_hex8(usb_keyboard_leds);
|
|
||||||
print_val_hex8(usb_keyboard_idle_count);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PROTOCOL_PJRC
|
|
||||||
# if USB_COUNT_SOF
|
|
||||||
print_val_hex8(usbSofCount);
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,27 +1,11 @@
|
|||||||
BLUEFRUIT_DIR = protocol/bluefruit
|
BLUEFRUIT_DIR = protocol/bluefruit
|
||||||
PJRC_DIR = protocol/pjrc
|
|
||||||
|
|
||||||
SRC += $(BLUEFRUIT_DIR)/main.c \
|
SRC += $(BLUEFRUIT_DIR)/main.c \
|
||||||
$(BLUEFRUIT_DIR)/bluefruit.c \
|
$(BLUEFRUIT_DIR)/bluefruit.c \
|
||||||
serial_uart.c \
|
serial_uart.c
|
||||||
$(PJRC_DIR)/pjrc.c \
|
|
||||||
$(PJRC_DIR)/usb_keyboard.c \
|
|
||||||
$(PJRC_DIR)/usb_debug.c \
|
|
||||||
$(PJRC_DIR)/usb.c
|
|
||||||
|
|
||||||
# Option modules
|
|
||||||
ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
|
|
||||||
SRC += $(PJRC_DIR)/usb_mouse.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef EXTRAKEY_ENABLE
|
|
||||||
SRC += $(PJRC_DIR)/usb_extra.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Search Path
|
# Search Path
|
||||||
VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)
|
VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)
|
||||||
#VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)/usb_debug_only
|
#VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)/usb_debug_only
|
||||||
VPATH += $(TMK_DIR)/$(PJRC_DIR)
|
|
||||||
|
|
||||||
OPT_DEFS += -DPROTOCOL_BLUEFRUIT
|
OPT_DEFS += -DPROTOCOL_BLUEFRUIT
|
||||||
OPT_DEFS += -DPROTOCOL_PJRC
|
|
||||||
@@ -24,7 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include <util/delay.h>
|
#include <util/delay.h>
|
||||||
#include "../serial.h"
|
#include "../serial.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "usb.h"
|
|
||||||
#include "host.h"
|
#include "host.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
@@ -32,14 +31,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "sendchar.h"
|
#include "sendchar.h"
|
||||||
#include "suspend.h"
|
#include "suspend.h"
|
||||||
#include "bluefruit.h"
|
#include "bluefruit.h"
|
||||||
#include "pjrc.h"
|
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
||||||
|
|
||||||
#define HOST_DRIVER_NOT_SET 0
|
|
||||||
#define BLUEFRUIT_HOST_DRIVER 1
|
|
||||||
#define PJRC_HOST_DRIVER 2
|
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
CPU_PRESCALE(0);
|
CPU_PRESCALE(0);
|
||||||
|
|
||||||
@@ -51,27 +45,11 @@ int main(void) {
|
|||||||
|
|
||||||
print_set_sendchar(sendchar);
|
print_set_sendchar(sendchar);
|
||||||
|
|
||||||
// usb_init();
|
|
||||||
// _delay_ms(2000);
|
|
||||||
// while (!usb_configured()) /* wait */
|
|
||||||
|
|
||||||
keyboard_setup();
|
keyboard_setup();
|
||||||
|
|
||||||
dprintf("Initializing keyboard...\n");
|
dprintf("Initializing keyboard...\n");
|
||||||
keyboard_init();
|
keyboard_init();
|
||||||
|
|
||||||
// This implementation is pretty simplistic... if the USB connection
|
|
||||||
// is not configured, choose the Bluefruit, otherwise use USB
|
|
||||||
// Definitely would prefer to have this driven by an input pin and make
|
|
||||||
// it switch dynamically - BCG
|
|
||||||
// if (!usb_configured()) {
|
|
||||||
|
|
||||||
// // Send power to Bluefruit... Adafruit says it takes 27 mA, I think
|
|
||||||
// // the pins should provide 40 mA, but just in case I switch the
|
|
||||||
// // Bluefruit using a transistor - BCG
|
|
||||||
// DDRB = _BV(PB6);
|
|
||||||
// PORTB |= _BV(PB6);
|
|
||||||
|
|
||||||
dprintf("Setting host driver to bluefruit...\n");
|
dprintf("Setting host driver to bluefruit...\n");
|
||||||
host_set_driver(bluefruit_driver());
|
host_set_driver(bluefruit_driver());
|
||||||
|
|
||||||
@@ -106,29 +84,4 @@ int main(void) {
|
|||||||
while (1) {
|
while (1) {
|
||||||
keyboard_task();
|
keyboard_task();
|
||||||
}
|
}
|
||||||
|
|
||||||
// } else {
|
|
||||||
|
|
||||||
// // I'm not smart enough to get this done with LUFA - BCG
|
|
||||||
// dprintf("Setting host driver to PJRC...\n");
|
|
||||||
// host_set_driver(pjrc_driver());
|
|
||||||
// #ifdef SLEEP_LED_ENABLE
|
|
||||||
// sleep_led_init();
|
|
||||||
// #endif
|
|
||||||
// // wait an extra second for the PC's operating system
|
|
||||||
// // to load drivers and do whatever it does to actually
|
|
||||||
// // be ready for input
|
|
||||||
// _delay_ms(1000);
|
|
||||||
// PORTB = ~_BV(PB0);
|
|
||||||
// dprintf("Starting main loop");
|
|
||||||
// while (1) {
|
|
||||||
// while (suspend) {
|
|
||||||
// suspend_power_down();
|
|
||||||
// if (remote_wakeup && suspend_wakeup_condition()) {
|
|
||||||
// usb_remote_wakeup();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// keyboard_task();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
PJRC_DIR = protocol/pjrc
|
|
||||||
|
|
||||||
SRC += $(PJRC_DIR)/main.c \
|
|
||||||
$(PJRC_DIR)/pjrc.c \
|
|
||||||
$(PJRC_DIR)/usb_keyboard.c \
|
|
||||||
$(PJRC_DIR)/usb_debug.c \
|
|
||||||
$(PJRC_DIR)/usb.c
|
|
||||||
|
|
||||||
# Option modules
|
|
||||||
ifdef MOUSEKEY_ENABLE
|
|
||||||
SRC += $(PJRC_DIR)/usb_mouse.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef ADB_MOUSE_ENABLE
|
|
||||||
SRC += $(PJRC_DIR)/usb_mouse.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef PS2_MOUSE_ENABLE
|
|
||||||
SRC += $(PJRC_DIR)/usb_mouse.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef EXTRAKEY_ENABLE
|
|
||||||
SRC += $(PJRC_DIR)/usb_extra.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
ifdef POINTING_DEVICE_ENABLE
|
|
||||||
SRC += $(PJRC_DIR)/usb_mouse.c
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Search Path
|
|
||||||
VPATH += $(TMK_DIR)/$(PJRC_DIR)
|
|
||||||
|
|
||||||
# This indicates using LUFA stack
|
|
||||||
OPT_DEFS += -DPROTOCOL_PJRC
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
Endpoint configuration
|
|
||||||
----------------------
|
|
||||||
0 Control endpoint
|
|
||||||
1 keyboard
|
|
||||||
2 mouse
|
|
||||||
3 debug
|
|
||||||
4 extra key(consumer/system)
|
|
||||||
5 nkro keyboard(supported only on ATmega32U4/16U4 and AT90USB64/128)
|
|
||||||
|
|
||||||
|
|
||||||
ATmega32U4/16U4, AT90USB64/128
|
|
||||||
• Endpoint 0:programmable size FIFO up to 64 bytes, default control endpoint
|
|
||||||
• Endpoints 1 programmable size FIFO up to 256 bytes in ping-pong mode.
|
|
||||||
• Endpoints 2 to 6: programmable size FIFO up to 64 bytes in ping-pong mode.
|
|
||||||
|
|
||||||
AT90USB82/162, ATmega8U2/16U2/32U2
|
|
||||||
• Endpoint 0:programmable size FIFO up to 64 bytes, default control endpoint
|
|
||||||
• Endpoints 1 and 2: programmable size FIFO up to 64 bytes.
|
|
||||||
• Endpoints 3 and 4: programmable size FIFO up to 64 bytes with ping-pong mode.
|
|
||||||
|
|
||||||
ping-pong mode means double buffer feature.
|
|
||||||
|
|
||||||
|
|
||||||
NOTE: ATmega8U2/16U2/32U2 is not supported with PJRC stack at this time.
|
|
||||||
TODO: Macro definition for ATmega8U2/16U2/32U2 in usb.h
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
/* Keyboard example with debug channel, for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2008 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include <avr/wdt.h>
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include "keyboard.h"
|
|
||||||
#include "usb.h"
|
|
||||||
#include "matrix.h"
|
|
||||||
#include "print.h"
|
|
||||||
#include "debug.h"
|
|
||||||
#include "sendchar.h"
|
|
||||||
#include "util.h"
|
|
||||||
#include "suspend.h"
|
|
||||||
#include "host.h"
|
|
||||||
#include "pjrc.h"
|
|
||||||
|
|
||||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
// set for 16 MHz clock
|
|
||||||
CPU_PRESCALE(0);
|
|
||||||
|
|
||||||
keyboard_setup();
|
|
||||||
|
|
||||||
// Initialize the USB, and then wait for the host to set configuration.
|
|
||||||
// If the Teensy is powered without a PC connected to the USB port,
|
|
||||||
// this will wait forever.
|
|
||||||
usb_init();
|
|
||||||
while (!usb_configured()) /* wait */
|
|
||||||
;
|
|
||||||
|
|
||||||
print_set_sendchar(sendchar);
|
|
||||||
|
|
||||||
keyboard_init();
|
|
||||||
host_set_driver(pjrc_driver());
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_init();
|
|
||||||
#endif
|
|
||||||
while (1) {
|
|
||||||
while (suspend) {
|
|
||||||
suspend_power_down();
|
|
||||||
if (remote_wakeup && suspend_wakeup_condition()) {
|
|
||||||
usb_remote_wakeup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
keyboard_task();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2011 Jun Wako <[email protected]>
|
|
||||||
|
|
||||||
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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "usb_keyboard.h"
|
|
||||||
#include "usb_mouse.h"
|
|
||||||
#include "usb_extra.h"
|
|
||||||
#include "host_driver.h"
|
|
||||||
#include "pjrc.h"
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------*
|
|
||||||
* Host driver
|
|
||||||
*------------------------------------------------------------------*/
|
|
||||||
static uint8_t keyboard_leds(void);
|
|
||||||
static void send_keyboard(report_keyboard_t *report);
|
|
||||||
static void send_mouse(report_mouse_t *report);
|
|
||||||
static void send_system(uint16_t data);
|
|
||||||
static void send_consumer(uint16_t data);
|
|
||||||
|
|
||||||
static host_driver_t driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer};
|
|
||||||
|
|
||||||
host_driver_t *pjrc_driver(void) { return &driver; }
|
|
||||||
|
|
||||||
static uint8_t keyboard_leds(void) { return usb_keyboard_leds; }
|
|
||||||
|
|
||||||
static void send_keyboard(report_keyboard_t *report) { usb_keyboard_send_report(report); }
|
|
||||||
|
|
||||||
static void send_mouse(report_mouse_t *report) {
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
usb_mouse_send(report->x, report->y, report->v, report->h, report->buttons);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void send_system(uint16_t data) {
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
usb_extra_system_send(data);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void send_consumer(uint16_t data) {
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
usb_extra_consumer_send(data);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
@@ -1,970 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include "usb.h"
|
|
||||||
#include "usb_keyboard.h"
|
|
||||||
#include "usb_mouse.h"
|
|
||||||
#include "usb_debug.h"
|
|
||||||
#include "usb_extra.h"
|
|
||||||
#include "led.h"
|
|
||||||
#include "print.h"
|
|
||||||
#include "util.h"
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
# include "sleep_led.h"
|
|
||||||
#endif
|
|
||||||
#include "suspend.h"
|
|
||||||
#include "action.h"
|
|
||||||
#include "action_util.h"
|
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
# include "keycode_config.h"
|
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Configurable Options
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// You can change these to give your code its own name.
|
|
||||||
#ifndef MANUFACTURER
|
|
||||||
# define STR_MANUFACTURER L"t.m.k."
|
|
||||||
#else
|
|
||||||
# define STR_MANUFACTURER LSTR(MANUFACTURER)
|
|
||||||
#endif
|
|
||||||
#ifndef PRODUCT
|
|
||||||
# define STR_PRODUCT L"t.m.k. keyboard"
|
|
||||||
#else
|
|
||||||
# define STR_PRODUCT LSTR(PRODUCT)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Mac OS-X and Linux automatically load the correct drivers. On
|
|
||||||
// Windows, even though the driver is supplied by Microsoft, an
|
|
||||||
// INF file is needed to load the driver. These numbers need to
|
|
||||||
// match the INF file.
|
|
||||||
#ifndef VENDOR_ID
|
|
||||||
# define VENDOR_ID 0xFEED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PRODUCT_ID
|
|
||||||
# define PRODUCT_ID 0xBABE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DEVICE_VER
|
|
||||||
# define DEVICE_VER 0x0100
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// USB devices are supposed to implment a halt feature, which is
|
|
||||||
// rarely (if ever) used. If you comment this line out, the halt
|
|
||||||
// code will be removed, saving 102 bytes of space (gcc 4.3.0).
|
|
||||||
// This is not strictly USB compliant, but works with all major
|
|
||||||
// operating systems.
|
|
||||||
#define SUPPORT_ENDPOINT_HALT
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Endpoint Buffer Configuration
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
#define ENDPOINT0_SIZE 32
|
|
||||||
|
|
||||||
bool remote_wakeup = false;
|
|
||||||
bool suspend = false;
|
|
||||||
|
|
||||||
// 0:control endpoint is enabled automatically by controller.
|
|
||||||
static const uint8_t PROGMEM endpoint_config_table[] = {
|
|
||||||
// enable, UECFG0X(type, direction), UECFG1X(size, bank, allocation)
|
|
||||||
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(KBD_SIZE) | KBD_BUFFER, // 1
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(MOUSE_SIZE) | MOUSE_BUFFER, // 2
|
|
||||||
#else
|
|
||||||
0, // 2
|
|
||||||
#endif
|
|
||||||
#ifdef CONSOLE_ENABLE
|
|
||||||
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(DEBUG_TX_SIZE) | DEBUG_TX_BUFFER, // 3
|
|
||||||
#else
|
|
||||||
0,
|
|
||||||
#endif
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(EXTRA_SIZE) | EXTRA_BUFFER, // 4
|
|
||||||
#else
|
|
||||||
0, // 4
|
|
||||||
#endif
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
1, EP_TYPE_INTERRUPT_IN, EP_SIZE(KBD2_SIZE) | KBD2_BUFFER, // 5
|
|
||||||
#else
|
|
||||||
0, // 5
|
|
||||||
#endif
|
|
||||||
0, // 6
|
|
||||||
};
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Descriptor Data
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// Descriptors are the data that your computer reads when it auto-detects
|
|
||||||
// this USB device (called "enumeration" in USB lingo). The most commonly
|
|
||||||
// changed items are editable at the top of this file. Changing things
|
|
||||||
// in here should only be done by those who've read chapter 9 of the USB
|
|
||||||
// spec and relevant portions of any USB class specifications!
|
|
||||||
|
|
||||||
static const uint8_t PROGMEM device_descriptor[] = {
|
|
||||||
18, // bLength
|
|
||||||
1, // bDescriptorType
|
|
||||||
0x00,
|
|
||||||
0x02, // bcdUSB
|
|
||||||
0, // bDeviceClass
|
|
||||||
0, // bDeviceSubClass
|
|
||||||
0, // bDeviceProtocol
|
|
||||||
ENDPOINT0_SIZE, // bMaxPacketSize0
|
|
||||||
LSB(VENDOR_ID),
|
|
||||||
MSB(VENDOR_ID), // idVendor
|
|
||||||
LSB(PRODUCT_ID),
|
|
||||||
MSB(PRODUCT_ID), // idProduct
|
|
||||||
LSB(DEVICE_VER),
|
|
||||||
MSB(DEVICE_VER), // bcdDevice
|
|
||||||
1, // iManufacturer
|
|
||||||
2, // iProduct
|
|
||||||
0, // iSerialNumber
|
|
||||||
1 // bNumConfigurations
|
|
||||||
};
|
|
||||||
|
|
||||||
// Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
|
|
||||||
static const uint8_t PROGMEM keyboard_hid_report_desc[] = {
|
|
||||||
0x05, 0x01, // Usage Page (Generic Desktop),
|
|
||||||
0x09, 0x06, // Usage (Keyboard),
|
|
||||||
0xA1, 0x01, // Collection (Application),
|
|
||||||
0x75, 0x01, // Report Size (1),
|
|
||||||
0x95, 0x08, // Report Count (8),
|
|
||||||
0x05, 0x07, // Usage Page (Key Codes),
|
|
||||||
0x19, 0xE0, // Usage Minimum (224),
|
|
||||||
0x29, 0xE7, // Usage Maximum (231),
|
|
||||||
0x15, 0x00, // Logical Minimum (0),
|
|
||||||
0x25, 0x01, // Logical Maximum (1),
|
|
||||||
0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
|
|
||||||
0x95, 0x01, // Report Count (1),
|
|
||||||
0x75, 0x08, // Report Size (8),
|
|
||||||
0x81, 0x03, // Input (Constant), ;Reserved byte
|
|
||||||
0x95, 0x05, // Report Count (5),
|
|
||||||
0x75, 0x01, // Report Size (1),
|
|
||||||
0x05, 0x08, // Usage Page (LEDs),
|
|
||||||
0x19, 0x01, // Usage Minimum (1),
|
|
||||||
0x29, 0x05, // Usage Maximum (5),
|
|
||||||
0x91, 0x02, // Output (Data, Variable, Absolute), ;LED report
|
|
||||||
0x95, 0x01, // Report Count (1),
|
|
||||||
0x75, 0x03, // Report Size (3),
|
|
||||||
0x91, 0x03, // Output (Constant), ;LED report padding
|
|
||||||
0x95, KBD_REPORT_KEYS, // Report Count (),
|
|
||||||
0x75, 0x08, // Report Size (8),
|
|
||||||
0x15, 0x00, // Logical Minimum (0),
|
|
||||||
0x25, 0xFF, // Logical Maximum(255),
|
|
||||||
0x05, 0x07, // Usage Page (Key Codes),
|
|
||||||
0x19, 0x00, // Usage Minimum (0),
|
|
||||||
0x29, 0xFF, // Usage Maximum (255),
|
|
||||||
0x81, 0x00, // Input (Data, Array),
|
|
||||||
0xc0 // End Collection
|
|
||||||
};
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
static const uint8_t PROGMEM keyboard2_hid_report_desc[] = {
|
|
||||||
0x05, 0x01, // Usage Page (Generic Desktop),
|
|
||||||
0x09, 0x06, // Usage (Keyboard),
|
|
||||||
0xA1, 0x01, // Collection (Application),
|
|
||||||
// bitmap of modifiers
|
|
||||||
0x75, 0x01, // Report Size (1),
|
|
||||||
0x95, 0x08, // Report Count (8),
|
|
||||||
0x05, 0x07, // Usage Page (Key Codes),
|
|
||||||
0x19, 0xE0, // Usage Minimum (224),
|
|
||||||
0x29, 0xE7, // Usage Maximum (231),
|
|
||||||
0x15, 0x00, // Logical Minimum (0),
|
|
||||||
0x25, 0x01, // Logical Maximum (1),
|
|
||||||
0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
|
|
||||||
// LED output report
|
|
||||||
0x95, 0x05, // Report Count (5),
|
|
||||||
0x75, 0x01, // Report Size (1),
|
|
||||||
0x05, 0x08, // Usage Page (LEDs),
|
|
||||||
0x19, 0x01, // Usage Minimum (1),
|
|
||||||
0x29, 0x05, // Usage Maximum (5),
|
|
||||||
0x91, 0x02, // Output (Data, Variable, Absolute),
|
|
||||||
0x95, 0x01, // Report Count (1),
|
|
||||||
0x75, 0x03, // Report Size (3),
|
|
||||||
0x91, 0x03, // Output (Constant),
|
|
||||||
// bitmap of keys
|
|
||||||
0x95, KBD2_REPORT_KEYS * 8, // Report Count (),
|
|
||||||
0x75, 0x01, // Report Size (1),
|
|
||||||
0x15, 0x00, // Logical Minimum (0),
|
|
||||||
0x25, 0x01, // Logical Maximum(1),
|
|
||||||
0x05, 0x07, // Usage Page (Key Codes),
|
|
||||||
0x19, 0x00, // Usage Minimum (0),
|
|
||||||
0x29, KBD2_REPORT_KEYS * 8 - 1, // Usage Maximum (),
|
|
||||||
0x81, 0x02, // Input (Data, Variable, Absolute),
|
|
||||||
0xc0 // End Collection
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
// Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
|
|
||||||
// http://www.microchip.com/forums/tm.aspx?high=&m=391435&mpage=1#391521
|
|
||||||
// http://www.keil.com/forum/15671/
|
|
||||||
// http://www.microsoft.com/whdc/device/input/wheel.mspx
|
|
||||||
static const uint8_t PROGMEM mouse_hid_report_desc[] = {
|
|
||||||
/* mouse */
|
|
||||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
|
||||||
0x09, 0x02, // USAGE (Mouse)
|
|
||||||
0xa1, 0x01, // COLLECTION (Application)
|
|
||||||
// 0x85, REPORT_ID_MOUSE, // REPORT_ID (1)
|
|
||||||
0x09, 0x01, // USAGE (Pointer)
|
|
||||||
0xa1, 0x00, // COLLECTION (Physical)
|
|
||||||
// ---------------------------- Buttons
|
|
||||||
0x05, 0x09, // USAGE_PAGE (Button)
|
|
||||||
0x19, 0x01, // USAGE_MINIMUM (Button 1)
|
|
||||||
0x29, 0x05, // USAGE_MAXIMUM (Button 5)
|
|
||||||
0x15, 0x00, // LOGICAL_MINIMUM (0)
|
|
||||||
0x25, 0x01, // LOGICAL_MAXIMUM (1)
|
|
||||||
0x75, 0x01, // REPORT_SIZE (1)
|
|
||||||
0x95, 0x05, // REPORT_COUNT (5)
|
|
||||||
0x81, 0x02, // INPUT (Data,Var,Abs)
|
|
||||||
0x75, 0x03, // REPORT_SIZE (3)
|
|
||||||
0x95, 0x01, // REPORT_COUNT (1)
|
|
||||||
0x81, 0x03, // INPUT (Cnst,Var,Abs)
|
|
||||||
// ---------------------------- X,Y position
|
|
||||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
|
||||||
0x09, 0x30, // USAGE (X)
|
|
||||||
0x09, 0x31, // USAGE (Y)
|
|
||||||
0x15, 0x81, // LOGICAL_MINIMUM (-127)
|
|
||||||
0x25, 0x7f, // LOGICAL_MAXIMUM (127)
|
|
||||||
0x75, 0x08, // REPORT_SIZE (8)
|
|
||||||
0x95, 0x02, // REPORT_COUNT (2)
|
|
||||||
0x81, 0x06, // INPUT (Data,Var,Rel)
|
|
||||||
// ---------------------------- Vertical wheel
|
|
||||||
0x09, 0x38, // USAGE (Wheel)
|
|
||||||
0x15, 0x81, // LOGICAL_MINIMUM (-127)
|
|
||||||
0x25, 0x7f, // LOGICAL_MAXIMUM (127)
|
|
||||||
0x35, 0x00, // PHYSICAL_MINIMUM (0) - reset physical
|
|
||||||
0x45, 0x00, // PHYSICAL_MAXIMUM (0)
|
|
||||||
0x75, 0x08, // REPORT_SIZE (8)
|
|
||||||
0x95, 0x01, // REPORT_COUNT (1)
|
|
||||||
0x81, 0x06, // INPUT (Data,Var,Rel)
|
|
||||||
// ---------------------------- Horizontal wheel
|
|
||||||
0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
|
|
||||||
0x0a, 0x38, 0x02, // USAGE (AC Pan)
|
|
||||||
0x15, 0x81, // LOGICAL_MINIMUM (-127)
|
|
||||||
0x25, 0x7f, // LOGICAL_MAXIMUM (127)
|
|
||||||
0x75, 0x08, // REPORT_SIZE (8)
|
|
||||||
0x95, 0x01, // REPORT_COUNT (1)
|
|
||||||
0x81, 0x06, // INPUT (Data,Var,Rel)
|
|
||||||
0xc0, // END_COLLECTION
|
|
||||||
0xc0, // END_COLLECTION
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static const uint8_t PROGMEM debug_hid_report_desc[] = {
|
|
||||||
0x06, 0x31, 0xFF, // Usage Page 0xFF31 (vendor defined)
|
|
||||||
0x09, 0x74, // Usage 0x74
|
|
||||||
0xA1, 0x53, // Collection 0x53
|
|
||||||
0x75, 0x08, // report size = 8 bits
|
|
||||||
0x15, 0x00, // logical minimum = 0
|
|
||||||
0x26, 0xFF, 0x00, // logical maximum = 255
|
|
||||||
0x95, DEBUG_TX_SIZE, // report count
|
|
||||||
0x09, 0x75, // usage
|
|
||||||
0x81, 0x02, // Input (array)
|
|
||||||
0xC0 // end collection
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
// audio controls & system controls
|
|
||||||
// http://www.microsoft.com/whdc/archive/w2kbd.mspx
|
|
||||||
static const uint8_t PROGMEM extra_hid_report_desc[] = {
|
|
||||||
/* system control */
|
|
||||||
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
|
|
||||||
0x09, 0x80, // USAGE (System Control)
|
|
||||||
0xa1, 0x01, // COLLECTION (Application)
|
|
||||||
0x85, REPORT_ID_SYSTEM, // REPORT_ID (2)
|
|
||||||
0x15, 0x01, // LOGICAL_MINIMUM (0x1)
|
|
||||||
0x25, 0xb7, // LOGICAL_MAXIMUM (0xb7)
|
|
||||||
0x19, 0x01, // USAGE_MINIMUM (0x1)
|
|
||||||
0x29, 0xb7, // USAGE_MAXIMUM (0xb7)
|
|
||||||
0x75, 0x10, // REPORT_SIZE (16)
|
|
||||||
0x95, 0x01, // REPORT_COUNT (1)
|
|
||||||
0x81, 0x00, // INPUT (Data,Array,Abs)
|
|
||||||
0xc0, // END_COLLECTION
|
|
||||||
/* consumer */
|
|
||||||
0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
|
|
||||||
0x09, 0x01, // USAGE (Consumer Control)
|
|
||||||
0xa1, 0x01, // COLLECTION (Application)
|
|
||||||
0x85, REPORT_ID_CONSUMER, // REPORT_ID (3)
|
|
||||||
0x15, 0x01, // LOGICAL_MINIMUM (0x1)
|
|
||||||
0x26, 0x9c, 0x02, // LOGICAL_MAXIMUM (0x29c)
|
|
||||||
0x19, 0x01, // USAGE_MINIMUM (0x1)
|
|
||||||
0x2a, 0x9c, 0x02, // USAGE_MAXIMUM (0x29c)
|
|
||||||
0x75, 0x10, // REPORT_SIZE (16)
|
|
||||||
0x95, 0x01, // REPORT_COUNT (1)
|
|
||||||
0x81, 0x00, // INPUT (Data,Array,Abs)
|
|
||||||
0xc0, // END_COLLECTION
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define KBD_HID_DESC_NUM 0
|
|
||||||
#define KBD_HID_DESC_OFFSET (9 + (9 + 9 + 7) * KBD_HID_DESC_NUM + 9)
|
|
||||||
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 1)
|
|
||||||
# define MOUSE_HID_DESC_OFFSET (9 + (9 + 9 + 7) * MOUSE_HID_DESC_NUM + 9)
|
|
||||||
#else
|
|
||||||
# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONSOLE_ENABLE
|
|
||||||
# define DEBUG_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 1)
|
|
||||||
# define DEBUG_HID_DESC_OFFSET (9 + (9 + 9 + 7) * DEBUG_HID_DESC_NUM + 9)
|
|
||||||
#else
|
|
||||||
# define DEBUG_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
# define EXTRA_HID_DESC_NUM (DEBUG_HID_DESC_NUM + 1)
|
|
||||||
# define EXTRA_HID_DESC_OFFSET (9 + (9 + 9 + 7) * EXTRA_HID_DESC_NUM + 9)
|
|
||||||
#else
|
|
||||||
# define EXTRA_HID_DESC_NUM (DEBUG_HID_DESC_NUM + 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
# define KBD2_HID_DESC_NUM (EXTRA_HID_DESC_NUM + 1)
|
|
||||||
# define KBD2_HID_DESC_OFFSET (9 + (9 + 9 + 7) * EXTRA_HID_DESC_NUM + 9)
|
|
||||||
#else
|
|
||||||
# define KBD2_HID_DESC_NUM (EXTRA_HID_DESC_NUM + 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define NUM_INTERFACES (KBD2_HID_DESC_NUM + 1)
|
|
||||||
#define CONFIG1_DESC_SIZE (9 + (9 + 9 + 7) * NUM_INTERFACES)
|
|
||||||
static const uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
|
|
||||||
// configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
|
|
||||||
9, // bLength;
|
|
||||||
2, // bDescriptorType;
|
|
||||||
LSB(CONFIG1_DESC_SIZE), // wTotalLength
|
|
||||||
MSB(CONFIG1_DESC_SIZE),
|
|
||||||
NUM_INTERFACES, // bNumInterfaces
|
|
||||||
1, // bConfigurationValue
|
|
||||||
0, // iConfiguration
|
|
||||||
0xA0, // bmAttributes
|
|
||||||
50, // bMaxPower
|
|
||||||
|
|
||||||
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
|
|
||||||
9, // bLength
|
|
||||||
4, // bDescriptorType
|
|
||||||
KBD_INTERFACE, // bInterfaceNumber
|
|
||||||
0, // bAlternateSetting
|
|
||||||
1, // bNumEndpoints
|
|
||||||
0x03, // bInterfaceClass (0x03 = HID)
|
|
||||||
0x01, // bInterfaceSubClass (0x01 = Boot)
|
|
||||||
0x01, // bInterfaceProtocol (0x01 = Keyboard)
|
|
||||||
0, // iInterface
|
|
||||||
// HID descriptor, HID 1.11 spec, section 6.2.1
|
|
||||||
9, // bLength
|
|
||||||
0x21, // bDescriptorType
|
|
||||||
0x11, 0x01, // bcdHID
|
|
||||||
0, // bCountryCode
|
|
||||||
1, // bNumDescriptors
|
|
||||||
0x22, // bDescriptorType
|
|
||||||
sizeof(keyboard_hid_report_desc), // wDescriptorLength
|
|
||||||
0,
|
|
||||||
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
|
|
||||||
7, // bLength
|
|
||||||
5, // bDescriptorType
|
|
||||||
KBD_ENDPOINT | 0x80, // bEndpointAddress
|
|
||||||
0x03, // bmAttributes (0x03=intr)
|
|
||||||
KBD_SIZE, 0, // wMaxPacketSize
|
|
||||||
10, // bInterval
|
|
||||||
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
|
|
||||||
9, // bLength
|
|
||||||
4, // bDescriptorType
|
|
||||||
MOUSE_INTERFACE, // bInterfaceNumber
|
|
||||||
0, // bAlternateSetting
|
|
||||||
1, // bNumEndpoints
|
|
||||||
0x03, // bInterfaceClass (0x03 = HID)
|
|
||||||
// ThinkPad T23 BIOS doesn't work with boot mouse.
|
|
||||||
0x00, // bInterfaceSubClass (0x01 = Boot)
|
|
||||||
0x00, // bInterfaceProtocol (0x02 = Mouse)
|
|
||||||
/*
|
|
||||||
0x01, // bInterfaceSubClass (0x01 = Boot)
|
|
||||||
0x02, // bInterfaceProtocol (0x02 = Mouse)
|
|
||||||
*/
|
|
||||||
0, // iInterface
|
|
||||||
// HID descriptor, HID 1.11 spec, section 6.2.1
|
|
||||||
9, // bLength
|
|
||||||
0x21, // bDescriptorType
|
|
||||||
0x11, 0x01, // bcdHID
|
|
||||||
0, // bCountryCode
|
|
||||||
1, // bNumDescriptors
|
|
||||||
0x22, // bDescriptorType
|
|
||||||
sizeof(mouse_hid_report_desc), // wDescriptorLength
|
|
||||||
0,
|
|
||||||
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
|
|
||||||
7, // bLength
|
|
||||||
5, // bDescriptorType
|
|
||||||
MOUSE_ENDPOINT | 0x80, // bEndpointAddress
|
|
||||||
0x03, // bmAttributes (0x03=intr)
|
|
||||||
MOUSE_SIZE, 0, // wMaxPacketSize
|
|
||||||
1, // bInterval
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef CONSOLE_ENABLE
|
|
||||||
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
|
|
||||||
9, // bLength
|
|
||||||
4, // bDescriptorType
|
|
||||||
DEBUG_INTERFACE, // bInterfaceNumber
|
|
||||||
0, // bAlternateSetting
|
|
||||||
1, // bNumEndpoints
|
|
||||||
0x03, // bInterfaceClass (0x03 = HID)
|
|
||||||
0x00, // bInterfaceSubClass
|
|
||||||
0x00, // bInterfaceProtocol
|
|
||||||
0, // iInterface
|
|
||||||
// HID descriptor, HID 1.11 spec, section 6.2.1
|
|
||||||
9, // bLength
|
|
||||||
0x21, // bDescriptorType
|
|
||||||
0x11, 0x01, // bcdHID
|
|
||||||
0, // bCountryCode
|
|
||||||
1, // bNumDescriptors
|
|
||||||
0x22, // bDescriptorType
|
|
||||||
sizeof(debug_hid_report_desc), // wDescriptorLength
|
|
||||||
0,
|
|
||||||
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
|
|
||||||
7, // bLength
|
|
||||||
5, // bDescriptorType
|
|
||||||
DEBUG_TX_ENDPOINT | 0x80, // bEndpointAddress
|
|
||||||
0x03, // bmAttributes (0x03=intr)
|
|
||||||
DEBUG_TX_SIZE, 0, // wMaxPacketSize
|
|
||||||
1, // bInterval
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
|
|
||||||
9, // bLength
|
|
||||||
4, // bDescriptorType
|
|
||||||
EXTRA_INTERFACE, // bInterfaceNumber
|
|
||||||
0, // bAlternateSetting
|
|
||||||
1, // bNumEndpoints
|
|
||||||
0x03, // bInterfaceClass (0x03 = HID)
|
|
||||||
0x00, // bInterfaceSubClass
|
|
||||||
0x00, // bInterfaceProtocol
|
|
||||||
0, // iInterface
|
|
||||||
// HID descriptor, HID 1.11 spec, section 6.2.1
|
|
||||||
9, // bLength
|
|
||||||
0x21, // bDescriptorType
|
|
||||||
0x11, 0x01, // bcdHID
|
|
||||||
0, // bCountryCode
|
|
||||||
1, // bNumDescriptors
|
|
||||||
0x22, // bDescriptorType
|
|
||||||
sizeof(extra_hid_report_desc), // wDescriptorLength
|
|
||||||
0,
|
|
||||||
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
|
|
||||||
7, // bLength
|
|
||||||
5, // bDescriptorType
|
|
||||||
EXTRA_ENDPOINT | 0x80, // bEndpointAddress
|
|
||||||
0x03, // bmAttributes (0x03=intr)
|
|
||||||
EXTRA_SIZE, 0, // wMaxPacketSize
|
|
||||||
10, // bInterval
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
// interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
|
|
||||||
9, // bLength
|
|
||||||
4, // bDescriptorType
|
|
||||||
KBD2_INTERFACE, // bInterfaceNumber
|
|
||||||
0, // bAlternateSetting
|
|
||||||
1, // bNumEndpoints
|
|
||||||
0x03, // bInterfaceClass (0x03 = HID)
|
|
||||||
0x00, // bInterfaceSubClass (0x01 = Boot)
|
|
||||||
0x00, // bInterfaceProtocol (0x01 = Keyboard)
|
|
||||||
0, // iInterface
|
|
||||||
// HID descriptor, HID 1.11 spec, section 6.2.1
|
|
||||||
9, // bLength
|
|
||||||
0x21, // bDescriptorType
|
|
||||||
0x11, 0x01, // bcdHID
|
|
||||||
0, // bCountryCode
|
|
||||||
1, // bNumDescriptors
|
|
||||||
0x22, // bDescriptorType
|
|
||||||
sizeof(keyboard2_hid_report_desc), // wDescriptorLength
|
|
||||||
0,
|
|
||||||
// endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
|
|
||||||
7, // bLength
|
|
||||||
5, // bDescriptorType
|
|
||||||
KBD2_ENDPOINT | 0x80, // bEndpointAddress
|
|
||||||
0x03, // bmAttributes (0x03=intr)
|
|
||||||
KBD2_SIZE, 0, // wMaxPacketSize
|
|
||||||
1, // bInterval
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
// If you're desperate for a little extra code memory, these strings
|
|
||||||
// can be completely removed if iManufacturer, iProduct, iSerialNumber
|
|
||||||
// in the device desciptor are changed to zeros.
|
|
||||||
struct usb_string_descriptor_struct {
|
|
||||||
uint8_t bLength;
|
|
||||||
uint8_t bDescriptorType;
|
|
||||||
int16_t wString[];
|
|
||||||
};
|
|
||||||
static const struct usb_string_descriptor_struct PROGMEM string0 = {4, 3, {0x0409}};
|
|
||||||
static const struct usb_string_descriptor_struct PROGMEM string1 = {sizeof(STR_MANUFACTURER), 3, STR_MANUFACTURER};
|
|
||||||
static const struct usb_string_descriptor_struct PROGMEM string2 = {sizeof(STR_PRODUCT), 3, STR_PRODUCT};
|
|
||||||
|
|
||||||
// This table defines which descriptor data is sent for each specific
|
|
||||||
// request from the host (in wValue and wIndex).
|
|
||||||
static const struct descriptor_list_struct {
|
|
||||||
uint16_t wValue; // descriptor type
|
|
||||||
uint16_t wIndex;
|
|
||||||
const uint8_t *addr;
|
|
||||||
uint8_t length;
|
|
||||||
} PROGMEM descriptor_list[] = {
|
|
||||||
// DEVICE descriptor
|
|
||||||
{0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
|
|
||||||
// CONFIGURATION descriptor
|
|
||||||
{0x0200, 0x0000, config1_descriptor, sizeof(config1_descriptor)},
|
|
||||||
// HID/REPORT descriptors
|
|
||||||
{0x2100, KBD_INTERFACE, config1_descriptor + KBD_HID_DESC_OFFSET, 9},
|
|
||||||
{0x2200, KBD_INTERFACE, keyboard_hid_report_desc, sizeof(keyboard_hid_report_desc)},
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
{0x2100, MOUSE_INTERFACE, config1_descriptor + MOUSE_HID_DESC_OFFSET, 9},
|
|
||||||
{0x2200, MOUSE_INTERFACE, mouse_hid_report_desc, sizeof(mouse_hid_report_desc)},
|
|
||||||
#endif
|
|
||||||
#ifdef CONSOLE_ENABLE
|
|
||||||
{0x2100, DEBUG_INTERFACE, config1_descriptor + DEBUG_HID_DESC_OFFSET, 9},
|
|
||||||
{0x2200, DEBUG_INTERFACE, debug_hid_report_desc, sizeof(debug_hid_report_desc)},
|
|
||||||
#endif
|
|
||||||
#ifdef EXTRAKEY_ENABLE
|
|
||||||
{0x2100, EXTRA_INTERFACE, config1_descriptor + EXTRA_HID_DESC_OFFSET, 9},
|
|
||||||
{0x2200, EXTRA_INTERFACE, extra_hid_report_desc, sizeof(extra_hid_report_desc)},
|
|
||||||
#endif
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
{0x2100, KBD2_INTERFACE, config1_descriptor + KBD2_HID_DESC_OFFSET, 9},
|
|
||||||
{0x2200, KBD2_INTERFACE, keyboard2_hid_report_desc, sizeof(keyboard2_hid_report_desc)},
|
|
||||||
#endif
|
|
||||||
// STRING descriptors
|
|
||||||
{0x0300, 0x0000, (const uint8_t *)&string0, 4},
|
|
||||||
{0x0301, 0x0409, (const uint8_t *)&string1, sizeof(STR_MANUFACTURER)},
|
|
||||||
{0x0302, 0x0409, (const uint8_t *)&string2, sizeof(STR_PRODUCT)}};
|
|
||||||
#define NUM_DESC_LIST (sizeof(descriptor_list) / sizeof(struct descriptor_list_struct))
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Variables - these are the only non-stack RAM usage
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// zero when we are not configured, non-zero when enumerated
|
|
||||||
static volatile uint8_t usb_configuration = 0;
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Public Functions - these are the API intended for the user
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// initialize USB
|
|
||||||
void usb_init(void) {
|
|
||||||
HW_CONFIG();
|
|
||||||
USB_FREEZE(); // enable USB
|
|
||||||
PLL_CONFIG(); // config PLL
|
|
||||||
while (!(PLLCSR & (1 << PLOCK)))
|
|
||||||
; // wait for PLL lock
|
|
||||||
USB_CONFIG(); // start USB clock
|
|
||||||
UDCON = 0; // enable attach resistor
|
|
||||||
usb_configuration = 0;
|
|
||||||
suspend = false;
|
|
||||||
UDIEN = (1 << EORSTE) | (1 << SOFE) | (1 << SUSPE) | (1 << WAKEUPE);
|
|
||||||
sei();
|
|
||||||
}
|
|
||||||
|
|
||||||
// return 0 if the USB is not configured, or the configuration
|
|
||||||
// number selected by the HOST
|
|
||||||
uint8_t usb_configured(void) { return usb_configuration && !suspend; }
|
|
||||||
|
|
||||||
void usb_remote_wakeup(void) {
|
|
||||||
UDCON |= (1 << RMWKUP);
|
|
||||||
while (UDCON & (1 << RMWKUP))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* Private Functions - not intended for general user consumption....
|
|
||||||
*
|
|
||||||
**************************************************************************/
|
|
||||||
|
|
||||||
// USB Device Interrupt - handle all device-level events
|
|
||||||
// the transmit buffer flushing is triggered by the start of frame
|
|
||||||
//
|
|
||||||
ISR(USB_GEN_vect) {
|
|
||||||
uint8_t intbits, t;
|
|
||||||
static uint8_t div4 = 0;
|
|
||||||
|
|
||||||
intbits = UDINT;
|
|
||||||
UDINT = 0;
|
|
||||||
if ((intbits & (1 << SUSPI)) && (UDIEN & (1 << SUSPE)) && usb_configuration) {
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_enable();
|
|
||||||
#endif
|
|
||||||
UDIEN &= ~(1 << SUSPE);
|
|
||||||
UDIEN |= (1 << WAKEUPE);
|
|
||||||
suspend = true;
|
|
||||||
}
|
|
||||||
if ((intbits & (1 << WAKEUPI)) && (UDIEN & (1 << WAKEUPE)) && usb_configuration) {
|
|
||||||
suspend_wakeup_init();
|
|
||||||
#ifdef SLEEP_LED_ENABLE
|
|
||||||
sleep_led_disable();
|
|
||||||
// NOTE: converters may not accept this
|
|
||||||
led_set(host_keyboard_leds());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
UDIEN |= (1 << SUSPE);
|
|
||||||
UDIEN &= ~(1 << WAKEUPE);
|
|
||||||
suspend = false;
|
|
||||||
}
|
|
||||||
if (intbits & (1 << EORSTI)) {
|
|
||||||
UENUM = 0;
|
|
||||||
UECONX = 1;
|
|
||||||
UECFG0X = EP_TYPE_CONTROL;
|
|
||||||
UECFG1X = EP_SIZE(ENDPOINT0_SIZE) | EP_SINGLE_BUFFER;
|
|
||||||
UEIENX = (1 << RXSTPE);
|
|
||||||
usb_configuration = 0;
|
|
||||||
}
|
|
||||||
if ((intbits & (1 << SOFI)) && usb_configuration) {
|
|
||||||
t = debug_flush_timer;
|
|
||||||
if (t) {
|
|
||||||
debug_flush_timer = --t;
|
|
||||||
if (!t) {
|
|
||||||
UENUM = DEBUG_TX_ENDPOINT;
|
|
||||||
while ((UEINTX & (1 << RWAL))) {
|
|
||||||
UEDATX = 0;
|
|
||||||
}
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* TODO: should keep IDLE rate on each keyboard interface */
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
if (!keymap_config.nkro && keyboard_idle && (++div4 & 3) == 0) {
|
|
||||||
#else
|
|
||||||
if (keyboard_idle && (++div4 & 3) == 0) {
|
|
||||||
#endif
|
|
||||||
UENUM = KBD_ENDPOINT;
|
|
||||||
if (UEINTX & (1 << RWAL)) {
|
|
||||||
usb_keyboard_idle_count++;
|
|
||||||
if (usb_keyboard_idle_count == keyboard_idle) {
|
|
||||||
usb_keyboard_idle_count = 0;
|
|
||||||
/* TODO: fix keyboard_report inconsistency */
|
|
||||||
/* To avoid Mac SET_IDLE behaviour.
|
|
||||||
UEDATX = keyboard_report_prev->mods;
|
|
||||||
UEDATX = 0;
|
|
||||||
uint8_t keys = keyboard_protocol ? KBD_REPORT_KEYS : 6;
|
|
||||||
for (uint8_t i=0; i<keys; i++) {
|
|
||||||
UEDATX = keyboard_report_prev->keys[i];
|
|
||||||
}
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Misc functions to wait for ready and send/receive packets
|
|
||||||
static inline void usb_wait_in_ready(void) {
|
|
||||||
while (!(UEINTX & (1 << TXINI)))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
static inline void usb_send_in(void) { UEINTX = ~(1 << TXINI); }
|
|
||||||
static inline void usb_wait_receive_out(void) {
|
|
||||||
while (!(UEINTX & (1 << RXOUTI)))
|
|
||||||
;
|
|
||||||
}
|
|
||||||
static inline void usb_ack_out(void) { UEINTX = ~(1 << RXOUTI); }
|
|
||||||
|
|
||||||
// USB Endpoint Interrupt - endpoint 0 is handled here. The
|
|
||||||
// other endpoints are manipulated by the user-callable
|
|
||||||
// functions, and the start-of-frame interrupt.
|
|
||||||
//
|
|
||||||
ISR(USB_COM_vect) {
|
|
||||||
uint8_t intbits;
|
|
||||||
const uint8_t *list;
|
|
||||||
const uint8_t *cfg;
|
|
||||||
uint8_t i, n, len, en;
|
|
||||||
uint8_t bmRequestType;
|
|
||||||
uint8_t bRequest;
|
|
||||||
uint16_t wValue;
|
|
||||||
uint16_t wIndex;
|
|
||||||
uint16_t wLength;
|
|
||||||
uint16_t desc_val;
|
|
||||||
const uint8_t *desc_addr;
|
|
||||||
uint8_t desc_length;
|
|
||||||
|
|
||||||
UENUM = 0;
|
|
||||||
intbits = UEINTX;
|
|
||||||
if (intbits & (1 << RXSTPI)) {
|
|
||||||
bmRequestType = UEDATX;
|
|
||||||
bRequest = UEDATX;
|
|
||||||
wValue = UEDATX;
|
|
||||||
wValue |= (UEDATX << 8);
|
|
||||||
wIndex = UEDATX;
|
|
||||||
wIndex |= (UEDATX << 8);
|
|
||||||
wLength = UEDATX;
|
|
||||||
wLength |= (UEDATX << 8);
|
|
||||||
UEINTX = ~((1 << RXSTPI) | (1 << RXOUTI) | (1 << TXINI));
|
|
||||||
if (bRequest == GET_DESCRIPTOR) {
|
|
||||||
list = (const uint8_t *)descriptor_list;
|
|
||||||
for (i = 0;; i++) {
|
|
||||||
if (i >= NUM_DESC_LIST) {
|
|
||||||
UECONX = (1 << STALLRQ) | (1 << EPEN); // stall
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
desc_val = pgm_read_word(list);
|
|
||||||
if (desc_val != wValue) {
|
|
||||||
list += sizeof(struct descriptor_list_struct);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
list += 2;
|
|
||||||
desc_val = pgm_read_word(list);
|
|
||||||
if (desc_val != wIndex) {
|
|
||||||
list += sizeof(struct descriptor_list_struct) - 2;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
list += 2;
|
|
||||||
desc_addr = (const uint8_t *)pgm_read_word(list);
|
|
||||||
list += 2;
|
|
||||||
desc_length = pgm_read_byte(list);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
len = (wLength < 256) ? wLength : 255;
|
|
||||||
if (len > desc_length) len = desc_length;
|
|
||||||
do {
|
|
||||||
// wait for host ready for IN packet
|
|
||||||
do {
|
|
||||||
i = UEINTX;
|
|
||||||
} while (!(i & ((1 << TXINI) | (1 << RXOUTI))));
|
|
||||||
if (i & (1 << RXOUTI)) return; // abort
|
|
||||||
// send IN packet
|
|
||||||
n = len < ENDPOINT0_SIZE ? len : ENDPOINT0_SIZE;
|
|
||||||
for (i = n; i; i--) {
|
|
||||||
UEDATX = pgm_read_byte(desc_addr++);
|
|
||||||
}
|
|
||||||
len -= n;
|
|
||||||
usb_send_in();
|
|
||||||
} while (len || n == ENDPOINT0_SIZE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == SET_ADDRESS) {
|
|
||||||
usb_send_in();
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UDADDR = wValue | (1 << ADDEN);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == SET_CONFIGURATION && bmRequestType == 0) {
|
|
||||||
usb_configuration = wValue;
|
|
||||||
usb_send_in();
|
|
||||||
cfg = endpoint_config_table;
|
|
||||||
for (i = 1; i <= MAX_ENDPOINT; i++) {
|
|
||||||
UENUM = i;
|
|
||||||
en = pgm_read_byte(cfg++);
|
|
||||||
if (en) {
|
|
||||||
UECONX = (1 << EPEN);
|
|
||||||
UECFG0X = pgm_read_byte(cfg++);
|
|
||||||
UECFG1X = pgm_read_byte(cfg++);
|
|
||||||
} else {
|
|
||||||
UECONX = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UERST = UERST_MASK;
|
|
||||||
UERST = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == GET_CONFIGURATION && bmRequestType == 0x80) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = usb_configuration;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bRequest == GET_STATUS) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
i = 0;
|
|
||||||
#ifdef SUPPORT_ENDPOINT_HALT
|
|
||||||
if (bmRequestType == 0x82) {
|
|
||||||
UENUM = wIndex;
|
|
||||||
if (UECONX & (1 << STALLRQ)) i = 1;
|
|
||||||
UENUM = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
UEDATX = i;
|
|
||||||
UEDATX = 0;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == CLEAR_FEATURE || bRequest == SET_FEATURE) {
|
|
||||||
#ifdef SUPPORT_ENDPOINT_HALT
|
|
||||||
if (bmRequestType == 0x02 && wValue == ENDPOINT_HALT) {
|
|
||||||
i = wIndex & 0x7F;
|
|
||||||
if (i >= 1 && i <= MAX_ENDPOINT) {
|
|
||||||
usb_send_in();
|
|
||||||
UENUM = i;
|
|
||||||
if (bRequest == SET_FEATURE) {
|
|
||||||
UECONX = (1 << STALLRQ) | (1 << EPEN);
|
|
||||||
} else {
|
|
||||||
UECONX = (1 << STALLRQC) | (1 << RSTDT) | (1 << EPEN);
|
|
||||||
UERST = (1 << i);
|
|
||||||
UERST = 0;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (bmRequestType == 0x00 && wValue == DEVICE_REMOTE_WAKEUP) {
|
|
||||||
if (bRequest == SET_FEATURE) {
|
|
||||||
remote_wakeup = true;
|
|
||||||
} else {
|
|
||||||
remote_wakeup = false;
|
|
||||||
}
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (wIndex == KBD_INTERFACE) {
|
|
||||||
if (bmRequestType == 0xA1) {
|
|
||||||
if (bRequest == HID_GET_REPORT) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = keyboard_report->mods;
|
|
||||||
UEDATX = 0;
|
|
||||||
for (i = 0; i < 6; i++) {
|
|
||||||
UEDATX = keyboard_report->keys[i];
|
|
||||||
}
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == HID_GET_IDLE) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = keyboard_idle;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == HID_GET_PROTOCOL) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = keyboard_protocol;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bmRequestType == 0x21) {
|
|
||||||
if (bRequest == HID_SET_REPORT) {
|
|
||||||
usb_wait_receive_out();
|
|
||||||
usb_keyboard_leds = UEDATX;
|
|
||||||
usb_ack_out();
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == HID_SET_IDLE) {
|
|
||||||
keyboard_idle = (wValue >> 8);
|
|
||||||
usb_keyboard_idle_count = 0;
|
|
||||||
// usb_wait_in_ready();
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (bRequest == HID_SET_PROTOCOL) {
|
|
||||||
keyboard_protocol = wValue;
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
keymap_config.nkro = !!keyboard_protocol;
|
|
||||||
#endif
|
|
||||||
clear_keyboard();
|
|
||||||
// usb_wait_in_ready();
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifdef MOUSE_ENABLE
|
|
||||||
if (wIndex == MOUSE_INTERFACE) {
|
|
||||||
if (bmRequestType == 0xA1) {
|
|
||||||
if (bRequest == HID_GET_REPORT) {
|
|
||||||
if (wValue == HID_REPORT_INPUT) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = 0;
|
|
||||||
UEDATX = 0;
|
|
||||||
UEDATX = 0;
|
|
||||||
UEDATX = 0;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (wValue == HID_REPORT_FEATURE) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = 0x05;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bRequest == HID_GET_PROTOCOL) {
|
|
||||||
usb_wait_in_ready();
|
|
||||||
UEDATX = usb_mouse_protocol;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bmRequestType == 0x21) {
|
|
||||||
if (bRequest == HID_SET_PROTOCOL) {
|
|
||||||
usb_mouse_protocol = wValue;
|
|
||||||
usb_send_in();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (wIndex == DEBUG_INTERFACE) {
|
|
||||||
if (bRequest == HID_GET_REPORT && bmRequestType == 0xA1) {
|
|
||||||
len = wLength;
|
|
||||||
do {
|
|
||||||
// wait for host ready for IN packet
|
|
||||||
do {
|
|
||||||
i = UEINTX;
|
|
||||||
} while (!(i & ((1 << TXINI) | (1 << RXOUTI))));
|
|
||||||
if (i & (1 << RXOUTI)) return; // abort
|
|
||||||
// send IN packet
|
|
||||||
n = len < ENDPOINT0_SIZE ? len : ENDPOINT0_SIZE;
|
|
||||||
for (i = n; i; i--) {
|
|
||||||
UEDATX = 0;
|
|
||||||
}
|
|
||||||
len -= n;
|
|
||||||
usb_send_in();
|
|
||||||
} while (len || n == ENDPOINT0_SIZE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
UECONX = (1 << STALLRQ) | (1 << EPEN); // stall
|
|
||||||
}
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef USB_H
|
|
||||||
#define USB_H 1
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <avr/io.h>
|
|
||||||
|
|
||||||
extern bool remote_wakeup;
|
|
||||||
extern bool suspend;
|
|
||||||
|
|
||||||
void usb_init(void); // initialize everything
|
|
||||||
uint8_t usb_configured(void); // is the USB port configured
|
|
||||||
void usb_remote_wakeup(void);
|
|
||||||
|
|
||||||
#define EP_TYPE_CONTROL 0x00
|
|
||||||
#define EP_TYPE_BULK_IN 0x81
|
|
||||||
#define EP_TYPE_BULK_OUT 0x80
|
|
||||||
#define EP_TYPE_INTERRUPT_IN 0xC1
|
|
||||||
#define EP_TYPE_INTERRUPT_OUT 0xC0
|
|
||||||
#define EP_TYPE_ISOCHRONOUS_IN 0x41
|
|
||||||
#define EP_TYPE_ISOCHRONOUS_OUT 0x40
|
|
||||||
|
|
||||||
#define EP_SINGLE_BUFFER 0x02
|
|
||||||
#define EP_DOUBLE_BUFFER 0x06
|
|
||||||
|
|
||||||
#define EP_SIZE(s) ((s) == 64 ? 0x30 : ((s) == 32 ? 0x20 : ((s) == 16 ? 0x10 : 0x00)))
|
|
||||||
|
|
||||||
#if defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__)
|
|
||||||
# define MAX_ENDPOINT 4
|
|
||||||
# define UERST_MASK 0x1E
|
|
||||||
#else
|
|
||||||
# define MAX_ENDPOINT 6
|
|
||||||
# define UERST_MASK 0x7E
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define LSB(n) (n & 255)
|
|
||||||
#define MSB(n) ((n >> 8) & 255)
|
|
||||||
|
|
||||||
#if defined(__AVR_AT90USB162__)
|
|
||||||
# define HW_CONFIG()
|
|
||||||
# define PLL_CONFIG() (PLLCSR = ((1 << PLLE) | (1 << PLLP0)))
|
|
||||||
# define USB_CONFIG() (USBCON = (1 << USBE))
|
|
||||||
# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
|
|
||||||
#elif defined(__AVR_ATmega32U4__)
|
|
||||||
# define HW_CONFIG() (UHWCON = 0x01)
|
|
||||||
# define PLL_CONFIG() (PLLCSR = 0x12)
|
|
||||||
# define USB_CONFIG() (USBCON = ((1 << USBE) | (1 << OTGPADE)))
|
|
||||||
# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
|
|
||||||
#elif defined(__AVR_AT90USB646__)
|
|
||||||
# define HW_CONFIG() (UHWCON = 0x81)
|
|
||||||
# define PLL_CONFIG() (PLLCSR = 0x1A)
|
|
||||||
# define USB_CONFIG() (USBCON = ((1 << USBE) | (1 << OTGPADE)))
|
|
||||||
# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
|
|
||||||
#elif defined(__AVR_AT90USB1286__)
|
|
||||||
# define HW_CONFIG() (UHWCON = 0x81)
|
|
||||||
# define PLL_CONFIG() (PLLCSR = 0x16)
|
|
||||||
# define USB_CONFIG() (USBCON = ((1 << USBE) | (1 << OTGPADE)))
|
|
||||||
# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// standard control endpoint request types
|
|
||||||
#define GET_STATUS 0
|
|
||||||
#define CLEAR_FEATURE 1
|
|
||||||
#define SET_FEATURE 3
|
|
||||||
#define SET_ADDRESS 5
|
|
||||||
#define GET_DESCRIPTOR 6
|
|
||||||
#define GET_CONFIGURATION 8
|
|
||||||
#define SET_CONFIGURATION 9
|
|
||||||
#define GET_INTERFACE 10
|
|
||||||
#define SET_INTERFACE 11
|
|
||||||
// HID (human interface device)
|
|
||||||
#define HID_GET_REPORT 1
|
|
||||||
#define HID_GET_IDLE 2
|
|
||||||
#define HID_GET_PROTOCOL 3
|
|
||||||
#define HID_SET_REPORT 9
|
|
||||||
#define HID_SET_IDLE 10
|
|
||||||
#define HID_SET_PROTOCOL 11
|
|
||||||
#define HID_REPORT_INPUT 1
|
|
||||||
#define HID_REPORT_OUTPUT 2
|
|
||||||
#define HID_REPORT_FEATURE 3
|
|
||||||
// CDC (communication class device)
|
|
||||||
#define CDC_SET_LINE_CODING 0x20
|
|
||||||
#define CDC_GET_LINE_CODING 0x21
|
|
||||||
#define CDC_SET_CONTROL_LINE_STATE 0x22
|
|
||||||
// HID feature selectors
|
|
||||||
#define DEVICE_REMOTE_WAKEUP 1
|
|
||||||
#define ENDPOINT_HALT 0
|
|
||||||
#define TEST_MODE 2
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------*
|
|
||||||
* Keyboard descriptor setting
|
|
||||||
*------------------------------------------------------------------*/
|
|
||||||
#define KBD_INTERFACE 0
|
|
||||||
#define KBD_ENDPOINT 1
|
|
||||||
#define KBD_SIZE 8
|
|
||||||
#define KBD_BUFFER EP_SINGLE_BUFFER
|
|
||||||
#define KBD_REPORT_KEYS (KBD_SIZE - 2)
|
|
||||||
|
|
||||||
// secondary keyboard
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
# define KBD2_INTERFACE 4
|
|
||||||
# define KBD2_ENDPOINT 5
|
|
||||||
# define KBD2_SIZE 16
|
|
||||||
# define KBD2_BUFFER EP_DOUBLE_BUFFER
|
|
||||||
# define KBD2_REPORT_KEYS (KBD2_SIZE - 1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include "sendchar.h"
|
|
||||||
#include "usb_debug.h"
|
|
||||||
|
|
||||||
// the time remaining before we transmit any partially full
|
|
||||||
// packet, or send a zero length packet.
|
|
||||||
volatile uint8_t debug_flush_timer = 0;
|
|
||||||
|
|
||||||
int8_t sendchar(uint8_t c) {
|
|
||||||
static uint8_t previous_timeout = 0;
|
|
||||||
uint8_t timeout, intr_state;
|
|
||||||
|
|
||||||
// if we're not online (enumerated and configured), error
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
// interrupts are disabled so these functions can be
|
|
||||||
// used from the main program or interrupt context,
|
|
||||||
// even both in the same program!
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = DEBUG_TX_ENDPOINT;
|
|
||||||
// if we gave up due to timeout before, don't wait again
|
|
||||||
if (previous_timeout) {
|
|
||||||
if (!(UEINTX & (1 << RWAL))) {
|
|
||||||
SREG = intr_state;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
previous_timeout = 0;
|
|
||||||
}
|
|
||||||
// wait for the FIFO to be ready to accept data
|
|
||||||
timeout = UDFNUML + 4;
|
|
||||||
while (1) {
|
|
||||||
// are we ready to transmit?
|
|
||||||
if (UEINTX & (1 << RWAL)) break;
|
|
||||||
SREG = intr_state;
|
|
||||||
// have we waited too long?
|
|
||||||
if (UDFNUML == timeout) {
|
|
||||||
previous_timeout = 1;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
// has the USB gone offline?
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
// get ready to try checking again
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = DEBUG_TX_ENDPOINT;
|
|
||||||
}
|
|
||||||
// actually write the byte into the FIFO
|
|
||||||
UEDATX = c;
|
|
||||||
// if this completed a packet, transmit it now!
|
|
||||||
if (!(UEINTX & (1 << RWAL))) {
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
debug_flush_timer = 0;
|
|
||||||
} else {
|
|
||||||
debug_flush_timer = 2;
|
|
||||||
}
|
|
||||||
SREG = intr_state;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// immediately transmit any buffered output.
|
|
||||||
void usb_debug_flush_output(void) {
|
|
||||||
uint8_t intr_state;
|
|
||||||
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
if (debug_flush_timer) {
|
|
||||||
UENUM = DEBUG_TX_ENDPOINT;
|
|
||||||
while ((UEINTX & (1 << RWAL))) {
|
|
||||||
UEDATX = 0;
|
|
||||||
}
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
debug_flush_timer = 0;
|
|
||||||
}
|
|
||||||
SREG = intr_state;
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef USB_DEBUG_H
|
|
||||||
#define USB_DEBUG_H 1
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "usb.h"
|
|
||||||
|
|
||||||
#define DEBUG_INTERFACE 2
|
|
||||||
#define DEBUG_TX_ENDPOINT 3
|
|
||||||
#define DEBUG_TX_SIZE 32
|
|
||||||
#define DEBUG_TX_BUFFER EP_DOUBLE_BUFFER
|
|
||||||
|
|
||||||
extern volatile uint8_t debug_flush_timer;
|
|
||||||
|
|
||||||
void usb_debug_flush_output(void); // immediately transmit any buffered output
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include "host.h"
|
|
||||||
#include "usb_extra.h"
|
|
||||||
|
|
||||||
int8_t usb_extra_send(uint8_t report_id, uint16_t data) {
|
|
||||||
uint8_t intr_state, timeout;
|
|
||||||
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = EXTRA_ENDPOINT;
|
|
||||||
timeout = UDFNUML + 50;
|
|
||||||
while (1) {
|
|
||||||
// are we ready to transmit?
|
|
||||||
if (UEINTX & (1 << RWAL)) break;
|
|
||||||
SREG = intr_state;
|
|
||||||
// has the USB gone offline?
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
// have we waited too long?
|
|
||||||
if (UDFNUML == timeout) return -1;
|
|
||||||
// get ready to try checking again
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = EXTRA_ENDPOINT;
|
|
||||||
}
|
|
||||||
|
|
||||||
UEDATX = report_id;
|
|
||||||
UEDATX = data & 0xFF;
|
|
||||||
UEDATX = (data >> 8) & 0xFF;
|
|
||||||
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
SREG = intr_state;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t usb_extra_consumer_send(uint16_t bits) { return usb_extra_send(REPORT_ID_CONSUMER, bits); }
|
|
||||||
|
|
||||||
int8_t usb_extra_system_send(uint16_t bits) { return usb_extra_send(REPORT_ID_SYSTEM, bits); }
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef USB_EXTRA_H
|
|
||||||
#define USB_EXTRA_H 1
|
|
||||||
/*
|
|
||||||
* Enhanced keyboard features for Windows:
|
|
||||||
* Audio control and System control
|
|
||||||
*
|
|
||||||
* http://www.microsoft.com/whdc/archive/w2kbd.mspx
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include "usb.h"
|
|
||||||
|
|
||||||
#define EXTRA_INTERFACE 3
|
|
||||||
#define EXTRA_ENDPOINT 4
|
|
||||||
#define EXTRA_SIZE 8
|
|
||||||
#define EXTRA_BUFFER EP_DOUBLE_BUFFER
|
|
||||||
|
|
||||||
int8_t usb_extra_consumer_send(uint16_t bits);
|
|
||||||
int8_t usb_extra_system_send(uint16_t bits);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#include "keycode.h"
|
|
||||||
#include "usb_keyboard.h"
|
|
||||||
#include "print.h"
|
|
||||||
#include "debug.h"
|
|
||||||
#include "util.h"
|
|
||||||
#include "host.h"
|
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
# include "keycode_config.h"
|
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// protocol setting from the host. We use exactly the same report
|
|
||||||
// either way, so this variable only stores the setting since we
|
|
||||||
// are required to be able to report which setting is in use.
|
|
||||||
uint8_t keyboard_protocol = 1;
|
|
||||||
|
|
||||||
// the idle configuration, how often we send the report to the
|
|
||||||
// host (ms * 4) even when it hasn't changed
|
|
||||||
// Windows and Linux set 0 while OS X sets 6(24ms) by SET_IDLE request.
|
|
||||||
uint8_t keyboard_idle = 125;
|
|
||||||
|
|
||||||
// count until idle timeout
|
|
||||||
uint8_t usb_keyboard_idle_count = 0;
|
|
||||||
|
|
||||||
// 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana
|
|
||||||
volatile uint8_t usb_keyboard_leds = 0;
|
|
||||||
|
|
||||||
static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end);
|
|
||||||
|
|
||||||
int8_t usb_keyboard_send_report(report_keyboard_t *report) {
|
|
||||||
int8_t result = 0;
|
|
||||||
|
|
||||||
#ifdef NKRO_ENABLE
|
|
||||||
if (keymap_config.nkro)
|
|
||||||
result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE);
|
|
||||||
else
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
result = send_report(report, KBD_ENDPOINT, 0, KBD_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result) return result;
|
|
||||||
usb_keyboard_idle_count = 0;
|
|
||||||
usb_keyboard_print_report(report);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void usb_keyboard_print_report(report_keyboard_t *report) {
|
|
||||||
if (!debug_keyboard) return;
|
|
||||||
print("keys: ");
|
|
||||||
for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
|
|
||||||
phex(report->keys[i]);
|
|
||||||
print(" ");
|
|
||||||
}
|
|
||||||
print(" mods: ");
|
|
||||||
phex(report->mods);
|
|
||||||
print("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end) {
|
|
||||||
uint8_t intr_state, timeout;
|
|
||||||
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = endpoint;
|
|
||||||
timeout = UDFNUML + 50;
|
|
||||||
while (1) {
|
|
||||||
// are we ready to transmit?
|
|
||||||
if (UEINTX & (1 << RWAL)) break;
|
|
||||||
SREG = intr_state;
|
|
||||||
// has the USB gone offline?
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
// have we waited too long?
|
|
||||||
if (UDFNUML == timeout) return -1;
|
|
||||||
// get ready to try checking again
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = endpoint;
|
|
||||||
}
|
|
||||||
for (uint8_t i = keys_start; i < keys_end; i++) {
|
|
||||||
UEDATX = report->raw[i];
|
|
||||||
}
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
SREG = intr_state;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_keyboard.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef USB_KEYBOARD_H
|
|
||||||
#define USB_KEYBOARD_H 1
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "usb.h"
|
|
||||||
#include "host.h"
|
|
||||||
|
|
||||||
extern uint8_t usb_keyboard_idle_count;
|
|
||||||
extern volatile uint8_t usb_keyboard_leds;
|
|
||||||
|
|
||||||
int8_t usb_keyboard_send_report(report_keyboard_t *report);
|
|
||||||
void usb_keyboard_print_report(report_keyboard_t *report);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
/* USB Mouse Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_mouse.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include "usb_mouse.h"
|
|
||||||
#include "print.h"
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
uint8_t usb_mouse_protocol = 1;
|
|
||||||
|
|
||||||
int8_t usb_mouse_send(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons) {
|
|
||||||
uint8_t intr_state, timeout;
|
|
||||||
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
if (x == -128) x = -127;
|
|
||||||
if (y == -128) y = -127;
|
|
||||||
if (wheel_v == -128) wheel_v = -127;
|
|
||||||
if (wheel_h == -128) wheel_h = -127;
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = MOUSE_ENDPOINT;
|
|
||||||
timeout = UDFNUML + 50;
|
|
||||||
while (1) {
|
|
||||||
// are we ready to transmit?
|
|
||||||
if (UEINTX & (1 << RWAL)) break;
|
|
||||||
SREG = intr_state;
|
|
||||||
// has the USB gone offline?
|
|
||||||
if (!usb_configured()) return -1;
|
|
||||||
// have we waited too long?
|
|
||||||
if (UDFNUML == timeout) return -1;
|
|
||||||
// get ready to try checking again
|
|
||||||
intr_state = SREG;
|
|
||||||
cli();
|
|
||||||
UENUM = MOUSE_ENDPOINT;
|
|
||||||
}
|
|
||||||
UEDATX = buttons;
|
|
||||||
UEDATX = x;
|
|
||||||
UEDATX = y;
|
|
||||||
if (usb_mouse_protocol) {
|
|
||||||
UEDATX = wheel_v;
|
|
||||||
UEDATX = wheel_h;
|
|
||||||
}
|
|
||||||
|
|
||||||
UEINTX = 0x3A;
|
|
||||||
SREG = intr_state;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void usb_mouse_print(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons) {
|
|
||||||
if (!debug_mouse) return;
|
|
||||||
print("usb_mouse[btn|x y v h]: ");
|
|
||||||
phex(buttons);
|
|
||||||
print("|");
|
|
||||||
phex(x);
|
|
||||||
print(" ");
|
|
||||||
phex(y);
|
|
||||||
print(" ");
|
|
||||||
phex(wheel_v);
|
|
||||||
print(" ");
|
|
||||||
phex(wheel_h);
|
|
||||||
print("\n");
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
/* USB Mouse Plus Debug Channel Example for Teensy USB Development Board
|
|
||||||
* http://www.pjrc.com/teensy/usb_mouse.html
|
|
||||||
* Copyright (c) 2009 PJRC.COM, LLC
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in
|
|
||||||
* all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef USB_MOUSE_H
|
|
||||||
#define USB_MOUSE_H 1
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "usb.h"
|
|
||||||
|
|
||||||
#define MOUSE_INTERFACE 1
|
|
||||||
#define MOUSE_ENDPOINT 2
|
|
||||||
#define MOUSE_SIZE 8
|
|
||||||
#define MOUSE_BUFFER EP_SINGLE_BUFFER
|
|
||||||
|
|
||||||
#define MOUSE_BTN1 (1 << 0)
|
|
||||||
#define MOUSE_BTN2 (1 << 1)
|
|
||||||
#define MOUSE_BTN3 (1 << 2)
|
|
||||||
#define MOUSE_BTN4 (1 << 3)
|
|
||||||
#define MOUSE_BTN5 (1 << 4)
|
|
||||||
|
|
||||||
extern uint8_t usb_mouse_protocol;
|
|
||||||
|
|
||||||
int8_t usb_mouse_send(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons);
|
|
||||||
void usb_mouse_print(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+4
-5
@@ -48,7 +48,7 @@ Complete firmwares for various keyboards and protocol converters.
|
|||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
**GPLv2** or later. Some protocol files are under **Modified BSD License**.
|
**GPLv2** or later. Some protocol files are under **Modified BSD License**.
|
||||||
LUFA, PJRC and V-USB stack have their own license respectively.
|
ChibiOS, LUFA and V-USB stack have their own license respectively.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -85,9 +85,9 @@ Architecture
|
|||||||
/ /| Keys/Mouse | Protocol |d| | Action | | | Protocol |
|
/ /| Keys/Mouse | Protocol |d| | Action | | | Protocol |
|
||||||
/__________/ |<-----------| LUFA |r| | Layer, Tap | | | Matrix |
|
/__________/ |<-----------| LUFA |r| | Layer, Tap | | | Matrix |
|
||||||
|.--------.| | LED | V-USB |i| |-------------| | | PS/2,IBM | __________________
|
|.--------.| | LED | V-USB |i| |-------------| | | PS/2,IBM | __________________
|
||||||
|| || |----------->| PJRC |v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
|
|| || |----------->| iWRAP(BT)|v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
|
||||||
|| Host || | Console | iWRAP(BT)|e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
|
|| Host || | Console | UART |e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
|
||||||
||________||/.<-----------| UART |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
|
||________||/.<-----------| |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
|
||||||
`_========_'/| |---------------------------------------------|-------->/___ /_______/ ___/ /
|
`_========_'/| |---------------------------------------------|-------->/___ /_______/ ___/ /
|
||||||
|_o______o_|/ | Sendchar, Print, Debug, Command, ... | |_________________|/
|
|_o______o_|/ | Sendchar, Print, Debug, Command, ... | |_________________|/
|
||||||
+---------------------------------------------+ Keyboard
|
+---------------------------------------------+ Keyboard
|
||||||
@@ -133,7 +133,6 @@ Files and Directories
|
|||||||
|
|
||||||
### Keyboard Protocols
|
### Keyboard Protocols
|
||||||
* lufa/ - LUFA USB stack
|
* lufa/ - LUFA USB stack
|
||||||
* pjrc/ - PJRC USB stack
|
|
||||||
* vusb/ - Objective Development V-USB
|
* vusb/ - Objective Development V-USB
|
||||||
* iwrap/ - Bluetooth HID for Bluegiga iWRAP
|
* iwrap/ - Bluetooth HID for Bluegiga iWRAP
|
||||||
* ps2.c - PS/2 protocol
|
* ps2.c - PS/2 protocol
|
||||||
|
|||||||
+5
-2
@@ -3,10 +3,13 @@
|
|||||||
|
|
||||||
#define TAP_CODE_DELAY 20
|
#define TAP_CODE_DELAY 20
|
||||||
|
|
||||||
/* Extend default tap timeout because I'm too slow. :) */
|
/*
|
||||||
|
* Force the default tapping term since some keyboards make it way too short
|
||||||
|
* (*cough*Lily58*cough*).
|
||||||
|
*/
|
||||||
#undef TAPPING_TERM
|
#undef TAPPING_TERM
|
||||||
|
|
||||||
#define TAPPING_TERM 250
|
#define TAPPING_TERM 200
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Treat mod-tap keys as holds even if the mod-tap key and the key being
|
* Treat mod-tap keys as holds even if the mod-tap key and the key being
|
||||||
|
|||||||
Reference in new issue
Block a user