Compare commits
61 Commits
Author | SHA1 | Date | |
---|---|---|---|
da81e5c7cd | |||
853e56d080 | |||
9e77cdf4e6 | |||
3f2a030de6 | |||
d510f6afa9 | |||
4294aa0f1e | |||
8f8411a98a | |||
2e0659f7fd | |||
9c175f1801 | |||
541e101291 | |||
3ef01a3482 | |||
1ebaec96e7 | |||
267ffb9914 | |||
0b8d6df390 | |||
60c5bd7b5e | |||
04c0704b28 | |||
e7a5c006d9 | |||
2d6635214a | |||
1dbe4e7dd0 | |||
85a14ac25b | |||
1a494da288 | |||
1e1be4c229 | |||
8d6d8cfadf | |||
fe6d6cf76d | |||
8a8fdd9a72 | |||
767f2c0284 | |||
0471429c01 | |||
014aa0661e | |||
c9262cf7f8 | |||
b15bd128a5 | |||
06c89e8abf | |||
90909fbaf7 | |||
5f6d9913f8 | |||
8574bf20d3 | |||
a01057d19d | |||
956cf8d7bf | |||
d36a7c512d | |||
ebfa7e14f3 | |||
0290dd3547 | |||
98a2e9dc0e | |||
e056ae58a0 | |||
37aef4ebe1 | |||
c1e5c920a9 | |||
b55154fb0a | |||
c0eab2a504 | |||
cb53c4fd41 | |||
872414f454 | |||
b6ca21c65c | |||
cded3b7582 | |||
bb356a1584 | |||
7575bc23a6 | |||
583f07ac58 | |||
c573926e05 | |||
8d97c54770 | |||
c5ec423438 | |||
fac5ec4656 | |||
b7693c971c | |||
92106ee038 | |||
b6d7b13a7a | |||
6f5428687c | |||
bdd0a6c097 |
@ -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
|
||||
|
@ -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?
|
||||
|
||||
|
@ -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).
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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] = {
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
*/
|
||||
|
@ -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) { }
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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] = {
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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] = {
|
||||
|
@ -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) {
|
||||
|
||||
}
|
||||
|
@ -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
Reference in New Issue
Block a user