Compare commits

..

61 Commits

Author SHA1 Message Date
da81e5c7cd OLED TIMEOUT 0 and OLED_DISABLE_TIMEOUT should behave the same (#14302) 2021-09-08 18:34:34 -07:00
853e56d080 [Keyboard] Minor tweaks to Work Board layout (#14351) 2021-09-08 18:10:43 -07:00
9e77cdf4e6 Bugfix for Joystick and JSON schema (#14295) 2021-09-09 10:27:58 +10:00
3f2a030de6 [Keyboard] Add new Mokey keyboard (#14329)
Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-08 16:57:43 -07:00
d510f6afa9 [Keymap] Add Gaston's Lily58 custom keymap (#14334)
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Gaston Jorquera <gjorquera@gmail.com>
2021-09-08 16:55:12 -07:00
4294aa0f1e [Keyboard] Tractyl Manuform - configuration updates (#14314)
* [Keyboard] Tractyl Manuform - configuration updates

* Update readmes

* Add more details

* Fix issues with encoder pins

* Additional fixes for pin config

* Fix up some comments
2021-09-08 16:52:43 -07:00
8f8411a98a [Keyboard] Add VIA keymap for the reviung39 (#14234) 2021-09-08 16:02:50 -07:00
2e0659f7fd Fixes for recent i2c migrations (#14352) 2021-09-08 15:44:18 -07:00
9c175f1801 [Keyboard] Update VIA support for lazydesigners/the40 (#14240)
Co-authored-by: Joel Challis <git@zvecr.com>
2021-09-08 00:34:36 -07:00
541e101291 [Keymap] New keymap for bm40 (#14182) 2021-09-07 23:53:33 -07:00
3ef01a3482 [Keyboard] add wang ergo (#14245)
Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-07 21:07:00 -07:00
1ebaec96e7 Sneakbox Ava tidy-up (#14298) 2021-09-07 20:23:45 -07:00
267ffb9914 [Keymap] Adding IFo Hancroft's ErgoDox EZ Keymap (#14342) 2021-09-07 20:01:58 -07:00
0b8d6df390 [Keyboard] Fix issues with 3w6 rev2 matrix (#14346) 2021-09-08 02:53:55 +01:00
60c5bd7b5e handwired/dactyl - Refactor use of legacy i2c implementation (#14344) 2021-09-07 18:23:11 -07:00
04c0704b28 3w6 - Refactor use of AVR only I2C functions (#14339)
* Refactor use of legacy i2c functions

* Align rev2

* Review fixes
2021-09-07 16:35:13 +01:00
e7a5c006d9 Refactor use of legacy i2c implementation (#14341) 2021-09-07 16:34:59 +01:00
2d6635214a ergodone - Refactor use of legacy i2c implementation (#14340)
* Refactor use of legacy i2c implementation

* copy-paste error
2021-09-07 16:33:29 +01:00
1dbe4e7dd0 [Keyboard] Redox media (#13084)
* adding a new revision 'media' to the redox keyboard

* readme update

* encoder fix

* video link

* drashna change requests

* removing SPLIT_USB_TIMEOUT

* intermediate rename

* lowercase

* drashna comments

* include if defined KEYBOARD_redox_media

* lowercase readme, tmp step

* lowercase readme

* drashna changes

* more drashna comments

* readme update

* readme update

* fauxpark and drashna comments

* fauxpark comments

* Update keyboards/redox/media/readme.md

Co-authored-by: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-06 12:44:39 -07:00
85a14ac25b [Keyboard] Zinc: fix RGBLED_NUM bug (#13287) 2021-09-06 06:49:09 -07:00
1a494da288 Fix eeprom for Durgod boards (#14324) 2021-09-05 23:56:10 +01:00
1e1be4c229 [Bug] Fix compile issues for boards with custom matrix (#14323) 2021-09-05 23:35:42 +01:00
8d6d8cfadf Tidy up defines within STM EEPROM emulation (#14275)
* Tidy up defines within stm eeprom emulation

* Fix tests

* Resolve todo

* Still use page notion in clear

* Remove more f4 refs
2021-09-05 21:36:43 +01:00
fe6d6cf76d Remove empty override functions (#14312)
* Remove empty override functions, 0-9

* Remove empty override functions, A-D

* Remove empty override functions, E-H

* Remove empty override functions, handwired

* Remove empty override functions, I-L

* Remove empty override functions, M-P

* Remove empty override functions, Q-T

* Remove empty override functions, U-Z
2021-09-05 21:36:31 +01:00
8a8fdd9a72 Highlight keycode (#14317)
This should make it consistent with other docs and hopefully will make less people miss this detail.
2021-09-05 20:36:16 +01:00
767f2c0284 [Core] Add is_oled_scrolling (#14305) 2021-09-05 09:09:20 -07:00
0471429c01 [Keyboard] Fix rotary encoder function for Voice65 (#14316)
Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-05 09:05:55 -07:00
014aa0661e Fix Space Cadet md link (#14300) 2021-09-04 15:01:56 +01:00
c9262cf7f8 Enable extra keys for Technik ortho and stagger (#14282)
* Extra keys for technik ortho

* Extra keys for technik staggered

Co-authored-by: filterpaper <filterpaper@localhost>
2021-09-04 03:02:15 +01:00
b15bd128a5 FJLabs Ready100 Configurator Fixes (#14291)
* grid-align keycodes; use short-form keycodes

No logic change.

* info.json: correct layout macro reference

* info.json: correct LAYOUT_64key data

Removes an extra key from the layout data.

* 64_ansi Community Layout support

* rename LAYOUT_64key to LAYOUT_64_ansi (with alias for backwards compatibility)
* add LAYOUTS = 64_ansi to rules.mk

* remove width and height keys from info.json
2021-09-03 21:03:15 +01:00
06c89e8abf Naiping NPhhkb: 60_tsangan_hhkb Community Layout support (#14292)
* 60_tsangan_hhkb Community Layout support

* rename LAYOUT to LAYOUT_60_tsangan_hhkb
* add LAYOUTS = 60_tsangan_hhkb to rules.mk

* correct maintainer field in info.json

* remove width and height keys from info.json

* fix GitHub account link on readme
2021-09-03 21:01:50 +01:00
90909fbaf7 takashicompany/endzone34: correct QMK Configurator key sequence (#14290)
* update info.json formatting

* convert tabs to spaces
* apply human-friendly formatting

* correct Configurator key sequence

* remove width and height keys from info.json
2021-09-03 21:00:29 +01:00
5f6d9913f8 OwLab Voice65 Hotswap: 65_ansi_blocker Community Layout support (#14293)
* 65_ansi_blocker Community Layout support

* rename LAYOUT to LAYOUT_65_ansi_blocker (with alias for backwards compatibility)
* add LAYOUTS = 65_ansi_blocker to rules.mk

* remove width and height keys from info.json
2021-09-03 11:48:10 -07:00
8574bf20d3 Remove more cruft in keyboard files (#14288) 2021-09-03 17:09:30 +01:00
a01057d19d [Keymap] Update iris fluffactually keymap (#14265)
Co-authored-by: Drashna Jaelre <drashna@live.com>
2021-09-02 10:50:17 -07:00
956cf8d7bf [Keyboard] Work Louder board fixup (#14247)
* [Keyboard] Add some last minute tweaks to Work board

* Additional fixes

* Fix rgb pin

* Fix ws2812 hackery

* additional led tweaks

* Add indicator LEDs

* fix bootmagic settings

* Fix up RGB stuff

* Limit power draw for entire board

* fixup lights and such

* change LED order on loop

* Fix indicators if via is not enabled

* Enable Sleep for rgb matrix

* Even more LED tweaks

* Final tweaks?

* Tweak keycodes
2021-09-02 10:49:44 -07:00
d36a7c512d PistachioPro: correct Configurator key sequence (#14277)
* info.json: apply human-friendly formatting

* correct LAYOUT key sequence

Moves the Enter key object to the correct place in sequence.
2021-09-02 10:17:35 -07:00
ebfa7e14f3 Matrix Falcon info.json fixes (#14273)
* apply human-friendly formatting to info.json

* update key labels; correct maintainer field

* add LAYOUT_all data to info.json

* remove width and height keys from info.json (per fauxpark)

Co-authored-by: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-02 18:09:38 +01:00
0290dd3547 Yoichiro Lunakey Macro: correct Configurator key sequence (#14276)
* apply human-friendly formatting to info.json

* correct Configurator key sequence
2021-09-02 18:08:35 +01:00
98a2e9dc0e [Keymap] new murphpad landscape keymap with encoder enhanced functions (#14103)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Jonavin <=>
2021-09-01 21:12:57 -07:00
e056ae58a0 [Keymap] Fine-tuning Nyquist keymap. (#14269) 2021-09-01 21:12:15 -07:00
37aef4ebe1 [Keymap] Fix Drashna Keymap issues missed before Develop merge (#14271) 2021-09-01 21:08:58 -07:00
c1e5c920a9 naiping/np64: 64_ansi Community Layout support and codebase touch-up (#14264) 2021-09-01 20:50:44 -07:00
b55154fb0a neson design/n6: Extended Community Layout Support and Layout Macro Fix (#14266) 2021-09-01 20:47:28 -07:00
c0eab2a504 wuque/serneity65: Layout Macro rework and Configurator fix (#14267) 2021-09-01 20:46:53 -07:00
hvp
cb53c4fd41 [Keymap] hvp keymap for Cornelius, updated ut47.2 and userspace (#14187) 2021-09-01 20:44:36 -07:00
872414f454 [Keymap] Add peott-fr H87 keymap (#14232) 2021-09-01 20:44:12 -07:00
b6ca21c65c [Keymap] Jonavin keymap gmmk pro (#14220)
add rgb nightmode and optional colemak layer 

Co-authored-by: Jonavin <=>
2021-09-01 20:42:31 -07:00
cded3b7582 [Keymap] own scylla keymap (#14224)
Co-authored-by: Drashna Jaelre <drashna@live.com>
2021-09-01 20:41:17 -07:00
bb356a1584 [Docs] Update path to keycode.h (#14263) 2021-09-01 20:40:12 -07:00
7575bc23a6 MatchstickWorks SouthPad: correct Configurator key sequence (#14255)
* matchstickworks/southpad: correct Configurator key sequence

* replace tabs with spaces; apply four-space indent
2021-09-01 10:44:03 -07:00
583f07ac58 owl8: add info.json file (#14256)
* owl8: add info.json file

* remove width and height keys (per fauxpark)

Co-authored-by: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-01 13:20:56 +01:00
c573926e05 Fix snailmap compilation error (#14250)
* Fix snailmap compilation error

* Update keymap.c with correct OLED_ENABLE defines
2021-09-01 10:48:14 +01:00
8d97c54770 mnk50: Configurator Fix and Layout Macro Additions (#14257)
Co-authored-by: Ryan <fauxpark@gmail.com>
2021-09-01 12:50:32 +10:00
c5ec423438 [Keymap] cwebster2 Keymap and userspace updates (#14258) 2021-08-31 17:50:42 -07:00
fac5ec4656 Move GMMK Pro layouts to the correct subdir (#14241)
Also fix a compilation issue in the mike1808 keymap
2021-09-01 00:18:35 +01:00
b7693c971c [Keyboard] Disable console on Iris Rev5 (#14249) 2021-08-31 15:25:46 -07:00
92106ee038 emi20: remove dead space from Configurator layout (#14254) 2021-08-31 19:29:49 +01:00
b6d7b13a7a [Keyboard] Add FJLabs KF87 PCB (#14179)
Co-authored-by: Drashna Jaelre <drashna@live.com>
2021-08-31 11:24:41 -07:00
6f5428687c [Keymap] reflects current rick's keymap (#14169) 2021-08-31 11:23:02 -07:00
bdd0a6c097 [Keyboard] Addition of VIA keymap and a few fixes for naked60 (#14225)
Co-authored-by: Joel Challis <git@zvecr.com>
2021-08-30 22:19:21 -07:00
742 changed files with 5754 additions and 11609 deletions

View File

@ -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

View File

@ -5,7 +5,7 @@ This page covers questions people often have about keymaps. If you haven't you s
## What Keycodes Can I Use?
See [Keycodes](keycodes.md) for an index of keycodes available to you. These link to more extensive documentation when available.
Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
Keycodes are actually defined in [quantum/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h).
## What Are the Default Keycodes?

View File

@ -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).

View File

@ -356,6 +356,10 @@ bool oled_scroll_left(void);
// Returns true if the screen was not scrolling or stops scrolling
bool oled_scroll_off(void);
// Returns true if the oled is currently scrolling, false if it is
// not
bool is_oled_scrolling(void);
// Inverts the display
// Returns true if the screen was or is inverted
bool oled_invert(bool invert);

View File

@ -13,7 +13,7 @@ EXTRAKEY_ENABLE = yes
VELOCIKEY_ENABLE = yes
```
Then, while using your keyboard, you need to also turn it on with the VLK_TOG keycode, which toggles the feature on and off.
Then, while using your keyboard, you need to also turn it on with the `VLK_TOG` keycode, which toggles the feature on and off.
The following light effects will all be controlled by Velocikey when it is enabled:
- RGB Breathing

View File

@ -130,7 +130,7 @@ A 1 byte number that is sent as part of a HID report over USB that represents a
## Space Cadet Shift
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
* [Space Cadet Shift Documentation](feature_space_cadet_shift.md)
* [Space Cadet Shift Documentation](feature_space_cadet.md)
## Tap
Pressing and releasing a key. In some situations you will need to distinguish between a key down and a key up event, and Tap always refers to both at once.

View File

@ -313,6 +313,10 @@ bool oled_scroll_left(void);
// Returns true if the screen was not scrolling or stops scrolling
bool oled_scroll_off(void);
// Returns true if the oled is currently scrolling, false if it is
// not
bool is_oled_scrolling(void);
// Inverts the display
// Returns true if the screen was or is inverted
bool oled_invert(bool invert);

View File

@ -692,6 +692,8 @@ bool oled_scroll_off(void) {
return !oled_scrolling;
}
bool is_oled_scrolling(void) { return oled_scrolling; }
bool oled_invert(bool invert) {
if (!oled_initialized) {
return oled_inverted;

View File

@ -14,30 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "1up60hse.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}

View File

@ -18,46 +18,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
setPinOutput(B2);
writePinLow(B2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
setPinInput(B2);
writePinLow(B2);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

View File

@ -18,46 +18,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
setPinOutput(B2);
writePinLow(B2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
setPinInput(B2);
writePinLow(B2);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

View File

@ -18,46 +18,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
setPinOutput(B2);
writePinLow(B2);
} else {
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
setPinInput(B2);
writePinLow(B2);
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

View File

@ -23,19 +23,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
RGB_MOD, KC_1, KC_U, KC_P
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -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();
}
}
}

View File

@ -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();
}
}
}

View File

@ -15,33 +15,6 @@
*/
#include "25.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {

View File

@ -70,18 +70,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -24,19 +24,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -29,26 +29,3 @@ void matrix_init_kb(void) {
// Do the rest
matrix_init_user();
}
/*
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/

View File

@ -21,6 +21,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_A, KC_S, KC_D, KC_F
),
};
void matrix_init_user(void) { }

View File

@ -1,29 +1 @@
#include "4x4.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}

View File

@ -86,19 +86,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -1,29 +1 @@
#include "5x5.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}

View File

@ -98,20 +98,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -15,33 +15,6 @@
*/
#include "6lit.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {

View File

@ -21,19 +21,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -21,19 +21,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_F22, KC_F23, KC_F24 \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -15,33 +15,6 @@
*/
#include "foobar.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {

View File

@ -73,19 +73,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, RESET, _______, _______, _______, _______
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@ -22,19 +22,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_F21, KC_F22, KC_F23, KC_F14, KC_INT5 \
),
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

Some files were not shown because too many files have changed in this diff Show More