mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-07 12:49:09 +00:00
Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6d43a5daf4 | ||
![]() |
cb4006c0b4 | ||
![]() |
891ddd9a30 | ||
![]() |
f3bef84dac | ||
![]() |
da81e5c7cd | ||
![]() |
853e56d080 | ||
![]() |
9e77cdf4e6 | ||
![]() |
3f2a030de6 | ||
![]() |
d510f6afa9 | ||
![]() |
4294aa0f1e | ||
![]() |
8f8411a98a | ||
![]() |
2e0659f7fd | ||
![]() |
9c175f1801 | ||
![]() |
541e101291 | ||
![]() |
3ef01a3482 | ||
![]() |
1ebaec96e7 | ||
![]() |
267ffb9914 | ||
![]() |
0b8d6df390 | ||
![]() |
60c5bd7b5e | ||
![]() |
04c0704b28 | ||
![]() |
e7a5c006d9 | ||
![]() |
2d6635214a | ||
![]() |
1dbe4e7dd0 | ||
![]() |
85a14ac25b | ||
![]() |
1a494da288 | ||
![]() |
1e1be4c229 |
@@ -698,19 +698,23 @@ ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
|
||||
endif
|
||||
|
||||
JOYSTICK_ENABLE ?= no
|
||||
ifneq ($(strip $(JOYSTICK_ENABLE)), no)
|
||||
VALID_JOYSTICK_TYPES := analog digital
|
||||
JOYSTICK_DRIVER ?= analog
|
||||
ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
|
||||
ifeq ($(filter $(JOYSTICK_DRIVER),$(VALID_JOYSTICK_TYPES)),)
|
||||
$(error "$(JOYSTICK_DRIVER)" is not a valid joystick driver)
|
||||
endif
|
||||
OPT_DEFS += -DJOYSTICK_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_joystick.c
|
||||
SRC += $(QUANTUM_DIR)/joystick.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(JOYSTICK_ENABLE)), analog)
|
||||
OPT_DEFS += -DANALOG_JOYSTICK_ENABLE
|
||||
SRC += analog.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(JOYSTICK_ENABLE)), digital)
|
||||
OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE
|
||||
ifeq ($(strip $(JOYSTICK_DRIVER)), analog)
|
||||
OPT_DEFS += -DANALOG_JOYSTICK_ENABLE
|
||||
SRC += analog.c
|
||||
endif
|
||||
ifeq ($(strip $(JOYSTICK_DRIVER)), digital)
|
||||
OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE
|
||||
endif
|
||||
endif
|
||||
|
||||
DIGITIZER_ENABLE ?= no
|
||||
|
@@ -2,8 +2,6 @@
|
||||
|
||||
The keyboard can be made to be recognized as a joystick HID device by the operating system.
|
||||
|
||||
This is enabled by adding `JOYSTICK_ENABLE` to `rules.mk`. You can set this value to `analog`, `digital`, or `no`.
|
||||
|
||||
!> Joystick support is not currently available on V-USB devices.
|
||||
|
||||
The joystick feature provides two services:
|
||||
@@ -18,7 +16,8 @@ or send gamepad reports based on values computed by the keyboard.
|
||||
To use analog input you must first enable it in `rules.mk`:
|
||||
|
||||
```makefile
|
||||
JOYSTICK_ENABLE = analog
|
||||
JOYSTICK_ENABLE = yes
|
||||
JOYSTICK_DRIVER = analog # or 'digital'
|
||||
```
|
||||
|
||||
An analog device such as a potentiometer found on a gamepad's analog axes is based on a [voltage divider](https://en.wikipedia.org/wiki/Voltage_divider).
|
||||
|
17
keyboards/0xc7/61key/61key.c
Normal file
17
keyboards/0xc7/61key/61key.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Copyright 2021 0xC7
|
||||
*
|
||||
* 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 "61key.h"
|
43
keyboards/0xc7/61key/61key.h
Normal file
43
keyboards/0xc7/61key/61key.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Copyright 2021 0xC7
|
||||
*
|
||||
* 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 KC_NOt, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define ___ KC_NO
|
||||
|
||||
/* This is 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( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
|
||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \
|
||||
K40, K41, K42, K45, K48, K49, K4B, K4D \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D }, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, ___, ___, K3D }, \
|
||||
{ K40, K41, K42, ___, ___, K45, ___, ___, K48, K49, ___, K4B, ___, K4D } \
|
||||
}
|
152
keyboards/0xc7/61key/config.h
Normal file
152
keyboards/0xc7/61key/config.h
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright 2021 0xC7
|
||||
|
||||
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 0xE117
|
||||
#define PRODUCT_ID 0x6161
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER 0xC7
|
||||
#define PRODUCT 61Key
|
||||
|
||||
/* 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 { B0, B1, B2, B3, B7 }
|
||||
#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, F7, F6, F5, F4, F1, F0 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/*
|
||||
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||
*/
|
||||
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||
|
||||
//#define LED_NUM_LOCK_PIN B0
|
||||
//#define LED_CAPS_LOCK_PIN B1
|
||||
//#define LED_SCROLL_LOCK_PIN B2
|
||||
//#define LED_COMPOSE_PIN B3
|
||||
//#define LED_KANA_PIN B4
|
||||
|
||||
//#define BACKLIGHT_PIN B7
|
||||
//#define BACKLIGHT_LEVELS 3
|
||||
//#define BACKLIGHT_BREATHING
|
||||
|
||||
//#define RGB_DI_PIN E2
|
||||
//#ifdef RGB_DI_PIN
|
||||
//# define RGBLED_NUM 16
|
||||
//# 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 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* 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
|
||||
|
||||
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||
* This is useful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||
*/
|
||||
//#define GRAVE_ESC_CTRL_OVERRIDE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
/* disable these deprecated features by default */
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
|
||||
/* Bootmagic Lite key configuration */
|
||||
//#define BOOTMAGIC_LITE_ROW 0
|
||||
//#define BOOTMAGIC_LITE_COLUMN 0
|
76
keyboards/0xc7/61key/info.json
Normal file
76
keyboards/0xc7/61key/info.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"keyboard_name": "61Key",
|
||||
"url": "",
|
||||
"maintainer": "0xC7",
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"x": 0, "y": 0},
|
||||
{"x": 1, "y": 0},
|
||||
{"x": 2, "y": 0},
|
||||
{"x": 3, "y": 0},
|
||||
{"x": 4, "y": 0},
|
||||
{"x": 5, "y": 0},
|
||||
{"x": 6, "y": 0},
|
||||
{"x": 7, "y": 0},
|
||||
{"x": 8, "y": 0},
|
||||
{"x": 9, "y": 0},
|
||||
{"x": 10, "y": 0},
|
||||
{"x": 11, "y": 0},
|
||||
{"x": 12, "y": 0},
|
||||
{"x": 13, "y": 0},
|
||||
|
||||
{"x": 0, "y": 1, "w": 1.5},
|
||||
{"x": 1.5, "y": 1},
|
||||
{"x": 2.5, "y": 1},
|
||||
{"x": 3.5, "y": 1},
|
||||
{"x": 4.5, "y": 1},
|
||||
{"x": 5.5, "y": 1},
|
||||
{"x": 6.5, "y": 1},
|
||||
{"x": 7.5, "y": 1},
|
||||
{"x": 8.5, "y": 1},
|
||||
{"x": 9.5, "y": 1},
|
||||
{"x": 10.5, "y": 1},
|
||||
{"x": 11.5, "y": 1},
|
||||
{"x": 12.5, "y": 1},
|
||||
{"x": 13.5, "y": 1, "w": 1.5},
|
||||
|
||||
{"x": 0, "y": 2, "w": 1.75},
|
||||
{"x": 1.75, "y": 2},
|
||||
{"x": 2.75, "y": 2},
|
||||
{"x": 3.75, "y": 2},
|
||||
{"x": 4.75, "y": 2},
|
||||
{"x": 5.75, "y": 2},
|
||||
{"x": 6.75, "y": 2},
|
||||
{"x": 7.75, "y": 2},
|
||||
{"x": 8.75, "y": 2},
|
||||
{"x": 9.75, "y": 2},
|
||||
{"x": 10.75, "y": 2},
|
||||
{"x": 11.75, "y": 2},
|
||||
{"x": 12.75, "y": 2, "w": 1.25},
|
||||
|
||||
{"x": 0, "y": 3, "w": 1.25},
|
||||
{"x": 1.25, "y": 3},
|
||||
{"x": 2.25, "y": 3},
|
||||
{"x": 3.25, "y": 3},
|
||||
{"x": 4.25, "y": 3},
|
||||
{"x": 5.25, "y": 3},
|
||||
{"x": 6.25, "y": 3},
|
||||
{"x": 7.25, "y": 3},
|
||||
{"x": 8.25, "y": 3},
|
||||
{"x": 9.25, "y": 3},
|
||||
{"x": 10.25, "y": 3},
|
||||
{"x": 11.25, "y": 3, "w": 1.75},
|
||||
|
||||
{"x": 0, "y": 4, "w": 1.25},
|
||||
{"x": 1.25, "y": 4, "w": 1.25},
|
||||
{"x": 2.5, "y": 4, "w": 1.25},
|
||||
{"x": 3.75, "y": 4, "w": 6.25},
|
||||
{"x": 10, "y": 4, "w": 1.25},
|
||||
{"x": 11.25, "y": 4, "w": 1.25},
|
||||
{"x": 12.5, "y": 4, "w": 1.25},
|
||||
{"x": 13.75, "y": 4, "w": 1.25}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
34
keyboards/0xc7/61key/keymaps/default/keymap.c
Normal file
34
keyboards/0xc7/61key/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/* Copyright 2021 0xC7
|
||||
*
|
||||
* 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(
|
||||
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, MO(1), KC_APP, KC_RCTL
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
KC_ESC, 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_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, C(A(KC_DEL))
|
||||
)
|
||||
};
|
48
keyboards/0xc7/61key/keymaps/via/keymap.c
Normal file
48
keyboards/0xc7/61key/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Copyright 2021 0xC7
|
||||
*
|
||||
* 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(
|
||||
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, MO(1), KC_APP, KC_RCTL
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
KC_ESC, 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_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_LOCK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, C(A(KC_DEL))
|
||||
),
|
||||
[2] = LAYOUT(
|
||||
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(
|
||||
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
|
||||
)
|
||||
};
|
1
keyboards/0xc7/61key/keymaps/via/rules.mk
Normal file
1
keyboards/0xc7/61key/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
27
keyboards/0xc7/61key/readme.md
Normal file
27
keyboards/0xc7/61key/readme.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# 61Key
|
||||
|
||||

|
||||
|
||||
Custom keyboard designed by RealEmanGaming aka 0xC7
|
||||
|
||||
* Keyboard Maintainer: [0xC7](https://github.com/RealEmanGaming)
|
||||
* Hardware Supported: ATMega32u4
|
||||
* Hardware Availability: N/A (private board, might open source)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make 61key:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make 61key:default:flash
|
||||
|
||||
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).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
|
||||
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
|
||||
* **Keycode in layout**: Press the key mapped to `RESET` if it is available
|
25
keyboards/0xc7/61key/rules.mk
Normal file
25
keyboards/0xc7/61key/rules.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = no # Mouse keys
|
||||
EXTRAKEY_ENABLE = no # 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 = no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
|
||||
LTO_ENABLE = yes
|
||||
KEY_LOCK_ENABLE = yes
|
@@ -34,9 +34,7 @@ extern i2c_status_t tca9555_status;
|
||||
// All address pins of the tca9555 are connected to the ground
|
||||
// | 0 | 1 | 0 | 0 | A2 | A1 | A0 |
|
||||
// | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
|
||||
#define I2C_ADDR 0b0100000
|
||||
#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE)
|
||||
#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ)
|
||||
#define I2C_ADDR (0b0100000 << 1)
|
||||
|
||||
// Register addresses
|
||||
#define IODIRA 0x06 // i/o direction register
|
||||
@@ -64,19 +62,14 @@ uint8_t init_tca9555(void) {
|
||||
// - unused : input : 1
|
||||
// - input : input : 1
|
||||
// - driving : output : 0
|
||||
tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(IODIRA, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
// This means: write on pin 5 of port 0, read on rest
|
||||
tca9555_status = i2c_write(0b11011111, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
// This means: we will write on pins 0 to 2 on port 1. read rest
|
||||
tca9555_status = i2c_write(0b11111000, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
uint8_t conf[2] = {
|
||||
// This means: write on pin 5 of port 0, read on rest
|
||||
0b11011111,
|
||||
// This means: we will write on pins 0 to 2 on port 1. read rest
|
||||
0b11111000,
|
||||
};
|
||||
tca9555_status = i2c_writeReg(I2C_ADDR, IODIRA, conf, 2, I2C_TIMEOUT);
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
return tca9555_status;
|
||||
}
|
||||
|
||||
@@ -192,36 +185,29 @@ static matrix_row_t read_cols(uint8_t row) {
|
||||
if (tca9555_status) { // if there was an error
|
||||
return 0;
|
||||
} else {
|
||||
uint8_t data = 0;
|
||||
uint8_t port0 = 0;
|
||||
uint8_t port1 = 0;
|
||||
tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(IREGP0, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_read_ack(I2C_TIMEOUT);
|
||||
if (tca9555_status < 0) goto out;
|
||||
port0 = (uint8_t)tca9555_status;
|
||||
tca9555_status = i2c_read_nack(I2C_TIMEOUT);
|
||||
if (tca9555_status < 0) goto out;
|
||||
port1 = (uint8_t)tca9555_status;
|
||||
uint8_t data = 0;
|
||||
uint8_t ports[2] = {0};
|
||||
tca9555_status = i2c_readReg(I2C_ADDR, IREGP0, ports, 2, I2C_TIMEOUT);
|
||||
if (tca9555_status) { // if there was an error
|
||||
// do nothing
|
||||
return 0;
|
||||
} else {
|
||||
uint8_t port0 = ports[0];
|
||||
uint8_t port1 = ports[1];
|
||||
|
||||
// The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero.
|
||||
// The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys.
|
||||
// Since the pins are not ordered sequentially, we have to build the correct dataset from the two ports. Refer to the schematic to see where every pin is connected.
|
||||
data |= ( port0 & 0x01 );
|
||||
data |= ( port0 & 0x02 );
|
||||
data |= ( port1 & 0x10 ) >> 2;
|
||||
data |= ( port1 & 0x08 );
|
||||
data |= ( port0 & 0x40 ) >> 2;
|
||||
data = ~(data);
|
||||
// The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero.
|
||||
// The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys.
|
||||
// Since the pins are not ordered sequentially, we have to build the correct dataset from the two ports. Refer to the schematic to see where every pin is connected.
|
||||
data |= ( port0 & 0x01 );
|
||||
data |= ( port0 & 0x02 );
|
||||
data |= ( port1 & 0x10 ) >> 2;
|
||||
data |= ( port1 & 0x08 );
|
||||
data |= ( port0 & 0x40 ) >> 2;
|
||||
data = ~(data);
|
||||
|
||||
tca9555_status = I2C_STATUS_SUCCESS;
|
||||
out:
|
||||
i2c_stop();
|
||||
return data;
|
||||
tca9555_status = I2C_STATUS_SUCCESS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,18 +249,10 @@ static void select_row(uint8_t row) {
|
||||
default: break;
|
||||
}
|
||||
|
||||
tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(OREGP0, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(port0, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(port1, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
uint8_t ports[2] = {port0, port1};
|
||||
tca9555_status = i2c_writeReg(I2C_ADDR, OREGP0, ports, 2, I2C_TIMEOUT);
|
||||
// Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one.
|
||||
// Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus.
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -34,9 +34,7 @@ extern i2c_status_t tca9555_status;
|
||||
// All address pins of the tca9555 are connected to the ground
|
||||
// | 0 | 1 | 0 | 0 | A2 | A1 | A0 |
|
||||
// | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
|
||||
#define I2C_ADDR 0b0100000
|
||||
#define I2C_ADDR_WRITE ((I2C_ADDR << 1) | I2C_WRITE)
|
||||
#define I2C_ADDR_READ ((I2C_ADDR << 1) | I2C_READ)
|
||||
#define I2C_ADDR (0b0100000 << 1)
|
||||
|
||||
// Register addresses
|
||||
#define IODIRA 0x06 // i/o direction register
|
||||
@@ -64,19 +62,14 @@ uint8_t init_tca9555(void) {
|
||||
// - unused : input : 1
|
||||
// - input : input : 1
|
||||
// - driving : output : 0
|
||||
tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(IODIRA, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
// This means: read all pins of port 0
|
||||
tca9555_status = i2c_write(0b11111111, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
// This means: we will write on pins 0 to 3 on port 1. read rest
|
||||
tca9555_status = i2c_write(0b11110000, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
uint8_t conf[2] = {
|
||||
// This means: read all pins of port 0
|
||||
0b11111111,
|
||||
// This means: we will write on pins 0 to 3 on port 1. read rest
|
||||
0b11110000,
|
||||
};
|
||||
tca9555_status = i2c_writeReg(I2C_ADDR, IODIRA, conf, 2, I2C_TIMEOUT);
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
return tca9555_status;
|
||||
}
|
||||
|
||||
@@ -194,32 +187,25 @@ static matrix_row_t read_cols(uint8_t row) {
|
||||
} else {
|
||||
uint8_t data = 0;
|
||||
uint8_t port0 = 0;
|
||||
tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(IREGP0, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_read_nack(I2C_TIMEOUT);
|
||||
if (tca9555_status < 0) goto out;
|
||||
|
||||
port0 = ~(uint8_t)tca9555_status;
|
||||
tca9555_status = i2c_readReg(I2C_ADDR, IREGP0, &port0, 1, I2C_TIMEOUT);
|
||||
if (tca9555_status) { // if there was an error
|
||||
// do nothing
|
||||
return 0;
|
||||
} else {
|
||||
port0 = ~port0;
|
||||
// We read all the pins on GPIOA.
|
||||
// The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero.
|
||||
// The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys.
|
||||
// the pins connected to eact columns are sequential, but in reverse order, and counting from zero down (col 5 -> GPIO04, col6 -> GPIO03 and so on).
|
||||
data |= (port0 & 0x01) << 4;
|
||||
data |= (port0 & 0x02) << 2;
|
||||
data |= (port0 & 0x04);
|
||||
data |= (port0 & 0x08) >> 2;
|
||||
data |= (port0 & 0x10) >> 4;
|
||||
|
||||
// We read all the pins on GPIOA.
|
||||
// The initial state was all ones and any depressed key at a given column for the currently selected row will have its bit flipped to zero.
|
||||
// The return value is a row as represented in the generic matrix code were the rightmost bits represent the lower columns and zeroes represent non-depressed keys while ones represent depressed keys.
|
||||
// the pins connected to eact columns are sequential, but in reverse order, and counting from zero down (col 5 -> GPIO04, col6 -> GPIO03 and so on).
|
||||
data |= ( port0 & 0x01 ) << 4;
|
||||
data |= ( port0 & 0x02 ) << 2;
|
||||
data |= ( port0 & 0x04 );
|
||||
data |= ( port0 & 0x08 ) >> 2;
|
||||
data |= ( port0 & 0x10 ) >> 4;
|
||||
|
||||
tca9555_status = I2C_STATUS_SUCCESS;
|
||||
out:
|
||||
i2c_stop();
|
||||
|
||||
return data;
|
||||
tca9555_status = I2C_STATUS_SUCCESS;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -256,20 +242,15 @@ static void select_row(uint8_t row) {
|
||||
case 4: port1 &= ~(1 << 0); break;
|
||||
case 5: port1 &= ~(1 << 1); break;
|
||||
case 6: port1 &= ~(1 << 2); break;
|
||||
case 7: port1 &= ~(1 << 3); break;
|
||||
case 7:
|
||||
port1 &= ~(1 << 3);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
tca9555_status = i2c_writeReg(I2C_ADDR, OREGP1, &port1, 1, I2C_TIMEOUT);
|
||||
// Select the desired row by writing a byte for the entire GPIOB bus where only the bit representing the row we want to select is a zero (write instruction) and every other bit is a one.
|
||||
// Note that the row - MATRIX_ROWS_PER_SIDE reflects the fact that being on the right hand, the columns are numbered from MATRIX_ROWS_PER_SIDE to MATRIX_ROWS, but the pins we want to write to are indexed from zero up on the GPIOB bus.
|
||||
tca9555_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(OREGP1, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
tca9555_status = i2c_write(port1, I2C_TIMEOUT);
|
||||
if (tca9555_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -33,6 +33,18 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
static matrix_row_t read_cols(void);
|
||||
static void select_row(uint8_t col);
|
||||
|
||||
// user-defined overridable functions
|
||||
|
||||
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_init_user(void) {}
|
||||
|
||||
__attribute__((weak)) void matrix_scan_user(void) {}
|
||||
|
||||
// helper functions
|
||||
|
||||
inline uint8_t matrix_rows(void)
|
||||
{
|
||||
return MATRIX_ROWS;
|
||||
|
23
keyboards/ergodox_ez/keymaps/ifohancroft/config.h
Normal file
23
keyboards/ergodox_ez/keymaps/ifohancroft/config.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Copyright 2021 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
#define USB_POLLING_INTERVAL_MS 1
|
||||
#define FORCE_NKRO
|
||||
#undef DEBOUNCE
|
||||
#define DEBOUNCE 5
|
157
keyboards/ergodox_ez/keymaps/ifohancroft/keymap.c
Normal file
157
keyboards/ergodox_ez/keymaps/ifohancroft/keymap.c
Normal file
@@ -0,0 +1,157 @@
|
||||
/* Copyright 2021 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] = {
|
||||
|
||||
/* Default Layer
|
||||
* *---------------------------------------------------------------------* *---------------------------------------------------------------------*
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Del |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | ESC | A | S | D | F | G | | | | H | J | K | L | ; | ' |
|
||||
* |---------+---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------+---------|
|
||||
* | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift |
|
||||
* |---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------|
|
||||
* | Ctrl | Super | Alt | MO(3) | MO(2) | | MO(2) | Left | Down | Up | Right |
|
||||
* *-------------------------------------------------* *-------------------------------------------------*
|
||||
*
|
||||
* *-------------------* *-------------------*
|
||||
* | | TG(1) | | | |
|
||||
* *---------+---------+---------| |---------+---------+---------*
|
||||
* | | | | | | | |
|
||||
* | Bckspc | Enter |---------| |---------| Enter | Space |
|
||||
* | | | PgDn | | PgUp | | |
|
||||
* *---------+---------+---------* *---------+---------+---------*
|
||||
*/
|
||||
|
||||
LAYOUT_ergodox_pretty(
|
||||
KC_GRV, 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_DEL,
|
||||
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_BSLS,
|
||||
KC_ESC, 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_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, MO(3), MO(2), MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,
|
||||
|
||||
KC_NO, TG(1), KC_NO, KC_NO,
|
||||
KC_NO, KC_NO,
|
||||
KC_BSPC, KC_ENT, KC_PGDN, KC_PGUP, KC_ENT, KC_SPC
|
||||
),
|
||||
|
||||
/* Gaming Layer
|
||||
* *---------------------------------------------------------------------* *---------------------------------------------------------------------*
|
||||
* | | | | | | | 6 | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | |
|
||||
* *-------------------------------------------------* *-------------------------------------------------*
|
||||
*
|
||||
* *-------------------* *-------------------*
|
||||
* | | | | | |
|
||||
* *---------+---------+---------| |---------+---------+---------*
|
||||
* | | | | | | | |
|
||||
* | Space | |---------| |---------| | |
|
||||
* | | | | | | | |
|
||||
* *---------+---------+---------* *---------+---------+---------*
|
||||
*/
|
||||
|
||||
LAYOUT_ergodox_pretty(
|
||||
_______, _______, _______, _______, _______, _______, KC_6, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______,
|
||||
_______, _______,
|
||||
KC_SPC, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Function Keys Layer
|
||||
* *---------------------------------------------------------------------* *---------------------------------------------------------------------*
|
||||
* | | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | | Up | | | | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | Left | Down | Right | | | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | |
|
||||
* *-------------------------------------------------* *-------------------------------------------------*
|
||||
*
|
||||
* *-------------------* *-------------------*
|
||||
* | | | | | |
|
||||
* *---------+---------+---------| |---------+---------+---------*
|
||||
* | | | | | | | |
|
||||
* | | |---------| |---------| | |
|
||||
* | | | | | | | |
|
||||
* *---------+---------+---------* *---------+---------+---------*
|
||||
*/
|
||||
|
||||
LAYOUT_ergodox_pretty(
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
|
||||
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* CAD Layer
|
||||
* *---------------------------------------------------------------------* *---------------------------------------------------------------------*
|
||||
* | Del | 0 | 9 | 8 | 7 | 6 | = | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | \ | P | O | I | U | Y | ] | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||
* | ' | ; | L | K | J | H | | | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------+---------|
|
||||
* | | / | . | , | M | N | | | | | | | |
|
||||
* |---------+---------+---------+---------+---------+---------* *---------+---------+---------+---------+---------+---------|
|
||||
* | | | | | | | | | | | |
|
||||
* *-------------------------------------------------* *-------------------------------------------------*
|
||||
*
|
||||
* *-------------------* *-------------------*
|
||||
* | | | | | |
|
||||
* *---------+---------+---------| |---------+---------+---------*
|
||||
* | | | | | | | |
|
||||
* | Space | |---------| |---------| | |
|
||||
* | | | PgUp | | | | |
|
||||
* *---------+---------+---------* *---------+---------+---------*
|
||||
*/
|
||||
|
||||
LAYOUT_ergodox_pretty(
|
||||
KC_DEL, KC_0, KC_9, KC_8, KC_7, KC_6, KC_EQL, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_BSLS, KC_P, KC_O, KC_I, KC_U, KC_Y, KC_RBRC, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_QUOT, KC_SCLN, KC_L, KC_K, KC_J, KC_H, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
||||
_______, _______, _______, _______,
|
||||
_______, _______,
|
||||
KC_SPC, _______, KC_PGUP, _______, _______, _______
|
||||
)
|
||||
|
||||
};
|
19
keyboards/ergodox_ez/keymaps/ifohancroft/readme.md
Normal file
19
keyboards/ergodox_ez/keymaps/ifohancroft/readme.md
Normal file
@@ -0,0 +1,19 @@
|
||||

|
||||
|
||||
# IFo Hancroft's ErgoDox EZ Layout
|
||||
|
||||
- Layer 0: A Standard ANSI QWERTY Layer.
|
||||
- Layer 1: A Gaming Layer. It replaces the Backspace with a Space, and the Dash with a 6, so you can play CS:GO without needing to lift your right hand from the mouse.
|
||||
- Layer 2: A function layer. It contains the F1-F12 keys and arrows on WASD.
|
||||
- Layer 3: A CAD Layer. It is basically a mirrored version of the right hand side, so you can use CAD without needing to lift your right hand from the the mouse.
|
||||
|
||||
This keymap also does the following:
|
||||
|
||||
- Sets the polling rate of the keyboard to 1ms
|
||||
- Sets the debounce time to 5ms
|
||||
- NKRO (Forced on)
|
||||
- Disables:
|
||||
- Mouse Key
|
||||
- Extra Key
|
||||
- Unicode
|
||||
- Swap Hands
|
4
keyboards/ergodox_ez/keymaps/ifohancroft/rules.mk
Normal file
4
keyboards/ergodox_ez/keymaps/ifohancroft/rules.mk
Normal file
@@ -0,0 +1,4 @@
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = no
|
||||
UNICODE_ENABLE = no
|
||||
SWAP_HANDS_ENABLE = no
|
@@ -1,5 +1,4 @@
|
||||
#include "dactyl.h"
|
||||
#include "i2cmaster.h"
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
__attribute__ ((weak))
|
||||
|
@@ -4,12 +4,11 @@
|
||||
#include "quantum.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2cmaster.h"
|
||||
#include "i2c_master.h"
|
||||
#include <util/delay.h>
|
||||
|
||||
#define I2C_ADDR 0b0100000
|
||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||
#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
|
||||
#define I2C_ADDR (0b0100000 << 1)
|
||||
#define I2C_TIMEOUT 100
|
||||
#define IODIRA 0x00 // i/o direction register
|
||||
#define IODIRB 0x01
|
||||
#define GPPUA 0x0C // GPIO pull-up resistor register
|
||||
|
@@ -1,178 +0,0 @@
|
||||
#ifndef _I2CMASTER_H
|
||||
#define _I2CMASTER_H 1
|
||||
/*************************************************************************
|
||||
* Title: C include file for the I2C master interface
|
||||
* (i2cmaster.S or twimaster.c)
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device
|
||||
* Usage: see Doxygen manual
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
@defgroup pfleury_ic2master I2C Master library
|
||||
@code #include <i2cmaster.h> @endcode
|
||||
|
||||
@brief I2C (TWI) Master Software Library
|
||||
|
||||
Basic routines for communicating with I2C slave devices. This single master
|
||||
implementation is limited to one bus master on the I2C bus.
|
||||
|
||||
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
|
||||
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
|
||||
Since the API for these two implementations is exactly the same, an application can be linked either against the
|
||||
software I2C implementation or the hardware I2C implementation.
|
||||
|
||||
Use 4.7k pull-up resistor on the SDA and SCL pin.
|
||||
|
||||
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
|
||||
i2cmaster.S to your target when using the software I2C implementation !
|
||||
|
||||
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
|
||||
|
||||
@note
|
||||
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
|
||||
to GNU assembler and AVR-GCC C call interface.
|
||||
Replaced the incorrect quarter period delays found in AVR300 with
|
||||
half period delays.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@par API Usage Example
|
||||
The following code shows typical usage of this library, see example test_i2cmaster.c
|
||||
|
||||
@code
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
#define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned char ret;
|
||||
|
||||
i2c_init(); // initialize I2C library
|
||||
|
||||
// write 0x75 to EEPROM address 5 (Byte Write)
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_write(0x75); // write value 0x75 to EEPROM
|
||||
i2c_stop(); // set stop conditon = release bus
|
||||
|
||||
|
||||
// read previously written value back from EEPROM address 5
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode
|
||||
|
||||
ret = i2c_readNak(); // read one byte from EEPROM
|
||||
i2c_stop();
|
||||
|
||||
for(;;);
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
||||
#endif /* DOXYGEN */
|
||||
|
||||
/**@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
|
||||
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_READ 1
|
||||
|
||||
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_WRITE 0
|
||||
|
||||
|
||||
/**
|
||||
@brief initialize the I2C master interace. Need to be called only once
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_init(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminates the data transfer and releases the I2C bus
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
If device is busy, use ack polling to wait until device ready
|
||||
@param addr address and transfer direction of I2C device
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send one byte to I2C device
|
||||
@param data byte to be transfered
|
||||
@retval 0 write successful
|
||||
@retval 1 write failed
|
||||
*/
|
||||
extern unsigned char i2c_write(unsigned char data);
|
||||
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, request more data from device
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readAck(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readNak(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device
|
||||
|
||||
Implemented as a macro, which calls either i2c_readAck or i2c_readNak
|
||||
|
||||
@param ack 1 send ack, request more data from device<br>
|
||||
0 send nak, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
@@ -25,7 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "dactyl.h"
|
||||
#include "i2cmaster.h"
|
||||
#include "i2c_master.h"
|
||||
#include "timer.h"
|
||||
|
||||
|
||||
@@ -147,9 +147,6 @@ void init_expander(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out;
|
||||
expander_status = i2c_write(IODIRA); if (expander_status) goto out;
|
||||
|
||||
/*
|
||||
Pin direction and pull-up depends on both the diode direction
|
||||
and on whether the column register is GPIOA or GPIOB
|
||||
@@ -164,50 +161,65 @@ void init_expander(void) {
|
||||
|
||||
#if (EXPANDER_COL_REGISTER == GPIOA)
|
||||
# if (DIODE_DIRECTION == COL2ROW)
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
uint8_t direction[2] = {
|
||||
expander_input_pin_mask,
|
||||
0,
|
||||
};
|
||||
# elif (DIODE_DIRECTION == ROW2COL)
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
uint8_t direction[2] = {
|
||||
0,
|
||||
expander_input_pin_mask,
|
||||
};
|
||||
# endif
|
||||
#elif (EXPANDER_COL_REGISTER == GPIOB)
|
||||
# if (DIODE_DIRECTION == COL2ROW)
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
uint8_t direction[2] = {
|
||||
0,
|
||||
expander_input_pin_mask,
|
||||
};
|
||||
# elif (DIODE_DIRECTION == ROW2COL)
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
uint8_t direction[2] = {
|
||||
expander_input_pin_mask,
|
||||
0,
|
||||
};
|
||||
# endif
|
||||
#endif
|
||||
|
||||
i2c_stop();
|
||||
|
||||
// set pull-up
|
||||
// - unused : off : 0
|
||||
// - input : on : 1
|
||||
// - driving : off : 0
|
||||
expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out;
|
||||
expander_status = i2c_write(GPPUA); if (expander_status) goto out;
|
||||
#if (EXPANDER_COL_REGISTER == GPIOA)
|
||||
# if (DIODE_DIRECTION == COL2ROW)
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
uint8_t pullup[2] = {
|
||||
expander_input_pin_mask,
|
||||
0,
|
||||
};
|
||||
# elif (DIODE_DIRECTION == ROW2COL)
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
uint8_t pullup[2] = {
|
||||
0,
|
||||
expander_input_pin_mask,
|
||||
};
|
||||
# endif
|
||||
#elif (EXPANDER_COL_REGISTER == GPIOB)
|
||||
# if (DIODE_DIRECTION == COL2ROW)
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
uint8_t pullup[2] = {
|
||||
0,
|
||||
expander_input_pin_mask,
|
||||
};
|
||||
# elif (DIODE_DIRECTION == ROW2COL)
|
||||
expander_status = i2c_write(expander_input_pin_mask); if (expander_status) goto out;
|
||||
expander_status = i2c_write(0); if (expander_status) goto out;
|
||||
uint8_t pullup[2] = {
|
||||
expander_input_pin_mask,
|
||||
0,
|
||||
};
|
||||
# endif
|
||||
#endif
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
|
||||
expander_status = i2c_writeReg(I2C_ADDR, IODIRA, direction, 2, I2C_TIMEOUT);
|
||||
if (expander_status) return;
|
||||
|
||||
expander_status = i2c_writeReg(I2C_ADDR, GPPUA, pullup, 2, I2C_TIMEOUT);
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
@@ -337,14 +349,11 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
|
||||
// Read columns from expander, unless it's in an error state
|
||||
if (! expander_status) {
|
||||
expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out;
|
||||
expander_status = i2c_write(EXPANDER_COL_REGISTER); if (expander_status) goto out;
|
||||
expander_status = i2c_start(I2C_ADDR_READ); if (expander_status) goto out;
|
||||
|
||||
current_matrix[current_row] |= (~i2c_readNak()) & expander_input_pin_mask;
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
uint8_t state = 0;
|
||||
expander_status = i2c_readReg(I2C_ADDR, EXPANDER_COL_REGISTER, &state, 1, I2C_TIMEOUT);
|
||||
if (! expander_status) {
|
||||
current_matrix[current_row] |= (~state) & expander_input_pin_mask;
|
||||
}
|
||||
}
|
||||
|
||||
// Read columns from onboard pins
|
||||
@@ -366,11 +375,8 @@ static void select_row(uint8_t row) {
|
||||
if (! expander_status) {
|
||||
// set active row low : 0
|
||||
// set other rows hi-Z : 1
|
||||
expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out;
|
||||
expander_status = i2c_write(EXPANDER_ROW_REGISTER); if (expander_status) goto out;
|
||||
expander_status = i2c_write(0xFF & ~(1<<row)); if (expander_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
uint8_t port = 0xFF & ~(1<<row);
|
||||
expander_status = i2c_writeReg(I2C_ADDR, EXPANDER_ROW_REGISTER, &port, 1, I2C_TIMEOUT);
|
||||
}
|
||||
|
||||
// select on teensy
|
||||
@@ -426,13 +432,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||
return false;
|
||||
}
|
||||
|
||||
expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out;
|
||||
expander_status = i2c_write(EXPANDER_ROW_REGISTER); if (expander_status) goto out;
|
||||
expander_status = i2c_start(I2C_ADDR_READ); if (expander_status) goto out;
|
||||
column_state = i2c_readNak();
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
expander_status = i2c_readReg(I2C_ADDR, EXPANDER_ROW_REGISTER, &column_state, 1, I2C_TIMEOUT);
|
||||
|
||||
column_state = ~column_state;
|
||||
} else {
|
||||
@@ -476,11 +476,8 @@ static void select_col(uint8_t col)
|
||||
} else {
|
||||
// set active col low : 0
|
||||
// set other cols hi-Z : 1
|
||||
expander_status = i2c_start(I2C_ADDR_WRITE); if (expander_status) goto out;
|
||||
expander_status = i2c_write(EXPANDER_COL_REGISTER); if (expander_status) goto out;
|
||||
expander_status = i2c_write(0xFF & ~(1<<col)); if (expander_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
uint8_t port = 0xFF & ~(1<<col);
|
||||
expander_status = i2c_writeReg(I2C_ADDR, EXPANDER_COL_REGISTER, &port, 1, I2C_TIMEOUT);
|
||||
}
|
||||
} else {
|
||||
// select on teensy
|
||||
|
@@ -28,5 +28,5 @@ SLEEP_LED_ENABLE = no
|
||||
RGBLIGHT_ENABLE = no
|
||||
|
||||
# project specific files
|
||||
SRC = twimaster.c \
|
||||
matrix.c
|
||||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
SRC += matrix.c
|
||||
|
@@ -1,207 +0,0 @@
|
||||
/*************************************************************************
|
||||
* Title: I2C master library using hardware TWI interface
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device with hardware TWI
|
||||
* Usage: API compatible with I2C Software Library i2cmaster.h
|
||||
**************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <compat/twi.h>
|
||||
|
||||
#include "i2cmaster.h"
|
||||
|
||||
/* define CPU frequency in Hz here if not defined in Makefile */
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/* I2C clock in Hz */
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialization of the I2C bus interface. Need to be called only once
|
||||
*************************************************************************/
|
||||
void i2c_init(void)
|
||||
{
|
||||
/* initialize TWI clock
|
||||
* minimal values in Bit Rate Register (TWBR) and minimal Prescaler
|
||||
* bits in the TWI Status Register should give us maximal possible
|
||||
* I2C bus speed - about 444 kHz
|
||||
*
|
||||
* for more details, see 20.5.2 in ATmega16/32 secification
|
||||
*/
|
||||
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = 10; /* must be >= 10 for stable operation */
|
||||
|
||||
}/* i2c_init */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
return 0 = device accessible, 1= failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_start(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed and ACK/NACK has been received
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}/* i2c_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
If device is busy, use ack polling to wait until device is ready
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
*************************************************************************/
|
||||
void i2c_start_wait(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
|
||||
{
|
||||
/* device busy, send stop condition to terminate write operation */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
continue;
|
||||
}
|
||||
//if( twst != TW_MT_SLA_ACK) return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}/* i2c_start_wait */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
|
||||
Return: 0 device accessible
|
||||
1 failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_rep_start(unsigned char address)
|
||||
{
|
||||
return i2c_start( address );
|
||||
|
||||
}/* i2c_rep_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Terminates the data transfer and releases the I2C bus
|
||||
*************************************************************************/
|
||||
void i2c_stop(void)
|
||||
{
|
||||
/* send stop condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
}/* i2c_stop */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send one byte to I2C device
|
||||
|
||||
Input: byte to be transfered
|
||||
Return: 0 write successful
|
||||
1 write failed
|
||||
*************************************************************************/
|
||||
unsigned char i2c_write( unsigned char data )
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send data to the previously addressed device
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if( twst != TW_MT_DATA_ACK) return 1;
|
||||
return 0;
|
||||
|
||||
}/* i2c_write */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, request more data from device
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readAck(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readAck */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, read is followed by a stop condition
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readNak(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readNak */
|
@@ -27,6 +27,17 @@ static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t read_cols(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
// user-defined overridable functions
|
||||
|
||||
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_init_user(void) {}
|
||||
|
||||
__attribute__((weak)) void matrix_scan_user(void) {}
|
||||
|
||||
// helper functions
|
||||
void matrix_init(void) {
|
||||
/* See datahand.h for more detail on pins. */
|
||||
|
||||
@@ -48,7 +59,7 @@ void matrix_init(void) {
|
||||
/* Turn off the lock LEDs. */
|
||||
PORTF |= LED_CAPS_LOCK | LED_NUM_LOCK | LED_SCROLL_LOCK | LED_MOUSE_LOCK;
|
||||
|
||||
matrix_init_user();
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void) {
|
||||
@@ -62,7 +73,7 @@ uint8_t matrix_scan(void) {
|
||||
matrix[row] = read_cols();
|
||||
}
|
||||
|
||||
matrix_scan_user();
|
||||
matrix_scan_quantum();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@@ -1 +1 @@
|
||||
JOYSTICK_ENABLE = analog
|
||||
JOYSTICK_ENABLE = yes
|
||||
|
@@ -24,7 +24,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MATRIX_COL_PINS \
|
||||
{ A15, B3, B4, B5, B6, B7 }
|
||||
#define MATRIX_ROW_PINS \
|
||||
{ B12, B13, B14, B15, A8, A9 }
|
||||
{ B12, B13, B14, B15, A8, A10 }
|
||||
|
||||
#define UNUSED_PINS \
|
||||
{ C15 }
|
||||
// B2 used for BOOT1, has internal pull down?
|
||||
// A9 has internal pull-down
|
||||
// A11 and A12 are used for USB sense. DO NOT USE.
|
||||
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
@@ -45,12 +51,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLED_SPLIT \
|
||||
{ 10, 10 }
|
||||
|
||||
#define DEBUG_LED_PIN C13
|
||||
#define DEBUG_LED_PIN C13
|
||||
|
||||
#define AUDIO_PIN A0
|
||||
#define AUDIO_PWM_DRIVER PWMD5
|
||||
#define AUDIO_PWM_CHANNEL 1
|
||||
#define AUDIO_STATE_TIMER GPTD4
|
||||
/* Audio config */
|
||||
#define AUDIO_PIN B1
|
||||
#define AUDIO_PWM_DRIVER PWMD3
|
||||
#define AUDIO_PWM_CHANNEL 4
|
||||
#define AUDIO_PWM_PAL_MODE 2
|
||||
#define AUDIO_STATE_TIMER GPTD4
|
||||
|
||||
/* serial.c configuration for split keyboard */
|
||||
#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
|
||||
@@ -60,10 +68,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||
#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
|
||||
#undef SOFT_SERIAL_PIN
|
||||
|
||||
// #define EE_HANDS
|
||||
|
||||
/* i2c config for oleds */
|
||||
#define I2C_DRIVER I2CD1
|
||||
#define I2C1_SCL_BANK GPIOB
|
||||
#define I2C1_SDA_BANK GPIOB
|
||||
@@ -73,11 +79,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define I2C1_SDA_PAL_MODE 4
|
||||
#define I2C1_CLOCK_SPEED 400000
|
||||
|
||||
/* encoder config */
|
||||
#define ENCODERS_PAD_A \
|
||||
{ B1 }
|
||||
{ A13 }
|
||||
#define ENCODERS_PAD_B \
|
||||
{ B2 }
|
||||
{ A14 }
|
||||
|
||||
/* spi config for eeprom and pmw3360 sensor */
|
||||
#define SPI_DRIVER SPID1
|
||||
#define SPI_SCK_PIN A5
|
||||
#define SPI_SCK_PAL_MODE 5
|
||||
@@ -86,6 +94,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define SPI_MISO_PIN A6
|
||||
#define SPI_MISO_PAL_MODE 5
|
||||
|
||||
/* eeprom config */
|
||||
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4
|
||||
#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8
|
||||
// #define EXTERNAL_EEPROM_BYTE_COUNT 8196
|
||||
@@ -93,6 +102,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// #define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||
// #define DEBUG_EEPROM_OUTPUT
|
||||
|
||||
/* pmw3360 config */
|
||||
#define PMW3360_CS_PIN B0
|
||||
#define PMW3360_SPI_MODE 3
|
||||
#define PMW3360_SPI_DIVISOR 4
|
||||
|
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
// #define HAL_USE_DAC TRUE
|
||||
#define HAL_USE_PWM TRUE
|
||||
#define HAL_USE_SERIAL TRUE
|
||||
#define HAL_USE_I2C TRUE
|
||||
|
@@ -24,11 +24,14 @@
|
||||
#undef STM32_PWM_USE_TIM5
|
||||
#define STM32_PWM_USE_TIM5 TRUE
|
||||
|
||||
#undef STM32_GPT_USE_TIM4
|
||||
#define STM32_GPT_USE_TIM4 TRUE
|
||||
#undef STM32_PWM_USE_TIM3
|
||||
#define STM32_PWM_USE_TIM3 TRUE
|
||||
|
||||
#undef STM32_SPI_USE_SPI1
|
||||
#define STM32_SPI_USE_SPI1 TRUE
|
||||
|
||||
#undef STM32_SERIAL_USE_USART2
|
||||
#define STM32_SERIAL_USE_USART2 TRUE
|
||||
|
||||
#undef STM32_GPT_USE_TIM4
|
||||
#define STM32_GPT_USE_TIM4 TRUE
|
||||
|
@@ -0,0 +1,24 @@
|
||||
# Drashna's Blackpill Tractyl Manuform (5x6) with a right side trackball
|
||||
|
||||
* VBUS mod, using PB10
|
||||
* Split Hand Pin, using PC14
|
||||
* Full Duplex Serial/USART using PA3 and PA4 on USART2
|
||||
* PWM Audio using PB1 and TIM3 and GPT on TIM4
|
||||
* PWM RGB using PA1 TIM5
|
||||
* pmw3360 sensor sharing PA5-PA7 on SPI1, with B0 as CS pin
|
||||
* 8KB SPI EEPROM chip sharing PA5-PA7 on SPI1 with PA4 as CS pin
|
||||
* Encoder using PA10 and PA12
|
||||
* SSD1306 OLED display (128x64) using PB8-PB9 on I2C1
|
||||
|
||||
* Keyboard Maintainer: [Drashna Jael're](https://github.com/drashna)
|
||||
* Hardware Supported: [Design files](https://gitlab.com/keyboards1/dm_r_track/-/tree/master/boolean), [WeAct BlackPill (F411)](https://github.com/WeActTC/MiniSTM32F4x1), [PMW3360 Optical Sensor](https://www.tindie.com/products/jkicklighter/pmw3360-motion-sensor/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make handwired/tractyl_manuform/5x6_right/f411:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make handwired/tractyl_manuform/5x6_right/f411:default:flash
|
||||
|
||||
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).
|
@@ -142,8 +142,14 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
|
||||
[_LOWER] = { { RGB_MOD, RGB_RMOD}, { RGB_HUD, RGB_HUI } },
|
||||
[_ADJUST] = { { CK_DOWN, CK_UP }, { _______, _______ } },
|
||||
};
|
||||
// clang-format on
|
||||
#else
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
# ifdef SWAP_HANDS_ENABLE
|
||||
if (swap_hands) {
|
||||
index ^= 1;
|
||||
}
|
||||
# endif
|
||||
if (index == 0) {
|
||||
tap_code_delay(clockwise ? KC_VOLD : KC_VOLU, 5);
|
||||
} else if (index == 1) {
|
||||
@@ -152,7 +158,6 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
static uint16_t mouse_timer = 0;
|
||||
|
@@ -5,7 +5,7 @@ HAPTIC_ENABLE = no
|
||||
COMMAND_ENABLE = no
|
||||
TAP_DANCE_ENABLE = yes
|
||||
UNICODE_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
WPM_ENABLE = yes
|
||||
ENCODER_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# Drashna's Dactyl Manuform (5x6) with a right side trackball
|
||||
# Drashna's Tractyl Manuform (5x6) with a right side trackball
|
||||
|
||||

|
||||
|
||||
It's a Dactyl Manuform with an integrated thumb based trackball, using the pmw3360 optical sensor.
|
||||
It's a Tractyl Manuform with an integrated thumb based trackball, using the pmw3360 optical sensor.
|
||||
|
||||
It's powered by 2x Teensy++ 2.0's, using Drashna's [Teensy VBUS Hack](https://docs.qmk.fm/#/feature_split_keyboard?id=hardware-considerations-and-mods) for better detection.
|
||||
|
||||
@@ -12,10 +12,10 @@ It's powered by 2x Teensy++ 2.0's, using Drashna's [Teensy VBUS Hack](https://do
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make handwired/dactyl_manuform/5x6_right_trackball:default
|
||||
make handwired/tractyl_manuform/5x6_right:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make handwired/dactyl_manuform/5x6_right_trackball:default:flash
|
||||
make handwired/tractyl_manuform/5x6_right:default:flash
|
||||
|
||||
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).
|
||||
|
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#pragma once
|
||||
|
||||
// mouse config
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
# ifndef MOUSEKEY_MOVE_DELTA
|
||||
# ifndef MK_KINETIC_SPEED
|
||||
# define MOUSEKEY_MOVE_DELTA 5
|
||||
@@ -59,7 +60,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define MOUSEKEY_ACCELERATED_SPEED 3000
|
||||
# endif
|
||||
|
||||
|
||||
// mouse scroll config
|
||||
# ifndef MOUSEKEY_WHEEL_DELAY
|
||||
# define MOUSEKEY_WHEEL_DELAY 15
|
||||
@@ -89,7 +89,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS
|
||||
# define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
|
@@ -20,43 +20,40 @@
|
||||
#include "drivers/sensors/pmw3360.h"
|
||||
|
||||
kb_config_data_t kb_config;
|
||||
kb_pointer_data_t kb_pointer;
|
||||
kb_mouse_report_t sync_mouse_report;
|
||||
|
||||
void kb_pointer_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
|
||||
if (target2initiator_buffer_size == sizeof(sync_mouse_report)) {
|
||||
memcpy(target2initiator_buffer, &sync_mouse_report, sizeof(sync_mouse_report));
|
||||
}
|
||||
sync_mouse_report.x = 0;
|
||||
sync_mouse_report.y = 0;
|
||||
}
|
||||
|
||||
void kb_config_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
|
||||
if (initiator2target_buffer_size == sizeof(kb_config)) {
|
||||
memcpy(&kb_config, initiator2target_buffer, sizeof(kb_config));
|
||||
}
|
||||
}
|
||||
void kb_pointer_sync_handler(uint8_t initiator2target_buffer_size, const void* initiator2target_buffer, uint8_t target2initiator_buffer_size, void* target2initiator_buffer) {
|
||||
if (target2initiator_buffer_size == sizeof(kb_pointer)) {
|
||||
memcpy(target2initiator_buffer, &kb_pointer, sizeof(kb_pointer));
|
||||
|
||||
static uint16_t cpi = 0;
|
||||
// Check if the state values are different
|
||||
if (cpi != kb_config.device_cpi) {
|
||||
cpi = kb_config.device_cpi;
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_pre_init_sync(void) {
|
||||
memset(&kb_config, 0, sizeof(kb_config));
|
||||
memset(&kb_pointer, 0, sizeof(kb_pointer));
|
||||
memset(&sync_mouse_report, 0, sizeof(sync_mouse_report));
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
void keyboard_post_init_sync(void) {
|
||||
// Register keyboard state sync split transaction
|
||||
transaction_register_rpc(RPC_ID_KB_CONFIG_SYNC, kb_config_sync_handler);
|
||||
transaction_register_rpc(RPC_ID_POINTER_STATE_SYNC, kb_pointer_sync_handler);
|
||||
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
void kb_config_update(void) {
|
||||
if (is_keyboard_master()) {
|
||||
static uint16_t cpi = 0;
|
||||
if (cpi != kb_config.device_cpi) {
|
||||
cpi = kb_config.device_cpi;
|
||||
pmw_set_cpi(cpi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void kb_config_sync(void) {
|
||||
void housekeeping_task_sync(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Keep track of the last state, so that we can tell if we need to propagate to slave
|
||||
static kb_config_data_t last_kb_config;
|
||||
@@ -82,35 +79,6 @@ void kb_config_sync(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void kb_pointer_sync(void) {
|
||||
if (is_keyboard_master() && is_keyboard_left()) {
|
||||
// Keep track of the last state, so that we can tell if we need to propagate to slave
|
||||
static uint32_t last_sync = 0;
|
||||
|
||||
// Perform the sync if requested
|
||||
if (timer_elapsed32(last_sync) >= 5) {
|
||||
if (transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(kb_pointer), &kb_pointer)) {
|
||||
last_sync = timer_read32();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void housekeeping_task_kb(void) {
|
||||
// Update kb_config so we can send to slave
|
||||
kb_config_update();
|
||||
// Data sync from master to slave
|
||||
kb_config_sync();
|
||||
kb_pointer_sync();
|
||||
}
|
||||
|
||||
void kb_pointer_sync_send(int8_t x, int8_t y) {
|
||||
kb_pointer.mouse_x = x;
|
||||
kb_pointer.mouse_y = y;
|
||||
}
|
||||
|
||||
kb_pointer_data_t kb_pointer_sync_get(void) { return (kb_pointer_data_t){.mouse_x = kb_pointer.mouse_x, .mouse_y = kb_pointer.mouse_y}; }
|
||||
|
||||
void trackball_set_cpi(uint16_t cpi) {
|
||||
kb_config.device_cpi = cpi;
|
||||
if (!is_keyboard_left()) {
|
||||
|
@@ -34,23 +34,21 @@ keyboard_config_t keyboard_config;
|
||||
uint16_t dpi_array[] = TRACKBALL_DPI_OPTIONS;
|
||||
#define DPI_OPTION_SIZE (sizeof(dpi_array) / sizeof(uint16_t))
|
||||
|
||||
bool BurstState = false; // init burst state for Trackball module
|
||||
uint16_t MotionStart = 0; // Timer for accel, 0 is resting state
|
||||
bool BurstState = false; // init burst state for Trackball module
|
||||
uint16_t MotionStart = 0; // Timer for accel, 0 is resting state
|
||||
|
||||
__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y) {
|
||||
mouse_report->x = x;
|
||||
mouse_report->y = y;
|
||||
}
|
||||
|
||||
__attribute__((weak)) kb_pointer_data_t process_mouse(void) {
|
||||
kb_pointer_data_t temp_data = {.mouse_x = 0, .mouse_y = 0};
|
||||
|
||||
__attribute__((weak)) void process_mouse(void) {
|
||||
report_pmw_t data = pmw_read_burst();
|
||||
// Reset timer if stopped moving
|
||||
if (!data.isMotion) {
|
||||
if (MotionStart != 0) MotionStart = 0;
|
||||
return temp_data;
|
||||
}
|
||||
// Reset timer if stopped moving
|
||||
if (!data.isMotion) {
|
||||
if (MotionStart != 0) MotionStart = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.isOnSurface) {
|
||||
// Set timer if new motion
|
||||
@@ -59,8 +57,12 @@ __attribute__((weak)) kb_pointer_data_t process_mouse(void) {
|
||||
MotionStart = timer_read();
|
||||
}
|
||||
|
||||
if (debug_mouse) { dprintf("Delt] d: %d t: %u\n", abs(data.dx) + abs(data.dy), MotionStart); }
|
||||
if (debug_mouse) { dprintf("Pre ] X: %d, Y: %d\n", data.dx, data.dy); }
|
||||
if (debug_mouse) {
|
||||
dprintf("Delt] d: %d t: %u\n", abs(data.dx) + abs(data.dy), MotionStart);
|
||||
}
|
||||
if (debug_mouse) {
|
||||
dprintf("Pre ] X: %d, Y: %d\n", data.dx, data.dy);
|
||||
}
|
||||
#if defined(PROFILE_LINEAR)
|
||||
float scale = float(timer_elaspsed(MotionStart)) / 1000.0;
|
||||
data.dx *= scale;
|
||||
@@ -77,14 +79,15 @@ __attribute__((weak)) kb_pointer_data_t process_mouse(void) {
|
||||
if (debug_mouse) dprintf("Cons] X: %d, Y: %d\n", data.dx, data.dy);
|
||||
// dprintf("Elapsed:%u, X: %f Y: %\n", i, pgm_read_byte(firmware_data+i));
|
||||
|
||||
temp_data.mouse_x = -data.dx;
|
||||
temp_data.mouse_y = data.dy;
|
||||
sync_mouse_report.x = -data.dx;
|
||||
sync_mouse_report.y = data.dy;
|
||||
}
|
||||
return temp_data;
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
|
||||
if (!process_record_user(keycode, record)) { return false; }
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
if (keycode == DPI_CONFIG && record->event.pressed) {
|
||||
@@ -119,29 +122,28 @@ bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
|
||||
return true;
|
||||
}
|
||||
__attribute__((weak)) void keyboard_pre_init_sync(void) {}
|
||||
|
||||
// Hardware Setup
|
||||
void keyboard_pre_init_kb(void) {
|
||||
void keyboard_pre_init_kb(void) {
|
||||
// debug_enable = true;
|
||||
// debug_matrix = true;
|
||||
// debug_mouse = true;
|
||||
// debug_encoder = true;
|
||||
|
||||
/* Ground all output pins connected to ground. This provides additional
|
||||
* pathways to ground. If you're messing with this, know this: driving ANY
|
||||
* of these pins high will cause a short. On the MCU. Ka-blooey.
|
||||
*/
|
||||
|
||||
// This is the debug LED.
|
||||
#if defined(DEBUG_LED_PIN)
|
||||
setPinOutput(DEBUG_LED_PIN);
|
||||
writePin(DEBUG_LED_PIN, debug_enable);
|
||||
writePin(DEBUG_LED_PIN, !debug_enable);
|
||||
#endif
|
||||
|
||||
keyboard_pre_init_sync();
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void keyboard_post_init_sync(void) {}
|
||||
void keyboard_post_init_kb(void) {
|
||||
keyboard_post_init_sync();
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
void pointing_device_init(void) {
|
||||
if (!is_keyboard_left()) {
|
||||
@@ -153,18 +155,18 @@ void pointing_device_init(void) {
|
||||
|
||||
void pointing_device_task(void) {
|
||||
report_mouse_t mouse_report = pointing_device_get_report();
|
||||
kb_pointer_data_t data = {.mouse_x = mouse_report.x, .mouse_y = mouse_report.y};
|
||||
|
||||
if (is_keyboard_left()) {
|
||||
if (is_keyboard_master()) {
|
||||
data = kb_pointer_sync_get();
|
||||
process_mouse_user(&mouse_report, data.mouse_x, data.mouse_y);
|
||||
transaction_rpc_recv(RPC_ID_POINTER_STATE_SYNC, sizeof(sync_mouse_report), &sync_mouse_report);
|
||||
process_mouse_user(&mouse_report, sync_mouse_report.x, sync_mouse_report.y);
|
||||
}
|
||||
} else {
|
||||
data = process_mouse();
|
||||
if (!is_keyboard_master()) {
|
||||
kb_pointer_sync_send(data.mouse_x, data.mouse_y);
|
||||
} else {
|
||||
process_mouse_user(&mouse_report, data.mouse_x, data.mouse_y);
|
||||
process_mouse();
|
||||
if (is_keyboard_master()) {
|
||||
process_mouse_user(&mouse_report, sync_mouse_report.x, sync_mouse_report.y);
|
||||
sync_mouse_report.x = 0;
|
||||
sync_mouse_report.y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,11 +185,13 @@ void eeconfig_init_kb(void) {
|
||||
}
|
||||
|
||||
__attribute__((weak)) void matrix_init_sub_kb(void) {}
|
||||
void matrix_init_kb(void) {
|
||||
void matrix_init_kb(void) {
|
||||
// is safe to just read DPI setting since matrix init
|
||||
// comes before pointing device init.
|
||||
keyboard_config.raw = eeconfig_read_kb();
|
||||
if (keyboard_config.dpi_config > DPI_OPTION_SIZE) { eeconfig_init_kb(); }
|
||||
if (keyboard_config.dpi_config > DPI_OPTION_SIZE) {
|
||||
eeconfig_init_kb();
|
||||
}
|
||||
matrix_init_sub_kb();
|
||||
matrix_init_user();
|
||||
}
|
||||
@@ -198,6 +202,12 @@ void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void housekeeping_task_sync(void) {}
|
||||
void housekeeping_task_kb(void) {
|
||||
housekeeping_task_sync();
|
||||
// no need for user function, is called already
|
||||
}
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
void matrix_power_up(void) { pointing_device_task(); }
|
||||
#endif
|
||||
|
@@ -40,18 +40,22 @@ enum ploopy_keycodes {
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint16_t device_cpi;
|
||||
uint16_t device_cpi;
|
||||
} kb_config_data_t;
|
||||
|
||||
__attribute__((aligned(16))) typedef struct {
|
||||
int8_t mouse_x;
|
||||
int8_t mouse_y;
|
||||
} kb_pointer_data_t;
|
||||
int8_t x;
|
||||
int8_t y;
|
||||
} kb_mouse_report_t;
|
||||
|
||||
kb_pointer_data_t process_mouse(void);
|
||||
void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y);
|
||||
void kb_pointer_sync_send(int8_t x, int8_t y);
|
||||
kb_pointer_data_t kb_pointer_sync_get(void);
|
||||
void trackball_set_cpi(uint16_t cpi);
|
||||
void matrix_init_sub_kb(void);
|
||||
void matrix_scan_sub_kb(void);
|
||||
extern kb_mouse_report_t sync_mouse_report;
|
||||
|
||||
void process_mouse(void);
|
||||
void process_mouse_user(report_mouse_t* mouse_report, int8_t x, int8_t y);
|
||||
void trackball_set_cpi(uint16_t cpi);
|
||||
void matrix_init_sub_kb(void);
|
||||
void matrix_scan_sub_kb(void);
|
||||
|
||||
void keyboard_pre_init_sync(void);
|
||||
void keyboard_post_init_sync(void);
|
||||
void housekeeping_task_sync(void);
|
||||
|
@@ -25,6 +25,17 @@
|
||||
static matrix_row_t rows[MATRIX_ROWS];
|
||||
#define ROWS_PER_HAND (MATRIX_ROWS / 2)
|
||||
|
||||
// user-defined overridable functions
|
||||
|
||||
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_init_user(void) {}
|
||||
|
||||
__attribute__((weak)) void matrix_scan_user(void) {}
|
||||
|
||||
// helper functions
|
||||
inline
|
||||
uint8_t matrix_rows(void) {
|
||||
return MATRIX_ROWS;
|
||||
|
91
keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/config.h
Normal file
91
keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/config.h
Normal file
@@ -0,0 +1,91 @@
|
||||
#pragma once
|
||||
/* Copyright 2021 Gabriel Bustamante Toledo
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
// default but used in macros
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 200
|
||||
|
||||
// Prevent normal rollover on alphas from accidentally triggering mods.
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
// Enable rapid switch from tap to hold, disables double tap hold auto-repeat.
|
||||
#define TAPPING_FORCE_HOLD
|
||||
|
||||
// Auto Shift
|
||||
#define NO_AUTO_SHIFT_ALPHA
|
||||
#define AUTO_SHIFT_TIMEOUT TAPPING_TERM
|
||||
#define AUTO_SHIFT_NO_SETUP
|
||||
|
||||
// Recommended for heavy chording.
|
||||
#define QMK_KEYS_PER_SCAN 4
|
||||
|
||||
// Mouse key speed and acceleration.
|
||||
#undef MOUSEKEY_DELAY
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#undef MOUSEKEY_INTERVAL
|
||||
#define MOUSEKEY_INTERVAL 16
|
||||
#undef MOUSEKEY_WHEEL_DELAY
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
#undef MOUSEKEY_MAX_SPEED
|
||||
#define MOUSEKEY_MAX_SPEED 6
|
||||
#undef MOUSEKEY_TIME_TO_MAX
|
||||
#define MOUSEKEY_TIME_TO_MAX 64
|
||||
|
||||
#define RGBLIGHT_LAYERS
|
||||
#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF
|
||||
#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
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
|
||||
#define RGBLIGHT_LIMIT_VAL 10
|
||||
|
||||
//bootmagic
|
||||
#define BOOTMAGIC_KEY_SALT KC_V
|
||||
#define BOOTMAGIC_KEY_EEPROM_CLEAR KC_Q
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
#define DISABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
#define DISABLE_RGB_MATRIX_BREATHING
|
||||
#define DISABLE_RGB_MATRIX_BAND_SAT
|
||||
#define DISABLE_RGB_MATRIX_BAND_VAL
|
||||
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_ALL
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL
|
||||
#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
|
||||
#undef RGB_MATRIX_STARTUP_MODE
|
||||
|
||||
#define RGBLIGHT_HUE_STEP 20
|
||||
|
||||
#endif
|
125
keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/keymap.c
Executable file
125
keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/keymap.c
Executable file
@@ -0,0 +1,125 @@
|
||||
/* Copyright 2021 Gabriel Bustamante Toledo
|
||||
*
|
||||
* 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 layers { BASE1, BASE2, MEDIA, NAV, MOUSE, SYM, NUM, FUN };
|
||||
|
||||
enum {
|
||||
TD_MEDIA, TD_SCREEN,
|
||||
};
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_MEDIA] = ACTION_TAP_DANCE_DOUBLE( KC_MPLY , KC_MNXT ),
|
||||
[TD_SCREEN] = ACTION_TAP_DANCE_DOUBLE( (G(S(KC_S))) , S(C(KC_4)) ),
|
||||
};
|
||||
|
||||
void set_color(int r, int g, int b){
|
||||
rgb_matrix_set_color(5, r, g, b);
|
||||
rgb_matrix_set_color(6, r, g, b);
|
||||
rgb_matrix_set_color(17, r, g, b);
|
||||
rgb_matrix_set_color(18, r, g, b);
|
||||
rgb_matrix_set_color(29, r, g, b);
|
||||
rgb_matrix_set_color(30, r, g, b);
|
||||
rgb_matrix_set_color(41, r, g, b);
|
||||
}
|
||||
|
||||
void rgb_matrix_indicators_user(void) {
|
||||
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case BASE2:
|
||||
set_color(128, 64, 0);
|
||||
break;
|
||||
case MEDIA:
|
||||
set_color(50, 10, 20);
|
||||
break;
|
||||
case NAV:
|
||||
set_color(0, 40, 50);
|
||||
break;
|
||||
case MOUSE:
|
||||
set_color(0, 0, 50);
|
||||
break;
|
||||
case SYM:
|
||||
set_color(0, 50, 1.9);
|
||||
break;
|
||||
case NUM:
|
||||
set_color(10, 0, 50);
|
||||
break;
|
||||
case FUN:
|
||||
set_color(50, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[BASE1] = LAYOUT_planck_mit(
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, TG(BASE2), KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_QUOT,
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
|
||||
TD(TD_SCREEN), TD(TD_MEDIA), LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), KC_NO, LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), C(G(KC_LEFT)), C(G(KC_RIGHT))
|
||||
),
|
||||
|
||||
[BASE2] = LAYOUT_planck_mit(
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, TG(BASE2), KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||
LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_NO, KC_NO, KC_H, LSFT_T(KC_J), LCTL_T(KC_K), LALT_T(KC_L), LGUI_T(KC_QUOT),
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
|
||||
TD(TD_SCREEN), TD(TD_MEDIA), LT(MEDIA, KC_ESC), LT(NAV, KC_SPC), LT(MOUSE, KC_TAB), KC_NO, LT(SYM, KC_ENT), LT(NUM, KC_BSPC), LT(FUN, KC_DEL), KC_NO, KC_NO
|
||||
),
|
||||
|
||||
[MEDIA] = LAYOUT_planck_mit(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI,
|
||||
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT,
|
||||
KC_NO, KC_ALGR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MSTP, KC_MPLY, KC_MUTE, KC_NO, KC_NO
|
||||
),
|
||||
|
||||
[NAV] = LAYOUT_planck_mit(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, C(KC_S), C(KC_V), C(KC_C), C(KC_X), C(KC_Z),
|
||||
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_NO, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,
|
||||
KC_NO, KC_ALGR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ENT, KC_BSPC, KC_DEL, KC_NO, KC_NO
|
||||
),
|
||||
|
||||
[MOUSE] = LAYOUT_planck_mit(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, C(KC_S), C(KC_V), C(KC_C), C(KC_X), C(KC_Z),
|
||||
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R,
|
||||
KC_NO, KC_ALGR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_BTN3, KC_BTN2, KC_NO, KC_NO
|
||||
),
|
||||
|
||||
[SYM] = LAYOUT_planck_mit(
|
||||
KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BSPC,
|
||||
KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, KC_NO, KC_NO, KC_NO, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI,
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ALGR, KC_NO,
|
||||
KC_NO, KC_NO, KC_LPRN, KC_RPRN, KC_UNDS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
|
||||
[NUM] = LAYOUT_planck_mit(
|
||||
KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_BSPC,
|
||||
KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, KC_NO, KC_NO, KC_NO, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_BSLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ALGR, KC_NO,
|
||||
KC_NO, KC_NO, KC_DOT, KC_0, KC_MINS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
|
||||
[FUN] = LAYOUT_planck_mit(
|
||||
KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET,
|
||||
KC_F11, KC_F4, KC_F5, KC_F6, KC_SLCK, KC_NO, KC_NO, KC_NO, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI,
|
||||
KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ALGR, KC_NO,
|
||||
KC_NO, KC_NO, KC_APP, KC_SPC, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
)
|
||||
|
||||
};
|
||||
|
47
keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/readme.md
Normal file
47
keyboards/kprepublic/bm40hsrgb/keymaps/gabustoledo/readme.md
Normal file
@@ -0,0 +1,47 @@
|
||||
# Gabustoledo
|
||||
|
||||
### Compile
|
||||
|
||||
- Compile:
|
||||
|
||||
`qmk compile -kb bm40hsrgb -km gabustoledo`
|
||||
|
||||
### Flash
|
||||
|
||||
- Flash:
|
||||
|
||||
`qmk flash -kb bm40hsrgb -km gabustoledo`
|
||||
|
||||
# Layout
|
||||
|
||||
## BASE
|
||||
|
||||

|
||||
|
||||
## Base 2
|
||||
|
||||

|
||||
|
||||
## MEDIA
|
||||
|
||||

|
||||
|
||||
## NAVIGATION
|
||||
|
||||

|
||||
|
||||
## MOUSE
|
||||
|
||||

|
||||
|
||||
## SYMBOL
|
||||
|
||||

|
||||
|
||||
## NUMBER
|
||||
|
||||

|
||||
|
||||
## FUNCTION
|
||||
|
||||

|
@@ -0,0 +1,5 @@
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
AUTO_SHIFT_ENABLE = yes # Auto Shift
|
||||
TAP_DANCE_ENABLE = yes
|
||||
BOOTMAGIC_ENABLE = yes
|
@@ -1,9 +1,11 @@
|
||||
#include <stdbool.h>
|
||||
#include "action.h"
|
||||
#include "i2cmaster.h"
|
||||
#include "i2c_master.h"
|
||||
#include "expander.h"
|
||||
#include "debug.h"
|
||||
|
||||
#define I2C_TIMEOUT 100
|
||||
|
||||
static uint8_t expander_status = 0;
|
||||
static uint8_t expander_input = 0;
|
||||
|
||||
@@ -20,7 +22,7 @@ void expander_init(void)
|
||||
void expander_scan(void)
|
||||
{
|
||||
dprintf("expander status: %d ... ", expander_status);
|
||||
uint8_t ret = i2c_start(EXPANDER_ADDR | I2C_WRITE);
|
||||
uint8_t ret = i2c_start(EXPANDER_ADDR | I2C_WRITE, I2C_TIMEOUT);
|
||||
if (ret == 0) {
|
||||
i2c_stop();
|
||||
if (expander_status == 0) {
|
||||
@@ -90,15 +92,7 @@ uint8_t expander_write(uint8_t reg, uint8_t data)
|
||||
if (expander_status == 0) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t ret;
|
||||
ret = i2c_start(EXPANDER_ADDR | I2C_WRITE);
|
||||
if (ret) goto stop;
|
||||
ret = i2c_write(reg);
|
||||
if (ret) goto stop;
|
||||
ret = i2c_write(data);
|
||||
stop:
|
||||
i2c_stop();
|
||||
return ret;
|
||||
return i2c_writeReg(EXPANDER_ADDR, reg, &data, 1, I2C_TIMEOUT);
|
||||
}
|
||||
|
||||
uint8_t expander_read(uint8_t reg, uint8_t *data)
|
||||
@@ -106,15 +100,5 @@ uint8_t expander_read(uint8_t reg, uint8_t *data)
|
||||
if (expander_status == 0) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t ret;
|
||||
ret = i2c_start(EXPANDER_ADDR | I2C_WRITE);
|
||||
if (ret) goto stop;
|
||||
ret = i2c_write(reg);
|
||||
if (ret) goto stop;
|
||||
ret = i2c_rep_start(EXPANDER_ADDR | I2C_READ);
|
||||
if (ret) goto stop;
|
||||
*data = i2c_readNak();
|
||||
stop:
|
||||
i2c_stop();
|
||||
return ret;
|
||||
return i2c_readReg(EXPANDER_ADDR, reg, data, 1, I2C_TIMEOUT);
|
||||
}
|
||||
|
@@ -1,178 +0,0 @@
|
||||
#ifndef _I2CMASTER_H
|
||||
#define _I2CMASTER_H 1
|
||||
/*************************************************************************
|
||||
* Title: C include file for the I2C master interface
|
||||
* (i2cmaster.S or twimaster.c)
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device
|
||||
* Usage: see Doxygen manual
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
@defgroup pfleury_ic2master I2C Master library
|
||||
@code #include <i2cmaster.h> @endcode
|
||||
|
||||
@brief I2C (TWI) Master Software Library
|
||||
|
||||
Basic routines for communicating with I2C slave devices. This single master
|
||||
implementation is limited to one bus master on the I2C bus.
|
||||
|
||||
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
|
||||
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
|
||||
Since the API for these two implementations is exactly the same, an application can be linked either against the
|
||||
software I2C implementation or the hardware I2C implementation.
|
||||
|
||||
Use 4.7k pull-up resistor on the SDA and SCL pin.
|
||||
|
||||
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
|
||||
i2cmaster.S to your target when using the software I2C implementation !
|
||||
|
||||
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
|
||||
|
||||
@note
|
||||
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
|
||||
to GNU assembler and AVR-GCC C call interface.
|
||||
Replaced the incorrect quarter period delays found in AVR300 with
|
||||
half period delays.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@par API Usage Example
|
||||
The following code shows typical usage of this library, see example test_i2cmaster.c
|
||||
|
||||
@code
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
#define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned char ret;
|
||||
|
||||
i2c_init(); // initialize I2C library
|
||||
|
||||
// write 0x75 to EEPROM address 5 (Byte Write)
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_write(0x75); // write value 0x75 to EEPROM
|
||||
i2c_stop(); // set stop conditon = release bus
|
||||
|
||||
|
||||
// read previously written value back from EEPROM address 5
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode
|
||||
|
||||
ret = i2c_readNak(); // read one byte from EEPROM
|
||||
i2c_stop();
|
||||
|
||||
for(;;);
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
||||
#endif /* DOXYGEN */
|
||||
|
||||
/**@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
|
||||
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_READ 1
|
||||
|
||||
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_WRITE 0
|
||||
|
||||
|
||||
/**
|
||||
@brief initialize the I2C master interace. Need to be called only once
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_init(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminates the data transfer and releases the I2C bus
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
If device is busy, use ack polling to wait until device ready
|
||||
@param addr address and transfer direction of I2C device
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send one byte to I2C device
|
||||
@param data byte to be transfered
|
||||
@retval 0 write successful
|
||||
@retval 1 write failed
|
||||
*/
|
||||
extern unsigned char i2c_write(unsigned char data);
|
||||
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, request more data from device
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readAck(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readNak(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device
|
||||
|
||||
Implemented as a macro, which calls either i2c_readAck or i2c_readNak
|
||||
|
||||
@param ack 1 send ack, request more data from device<br>
|
||||
0 send nak, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
@@ -16,22 +16,22 @@ BOOTLOADER = caterina
|
||||
#
|
||||
CUSTOM_MATRIX = yes # Custom matrix file for the ErgoDone
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
USB_6KRO_ENABLE = no # USB 6key Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
SWAP_HANDS_ENABLE = no # Disable Onehand
|
||||
RGBLIGHT_ENABLE = no
|
||||
|
||||
# project specific files
|
||||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
SRC = \
|
||||
twimaster.c \
|
||||
matrix.c \
|
||||
expander.c \
|
||||
matrix.c \
|
||||
expander.c \
|
||||
|
||||
LAYOUTS = ergodox
|
||||
|
@@ -1,208 +0,0 @@
|
||||
/*************************************************************************
|
||||
* Title: I2C master library using hardware TWI interface
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device with hardware TWI
|
||||
* Usage: API compatible with I2C Software Library i2cmaster.h
|
||||
**************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <compat/twi.h>
|
||||
|
||||
#include "i2cmaster.h"
|
||||
|
||||
|
||||
/* define CPU frequency in Mhz here if not defined in Makefile */
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/* I2C clock in Hz */
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialization of the I2C bus interface. Need to be called only once
|
||||
*************************************************************************/
|
||||
void i2c_init(void)
|
||||
{
|
||||
/* initialize TWI clock
|
||||
* minimal values in Bit Rate Register (TWBR) and minimal Prescaler
|
||||
* bits in the TWI Status Register should give us maximal possible
|
||||
* I2C bus speed - about 444 kHz
|
||||
*
|
||||
* for more details, see 20.5.2 in ATmega16/32 secification
|
||||
*/
|
||||
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = 10; /* must be >= 10 for stable operation */
|
||||
|
||||
}/* i2c_init */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
return 0 = device accessible, 1= failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_start(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed and ACK/NACK has been received
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}/* i2c_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
If device is busy, use ack polling to wait until device is ready
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
*************************************************************************/
|
||||
void i2c_start_wait(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
|
||||
{
|
||||
/* device busy, send stop condition to terminate write operation */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
continue;
|
||||
}
|
||||
//if( twst != TW_MT_SLA_ACK) return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}/* i2c_start_wait */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
|
||||
Return: 0 device accessible
|
||||
1 failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_rep_start(unsigned char address)
|
||||
{
|
||||
return i2c_start( address );
|
||||
|
||||
}/* i2c_rep_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Terminates the data transfer and releases the I2C bus
|
||||
*************************************************************************/
|
||||
void i2c_stop(void)
|
||||
{
|
||||
/* send stop condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
}/* i2c_stop */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send one byte to I2C device
|
||||
|
||||
Input: byte to be transfered
|
||||
Return: 0 write successful
|
||||
1 write failed
|
||||
*************************************************************************/
|
||||
unsigned char i2c_write( unsigned char data )
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send data to the previously addressed device
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if( twst != TW_MT_DATA_ACK) return 1;
|
||||
return 0;
|
||||
|
||||
}/* i2c_write */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, request more data from device
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readAck(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readAck */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, read is followed by a stop condition
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readNak(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readNak */
|
@@ -17,28 +17,28 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_all(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_UP, MO(1),
|
||||
KC_LCTL, KC_LGUI, KC_RALT, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
[0] = LAYOUT_ortho(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_QUOTE, MO(2),
|
||||
KC_LCTL, KC_LGUI, KC_RALT, KC_LSFT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_UP, KC_DOWN, KC_LEFT, KC_RGHT
|
||||
),
|
||||
[1] = 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_NO,
|
||||
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC,
|
||||
KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO
|
||||
[1] = LAYOUT_ortho(
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO,
|
||||
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_NO,
|
||||
KC_NO, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
[2] = LAYOUT_all(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
[2] = LAYOUT_ortho(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
[3] = LAYOUT_all(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
[3] = LAYOUT_ortho(
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
};
|
||||
|
26
keyboards/lily58/keymaps/gaston/config.h
Normal file
26
keyboards/lily58/keymaps/gaston/config.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
* Copyright 2015 Jack Humbert
|
||||
* Copyright 2021 Gaston Jorquera
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* This is the c configuration file for the keymap. */
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MASTER_LEFT
|
||||
|
||||
#define TAPPING_FORCE_HOLD
|
||||
#define TAPPING_TERM 150 /* ms */
|
58
keyboards/lily58/keymaps/gaston/keymap.c
Normal file
58
keyboards/lily58/keymaps/gaston/keymap.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/* Copyright 2021 Gaston Jorquera
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* This is the keymap configuration. */
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum layer_number {
|
||||
_QWERTY = 0,
|
||||
_LOWER,
|
||||
_MOUSE,
|
||||
};
|
||||
|
||||
#define EN_LOWER LT(_LOWER, KC_SPC)
|
||||
#define EN_MOUSE MO(_MOUSE)
|
||||
|
||||
/* See the readme.md file for an ASCII representation of this keymap. */
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT(
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, 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_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
|
||||
KC_LCTRL,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, EN_MOUSE,KC_EQL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_RALT, KC_LALT, KC_LGUI, EN_LOWER,EN_LOWER, KC_LBRC, KC_RBRC, KC_BSLS
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, KC_F12,
|
||||
XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, KC_BRID, KC_BRIU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
[_MOUSE] = LAYOUT(
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, XXXXXXX, XXXXXXX, KC_ACL0, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_ACL1, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, KC_ACL2, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
)
|
||||
|
||||
};
|
67
keyboards/lily58/keymaps/gaston/readme.md
Normal file
67
keyboards/lily58/keymaps/gaston/readme.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# Gaston's Lily58 Keymap
|
||||
|
||||
A simple three layers keymap to improve typing performance by reducing
|
||||
cognitive load.
|
||||
|
||||
The main characteristics of this keymap are:
|
||||
|
||||
* The QWERTY layer tries to be as normal as possible, without having to use
|
||||
modifiers.
|
||||
* The main thumb buttons are spaces when tapped and enable the LOWER layer
|
||||
when held.
|
||||
* Vim style arrow keys.
|
||||
* Left and right ALT in case you need different behaviors. (For example, the
|
||||
default Option and readline's Alt behavior in macOS.)
|
||||
* The LOWER layer has mostly meta keys.
|
||||
* The MOUSE layer controls the mouse.
|
||||
|
||||
## QWERTY Layer
|
||||
|
||||
```plain
|
||||
,-----------------------------------------. ,-----------------------------------------.
|
||||
| ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | BSPC |
|
||||
|------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
| TAB | Q | W | E | R | T | | Y | U | I | O | P | - |
|
||||
|------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
|LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' |
|
||||
|------+------+------+------+------+------| MOUSE | | = |------+------+------+------+------+------|
|
||||
| LSFT | Z | X | C | V | B |-------| |-------| N | M | , | . | / | ENT |
|
||||
`-----------------------------------------/ LT / \ LT \----------------------------------------'
|
||||
| RALT | LALT | LGUI | / LOWER / \ LOWER \ | [ | ] | \ |
|
||||
| | | |/ SPC / \ SPC \ | | | |
|
||||
`----------------------------' '-----------------------------'
|
||||
```
|
||||
|
||||
## LOWER Layer
|
||||
|
||||
```plain
|
||||
,-----------------------------------------. ,-----------------------------------------.
|
||||
| ESC | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
|------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
| | | MUTE | VOLD | VOLU | | | HOME | PGDN | PGUP | END | | F12 |
|
||||
|------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
| | | MPRV | MPLY | MNXT | |-------. ,-------| LEFT | DOWN | UP | RGHT | | |
|
||||
|------+------+------+------+------+------| | | |------+------+------+------+------+------|
|
||||
| | | | BRID | BRIU | |-------| |-------| | INS | DEL | | | |
|
||||
`-----------------------------------------/ / \ \----------------------------------------'
|
||||
| | | | / TRNS / \ TRNS \ | | | |
|
||||
| | | |/ / \ \ | | | |
|
||||
`----------------------------' '-----------------------------'
|
||||
```
|
||||
|
||||
## MOUSE Layer
|
||||
|
||||
```plain
|
||||
,-----------------------------------------. ,-----------------------------------------.
|
||||
| | | | | | | | | | | | | |
|
||||
|------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
| | | | | | | | BTN1 | BTN2 | | | ACL0 | |
|
||||
|------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
| | | | | | |-------. ,-------| MS_L | MS_D | MS_U | MS_R | ACL1 | |
|
||||
|------+------+------+------+------+------| TRNS | | |------+------+------+------+------+------|
|
||||
| | | | | | |-------| |-------| WH_L | WH_D | WH_U | WH_R | ACL2 | |
|
||||
`-----------------------------------------/ / \ \----------------------------------------'
|
||||
| | | | / / \ \ | | | |
|
||||
| | | |/ / \ \ | | | |
|
||||
`----------------------------' '-----------------------------'
|
||||
```
|
9
keyboards/lily58/keymaps/gaston/rules.mk
Normal file
9
keyboards/lily58/keymaps/gaston/rules.mk
Normal file
@@ -0,0 +1,9 @@
|
||||
MOUSEKEY_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = no
|
||||
OLED_ENABLE = no
|
||||
|
||||
SRC += ./lib/rgb_state_reader.c \
|
||||
./lib/layer_state_reader.c \
|
||||
./lib/logo_reader.c \
|
||||
./lib/keylogger.c \
|
@@ -24,17 +24,17 @@ enum layers {
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_LAYER0] = LAYOUT_65_ansi_blocker(
|
||||
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_DEL, KC_HOME,
|
||||
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_HOME,
|
||||
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_PGUP,
|
||||
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_PGDN,
|
||||
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_DEL,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, KC_END,
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_LAYER1] = LAYOUT_65_ansi_blocker(
|
||||
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, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
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, 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_SLCK, KC_PAUSE, RESET, KC_PGUP,
|
||||
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_PGDN,
|
||||
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_PGDN,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, NK_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK
|
||||
),
|
||||
|
@@ -26,6 +26,17 @@ static matrix_row_t matrix_debouncing[MATRIX_COLS];
|
||||
static bool debouncing = false;
|
||||
static uint16_t debouncing_time = 0;
|
||||
|
||||
// user-defined overridable functions
|
||||
|
||||
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_init_user(void) {}
|
||||
|
||||
__attribute__((weak)) void matrix_scan_user(void) {}
|
||||
|
||||
// helper functions
|
||||
void matrix_init(void)
|
||||
{
|
||||
//debug_enable = true;
|
||||
|
44
keyboards/mokey/mokey64/config.h
Normal file
44
keyboards/mokey/mokey64/config.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
Copyright 2021 Kyle McCreery
|
||||
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"
|
||||
|
||||
#define VENDOR_ID 0x6653
|
||||
#define PRODUCT_ID 0x001A
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
#define MANUFACTURER rhmokey
|
||||
#define PRODUCT MOKEY64
|
||||
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
#define MATRIX_ROW_PINS { A1, A2, A3, A4, A5 }
|
||||
#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10, B11, B12, B13 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define DEBOUNCE 5
|
||||
|
||||
#define RGB_DI_PIN A7
|
||||
#define RGBLED_NUM 68
|
||||
|
||||
/* 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
|
79
keyboards/mokey/mokey64/info.json
Normal file
79
keyboards/mokey/mokey64/info.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"keyboard_name": "Mokey64",
|
||||
"url": "",
|
||||
"maintainer": "mokey",
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label":"k00", "x":0, "y":0},
|
||||
{"label":"k01", "x":1, "y":0},
|
||||
{"label":"k02", "x":2, "y":0},
|
||||
{"label":"k03", "x":3, "y":0},
|
||||
{"label":"k04", "x":4, "y":0},
|
||||
{"label":"k05", "x":5, "y":0},
|
||||
{"label":"k06", "x":6, "y":0},
|
||||
{"label":"k07", "x":7, "y":0},
|
||||
{"label":"k08", "x":8, "y":0},
|
||||
{"label":"k09", "x":9, "y":0},
|
||||
{"label":"k0a", "x":10, "y":0},
|
||||
{"label":"k0b", "x":11, "y":0},
|
||||
{"label":"k0c", "x":12, "y":0},
|
||||
{"label":"k0d", "x":13, "y":0, "w":2},
|
||||
|
||||
{"label":"k10", "x":0, "y":1, "w":1.5},
|
||||
{"label":"k11", "x":1.5, "y":1},
|
||||
{"label":"k12", "x":2.5, "y":1},
|
||||
{"label":"k13", "x":3.5, "y":1},
|
||||
{"label":"k14", "x":4.5, "y":1},
|
||||
{"label":"k15", "x":5.5, "y":1},
|
||||
{"label":"k16", "x":6.5, "y":1},
|
||||
{"label":"k17", "x":7.5, "y":1},
|
||||
{"label":"k18", "x":8.5, "y":1},
|
||||
{"label":"k19", "x":9.5, "y":1},
|
||||
{"label":"k1a", "x":10.5, "y":1},
|
||||
{"label":"k1b", "x":11.5, "y":1},
|
||||
{"label":"k1c", "x":12.5, "y":1},
|
||||
{"label":"k1d", "x":13.5, "y":1, "w":1.5},
|
||||
|
||||
{"label":"k20", "x":0, "y":2, "w":1.75},
|
||||
{"label":"k21", "x":1.75, "y":2},
|
||||
{"label":"k22", "x":2.75, "y":2},
|
||||
{"label":"k23", "x":3.75, "y":2},
|
||||
{"label":"k24", "x":4.75, "y":2},
|
||||
{"label":"k25", "x":5.75, "y":2},
|
||||
{"label":"k26", "x":6.75, "y":2},
|
||||
{"label":"k27", "x":7.75, "y":2},
|
||||
{"label":"k28", "x":8.75, "y":2},
|
||||
{"label":"k29", "x":9.75, "y":2},
|
||||
{"label":"k2a", "x":10.75, "y":2},
|
||||
{"label":"k2b", "x":11.75, "y":2},
|
||||
{"label":"k2c", "x":12.75, "y":2, "w":2.25},
|
||||
|
||||
{"label":"k30", "x":0, "y":3, "w":2},
|
||||
{"label":"k31", "x":2, "y":3},
|
||||
{"label":"k32", "x":3, "y":3},
|
||||
{"label":"k33", "x":4, "y":3},
|
||||
{"label":"k34", "x":5, "y":3},
|
||||
{"label":"k35", "x":6, "y":3},
|
||||
{"label":"k36", "x":7, "y":3},
|
||||
{"label":"k37", "x":8, "y":3},
|
||||
{"label":"k38", "x":9, "y":3},
|
||||
{"label":"k39", "x":10, "y":3},
|
||||
{"label":"k3a", "x":11, "y":3},
|
||||
{"label":"k3b", "x":12, "y":3},
|
||||
{"label":"k3c", "x":13, "y":3},
|
||||
{"label":"k3d", "x":14, "y":3},
|
||||
|
||||
{"label":"k40", "x":0, "y":4, "w":1.25},
|
||||
{"label":"k41", "x":1.25, "y":4, "w":1.25},
|
||||
{"label":"k42", "x":2.5, "y":4, "w":1.25},
|
||||
{"label":"k43", "x":3.75, "y":4, "w":6.25},
|
||||
{"label":"k44", "x":10, "y":4},
|
||||
{"label":"k45", "x":11, "y":4},
|
||||
{"label":"k46", "x":12, "y":4},
|
||||
{"label":"k47", "x":13, "y":4},
|
||||
{"label":"k48", "x":14, "y":4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
32
keyboards/mokey/mokey64/keymaps/default/keymap.c
Normal file
32
keyboards/mokey/mokey64/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* Copyright 2021 Kyle McCreery
|
||||
*
|
||||
* 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] = {
|
||||
LAYOUT(
|
||||
/*0 1 2 3 4 5 6 7 8 9 a b c d*/
|
||||
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_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_DEL,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
29
keyboards/mokey/mokey64/keymaps/via/keymap.c
Normal file
29
keyboards/mokey/mokey64/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/* Copyright 2021 Kyle McCreery
|
||||
*
|
||||
* 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] = {
|
||||
|
||||
LAYOUT(
|
||||
/*0 1 2 3 4 5 6 7 8 9 a b c d*/
|
||||
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_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_DEL,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_GRV, KC_LEFT, KC_DOWN, KC_RGHT)
|
||||
|
||||
};
|
1
keyboards/mokey/mokey64/keymaps/via/rules.mk
Normal file
1
keyboards/mokey/mokey64/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
17
keyboards/mokey/mokey64/mokey64.c
Normal file
17
keyboards/mokey/mokey64/mokey64.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Copyright 2021 Kyle McCreery
|
||||
*
|
||||
* 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 "mokey64.h"
|
48
keyboards/mokey/mokey64/mokey64.h
Normal file
48
keyboards/mokey/mokey64/mokey64.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Copyright 2021 Kyle McCreery
|
||||
*
|
||||
* 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 XXX KC_NO
|
||||
|
||||
/*
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||
* │10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
|
||||
* │20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │
|
||||
* ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤
|
||||
* │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3c │3d │
|
||||
* ├────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤
|
||||
* │40 │41 │42 │ 43 │44 │45 │46 │47 │48 │
|
||||
* └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘
|
||||
*/
|
||||
#define LAYOUT( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \
|
||||
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
|
||||
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
|
||||
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, \
|
||||
k40, k41, k42, k43, k44, k45, k46, k47, k48 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d }, \
|
||||
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d }, \
|
||||
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, XXX }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d }, \
|
||||
{ k40, k41, k42, k43, k44, k45, k46, k47, k48, XXX, XXX, XXX, XXX, XXX } \
|
||||
}
|
21
keyboards/mokey/mokey64/readme.md
Normal file
21
keyboards/mokey/mokey64/readme.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# MOKEY 64
|
||||
|
||||

|
||||
|
||||
Support STM32F401 keyboard.
|
||||
|
||||
* Keyboard Maintainer: [rhmokey](https://github.com/rhmokey)
|
||||
* Hardware Supported: STM32F401
|
||||
## Bootloader
|
||||
* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware
|
||||
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make mokey/mokey64:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make mokey/mokey64:default:flash
|
||||
|
||||
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).
|
24
keyboards/mokey/mokey64/rules.mk
Normal file
24
keyboards/mokey/mokey64/rules.mk
Normal file
@@ -0,0 +1,24 @@
|
||||
# MCU name
|
||||
MCU = STM32F401
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = stm32-dfu
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
KEYBOARD_SHARED_EP = yes
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # 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 = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
|
51
keyboards/ocean/wang_ergo/config.h
Normal file
51
keyboards/ocean/wang_ergo/config.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*Copyright 2021 Ocean
|
||||
|
||||
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"
|
||||
|
||||
#define VENDOR_ID 0x9624
|
||||
#define PRODUCT_ID 0x0008
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Ocean
|
||||
#define PRODUCT Wang Ergo
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 12
|
||||
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14*/
|
||||
#define MATRIX_ROW_PINS { F4, F5, F6, F7 }
|
||||
#define MATRIX_COL_PINS { D1, D0, D4, C6, D7, E6, B4, B5, B6, B2, B3, B1 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 5
|
||||
|
10
keyboards/ocean/wang_ergo/info.json
Normal file
10
keyboards/ocean/wang_ergo/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"keyboard_name": "Wang Ergo",
|
||||
"url": "",
|
||||
"maintainer": "Ocean",
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [{"label":"0,0", "x":1.75, "y":2.25}, {"label":"0,11", "x":15.15, "y":2.25}, {"label":"3,10", "x":16.15, "y":2.25}, {"label":"1,0", "x":1.5, "y":3.25, "w":1.25}, {"label":"1,11", "x":15.15, "y":3.25, "w":1.75}, {"label":"2,0", "x":1, "y":4.25, "w":1.75}, {"label":"2,11", "x":15.15, "y":4.25, "w":1.25}, {"label":"3,0", "x":0.75, "y":5.25}, {"label":"3,1", "x":1.75, "y":5.25}, {"label":"3,11", "x":15.15, "y":5.25}, {"label":"0,1", "x":3.15, "y":2}, {"label":"1,1", "x":3.15, "y":3}, {"label":"2,1", "x":3.15, "y":4}, {"label":"0,2", "x":4.5, "y":1.75}, {"label":"0,3", "x":5.5, "y":1.75}, {"label":"0,4", "x":6.5, "y":1.75}, {"label":"0,5", "x":7.5, "y":1.75}, {"label":"1,2", "x":4.5, "y":2.75}, {"label":"1,3", "x":5.5, "y":2.75}, {"label":"1,4", "x":6.5, "y":2.75}, {"label":"1,5", "x":7.5, "y":2.75}, {"label":"2,2", "x":4.5, "y":3.75}, {"label":"2,3", "x":5.5, "y":3.75}, {"label":"2,4", "x":6.5, "y":3.75}, {"label":"2,5", "x":7.5, "y":3.75}, {"label":"3,3", "x":5.5, "y":4.75}, {"label":"3,4", "x":6.5, "y":4.75}, {"label":"3,5", "x":7.5, "y":4.75}, {"label":"0,6", "x":9.25, "y":4.25}, {"label":"0,7", "x":10.25, "y":4.25}, {"label":"0,8", "x":11.25, "y":4.25}, {"label":"0,9", "x":12.25, "y":4.25}, {"label":"1,6", "x":9.25, "y":5.25}, {"label":"1,7", "x":10.25, "y":5.25}, {"label":"1,8", "x":11.25, "y":5.25}, {"label":"1,9", "x":12.25, "y":5.25}, {"label":"2,6", "x":9.25, "y":6.25}, {"label":"2,7", "x":10.25, "y":6.25}, {"label":"2,8", "x":11.25, "y":6.25}, {"label":"2,9", "x":12.25, "y":6.25}, {"label":"3,6", "x":9.25, "y":7.25}, {"label":"3,7", "x":10.25, "y":7.25}, {"label":"3,8", "x":11.25, "y":7.25}, {"label":"0,10", "x":13.75, "y":3.25}, {"label":"1,10", "x":13.75, "y":4.25}, {"label":"2,10", "x":13.75, "y":5.25}]
|
||||
}
|
||||
}
|
||||
}
|
24
keyboards/ocean/wang_ergo/keymaps/default/keymap.c
Normal file
24
keyboards/ocean/wang_ergo/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/* Copyright 2021 Ocean
|
||||
* 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(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_BSPC, KC_RCTL
|
||||
),
|
||||
};
|
45
keyboards/ocean/wang_ergo/keymaps/via/keymap.c
Normal file
45
keyboards/ocean/wang_ergo/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,45 @@
|
||||
/* Copyright 2021 Ocean
|
||||
* 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(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, 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_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_BSPC, KC_RCTL
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
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(
|
||||
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(
|
||||
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
keyboards/ocean/wang_ergo/keymaps/via/rules.mk
Normal file
2
keyboards/ocean/wang_ergo/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
24
keyboards/ocean/wang_ergo/readme.md
Normal file
24
keyboards/ocean/wang_ergo/readme.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# Wang Ergo
|
||||
|
||||

|
||||
|
||||
|
||||
40% ortholinear ergo keyboard
|
||||
|
||||
* Keyboard Maintainer: Ocean
|
||||
* Hardware Supported: Wang Ergo, Pro Micro
|
||||
* Hardware Availability: [Local Marketplace](https://tokopedia.com/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make ocean/wang_ergo:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make ocean/wang_ergo:default:flash
|
||||
|
||||
## Bootloader
|
||||
|
||||
To Enter the bootloader you can double click reset button on board when you flash the firmware
|
||||
|
||||
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).
|
22
keyboards/ocean/wang_ergo/rules.mk
Normal file
22
keyboards/ocean/wang_ergo/rules.mk
Normal file
@@ -0,0 +1,22 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # 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 = no # 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 = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
15
keyboards/ocean/wang_ergo/wang_ergo.c
Normal file
15
keyboards/ocean/wang_ergo/wang_ergo.c
Normal file
@@ -0,0 +1,15 @@
|
||||
/* Copyright 2021 Ocean
|
||||
* 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 "wang_ergo.h"
|
31
keyboards/ocean/wang_ergo/wang_ergo.h
Normal file
31
keyboards/ocean/wang_ergo/wang_ergo.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright 2021 Ocean
|
||||
*
|
||||
* 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 LAYOUT(\
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
|
||||
K30, K31, K33, K34, K35, K36, K37, K38, K3A, K3B \
|
||||
) \
|
||||
{ \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
|
||||
{ K30, K31, KC_NO, K33, K34, K35, K36, K37, K38, KC_NO, K3A, K3B }, \
|
||||
}
|
26
keyboards/redox/keymaps/media_ch/config.h
Normal file
26
keyboards/redox/keymaps/media_ch/config.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
Copyright 2021 Shiftux <shiftux@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
#define USE_SERIAL
|
||||
// #define USE_I2C
|
||||
|
||||
/* Select hand configuration */
|
||||
// #define MASTER_LEFT
|
||||
#define EE_HANDS
|
86
keyboards/redox/keymaps/media_ch/keymap.c
Normal file
86
keyboards/redox/keymaps/media_ch/keymap.c
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
Copyright 2021 Shiftux <shiftux@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum layers {
|
||||
_QWERTZ, // standard layer
|
||||
_SYMB, // symbols layer
|
||||
};
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTZ = SAFE_RANGE,
|
||||
SYMB,
|
||||
};
|
||||
|
||||
// Shortcut to make keymap more readable
|
||||
#define KC_BKSL KC_BSLASH
|
||||
#define SYM_L MO(_SYMB)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTZ] = LAYOUT(
|
||||
// ┌────────┐ ┌────────┬────────┐
|
||||
KC_MUTE, KC_MPLY, KC_MNXT,
|
||||
//┌────────┬────────┬────────┬───┼────┬───┼────┬────────┐ ┌──┼─────┬──┼─────┬──┼─────┬────────┬────────┬────────┐
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, 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_NUBS, KC_MINS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_EQL, 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_PGDN, KC_PGUP, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
|
||||
KC_LCTL, SYM_L, KC_LALT, KC_GRV, KC_DEL, KC_LGUI, KC_SPC, KC_ENT, KC_SPC, KC_RALT, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT
|
||||
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
|
||||
),
|
||||
|
||||
|
||||
[_SYMB] = LAYOUT(
|
||||
// ┌────────┐ ┌────────┬────────┐
|
||||
KC_MPRV, XXXXXXX, XXXXXXX,
|
||||
//┌────────┬────────┬────────┬───┼────┬───┼────┬────────┐ ┌──┼─────┬──┼─────┬──┼─────┬────────┬────────┬────────┐
|
||||
RESET ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5, KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,KC_F12 , XXXXXXX ,XXXXXXX ,XXXXXXX, KC_UP ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
XXXXXXX ,XXXXXXX ,KC_BSLS ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT ,XXXXXXX ,XXXXXXX ,
|
||||
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤
|
||||
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX ,XXXXXXX ,KC_TILD ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,
|
||||
//├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤
|
||||
XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX
|
||||
//└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLD);
|
||||
} else {
|
||||
tap_code(KC_VOLU);
|
||||
}
|
||||
} else if (index == 1) { /* Second encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_WH_D);
|
||||
} else {
|
||||
tap_code(KC_WH_U);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
6
keyboards/redox/keymaps/media_ch/readme.md
Normal file
6
keyboards/redox/keymaps/media_ch/readme.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# German keymap for Redox-media
|
||||
|
||||
A layout for the Redox MEDIA revision.
|
||||
The layout acommodates the German umlauts and the punctuation symbols
|
||||
at their usual positions relative to the other alphabetic characters.
|
||||
Apart from that it stays close to the default english Redox layout.
|
2
keyboards/redox/keymaps/media_ch/rules.mk
Normal file
2
keyboards/redox/keymaps/media_ch/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
RGBLIGHT_ENABLE = no
|
||||
ENCODER_ENABLE = yes
|
60
keyboards/redox/media/config.h
Normal file
60
keyboards/redox/media/config.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2021 Shiftux <shiftux@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0000
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER shiftux
|
||||
#define PRODUCT The Redox Keyboard
|
||||
|
||||
/* key matrix size */
|
||||
// Rows are doubled-up
|
||||
#define MATRIX_ROWS 12
|
||||
#define MATRIX_COLS 7
|
||||
|
||||
// wiring of each half
|
||||
#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 }
|
||||
#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6, D1 }
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* serial.c configuration for split keyboard */
|
||||
#define SOFT_SERIAL_PIN D0
|
||||
|
||||
/* 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
|
||||
|
||||
#define ENCODERS_PAD_A { F4 }
|
||||
#define ENCODERS_PAD_B { F5 }
|
||||
#define ENCODER_RESOLUTION 4
|
18
keyboards/redox/media/media.c
Normal file
18
keyboards/redox/media/media.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2021 Shiftux <shiftux@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "redox.h"
|
46
keyboards/redox/media/media.h
Normal file
46
keyboards/redox/media/media.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2021 Shiftux <shiftux@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "redox.h"
|
||||
#include "quantum.h"
|
||||
|
||||
// rows are doubled
|
||||
#define LAYOUT( \
|
||||
R5C6, R11C6, R11C5, \
|
||||
R0C0, R0C1, R0C2, R0C3, R0C4, R0C5, R6C5, R6C4, R6C3, R6C2, R6C1, R6C0, \
|
||||
R1C0, R1C1, R1C2, R1C3, R1C4, R1C5, R0C6, R6C6, R7C5, R7C4, R7C3, R7C2, R7C1, R7C0, \
|
||||
R2C0, R2C1, R2C2, R2C3, R2C4, R2C5, R1C6, R7C6, R8C5, R8C4, R8C3, R8C2, R8C1, R8C0, \
|
||||
R3C0, R3C1, R3C2, R3C3, R3C4, R3C5, R2C6, R3C6, R9C6, R8C6, R9C5, R9C4, R9C3, R9C2, R9C1, R9C0, \
|
||||
R4C0, R4C1, R4C2, R4C3, R4C4, R4C5, R4C6, R10C6, R10C5, R10C4, R10C3, R10C2, R10C1, R10C0 \
|
||||
) \
|
||||
{ \
|
||||
{ R0C0, R0C1, R0C2, R0C3, R0C4, R0C5, R0C6 }, \
|
||||
{ R1C0, R1C1, R1C2, R1C3, R1C4, R1C5, R1C6 }, \
|
||||
{ R2C0, R2C1, R2C2, R2C3, R2C4, R2C5, R2C6 }, \
|
||||
{ R3C0, R3C1, R3C2, R3C3, R3C4, R3C5, R3C6 }, \
|
||||
{ R4C0, R4C1, R4C2, R4C3, R4C4, R4C5, R4C6 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, R5C6 }, \
|
||||
\
|
||||
{ R6C0, R6C1, R6C2, R6C3, R6C4, R6C5, R6C6 }, \
|
||||
{ R7C0, R7C1, R7C2, R7C3, R7C4, R7C5, R7C6 }, \
|
||||
{ R8C0, R8C1, R8C2, R8C3, R8C4, R8C5, R8C6 }, \
|
||||
{ R9C0, R9C1, R9C2, R9C3, R9C4, R9C5, R9C6 }, \
|
||||
{ R10C0, R10C1, R10C2, R10C3, R10C4, R10C5, R10C6 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, R11C5, R11C6 } \
|
||||
}
|
57
keyboards/redox/media/readme.md
Normal file
57
keyboards/redox/media/readme.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# The Redox Media Keyboard
|
||||
|
||||
I've taken the Redox keyboard and modified the SCAD files as well as the QMK layout to include media and scroll features:
|
||||
- 3 Media buttons
|
||||
- Play / Pause button
|
||||
- Next track
|
||||
- Mute (previous track on secondary layout)
|
||||
- Volume knob
|
||||
- Scroll wheel on the keyboard
|
||||
|
||||
For an in-depth report see [my page](https://shiftux.org/making_projects/keyboard.html) and a [video](https://youtu.be/Cwkf7HFcUkY) about the build process, design, printing, programing and assembly.
|
||||
|
||||
## IMAGE
|
||||
|
||||
### The build
|
||||
I've used 2 [Sparkfun Pro Micros (5V)](https://www.sparkfun.com/products/12640) and a single hand master setup providing power and serial connection via a TRS jack.
|
||||
|
||||
### The pro micro and how to flash it
|
||||
To try out your pro micro and setup your environment to flash such a device I recommend following [this guide](https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all). It will take you through the install and setup and provides a first easy to flash program so you can test your setup quickly.
|
||||
|
||||
Whenever you can't program one of the pro micros or the USB-COM port is not found on your computer, it most probably means that is is not in "bootloader mode". What you want to do is connect the GND and RST pin twice to reset the device and put it into bootloader mode (details [here](https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq#ts-serial)).
|
||||
|
||||
### Compiling and flashing
|
||||
|
||||
Obviously start by [installing QMK](https://docs.qmk.fm/#/getting_started_build_tools?id=set-up-your-environment).
|
||||
|
||||
- Before flashing the firmware you should make sure that it compiles. Thus assuring that your QMK setup works fine and the keyboard and keymap files are correct:
|
||||
```
|
||||
qmk compile -kb redox/media -km media_ch
|
||||
```
|
||||
The generated `.hex` file is output to the QMK root.
|
||||
|
||||
Once you are comfortable flashing your Pro Micros and your setup works continue with the following steps:
|
||||
|
||||
- I've had the most success with using the `EE_HANDS` setting and flashing the EEPROM to the left and right halves of the keyboard respectively. To do this start with flashing the EEPROM of the 2 pro micros separately by setting the bootloader flag in the flash command (the pro micro uses the avrdude bootloader):
|
||||
```
|
||||
qmk flash -kb redox/media -km media_ch -bl avrdude-split-left
|
||||
qmk flash -kb redox/media -km media_ch -bl avrdude-split-right
|
||||
```
|
||||
Note that you need to reset the pro micro to set it to bootloader mode before you can flash it: connect GND to RST twice in quick succession (750ms), then you have 8 seconds to upload the new eep file.
|
||||
|
||||
### Adapting the keyboard layout
|
||||
|
||||
Copy the `keymaps/media_ch` folder to `keymaps/media_<your-layout>` and adapt the `keymap.c` file in there.
|
||||
|
||||
I recommend testing the key codes with the [QMK tester](https://config.qmk.fm/#/test) and then adapting the `keymap.c` file accordingly.
|
||||
|
||||
Finally compile your new layout from the QMK root with:
|
||||
```
|
||||
qmk compile -kb redox/media -km media_<your-layout>
|
||||
```
|
||||
and proceed to flashing it equivalent to the above instructions.
|
||||
|
||||
### CAD files and additional resources
|
||||
See [here](https://shiftux.org/making_projects/keyboard.html) for a detailed build description and video.
|
||||
|
||||
You can find the CAD and SCAD files, I created here: https://github.com/shiftux/redox-media-keyboard
|
0
keyboards/redox/media/rules.mk
Normal file
0
keyboards/redox/media/rules.mk
Normal file
@@ -16,8 +16,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef KEYBOARD_redox_rev1
|
||||
#include "rev1.h"
|
||||
#if defined(KEYBOARD_redox_rev1)
|
||||
# include "rev1.h"
|
||||
#elif defined(KEYBOARD_redox_media)
|
||||
# include "media.h"
|
||||
#endif
|
||||
|
||||
#include "quantum.h"
|
||||
|
53
keyboards/reviung39/keymaps/via/keymap.c
Normal file
53
keyboards/reviung39/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,53 @@
|
||||
/* Copyright 2020 @toastedmangoes
|
||||
*
|
||||
* 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,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_ADJUST
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_BASE] = LAYOUT_reviung41(
|
||||
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, RSFT_T(KC_ENT),
|
||||
FN_MO13, KC_SPC, FN_MO23
|
||||
|
||||
[_LOWER] = LAYOUT_reviung41(
|
||||
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
|
||||
_______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_GRV, KC_TILD,
|
||||
_______, KC_ESC, KC_LGUI, KC_LALT, KC_CAPS, KC_DQUO, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_PSCR, RSFT_T(KC_SPC),
|
||||
_______, KC_ENT, _______
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT_reviung41(
|
||||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
|
||||
_______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
_______, KC_ESC, KC_RGUI, KC_RALT, KC_CAPS, KC_QUOT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
_______, KC_BSPC, _______
|
||||
),
|
||||
|
||||
[_ADJUST] = LAYOUT_reviung41(
|
||||
RGB_VAI, RGB_SAI, RGB_HUI, RGB_MOD, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
RGB_VAD, RGB_SAD, RGB_HUD, RGB_RMOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
_______, XXXXXXX, _______
|
||||
),
|
||||
};
|
||||
|
3
keyboards/reviung39/keymaps/via/rules.mk
Normal file
3
keyboards/reviung39/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
VIA_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT_all LAYOUT_alice_split_bs
|
||||
#define LAYOUT_all LAYOUT_ava_split_bs
|
||||
|
||||
#define LAYOUT_alice_split_bs( \
|
||||
#define LAYOUT_ava_split_bs( \
|
||||
K020, K000, K001, K002, K003, K004, K005, K006, K010, K011, K012, K013, K014, K015, K016, K017, \
|
||||
K040, K021, K022, K023, K024, K025, K026, K030, K031, K032, K033, K034, K035, K036, K037, \
|
||||
K060, K041, K042, K043, K044, K045, K046, K050, K051, K052, K053, K054, K055, K056, \
|
||||
@@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
{ KC_NO, K081, KC_NO, K083, KC_NO, K085, K086, K087 } \
|
||||
}
|
||||
|
||||
#define LAYOUT_alice( \
|
||||
#define LAYOUT_ava( \
|
||||
K020, K000, K001, K002, K003, K004, K005, K006, K010, K011, K012, K013, K014, K015, K017, \
|
||||
K040, K021, K022, K023, K024, K025, K026, K030, K031, K032, K033, K034, K035, K036, K037, \
|
||||
K060, K041, K042, K043, K044, K045, K046, K050, K051, K052, K053, K054, K055, K056, \
|
||||
|
@@ -2,10 +2,12 @@
|
||||
"keyboard_name": "AVA",
|
||||
"url": "https://sneakbox.com",
|
||||
"maintainer": "mujimanic",
|
||||
"width": 18.75,
|
||||
"height": 5,
|
||||
"layout_aliases": {
|
||||
"LAYOUT_alice_split_bs": "LAYOUT_ava_split_bs",
|
||||
"LAYOUT_alice": "LAYOUT_ava"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT_alice_split_bs": {
|
||||
"LAYOUT_ava_split_bs": {
|
||||
"layout": [
|
||||
{"x":0, "y":0}, {"x":1.25, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0},
|
||||
{"x":0, "y":1}, {"x":1.25, "y":1, "w":1.5}, {"x":2.75, "y":1}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":9.75, "y":1}, {"x":10.75, "y":1}, {"x":11.75, "y":1}, {"x":12.75, "y":1}, {"x":13.75, "y":1}, {"x":14.75, "y":1}, {"x":15.75, "y":1}, {"x":16.75, "y":1, "w":1.5},
|
||||
@@ -14,7 +16,7 @@
|
||||
{"x":1.25, "y":4, "w":1.5}, {"x":2.75, "y":4}, {"x":5, "y":4, "w":1.5}, {"x":6.5, "y":4, "w":2.25}, {"x":9.75, "y":4, "w":2.75}, {"x":12.5, "y":4, "w":1}, {"x":14.65, "y":4.25}, {"x":15.65, "y":4.25}, {"x":16.65, "y":4.25}
|
||||
]
|
||||
},
|
||||
"LAYOUT_alice": {
|
||||
"LAYOUT_ava": {
|
||||
"layout": [
|
||||
{"x":0, "y":0}, {"x":1.25, "y":0}, {"x":2.25, "y":0}, {"x":3.25, "y":0}, {"x":4.25, "y":0}, {"x":5.25, "y":0}, {"x":6.25, "y":0}, {"x":7.25, "y":0}, {"x":10.25, "y":0}, {"x":11.25, "y":0}, {"x":12.25, "y":0}, {"x":13.25, "y":0}, {"x":14.25, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0, "w":2},
|
||||
{"x":0, "y":1}, {"x":1.25, "y":1, "w":1.5}, {"x":2.75, "y":1}, {"x":3.75, "y":1}, {"x":4.75, "y":1}, {"x":5.75, "y":1}, {"x":6.75, "y":1}, {"x":9.75, "y":1}, {"x":10.75, "y":1}, {"x":11.75, "y":1}, {"x":12.75, "y":1}, {"x":13.75, "y":1}, {"x":14.75, "y":1}, {"x":15.75, "y":1}, {"x":16.75, "y":1, "w":1.5},
|
||||
|
@@ -24,13 +24,13 @@ enum layer_names {
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_BASE] = LAYOUT_alice_split_bs(
|
||||
[_BASE] = LAYOUT_ava_split_bs(
|
||||
KC_ESC, 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, KC_BSPC, KC_BSPC,
|
||||
KC_PGUP, 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_PGDN, 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_END, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_DEL,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, LT(_FN, KC_SPC), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
[_FN] = LAYOUT_alice_split_bs(
|
||||
[_FN] = LAYOUT_ava_split_bs(
|
||||
KC_TRNS, KC_TRNS, 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_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_MOD, RGB_TOG,
|
||||
KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, KC_TRNS,
|
||||
|
@@ -27,25 +27,25 @@ enum layer_names {
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_BASE] = LAYOUT_alice_split_bs(
|
||||
[_BASE] = LAYOUT_ava_split_bs(
|
||||
KC_ESC, 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, KC_BSPC, KC_BSPC,
|
||||
KC_PGUP, 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_PGDN, 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_END, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_DEL,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, LT(_FN, KC_SPC), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
[_FN] = LAYOUT_alice_split_bs(
|
||||
[_FN] = LAYOUT_ava_split_bs(
|
||||
KC_TRNS, KC_TRNS, 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_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_RMOD, RGB_MOD, RGB_TOG,
|
||||
KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, KC_TRNS,
|
||||
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAD, RGB_SAI, KC_TRNS, RGB_HUI,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
[_L3] = LAYOUT_alice_split_bs(
|
||||
[_L3] = LAYOUT_ava_split_bs(
|
||||
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),
|
||||
[_L4] = LAYOUT_alice_split_bs(
|
||||
[_L4] = LAYOUT_ava_split_bs(
|
||||
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,
|
||||
|
@@ -21,5 +21,3 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
ENCODER_ENABLE = yes
|
||||
|
||||
LAYOUTS = alice alice_split_bs
|
@@ -1,178 +0,0 @@
|
||||
#ifndef _I2CMASTER_H
|
||||
#define _I2CMASTER_H 1
|
||||
/*************************************************************************
|
||||
* Title: C include file for the I2C master interface
|
||||
* (i2cmaster.S or twimaster.c)
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device
|
||||
* Usage: see Doxygen manual
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
@defgroup pfleury_ic2master I2C Master library
|
||||
@code #include <i2cmaster.h> @endcode
|
||||
|
||||
@brief I2C (TWI) Master Software Library
|
||||
|
||||
Basic routines for communicating with I2C slave devices. This single master
|
||||
implementation is limited to one bus master on the I2C bus.
|
||||
|
||||
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
|
||||
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
|
||||
Since the API for these two implementations is exactly the same, an application can be linked either against the
|
||||
software I2C implementation or the hardware I2C implementation.
|
||||
|
||||
Use 4.7k pull-up resistor on the SDA and SCL pin.
|
||||
|
||||
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
|
||||
i2cmaster.S to your target when using the software I2C implementation !
|
||||
|
||||
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
|
||||
|
||||
@note
|
||||
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
|
||||
to GNU assembler and AVR-GCC C call interface.
|
||||
Replaced the incorrect quarter period delays found in AVR300 with
|
||||
half period delays.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@par API Usage Example
|
||||
The following code shows typical usage of this library, see example test_i2cmaster.c
|
||||
|
||||
@code
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
#define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned char ret;
|
||||
|
||||
i2c_init(); // initialize I2C library
|
||||
|
||||
// write 0x75 to EEPROM address 5 (Byte Write)
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_write(0x75); // write value 0x75 to EEPROM
|
||||
i2c_stop(); // set stop conditon = release bus
|
||||
|
||||
|
||||
// read previously written value back from EEPROM address 5
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode
|
||||
|
||||
ret = i2c_readNak(); // read one byte from EEPROM
|
||||
i2c_stop();
|
||||
|
||||
for(;;);
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
||||
#endif /* DOXYGEN */
|
||||
|
||||
/**@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
|
||||
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_READ 1
|
||||
|
||||
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_WRITE 0
|
||||
|
||||
|
||||
/**
|
||||
@brief initialize the I2C master interace. Need to be called only once
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_init(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminates the data transfer and releases the I2C bus
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
If device is busy, use ack polling to wait until device ready
|
||||
@param addr address and transfer direction of I2C device
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send one byte to I2C device
|
||||
@param data byte to be transfered
|
||||
@retval 0 write successful
|
||||
@retval 1 write failed
|
||||
*/
|
||||
extern unsigned char i2c_write(unsigned char data);
|
||||
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, request more data from device
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readAck(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readNak(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device
|
||||
|
||||
Implemented as a macro, which calls either i2c_readAck or i2c_readNak
|
||||
|
||||
@param ack 1 send ack, request more data from device<br>
|
||||
0 send nak, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
@@ -243,15 +243,11 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||
/* if there was an error */
|
||||
return 0;
|
||||
} else {
|
||||
uint16_t data = 0;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out;
|
||||
data = i2c_readNak();
|
||||
data = ~data;
|
||||
out:
|
||||
i2c_stop();
|
||||
current_matrix[current_row] |= (data << 8);
|
||||
uint8_t data = 0;
|
||||
mcp23018_status = i2c_readReg(I2C_ADDR, GPIOA, &data, 1, I2C_TIMEOUT);
|
||||
if (!mcp23018_status) {
|
||||
current_matrix[current_row] |= (~((uint16_t)data) << 8);
|
||||
}
|
||||
}
|
||||
|
||||
/* For each col... */
|
||||
@@ -278,11 +274,8 @@ static void select_row(uint8_t row)
|
||||
/* set active row low : 0
|
||||
set active row output : 1
|
||||
set other rows hi-Z : 1 */
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0xFF & ~(1<<abs(row-4))); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
uint8_t port = 0xFF & ~(1<<abs(row-4));
|
||||
mcp23018_status = i2c_writeReg(I2C_ADDR, GPIOB, &port, 1, I2C_TIMEOUT);
|
||||
}
|
||||
|
||||
uint8_t pin = row_pins[row];
|
||||
|
@@ -27,5 +27,5 @@ RGBLIGHT_ENABLE = no
|
||||
CUSTOM_MATRIX = yes
|
||||
|
||||
# project specific files
|
||||
SRC = twimaster.c \
|
||||
matrix.c
|
||||
QUANTUM_LIB_SRC += i2c_master.c
|
||||
SRC += matrix.c
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "sx60.h"
|
||||
#include "i2cmaster.h"
|
||||
#include "i2c_master.h"
|
||||
|
||||
|
||||
bool i2c_initialized = 0;
|
||||
@@ -18,21 +18,18 @@ uint8_t init_mcp23018(void) {
|
||||
|
||||
/* B Pins are Row, A pins are Columns
|
||||
Set them to output */
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b11111111); if (mcp23018_status) goto out;
|
||||
/* Now write to IODIRB */
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
i2c_stop();
|
||||
static uint8_t direction[2] = {
|
||||
0b11111111,
|
||||
0b00000000,
|
||||
};
|
||||
static uint8_t pullup[2] = {
|
||||
0b11111111,
|
||||
0b00000000,
|
||||
};
|
||||
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b11111111); if (mcp23018_status) goto out;
|
||||
/* Now write to GPPUB */
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
mcp23018_status = i2c_writeReg(I2C_ADDR, IODIRA, direction, 2, I2C_TIMEOUT);
|
||||
if (mcp23018_status) return mcp23018_status;
|
||||
|
||||
mcp23018_status = i2c_writeReg(I2C_ADDR, GPPUA, pullup, 2, I2C_TIMEOUT);
|
||||
return mcp23018_status;
|
||||
}
|
||||
|
@@ -4,13 +4,12 @@
|
||||
#include "quantum.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2cmaster.h"
|
||||
#include "i2c_master.h"
|
||||
#include <util/delay.h>
|
||||
|
||||
/* I2C aliases and register addresses (see "mcp23018.md") */
|
||||
#define I2C_ADDR 0b0100000
|
||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||
#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
|
||||
#define I2C_ADDR (0b0100000 << 1)
|
||||
#define I2C_TIMEOUT 100
|
||||
#define IODIRA 0x00 /* i/o direction register */
|
||||
#define IODIRB 0x01
|
||||
#define GPPUA 0x0C /* GPIO pull-up resistor register */
|
||||
|
@@ -1,207 +0,0 @@
|
||||
/*************************************************************************
|
||||
* Title: I2C master library using hardware TWI interface
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device with hardware TWI
|
||||
* Usage: API compatible with I2C Software Library i2cmaster.h
|
||||
**************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <compat/twi.h>
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
/* define CPU frequency in Hz here if not defined in Makefile */
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/* I2C clock in Hz */
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialization of the I2C bus interface. Need to be called only once
|
||||
*************************************************************************/
|
||||
void i2c_init(void)
|
||||
{
|
||||
/* initialize TWI clock
|
||||
* minimal values in Bit Rate Register (TWBR) and minimal Prescaler
|
||||
* bits in the TWI Status Register should give us maximal possible
|
||||
* I2C bus speed - about 444 kHz
|
||||
*
|
||||
* for more details, see 20.5.2 in ATmega16/32 secification
|
||||
*/
|
||||
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = 10; /* must be >= 10 for stable operation */
|
||||
|
||||
}/* i2c_init */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
return 0 = device accessible, 1= failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_start(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
/* send START condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
/* wait until transmission completed */
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
/* check value of TWI Status Register. Mask prescaler bits. */
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
|
||||
|
||||
/* send device address */
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
/* wail until transmission completed and ACK/NACK has been received */
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
/* check value of TWI Status Register. Mask prescaler bits. */
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}/* i2c_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
If device is busy, use ack polling to wait until device is ready
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
*************************************************************************/
|
||||
void i2c_start_wait(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
/* send START condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
/* wait until transmission completed */
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
/* check value of TWI Status Register. Mask prescaler bits. */
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
|
||||
|
||||
/* send device address */
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
/* wail until transmission completed */
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
/* check value of TWI Status Register. Mask prescaler bits. */
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
|
||||
{
|
||||
/* device busy, send stop condition to terminate write operation */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
/* wait until stop condition is executed and bus released */
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}/* i2c_start_wait */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
|
||||
Return: 0 device accessible
|
||||
1 failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_rep_start(unsigned char address)
|
||||
{
|
||||
return i2c_start( address );
|
||||
|
||||
}/* i2c_rep_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Terminates the data transfer and releases the I2C bus
|
||||
*************************************************************************/
|
||||
void i2c_stop(void)
|
||||
{
|
||||
/* send stop condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
/* wait until stop condition is executed and bus released */
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
}/* i2c_stop */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send one byte to I2C device
|
||||
|
||||
Input: byte to be transfered
|
||||
Return: 0 write successful
|
||||
1 write failed
|
||||
*************************************************************************/
|
||||
unsigned char i2c_write( unsigned char data )
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
/* send data to the previously addressed device */
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
/* wait until transmission completed */
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
/* check value of TWI Status Register. Mask prescaler bits */
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if( twst != TW_MT_DATA_ACK) return 1;
|
||||
return 0;
|
||||
|
||||
}/* i2c_write */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, request more data from device
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readAck(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readAck */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, read is followed by a stop condition
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readNak(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readNak */
|
@@ -42,9 +42,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* | Tab | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@@ -52,17 +52,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = LAYOUT(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, TD(ENC_TAP),
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, TD(ENC_TAP),
|
||||
KC_TAB, 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_ENT ,
|
||||
KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* | Esc | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* | Tab | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@@ -70,17 +70,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = LAYOUT(
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, _______,
|
||||
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, _______,
|
||||
KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
|
||||
KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Dvorak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||
* | Esc | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
|
||||
* | Tab | A | O | E | U | I | D | H | T | N | S | / |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@@ -88,8 +88,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_DVORAK] = LAYOUT(
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, _______,
|
||||
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
|
||||
KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, _______,
|
||||
KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
|
||||
KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
@@ -33,8 +33,8 @@ enum tap_dances {
|
||||
// clang-format off
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QWERTY] = LAYOUT_via(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, USER09,
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_VOLU,
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, USER09,
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_VOLU,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , KC_VOLD,
|
||||
KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
@@ -38,6 +38,17 @@ static void matrix_select_row(uint8_t row);
|
||||
static uint8_t mcp23018_reset_loop = 0;
|
||||
#endif
|
||||
|
||||
// user-defined overridable functions
|
||||
|
||||
__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
|
||||
|
||||
__attribute__((weak)) void matrix_init_user(void) {}
|
||||
|
||||
__attribute__((weak)) void matrix_scan_user(void) {}
|
||||
|
||||
// helper functions
|
||||
void matrix_init(void)
|
||||
{
|
||||
// all outputs for rows high
|
||||
|
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
Copyright 2018 monksoffunk
|
||||
|
||||
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
|
||||
@@ -59,76 +58,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
|
||||
// RGB LED support
|
||||
//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no
|
||||
// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#define RGBLIGHT_SPLIT
|
||||
#ifdef RGBLED_BACK
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 48
|
||||
#define RGBLED_SPLIT { 24, 24 }
|
||||
#else
|
||||
#define RGBLED_NUM 24
|
||||
#endif
|
||||
#else
|
||||
#ifdef RGBLED_BOTH
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 60
|
||||
#define RGBLED_SPLIT { 30, 30 }
|
||||
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
|
||||
#else
|
||||
#define RGBLED_NUM 30
|
||||
#endif
|
||||
#else
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 12
|
||||
#define RGBLED_SPLIT { 6, 6 }
|
||||
#else
|
||||
#define RGBLED_NUM 6
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef IOS_DEVICE_ENABLE
|
||||
#if (RGBLED_NUM <= 6) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 12))
|
||||
#define RGBLIGHT_LIMIT_VAL 255
|
||||
#else
|
||||
#if (RGBLED_NUM <= 16) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 32))
|
||||
#define RGBLIGHT_LIMIT_VAL 130
|
||||
#else
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#endif
|
||||
#endif
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
#else
|
||||
#if (RGBLED_NUM <= 6) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 12))
|
||||
#define RGBLIGHT_LIMIT_VAL 90
|
||||
#else
|
||||
#if (RGBLED_NUM <= 16) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 32))
|
||||
#define RGBLIGHT_LIMIT_VAL 45
|
||||
#else
|
||||
#define RGBLIGHT_LIMIT_VAL 35
|
||||
#endif
|
||||
#endif
|
||||
#define RGBLIGHT_VAL_STEP 4
|
||||
#endif
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
|
||||
// USB_MAX_POWER_CONSUMPTION value
|
||||
// 120 RGBoff
|
||||
// 330 RGB 6
|
||||
// 300 RGB 32
|
||||
#define USB_MAX_POWER_CONSUMPTION 400
|
||||
#else
|
||||
// fix iPhone and iPad power adapter issue
|
||||
// iOS device need lessthan 100
|
||||
#define USB_MAX_POWER_CONSUMPTION 100
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
|
86
keyboards/zinc/rev1/post_config.h
Normal file
86
keyboards/zinc/rev1/post_config.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
Copyright 2021 monksoffunk
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
// RGB LED support
|
||||
//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no
|
||||
// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#define RGBLIGHT_SPLIT
|
||||
#ifdef RGBLED_BACK
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 48
|
||||
#define RGBLED_SPLIT { 24, 24 }
|
||||
#else
|
||||
#define RGBLED_NUM 24
|
||||
#endif
|
||||
#else
|
||||
#ifdef RGBLED_BOTH
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 60
|
||||
#define RGBLED_SPLIT { 30, 30 }
|
||||
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
|
||||
#else
|
||||
#define RGBLED_NUM 30
|
||||
#endif
|
||||
#else
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 12
|
||||
#define RGBLED_SPLIT { 6, 6 }
|
||||
#else
|
||||
#define RGBLED_NUM 6
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef IOS_DEVICE_ENABLE
|
||||
#if (RGBLED_NUM <= 6) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 12))
|
||||
#define RGBLIGHT_LIMIT_VAL 255
|
||||
#else
|
||||
#if (RGBLED_NUM <= 16) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 32))
|
||||
#define RGBLIGHT_LIMIT_VAL 130
|
||||
#else
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#endif
|
||||
#endif
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
#else
|
||||
#if (RGBLED_NUM <= 6) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 12))
|
||||
#define RGBLIGHT_LIMIT_VAL 90
|
||||
#else
|
||||
#if (RGBLED_NUM <= 16) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 32))
|
||||
#define RGBLIGHT_LIMIT_VAL 45
|
||||
#else
|
||||
#define RGBLIGHT_LIMIT_VAL 35
|
||||
#endif
|
||||
#endif
|
||||
#define RGBLIGHT_VAL_STEP 4
|
||||
#endif
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
|
||||
// USB_MAX_POWER_CONSUMPTION value
|
||||
// 120 RGBoff
|
||||
// 330 RGB 6
|
||||
// 300 RGB 32
|
||||
#define USB_MAX_POWER_CONSUMPTION 400
|
||||
#else
|
||||
// fix iPhone and iPad power adapter issue
|
||||
// iOS device need lessthan 100
|
||||
#define USB_MAX_POWER_CONSUMPTION 100
|
||||
#endif
|
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
Copyright 2018 monksoffunk
|
||||
|
||||
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
|
||||
@@ -59,76 +58,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D3
|
||||
|
||||
// RGB LED support
|
||||
//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no
|
||||
// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#define RGBLIGHT_SPLIT
|
||||
#ifdef RGBLED_BACK
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 48
|
||||
#define RGBLED_SPLIT { 24, 24 }
|
||||
#else
|
||||
#define RGBLED_NUM 24
|
||||
#endif
|
||||
#else
|
||||
#ifdef RGBLED_BOTH
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 60
|
||||
#define RGBLED_SPLIT { 30, 30 }
|
||||
// #define RGBLIGHT_LED_MAP {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}
|
||||
#else
|
||||
#define RGBLED_NUM 30
|
||||
#endif
|
||||
#else
|
||||
#ifdef RGBLED_CONT
|
||||
#define RGBLED_NUM 12
|
||||
#define RGBLED_SPLIT { 6, 6 }
|
||||
#else
|
||||
#define RGBLED_NUM 6
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef IOS_DEVICE_ENABLE
|
||||
#if (RGBLED_NUM <= 6) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 12))
|
||||
#define RGBLIGHT_LIMIT_VAL 255
|
||||
#else
|
||||
#if (RGBLED_NUM <= 16) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 32))
|
||||
#define RGBLIGHT_LIMIT_VAL 130
|
||||
#else
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#endif
|
||||
#endif
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
#else
|
||||
#if (RGBLED_NUM <= 6) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 12))
|
||||
#define RGBLIGHT_LIMIT_VAL 90
|
||||
#else
|
||||
#if (RGBLED_NUM <= 16) || (defined(RGBLED_CONT) && (RGBLED_NUM <= 32))
|
||||
#define RGBLIGHT_LIMIT_VAL 45
|
||||
#else
|
||||
#define RGBLIGHT_LIMIT_VAL 35
|
||||
#endif
|
||||
#endif
|
||||
#define RGBLIGHT_VAL_STEP 4
|
||||
#endif
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
|
||||
#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
|
||||
// USB_MAX_POWER_CONSUMPTION value
|
||||
// 120 RGBoff
|
||||
// 330 RGB 6
|
||||
// 300 RGB 32
|
||||
#define USB_MAX_POWER_CONSUMPTION 400
|
||||
#else
|
||||
// fix iPhone and iPad power adapter issue
|
||||
// iOS device need lessthan 100
|
||||
#define USB_MAX_POWER_CONSUMPTION 100
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user