Compare commits

...
23 Commits
Author SHA1 Message Date
skullydazedandErovia 5e65af3a76 Beef up how qmk doctor works. (#7375)
* Beef up how `qmk doctor` works.

* improve the `git submodule status` parsing. h/t @erovia

* Fix whitespace and imports

* yapf

* Add documentation for the new doctor functionality

* Replace type_unchanged() with str()

* remove unused modules

* Update lib/python/qmk/cli/doctor.py

Co-Authored-By: Erovia <[email protected]>

Co-authored-by: Erovia <[email protected]>
2020-01-24 20:31:16 +01:00
Joel Challis e4a0f841e1 Update split serial code to use driver pattern (#7990)
* Move avr serial code to drivers

* Update src+= serial.c to driver pattern
2020-01-24 13:50:51 +00:00
James Young 4867a9b1e6 [Keyboard] HS60 v2 ISO: fix Configurator key ordering (#7958)
* white-space formatting

* reorder the objects
2020-01-24 01:09:55 -08:00
Wilba 9a9eaa8100 Added VIA support to Noxary 280 (#7960)
* Added VIA support to Noxary 280

* Added VIA support to Noxary 280

* Review changes
2020-01-23 21:03:04 -08:00
Xelus22 339e29d5af Add VIA support to TMO50 (#7986)
* via compatible

* disable mousekey

* remove unnecessary space
2020-01-23 19:28:25 -08:00
fauxpark b568999769 Fix LED configuration for PS2AVRGB boards (#7989)
* Fix LED configuration for PS2AVRGB boards

* Undo backlight on state changes
2020-01-23 19:24:10 -08:00
QMK Bot fe50883c15 format code according to conventions [skip ci] 2020-01-24 02:15:29 +00:00
Nick Brassel d13ada1162 Add customisable EEPROM driver selection (#7274)
- uprintf -> dprintf
- Fix atsam "vendor" eeprom.
- Bump Kinetis K20x to 64 bytes, too.
- Rollback Kinetis to 32 bytes as partitioning can only be done once. Add warning about changing the value.
- Change RAM-backed "fake" EEPROM implementations to match eeconfig's current usage.
- Add 24LC128 by request.
2020-01-24 12:45:58 +11:00
Akaash Suresh 6ff093efbe Local Changes 2020-01-23 22:41:15 +11:00
Max Rumpf c3835262d8 [Keymap] Phoebe keymap improvements (#7963)
* [Phoebe] Allow to input pipe characters with only one modifier

* [Phoebe] Update RGB animations
2020-01-22 14:46:00 -08:00
yiancar 1a40af74da HS60 EEPROM size fix (#7968) 2020-01-23 08:28:42 +11:00
yiancar 9e6e01cabb eeprom size fix (#7969) 2020-01-22 12:44:12 -08:00
Cable Car Designs a561443fca [Keyboard] added support for new rev of cypher PCB (#7636)
* cleanup of existing branches to resync with upstream. removed old cyp…

…her files, added new cypher files.
2020-01-22 09:45:32 -08:00
MechMerlinandfauxpark e0a0430c31 Clueboard Rev4 Updates aka Volcano 660 (#7942)
* fix audio enable repetition

* remove RGB LED support as this board has no RGB LB LEDs

* use pragma once

* this board has no backlight support

* enable COMMAND_ENABLE

* comment cleanups

* setting bootmagic to lite as the first board thathat has this PCB has a solid bottom. If someone forgets to put in a RESET key on their keymap, they are not going to have fun resetting the board

* Update keyboards/clueboard/66/rev4/rules.mk

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/clueboard/66/rev4/rules.mk

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/clueboard/66/rev4/rules.mk

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/clueboard/66/rev4/rules.mk

Co-Authored-By: fauxpark <[email protected]>

* convert the palset and palclear routines to setpinoutput and writepinlow

* remove scankb

* restore original guards instead of pragma once

Co-authored-by: fauxpark <[email protected]>
2020-01-22 04:14:14 +00:00
Brett InmanandJames Young 49c3a1cda5 Swap two columns to fix Skog Lite (#7940)
* Swap two cols to fix skog lite

* Fix readme

* Suggested formatting

Co-Authored-By: James Young <[email protected]>

Co-authored-by: James Young <[email protected]>
2020-01-21 19:58:17 -08:00
fauxpark ba264c69c2 [Keyboard] Cospad refactor (#7957)
* Cospad refactor

* Add num lock indicator code

* Add led_init_ports()

* Revert change to matrix position blanks

* Define BACKLIGHT_ON_STATE explicitly, in anticipation of PR6749
2020-01-21 18:21:47 -08:00
Joel Challis 8e500c3670 Align cformat rules with current CI implementation (#7936)
* Align cformat rules with current CI implementation

* Optimise file walking
2020-01-21 18:21:14 -08:00
Rossman360 bf4611c7b7 [Keymap] adding personal rebound keymap (#7956) 2020-01-21 18:18:18 -08:00
yiancar f773056750 [Keyboard] HS60 Refactor (Keymap restructure to be more standardized) (#7847)
* Keymap restructure to be more standardized

* made bootmagic lite default

* Dividing keymaps

* Update keyboards/hs60/v2/v2.c
2020-01-21 15:09:50 -08:00
Wilba b70500806a [Keyboard] Added WT60-B, WT60-BX (wilba.tech THERMAL) (#7948)
* Added WT60-B, WT60-BX

* Review changes
2020-01-21 13:28:12 -08:00
MechMerlin 9b6b54cdaa [Keyboard] Think 6.5 Soldered Matrix Fix (#7952)
* both backspace and left shift matrix positions off by one

* update the led_update routine

* update readme

* Update keyboards/gray_studio/think65/solder/solder.c
2020-01-21 13:26:00 -08:00
dsanchezseco 37db6012a7 keymap, fixed rgb effect name and deactivate oled (#7953)
* added rgblight controls to planck keymap

* fixed knight ridder offset to face me

* no oled for crkbd 'till fixed

* fixed RGB effect name
2020-01-21 09:12:07 -08:00
Dmitrijs MinajevsandJames Young 6f176dfc7c Add VIA support to DZ60 (#7814)
* Add DZ60 to VIA

* Changed vendor id from 'KF' to 'DZ'

* Capitalize hex

* Fix Via_layout_options size setting

* Update keyboards/dz60/keymaps/via/rules.mk

Co-Authored-By: James Young <[email protected]>

Co-authored-by: James Young <[email protected]>
2020-01-21 07:48:13 -08:00
211 changed files with 3873 additions and 2561 deletions

No files matched your search

+59 -2
View File
@@ -102,6 +102,57 @@ ifeq ($(strip $(UNICODE_COMMON)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
endif endif
VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c
EEPROM_DRIVER ?= vendor
ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),)
$(error EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver)
else
OPT_DEFS += -DEEPROM_ENABLE
ifeq ($(strip $(EEPROM_DRIVER)), custom)
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_CUSTOM
COMMON_VPATH += $(DRIVER_PATH)/eeprom
SRC += eeprom_driver.c
else ifeq ($(strip $(EEPROM_DRIVER)), i2c)
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_I2C
COMMON_VPATH += $(DRIVER_PATH)/eeprom
QUANTUM_LIB_SRC += i2c_master.c
SRC += eeprom_driver.c eeprom_i2c.c
else ifeq ($(strip $(EEPROM_DRIVER)), transient)
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
COMMON_VPATH += $(DRIVER_PATH)/eeprom
SRC += eeprom_driver.c eeprom_transient.c
else ifeq ($(strip $(EEPROM_DRIVER)), vendor)
OPT_DEFS += -DEEPROM_VENDOR
ifeq ($(PLATFORM),AVR)
# Automatically provided by avr-libc, nothing required
else ifeq ($(PLATFORM),CHIBIOS)
ifeq ($(MCU_SERIES), STM32F3xx)
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F303xC
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else ifeq ($(MCU_SERIES), STM32F1xx)
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F103xB
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB)
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F072xB
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else
# This will effectively work the same as "transient" if not supported by the chip
SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c
endif
else ifeq ($(PLATFORM),ARM_ATSAM)
SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
else ifeq ($(PLATFORM),TEST)
SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
endif
endif
endif
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
OPT_DEFS += -DRGBLIGHT_ENABLE OPT_DEFS += -DRGBLIGHT_ENABLE
@@ -418,9 +469,15 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c
# Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called. # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called.
# Unused functions are pruned away, which is why we can add multiple drivers here without bloat. # Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/serial.c \ QUANTUM_LIB_SRC += i2c_master.c \
i2c_master.c \
i2c_slave.c i2c_slave.c
SERIAL_DRIVER ?= bitbang
ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
QUANTUM_LIB_SRC += serial.c
else
QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
endif
endif endif
COMMON_VPATH += $(QUANTUM_PATH)/split_common COMMON_VPATH += $(QUANTUM_PATH)/split_common
endif endif
+1
View File
@@ -104,6 +104,7 @@
* [ADC Driver](adc_driver.md) * [ADC Driver](adc_driver.md)
* [I2C Driver](i2c_driver.md) * [I2C Driver](i2c_driver.md)
* [WS2812 Driver](ws2812_driver.md) * [WS2812 Driver](ws2812_driver.md)
* [EEPROM Driver](eeprom_driver.md)
* [GPIO Controls](internals_gpio_control.md) * [GPIO Controls](internals_gpio_control.md)
* [Custom Matrix](custom_matrix.md) * [Custom Matrix](custom_matrix.md)
* [Proton C Conversion](proton_c_conversion.md) * [Proton C Conversion](proton_c_conversion.md)
+16 -2
View File
@@ -141,14 +141,28 @@ qmk docs [-p PORT]
## `qmk doctor` ## `qmk doctor`
This command examines your environment and alerts you to potential build or flash problems. This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to.
**Usage**: **Usage**:
``` ```
qmk doctor qmk doctor [-y] [-n]
``` ```
**Examples**:
Check your environment for problems and prompt to fix them:
qmk doctor
Check your environment and automatically fix any problems found:
qmk doctor -y
Check your environment and report problems only:
qmk doctor -n
## `qmk json-keymap` ## `qmk json-keymap`
Creates a keymap.c from a QMK Configurator export. Creates a keymap.c from a QMK Configurator export.
+50
View File
@@ -0,0 +1,50 @@
# EEPROM Driver Configuration
The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.
Driver | Description
--------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
`EEPROM_DRIVER = vendor` | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. Other chips will generally act as "transient" below.
`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below.
`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost.
## Vendor Driver Configuration
No configurable options are available.
## I2C Driver Configuration
Currently QMK supports 24xx-series chips over I2C. As such, requires a working i2c_master driver configuration. You can override the driver configuration via your config.h:
`config.h` override | Description | Default Value
------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------
`#define EXTERNAL_EEPROM_I2C_BASE_ADDRESS` | Base I2C address for the EEPROM -- shifted left by 1 as per i2c_master requirements | 0b10100000
`#define EXTERNAL_EEPROM_I2C_ADDRESS(addr)` | Calculated I2C address for the EEPROM | `(EXTERNAL_EEPROM_I2C_BASE_ADDRESS)`
`#define EXTERNAL_EEPROM_BYTE_COUNT` | Total size of the EEPROM in bytes | 8192
`#define EXTERNAL_EEPROM_PAGE_SIZE` | Page size of the EEPROM in bytes, as specified in the datasheet | 32
`#define EXTERNAL_EEPROM_ADDRESS_SIZE` | The number of bytes to transmit for the memory location within the EEPROM | 2
`#define EXTERNAL_EEPROM_WRITE_TIME` | Write cycle time of the EEPROM, as specified in the datasheet | 5
Default values and extended descriptions can be found in `drivers/eeprom/eeprom_i2c.h`.
Alternatively, there are pre-defined hardware configurations for available chips/modules:
Module | Equivalent `#define` | Source
-----------------|---------------------------------|------------------------------------------
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/wwwproducts/en/24LC128>
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
?> If you find that the EEPROM is not cooperating, ensure you've correctly shifted up your EEPROM address by 1. For example, the datasheet might state the address as `0b01010000` -- the correct value of `EXTERNAL_EEPROM_I2C_BASE_ADDRESS` needs to be `0b10100000`.
## Transient Driver configuration
The only configurable item for the transient EEPROM driver is its size:
`config.h` override | Description | Default Value
------------------------------- | ----------------------------------------- | -------------
`#define TRANSIENT_EEPROM_SIZE` | Total size of the EEPROM storage in bytes | 64
Default values and extended descriptions can be found in `drivers/eeprom/eeprom_transient.h`.
+4
View File
@@ -33,3 +33,7 @@ Support for up to 2 drivers. Each driver impliments 2 charlieplex matrices to in
## IS31FL3733 ## IS31FL3733
Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page. Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page.
## 24xx series external I2C EEPROM
Support for an external I2C-based EEPROM instead of using the on-chip EEPROM. For more information on how to setup the driver see the [EEPROM Driver](eeprom_driver.md) page.
File renamed without changes.
File renamed without changes.
+46
View File
@@ -0,0 +1,46 @@
/* Copyright 2019 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
#include "eeprom_driver.h"
void eeprom_driver_init(void) {
/* Any initialisation code */
}
void eeprom_driver_erase(void) {
/* Wipe out the EEPROM, setting values to zero */
}
void eeprom_read_block(void *buf, const void *addr, size_t len) {
/*
Read a block of data:
buf: target buffer
addr: 0-based offset within the EEPROM
len: length to read
*/
}
void eeprom_write_block(const void *buf, void *addr, size_t len) {
/*
Write a block of data:
buf: target buffer
addr: 0-based offset within the EEPROM
len: length to write
*/
}
+73
View File
@@ -0,0 +1,73 @@
/* Copyright 2019 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
#include "eeprom_driver.h"
uint8_t eeprom_read_byte(const uint8_t *addr) {
uint8_t ret;
eeprom_read_block(&ret, addr, 1);
return ret;
}
uint16_t eeprom_read_word(const uint16_t *addr) {
uint16_t ret;
eeprom_read_block(&ret, addr, 2);
return ret;
}
uint32_t eeprom_read_dword(const uint32_t *addr) {
uint32_t ret;
eeprom_read_block(&ret, addr, 4);
return ret;
}
void eeprom_write_byte(uint8_t *addr, uint8_t value) { eeprom_write_block(&value, addr, 1); }
void eeprom_write_word(uint16_t *addr, uint16_t value) { eeprom_write_block(&value, addr, 2); }
void eeprom_write_dword(uint32_t *addr, uint32_t value) { eeprom_write_block(&value, addr, 4); }
void eeprom_update_block(const void *buf, void *addr, size_t len) {
uint8_t read_buf[len];
eeprom_read_block(read_buf, addr, len);
if (memcmp(buf, read_buf, len) != 0) {
eeprom_write_block(buf, addr, len);
}
}
void eeprom_update_byte(uint8_t *addr, uint8_t value) {
uint8_t orig = eeprom_read_byte(addr);
if (orig != value) {
eeprom_write_byte(addr, value);
}
}
void eeprom_update_word(uint16_t *addr, uint16_t value) {
uint16_t orig = eeprom_read_word(addr);
if (orig != value) {
eeprom_write_word(addr, value);
}
}
void eeprom_update_dword(uint32_t *addr, uint32_t value) {
uint32_t orig = eeprom_read_dword(addr);
if (orig != value) {
eeprom_write_dword(addr, value);
}
}
@@ -1,4 +1,4 @@
/* Copyright 2019 westfoxtrot /* Copyright 2019 Nick Brassel (tzarc)
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -16,4 +16,7 @@
#pragma once #pragma once
// place overrides here #include "eeprom.h"
void eeprom_driver_init(void);
void eeprom_driver_erase(void);
+120
View File
@@ -0,0 +1,120 @@
/* Copyright 2019 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
/*
Note that the implementations of eeprom_XXXX_YYYY on AVR are normally
provided by avr-libc. The same functions are reimplemented below and are
rerouted to the external i2c equivalent.
Seemingly, as this is compiled from within QMK, the object file generated
during the build overrides the avr-libc implementation during the linking
stage.
On other platforms such as ARM, there are no provided implementations, so
there is nothing to override during linkage.
*/
#include "wait.h"
#include "i2c_master.h"
#include "eeprom.h"
#include "eeprom_i2c.h"
// #define DEBUG_EEPROM_OUTPUT
#ifdef DEBUG_EEPROM_OUTPUT
# include "print.h"
#endif // DEBUG_EEPROM_OUTPUT
static inline void init_i2c_if_required(void) {
static int done = 0;
if (!done) {
i2c_init();
done = 1;
}
}
static inline void fill_target_address(uint8_t *buffer, const void *addr) {
intptr_t p = (intptr_t)addr;
for (int i = 0; i < EXTERNAL_EEPROM_ADDRESS_SIZE; ++i) {
buffer[EXTERNAL_EEPROM_ADDRESS_SIZE - 1 - i] = p & 0xFF;
p >>= 8;
}
}
void eeprom_driver_init(void) {}
void eeprom_driver_erase(void) {
uint8_t buf[EXTERNAL_EEPROM_PAGE_SIZE];
memset(buf, 0x00, EXTERNAL_EEPROM_PAGE_SIZE);
for (intptr_t addr = 0; addr < EXTERNAL_EEPROM_BYTE_COUNT; addr += EXTERNAL_EEPROM_PAGE_SIZE) {
eeprom_write_block(buf, (void *)addr, EXTERNAL_EEPROM_PAGE_SIZE);
}
}
void eeprom_read_block(void *buf, const void *addr, size_t len) {
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE];
fill_target_address(complete_packet, addr);
init_i2c_if_required();
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((intptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE, 100);
i2c_receive(EXTERNAL_EEPROM_I2C_ADDRESS((intptr_t)addr), buf, len, 100);
#ifdef DEBUG_EEPROM_OUTPUT
dprintf("[EEPROM R] 0x%04X: ", ((int)addr));
for (size_t i = 0; i < len; ++i) {
dprintf(" %02X", (int)(((uint8_t *)buf)[i]));
}
dprintf("\n");
#endif // DEBUG_EEPROM_OUTPUT
}
void eeprom_write_block(const void *buf, void *addr, size_t len) {
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE + EXTERNAL_EEPROM_PAGE_SIZE];
uint8_t *read_buf = (uint8_t *)buf;
intptr_t target_addr = (intptr_t)addr;
init_i2c_if_required();
while (len > 0) {
intptr_t page_offset = target_addr % EXTERNAL_EEPROM_PAGE_SIZE;
int write_length = EXTERNAL_EEPROM_PAGE_SIZE - page_offset;
if (write_length > len) {
write_length = len;
}
fill_target_address(complete_packet, (const void *)target_addr);
for (uint8_t i = 0; i < write_length; i++) {
complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE + i] = read_buf[i];
}
#ifdef DEBUG_EEPROM_OUTPUT
dprintf("[EEPROM W] 0x%04X: ", ((int)target_addr));
for (uint8_t i = 0; i < write_length; i++) {
dprintf(" %02X", (int)(read_buf[i]));
}
dprintf("\n");
#endif // DEBUG_EEPROM_OUTPUT
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((intptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE + write_length, 100);
wait_ms(EXTERNAL_EEPROM_WRITE_TIME);
read_buf += write_length;
target_addr += write_length;
len -= write_length;
}
}
+115
View File
@@ -0,0 +1,115 @@
/* Copyright 2019 Nick Brassel (tzarc)
*
* 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
/*
Default device configurations:
For the Sparkfun Qwiic I2C EEPROM module: https://www.sparkfun.com/products/14764
#define EEPROM_I2C_CAT24C512 // (part number 24512A)
#define EEPROM_I2C_RM24C512C // (part number 24512C)
For the Sparkfun I2C EEPROM chip: https://www.sparkfun.com/products/525
#define EEPROM_I2C_24LC256
For the Adafruit I2C FRAM chip: https://www.adafruit.com/product/1895
#define EEPROM_I2C_MB85RC256V
*/
#if defined(EEPROM_I2C_CAT24C512)
# define EXTERNAL_EEPROM_BYTE_COUNT 65536
# define EXTERNAL_EEPROM_PAGE_SIZE 128
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
# define EXTERNAL_EEPROM_WRITE_TIME 5
#elif defined(EEPROM_I2C_RM24C512C)
# define EXTERNAL_EEPROM_BYTE_COUNT 65536
# define EXTERNAL_EEPROM_PAGE_SIZE 128
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
# define EXTERNAL_EEPROM_WRITE_TIME 3
#elif defined(EEPROM_I2C_24LC256)
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
# define EXTERNAL_EEPROM_PAGE_SIZE 64
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
# define EXTERNAL_EEPROM_WRITE_TIME 5
#elif defined(EEPROM_I2C_24LC128)
# define EXTERNAL_EEPROM_BYTE_COUNT 16384
# define EXTERNAL_EEPROM_PAGE_SIZE 64
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
# define EXTERNAL_EEPROM_WRITE_TIME 5
#elif defined(EEPROM_I2C_MB85RC256V)
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
# define EXTERNAL_EEPROM_PAGE_SIZE 128
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
# define EXTERNAL_EEPROM_WRITE_TIME 0
#endif
/*
The base I2C address of the EEPROM.
This needs to be shifted up by 1, to match i2c_master requirements.
*/
#ifndef EXTERNAL_EEPROM_I2C_BASE_ADDRESS
# define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100000
#endif
/*
The calculated I2C address based on the input memory location.
For EEPROM chips that embed part of the memory location in the I2C address
such as AT24M02 you can use something similar to the following (ensuring the
result is shifted by left by 1):
#define EXTERNAL_EEPROM_I2C_ADDRESS(loc) \
(EXTERNAL_EEPROM_I2C_BASE_ADDRESS | ((((loc) >> 16) & 0x07) << 1))
*/
#ifndef EXTERNAL_EEPROM_I2C_ADDRESS
# define EXTERNAL_EEPROM_I2C_ADDRESS(loc) (EXTERNAL_EEPROM_I2C_BASE_ADDRESS)
#endif
/*
The total size of the EEPROM, in bytes. The EEPROM datasheet will usually
specify this value in kbits, and will require conversion to bytes.
*/
#ifndef EXTERNAL_EEPROM_BYTE_COUNT
# define EXTERNAL_EEPROM_BYTE_COUNT 8192
#endif
/*
The page size in bytes of the EEPROM, as specified in the datasheet.
*/
#ifndef EXTERNAL_EEPROM_PAGE_SIZE
# define EXTERNAL_EEPROM_PAGE_SIZE 32
#endif
/*
The address size in bytes of the EEPROM. For EEPROMs with <=256 bytes, this
will likely be 1. For EEPROMs >256 and <=65536, this will be 2. For EEPROMs
>65536, this will likely need to be 2 with the modified variant of
EXTERNAL_EEPROM_I2C_ADDRESS above.
As expected, consult the datasheet for specifics of your EEPROM.
*/
#ifndef EXTERNAL_EEPROM_ADDRESS_SIZE
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
#endif
/*
The write cycle time of the EEPROM in milliseconds, as specified in the
datasheet.
*/
#ifndef EXTERNAL_EEPROM_WRITE_TIME
# define EXTERNAL_EEPROM_WRITE_TIME 5
#endif
+52
View File
@@ -0,0 +1,52 @@
/* Copyright 2019 Nick Brassel (tzarc)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <string.h>
#include "eeprom_driver.h"
#include "eeprom_transient.h"
__attribute__((aligned(4))) static uint8_t transientBuffer[TRANSIENT_EEPROM_SIZE] = {0};
size_t clamp_length(intptr_t offset, size_t len) {
if (offset + len > TRANSIENT_EEPROM_SIZE) {
len = TRANSIENT_EEPROM_SIZE - offset;
}
return len;
}
void eeprom_driver_init(void) { eeprom_driver_erase(); }
void eeprom_driver_erase(void) { memset(transientBuffer, 0x00, TRANSIENT_EEPROM_SIZE); }
void eeprom_read_block(void *buf, const void *addr, size_t len) {
intptr_t offset = (intptr_t)addr;
memset(buf, 0x00, len);
len = clamp_length(offset, len);
if (len > 0) {
memcpy(buf, &transientBuffer[offset], len);
}
}
void eeprom_write_block(const void *buf, void *addr, size_t len) {
intptr_t offset = (intptr_t)addr;
len = clamp_length(offset, len);
if (len > 0) {
memcpy(&transientBuffer[offset], buf, len);
}
}
@@ -1,4 +1,4 @@
/* Copyright 2019 westfoxtrot /* Copyright 2019 Nick Brassel (tzarc)
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -16,4 +16,10 @@
#pragma once #pragma once
// place overrides here /*
The size of the transient EEPROM buffer size.
*/
#ifndef TRANSIENT_EEPROM_SIZE
# include "eeconfig.h"
# define TRANSIENT_EEPROM_SIZE (((EECONFIG_SIZE + 3) / 4) * 4) // based off eeconfig's current usage, aligned to 4-byte sizes, to deal with LTO
#endif
+1 -2
View File
@@ -24,12 +24,11 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1
View File
@@ -39,6 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define NO_UART 1 #define NO_UART 1
+1 -2
View File
@@ -24,12 +24,11 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1
View File
@@ -39,6 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define NO_UART 1 #define NO_UART 1
-22
View File
@@ -54,25 +54,3 @@
//#define NO_ACTION_ONESHOT //#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
/* Backlight configuration
*/
#define BACKLIGHT_LEVELS 1
/* Underlight configuration
*/
#define RGB_DI_PIN D7
#define RGBLED_NUM 18 // Number of LEDs
#define RGBLIGHT_HUE_STEP 32
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
#define RGBLIGHT_EFFECT_BREATHE_MAX 200
#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 666*2
#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 // How many LEDs wide to light up
#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 2 // The led to start at
#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 5 // How many LEDs to travel
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up
+11 -42
View File
@@ -1,5 +1,4 @@
#include "rev4.h" #include "rev4.h"
//#include "backlight.h"
void matrix_init_kb(void) { void matrix_init_kb(void) {
// put your keyboard start-up code here // put your keyboard start-up code here
@@ -8,49 +7,19 @@ void matrix_init_kb(void) {
led_init_ports(); led_init_ports();
} }
void matrix_scan_kb(void) {
matrix_scan_user();
}
void backlight_init_ports(void) {
print("init_backlight_pin()\n");
// Set our LED pins as output
//DDRD |= (1<<6); // Esc
//DDRB |= (1<<7); // Page Up
//DDRD |= (1<<4); // Arrows
// Set our LED pins low
//PORTD &= ~(1<<6); // Esc
//PORTB &= ~(1<<7); // Page Up
//PORTD &= ~(1<<4); // Arrows
}
void backlight_set(uint8_t level) {
/*
if ( level == 0 ) {
// Turn off light
PORTD |= (1<<6); // Esc
PORTB |= (1<<7); // Page Up
PORTD |= (1<<4); // Arrows
} else {
// Turn on light
PORTD &= ~(1<<6); // Esc
PORTB &= ~(1<<7); // Page Up
PORTD &= ~(1<<4); // Arrows
}
*/
}
void led_init_ports() { void led_init_ports() {
// Set our LED pins as output // Set our LED pins as output
palSetPadMode(GPIOB, 13, PAL_MODE_OUTPUT_PUSHPULL); // LED1 setPinOutput(B13); // LED1
palClearPad(GPIOB, 13); writePinLow(B13);
palSetPadMode(GPIOB, 14, PAL_MODE_OUTPUT_PUSHPULL); // LED2
palClearPad(GPIOB, 14); setPinOutput(B14); // LED2
palSetPadMode(GPIOA, 8, PAL_MODE_OUTPUT_PUSHPULL); // LED3 writePinLow(B14);
palClearPad(GPIOA, 8);
palSetPadMode(GPIOA, 0, PAL_MODE_OUTPUT_PUSHPULL); // Capslock LED setPinOutput(B8); // LED3
palClearPad(GPIOA, 0); writePinLow(B8);
setPinOutput(B0); // Capslock LED
writePinLow(B0);
} }
void led_set_kb(uint8_t usb_led) { void led_set_kb(uint8_t usb_led) {
+7 -8
View File
@@ -4,18 +4,17 @@ MCU = STM32F303
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
BACKLIGHT_ENABLE = yes BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug
CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
AUDIO_ENABLE = no AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality
BACKLIGHT_ENABLE = no
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = yes
LAYOUTS = 66_ansi 66_iso LAYOUTS = 66_ansi 66_iso
+177 -15
View File
@@ -1,5 +1,5 @@
/* /*
Copyright 2012 Jun Wako <[email protected]> Copyright 2020
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -21,11 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* USB Device descriptor parameter */ /* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED #define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060 #define PRODUCT_ID 0xB1E5
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER KPREPUBLIC #define MANUFACTURER KPrepublic
#define PRODUCT COSPAD #define PRODUCT Cospad
#define DESCRIPTION QMK keyboard firmware for COSPAD #define DESCRIPTION 6x4 numpad with underglow and backlighting
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 6 #define MATRIX_ROWS 6
@@ -40,22 +40,51 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
* *
*/ */
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5 } #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5 }
#define MATRIX_COL_PINS { F0, F1, E6, C7 } #define MATRIX_COL_PINS { F0, F1, E6, C7 }
#define UNUSED_PINS #define UNUSED_PINS
/* COL2ROW or ROW2COL */ /* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW #define DIODE_DIRECTION COL2ROW
/* Backlight configuration */ /*
* 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 BACKLIGHT_PIN F7 #define BACKLIGHT_PIN F7
#define BACKLIGHT_LEVELS 1 // #define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3
#define BACKLIGHT_ON_STATE 0
/* Underlight configuration */
#define RGB_DI_PIN F6 #define RGB_DI_PIN F6
#define RGBLED_NUM 4 #ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 4
// #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 */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #define DEBOUNCE 5
@@ -64,10 +93,89 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define MATRIX_HAS_GHOST //#define MATRIX_HAS_GHOST
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE #define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */ /* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful 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
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* key combination for magic key command */
/* defined by default; to change, uncomment and set to the combination you want */
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
/* control how magic key switches layers */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
/* override magic key keymap */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
//#define MAGIC_KEY_HELP H
//#define MAGIC_KEY_HELP_ALT SLASH
//#define MAGIC_KEY_DEBUG D
//#define MAGIC_KEY_DEBUG_MATRIX X
//#define MAGIC_KEY_DEBUG_KBD K
//#define MAGIC_KEY_DEBUG_MOUSE M
//#define MAGIC_KEY_VERSION V
//#define MAGIC_KEY_STATUS S
//#define MAGIC_KEY_CONSOLE C
//#define MAGIC_KEY_LAYER0 0
//#define MAGIC_KEY_LAYER0_ALT GRAVE
//#define MAGIC_KEY_LAYER1 1
//#define MAGIC_KEY_LAYER2 2
//#define MAGIC_KEY_LAYER3 3
//#define MAGIC_KEY_LAYER4 4
//#define MAGIC_KEY_LAYER5 5
//#define MAGIC_KEY_LAYER6 6
//#define MAGIC_KEY_LAYER7 7
//#define MAGIC_KEY_LAYER8 8
//#define MAGIC_KEY_LAYER9 9
//#define MAGIC_KEY_BOOTLOADER B
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z
/* /*
* Feature disable options * Feature disable options
* These options are also useful to firmware size reduction. * These options are also useful to firmware size reduction.
@@ -83,8 +191,62 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_LAYER //#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING //#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT //#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION /* disable these deprecated features by default */
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
#endif
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
//#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1
/*
* HD44780 LCD Display Configuration
*/
/*
#define LCD_LINES 2 //< number of visible lines of the display
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
#if LCD_IO_MODE
#define LCD_PORT PORTB //< port for the LCD lines
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
#define LCD_RS_PORT LCD_PORT //< port for RS line
#define LCD_RS_PIN 3 //< pin for RS line
#define LCD_RW_PORT LCD_PORT //< port for RW line
#define LCD_RW_PIN 2 //< pin for RW line
#define LCD_E_PORT LCD_PORT //< port for Enable line
#define LCD_E_PIN 1 //< pin for Enable line
#endif
*/
/* Bootmagic Lite key configuration */ /* Bootmagic Lite key configuration */
// #define BOOTMAGIC_LITE_ROW 0 // #define BOOTMAGIC_LITE_ROW 0
+11 -12
View File
@@ -1,5 +1,4 @@
/* Copyright 2020
/* Copyright 2019
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -16,18 +15,18 @@
*/ */
#include "cospad.h" #include "cospad.h"
#ifdef BACKLIGHT_ENABLE void keyboard_pre_init_kb(void) {
led_init_ports();
void backlight_init_ports(void) { keyboard_pre_init_user();
setPinOutput(F7);
} }
void backlight_set(uint8_t level) { void led_init_ports(void) {
writePin(F7, !!level); setPinOutput(B2);
} }
void backlight_task(void) { bool led_update_kb(led_t led_state) {
// do nothing - as default implementation of software PWM does not work if (led_update_user(led_state)) {
writePin(B2, !led_state.num_lock);
}
return true;
} }
#endif //BACKLIGHT_ENABLE
+82 -81
View File
@@ -1,5 +1,4 @@
/* Copyright 2020
/* Copyright 2019
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -14,12 +13,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#pragma once #pragma once
#include "quantum.h" #include "quantum.h"
#define ___ KC_NO #define ___ KC_NO
/* This a shortcut to help you visually see your layout. /* This is a shortcut to help you visually see your layout.
* *
* The first section contains all of the arguments representing the physical * The first section contains all of the arguments representing the physical
* layout of the board and position of the keys. * layout of the board and position of the keys.
@@ -28,100 +29,100 @@
* represents the switch matrix. * represents the switch matrix.
*/ */
/* COSPAD ortho matrix layout /* 6x4 ortholinear layout
* ,-------------------. * ,-------------------.
* | 00 | 01 | 02 | 03 | * | 00 | 01 | 02 | 03 |
* |----|----|----|----| * |----|----|----|----|
* | 10 | 11 | 12 | 13 | * | 10 | 11 | 12 | 13 |
* |----|----|----|----| * |----|----|----|----|
* | 20 | 21 | 22 | 23 | * | 20 | 21 | 22 | 23 |
* |----|----|----|----| * |----|----|----|----|
* | 30 | 31 | 32 | 33 | * | 30 | 31 | 32 | 33 |
* |----|----|----|----| * |----|----|----|----|
* | 40 | 41 | 42 | 43 | * | 40 | 41 | 42 | 43 |
* |----|----|----|----| * |----|----|----|----|
* | 50 | 51 | 52 | 53 | * | 50 | 51 | 52 | 53 |
* `-------------------' * `-------------------'
*/ */
#define LAYOUT_ortho_6x4( \ #define LAYOUT_ortho_6x4( \
k00, k01, k02, k03, \ k00, k01, k02, k03, \
k10, k11, k12, k13, \ k10, k11, k12, k13, \
k20, k21, k22, k23, \ k20, k21, k22, k23, \
k30, k31, k32, k33, \ k30, k31, k32, k33, \
k40, k41, k42, k43, \ k40, k41, k42, k43, \
k50, k51, k52, k53 \ k50, k51, k52, k53 \
) \ ) \
{ \ { \
{k00, k01, k02, k03}, \ { k00, k01, k02, k03 }, \
{k10, k11, k12, k13}, \ { k10, k11, k12, k13 }, \
{k20, k21, k22, k23}, \ { k20, k21, k22, k23 }, \
{k30, k31, k32, k33}, \ { k30, k31, k32, k33 }, \
{k40, k41, k42, k43}, \ { k40, k41, k42, k43 }, \
{k50, k51, k52, k53} \ { k50, k51, k52, k53 } \
} }
/* COSPAD gamepad matrix layout /* 6x4 gamepad layout
* ,-------------------. * ,-------------------.
* | 00 | 01 | 02 | 03 | * | 00 | 01 | 02 | 03 |
* |----|----|----|----| * |----|----|----|----|
* | 10 | 11 | 12 | 13 | * | 10 | 11 | 12 | 13 |
* |----|----|----|----| * |----|----|----|----|
* | 20 | 21 | 22 | | * | 20 | 21 | 22 | |
* |----|----|----| 23 | * |----|----|----| 23 |
* | 30 | 31 | 32 | | * | 30 | 31 | 32 | |
* |----|----|----|----| * |----|----|----|----|
* | 40 | 41 | 42 | 43 | * | 40 | 41 | 42 | 43 |
* |----|----|----|----| * |----|----|----|----|
* | 50 | 51 | 52 | 53 | * | 50 | 51 | 52 | 53 |
* `-------------------' * `-------------------'
*/ */
#define LAYOUT_gamepad_6x4( \ #define LAYOUT_gamepad_6x4( \
k00, k01, k02, k03, \ k00, k01, k02, k03, \
k10, k11, k12, k13, \ k10, k11, k12, k13, \
k20, k21, k22, \ k20, k21, k22, \
k30, k31, k32, k23, \ k30, k31, k32, k23, \
k40, k41, k42, k43, \ k40, k41, k42, k43, \
k50, k51, k52, k53 \ k50, k51, k52, k53 \
) \ ) \
{ \ { \
{k00, k01, k02, k03}, \ { k00, k01, k02, k03 }, \
{k10, k11, k12, k13}, \ { k10, k11, k12, k13 }, \
{k20, k21, k22, k23}, \ { k20, k21, k22, k23 }, \
{k30, k31, k32, ___}, \ { k30, k31, k32, ___ }, \
{k40, k41, k42, k43}, \ { k40, k41, k42, k43 }, \
{k50, k51, k52, k53} \ { k50, k51, k52, k53 } \
} }
/* COSPAD numpad matrix layout /* 6x4 numpad layout
* ,-------------------. * ,-------------------.
* | 00 | 01 | 02 | 03 | * | 00 | 01 | 02 | 03 |
* |----|----|----|----| * |----|----|----|----|
* | 10 | 11 | 12 | 13 | * | 10 | 11 | 12 | 13 |
* |----|----|----|----| * |----|----|----|----|
* | 20 | 21 | 22 | | * | 20 | 21 | 22 | |
* |----|----|----| 23 | * |----|----|----| 23 |
* | 30 | 31 | 32 | | * | 30 | 31 | 32 | |
* |----|----|----|----| * |----|----|----|----|
* | 40 | 41 | 42 | | * | 40 | 41 | 42 | |
* |----|----|----| 43 | * |----|----|----| 43 |
* | 50 | 52 | | * | 50 | 52 | |
* `-------------------' * `-------------------'
*/ */
#define LAYOUT_numpad_6x4( \ #define LAYOUT_numpad_6x4( \
k00, k01, k02, k03, \ k00, k01, k02, k03, \
k10, k11, k12, k13, \ k10, k11, k12, k13, \
k20, k21, k22, \ k20, k21, k22, \
k30, k31, k32, k23, \ k30, k31, k32, k23, \
k40, k41, k42, \ k40, k41, k42, \
k50, k52, k43 \ k50, k52, k43 \
) \ ) \
{ \ { \
{k00, k01, k02, k03}, \ { k00, k01, k02, k03 }, \
{k10, k11, k12, k13}, \ { k10, k11, k12, k13 }, \
{k20, k21, k22, k23}, \ { k20, k21, k22, k23 }, \
{k30, k31, k32, ___}, \ { k30, k31, k32, ___ }, \
{k40, k41, k42, k43}, \ { k40, k41, k42, k43 }, \
{k50, ___, k52, ___} \ { k50, ___, k52, ___ } \
} }
// Add backwards compatibility for existing keymaps // Add backwards compatibility for existing keymaps
+102 -90
View File
@@ -1,95 +1,107 @@
{ {
"keyboard_name": "Cospad", "keyboard_name": "Cospad",
"keyboard_folder": "cospad", "url": "",
"url": "", "maintainer": "qmk",
"maintainer": "qmk", "width": 4,
"width": 4, "height": 6,
"height": 6, "layouts": {
"layouts": { "LAYOUT_numpad_6x4": {
"LAYOUT_numpad_6x4": { "key_count": 21,
"key_count": 21, "layout": [
"layout": [ {"x":0, "y":0},
{"label":"Esc", "x":0, "y":0}, {"x":1, "y":0},
{"label":"Tab", "x":1, "y":0}, {"x":2, "y":0},
{"label":"Fn", "x":2, "y":0}, {"x":3, "y":0},
{"label":"Back", "x":3, "y":0},
{"label":"Num Lock", "x":0, "y":1},
{"label":"/", "x":1, "y":1},
{"label":"*", "x":2, "y":1},
{"label":"-", "x":3, "y":1},
{"label":"7", "x":0, "y":2},
{"label":"8", "x":1, "y":2},
{"label":"9", "x":2, "y":2},
{"label":"4", "x":0, "y":3},
{"label":"5", "x":1, "y":3},
{"label":"6", "x":2, "y":3},
{"label":"+", "x":3, "y":2, "h":2},
{"label":"1", "x":0, "y":4},
{"label":"2", "x":1, "y":4},
{"label":"3", "x":2, "y":4},
{"label":"0", "x":0, "y":5, "w":2},
{"label":".", "x":2, "y":5},
{"label":"Enter", "x":3, "y":4, "h":2}
]
},
"LAYOUT_gamepad_6x4": { {"x":0, "y":1},
"key_count": 23, {"x":1, "y":1},
"layout": [ {"x":2, "y":1},
{"label":"k00", "x":0, "y":0}, {"x":3, "y":1},
{"label":"k01", "x":1, "y":0},
{"label":"k02", "x":2, "y":0},
{"label":"k03", "x":3, "y":0},
{"label":"k10", "x":0, "y":1},
{"label":"k11", "x":1, "y":1},
{"label":"k12", "x":2, "y":1},
{"label":"k13", "x":3, "y":1},
{"label":"k20", "x":0, "y":2},
{"label":"k21", "x":1, "y":2},
{"label":"k22", "x":2, "y":2},
{"label":"k30", "x":0, "y":3},
{"label":"k31", "x":1, "y":3},
{"label":"k32", "x":2, "y":3},
{"label":"k23", "x":3, "y":2, "h":2},
{"label":"k40", "x":0, "y":4},
{"label":"k41", "x":1, "y":4},
{"label":"k42", "x":2, "y":4},
{"label":"k43", "x":3, "y":4},
{"label":"k50", "x":0, "y":5},
{"label":"k51", "x":1, "y":5},
{"label":"k52", "x":2, "y":5},
{"label":"k53", "x":3, "y":5}
]
},
"LAYOUT_ortho_6x4": { {"x":0, "y":2},
"key_count": 24, {"x":1, "y":2},
"layout": [ {"x":2, "y":2},
{"label":"k00", "x":0, "y":0},
{"label":"k01", "x":1, "y":0}, {"x":0, "y":3},
{"label":"k02", "x":2, "y":0}, {"x":1, "y":3},
{"label":"k03", "x":3, "y":0}, {"x":2, "y":3},
{"label":"k10", "x":0, "y":1}, {"x":3, "y":2, "h":2},
{"label":"k11", "x":1, "y":1},
{"label":"k12", "x":2, "y":1}, {"x":0, "y":4},
{"label":"k13", "x":3, "y":1}, {"x":1, "y":4},
{"label":"k20", "x":0, "y":2}, {"x":2, "y":4},
{"label":"k21", "x":1, "y":2},
{"label":"k22", "x":2, "y":2}, {"x":0, "y":5, "w":2},
{"label":"k23", "x":3, "y":2}, {"x":2, "y":5},
{"label":"k30", "x":0, "y":3}, {"x":3, "y":4, "h":2}
{"label":"k31", "x":1, "y":3}, ]
{"label":"k32", "x":2, "y":3}, },
{"label":"k33", "x":3, "y":3}, "LAYOUT_gamepad_6x4": {
{"label":"k40", "x":0, "y":4}, "key_count": 23,
{"label":"k41", "x":1, "y":4}, "layout": [
{"label":"k42", "x":2, "y":4}, {"x":0, "y":0},
{"label":"k43", "x":3, "y":4}, {"x":1, "y":0},
{"label":"k50", "x":0, "y":5}, {"x":2, "y":0},
{"label":"k51", "x":1, "y":5}, {"x":3, "y":0},
{"label":"k52", "x":2, "y":5},
{"label":"k53", "x":3, "y":5} {"x":0, "y":1},
] {"x":1, "y":1},
{"x":2, "y":1},
{"x":3, "y":1},
{"x":0, "y":2},
{"x":1, "y":2},
{"x":2, "y":2},
{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":2, "h":2},
{"x":0, "y":4},
{"x":1, "y":4},
{"x":2, "y":4},
{"x":3, "y":4},
{"x":0, "y":5},
{"x":1, "y":5},
{"x":2, "y":5},
{"x":3, "y":5}
]
},
"LAYOUT_ortho_6x4": {
"key_count": 24,
"layout": [
{"x":0, "y":0},
{"x":1, "y":0},
{"x":2, "y":0},
{"x":3, "y":0},
{"x":0, "y":1},
{"x":1, "y":1},
{"x":2, "y":1},
{"x":3, "y":1},
{"x":0, "y":2},
{"x":1, "y":2},
{"x":2, "y":2},
{"x":3, "y":2},
{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":3},
{"x":0, "y":4},
{"x":1, "y":4},
{"x":2, "y":4},
{"x":3, "y":4},
{"x":0, "y":5},
{"x":1, "y":5},
{"x":2, "y":5},
{"x":3, "y":5}
]
}
} }
}
} }
+50 -53
View File
@@ -1,60 +1,57 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below. // Defines names for use in layer keycodes and the keymap
// The underscores don't mean anything - you can have a layer called STUFF or any other name. enum layer_names {
// Layer names don't all need to be of the same length, obviously, and you can also skip them _BL,
// entirely and just use numbers. _FL
enum layers {
_BL = 0,
_FL
}; };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap _BL: (Base Layer) Default Layer /* Keymap _BL: (Base Layer) Default Layer
* ,-------------------. * ,-------------------.
* |Esc |TAB | FN | BS | * |Esc |TAB | FN | BS |
* |----|----|----|----| * |----|----|----|----|
* | NL | / | * | - | * | NL | / | * | - |
* |----|----|----|----| * |----|----|----|----|
* | 7 | 8 | 9 | | * | 7 | 8 | 9 | |
* |----|----|----| + | * |----|----|----| + |
* | 4 | 5 | 6 | | * | 4 | 5 | 6 | |
* |----|----|----|----| * |----|----|----|----|
* | 1 | 2 | 3 | | * | 1 | 2 | 3 | |
* |----|----|----| En | * |----|----|----| En |
* | 0 | . | | * | 0 | . | |
* `-------------------' * `-------------------'
*/ */
[_BL] = LAYOUT_numpad_6x4( [_BL] = LAYOUT_numpad_6x4(
KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \ KC_ESC, KC_TAB, MO(_FL), KC_BSPC,
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, \ KC_P7, KC_P8, KC_P9,
KC_P4, KC_P5, KC_P6, KC_PPLS, \ KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, \ KC_P1, KC_P2, KC_P3,
KC_P0, KC_PDOT, KC_PENT KC_P0, KC_PDOT, KC_PENT
), ),
/* Keymap _FL: Function Layer /* Keymap _FL: Function Layer
* ,-------------------. * ,-------------------.
* |RGBT| | | | * |RGBT| | | |
* |----|----|----|----| * |----|----|----|----|
* |RGBM|RGBP|BTOG| | * |RGBM|RGBP|BTOG| |
* |----|----|----|----| * |----|----|----|----|
* |HUD |HUI |BON | | * |HUD |HUI |BON | |
* |----|----|----| | * |----|----|----| |
* |SAD |SAI |BOFF| | * |SAD |SAI |BOFF| |
* |----|----|----|----| * |----|----|----|----|
* |VAD |VAS |BSTP| | * |VAD |VAS |BSTP| |
* |----|----|----| | * |----|----|----| |
* | |RST | | * | |RST | |
* `-------------------' * `-------------------'
*/ */
[_FL] = LAYOUT_numpad_6x4( [_FL] = LAYOUT_numpad_6x4(
RGB_TOG, _______, _______, _______, \ RGB_TOG, _______, _______, _______,
RGB_MOD, RGB_M_P, BL_TOGG, _______, \ RGB_MOD, RGB_M_P, BL_TOGG, _______,
RGB_HUD, RGB_HUI, BL_ON, \ RGB_HUD, RGB_HUI, BL_ON,
RGB_SAD, RGB_SAI, BL_OFF, _______, \ RGB_SAD, RGB_SAI, BL_OFF, _______,
RGB_VAD, RGB_VAI, BL_STEP, \ RGB_VAD, RGB_VAI, BL_STEP,
_______, RESET, _______ _______, RESET, _______
), )
}; };
+7 -10
View File
@@ -1,18 +1,15 @@
COSPAD # Cospad
===
A DIY Keypad Kit sold by KPRepublic, runs TKG natively. A DIY keypad kit sold by KPRepublic, runs TKG natively.
Keyboard Maintainer: QMK Community * Keyboard Maintainer: QMK Community
Hardware Supported: COSPAD * Hardware Supported: Cospad PCB
Hardware Availability: [KPrepublic on Aliexpress](https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html) * Hardware Availability: [KPrepublic on Aliexpress](https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html)
Only supports on and off for the backlight leds, as they are not connected to a PWM pin.
Supported Layouts: Supported Layouts:
![Numpad Layout of COSPAD](https://i.imgur.com/t03lXJ4.png) ![Numpad layouts](https://i.imgur.com/t03lXJ4.png)
![Ortholinear Layout of COSPAD](https://i.imgur.com/mliUcCc.png) ![Ortholinear layouts](https://i.imgur.com/mliUcCc.png)
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
+12 -12
View File
@@ -12,23 +12,23 @@ MCU = atmega32u4
BOOTLOADER = atmel-dfu BOOTLOADER = atmel-dfu
# Build Options # Build Options
# comment out to disable the options. # change yes to no to disable
# #
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
BACKLIGHT_CUSTOM_DRIVER = yes RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870) MIDI_ENABLE = no # MIDI support
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) HD44780_ENABLE = no # Enable support for HD44780 based LCDs
LAYOUTS = numpad_6x4 ortho_6x4 LAYOUTS = numpad_6x4 ortho_6x4
+2 -2
View File
@@ -6,8 +6,8 @@
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
) \ ) \
LAYOUT_wrapper( \ LAYOUT_wrapper( \
KC_TAB, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
MT_ESC, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ MT_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
OS_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, OS_RSFT, \ OS_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, OS_RSFT, \
KC_LEAD,OS_LALT, SP_LWER, ET_RAIS, KC_BSPC, KC_RGUI \ KC_LEAD,OS_LALT, SP_LWER, ET_RAIS, KC_BSPC, KC_RGUI \
) )
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// lower maximum brightness to lower power usage and prevent unresponsiveness // lower maximum brightness to lower power usage and prevent unresponsiveness
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_GRADIENT_LEFT_RIGHT
//disable effects //disable effects
#define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue speed is hue for secondary hue #define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue speed is hue for secondary hue
@@ -3,7 +3,7 @@
SRC += ./logo_reader.c SRC += ./logo_reader.c
# enable OLED displays # enable OLED displays
OLED_DRIVER_ENABLE = yes OLED_DRIVER_ENABLE = no
# enable media keys # enable media keys
EXTRAKEY_ENABLE = yes EXTRAKEY_ENABLE = yes
-1
View File
@@ -41,4 +41,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
+2 -4
View File
@@ -24,14 +24,12 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D0); setPinOutput(D0);
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D0);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D0, !led_state.num_lock); writePin(D0, led_state.num_lock);
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1
View File
@@ -39,4 +39,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
+5 -2
View File
@@ -4,7 +4,7 @@
#include "config_common.h" #include "config_common.h"
/* USB Device descriptor parameter */ /* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED #define VENDOR_ID 0x445A // "DZ"
#define PRODUCT_ID 0x2260 #define PRODUCT_ID 0x2260
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER KBDFans #define MANUFACTURER KBDFans
@@ -45,4 +45,7 @@
#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_VAL_STEP 8
#define RGBLIGHT_SLEEP #define RGBLIGHT_SLEEP
#endif #endif
#endif #endif
/* VIA related config */
#define VIA_EEPROM_LAYOUT_OPTIONS_SIZE 2
+29
View File
@@ -0,0 +1,29 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_NO, 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_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_NO, MO(1), KC_RCTL),
LAYOUT(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL,
KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
};
+2
View File
@@ -0,0 +1,2 @@
LINK_TIME_OPTIMIZATION_ENABLE = yes
VIA_ENABLE = yes
+1 -2
View File
@@ -23,12 +23,11 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1 -2
View File
@@ -23,12 +23,11 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1 -2
View File
@@ -23,12 +23,11 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1
View File
@@ -41,6 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define NO_UART 1 #define NO_UART 1
+3 -6
View File
@@ -25,16 +25,13 @@ void led_init_ports(void) {
setPinOutput(D0); setPinOutput(D0);
setPinOutput(D1); setPinOutput(D1);
setPinOutput(D6); setPinOutput(D6);
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D6);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D0, !led_state.num_lock); writePin(D0, led_state.num_lock);
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
writePin(D6, !led_state.scroll_lock); writePin(D6, led_state.scroll_lock);
} }
return true; return true;
} }
+1
View File
@@ -39,4 +39,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
+2 -3
View File
@@ -25,13 +25,12 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D0); setPinOutput(D0);
setPinOutput(D1); setPinOutput(D1);
writePinHigh(D0);
writePinHigh(D1);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D0, led_state.num_lock);
writePin(D1, led_state.caps_lock);
} }
return true; return true;
} }
+1
View File
@@ -40,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define BACKLIGHT_PIN D4 #define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3 #define BACKLIGHT_LEVELS 3
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define NO_UART 1 #define NO_UART 1
+2 -4
View File
@@ -24,14 +24,12 @@ void keyboard_pre_init_kb(void) {
void led_init_ports(void) { void led_init_ports(void) {
setPinOutput(D1); setPinOutput(D1);
setPinOutput(D6); setPinOutput(D6);
writePinHigh(D1);
writePinHigh(D6);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
writePin(D6, !led_state.scroll_lock); writePin(D6, led_state.scroll_lock);
} }
return true; return true;
} }
+3
View File
@@ -33,3 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLED_NUM 5 #define RGBLED_NUM 5
#define RGBLIGHT_ANIMATIONS #define RGBLIGHT_ANIMATIONS
#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3
+3 -6
View File
@@ -27,16 +27,13 @@ void led_init_ports(void) {
setPinOutput(D0); setPinOutput(D0);
setPinOutput(D1); setPinOutput(D1);
setPinOutput(D6); setPinOutput(D6);
writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D6);
} }
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D0, !led_state.num_lock); writePin(D0, led_state.num_lock);
writePin(D1, !led_state.caps_lock); writePin(D1, led_state.caps_lock);
writePin(D6, !led_state.scroll_lock); writePin(D6, led_state.scroll_lock);
} }
return true; return true;
} }
@@ -6,8 +6,6 @@ Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
Hardware Supported: Think6.5 Compatible PCB Hardware Supported: Think6.5 Compatible PCB
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=100166.0) Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=100166.0)
**Note:** The `LAYOUT_65_ansi_blocker` LAYOUT macro utilizes the same pins and switch matrix as the hotswap version. Any firmware made with this LAYOUT macro can be flashed on both the Solder (Compatible) version and the Hotswap version of the Think6.5.
**Indicator LEDs:** The solder PCB ONLY supports Caps Lock LEDs unlike the Hotswap version that supports Num Lock, Caps Lock, and Scroll Lock. **Indicator LEDs:** The solder PCB ONLY supports Caps Lock LEDs unlike the Hotswap version that supports Num Lock, Caps Lock, and Scroll Lock.
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
+4 -18
View File
@@ -25,17 +25,9 @@ void matrix_init_kb(void) {
// runs once when the firmware starts up // runs once when the firmware starts up
setPinOutput(C7); setPinOutput(C7);
matrix_init_user(); 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) { bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here // put your per-action keyboard code here
// runs for every action, just before processing by the firmware // runs for every action, just before processing by the firmware
@@ -43,15 +35,9 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return process_record_user(keycode, record); return process_record_user(keycode, record);
} }
void led_set_kb(uint8_t usb_led) { bool led_update_kb(led_t led_state) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here if(led_update_user(led_state)) {
writePin(C7, !led_state.caps_lock);
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
writePinLow(C7);
} else {
writePinHigh(C7);
} }
return true;
led_set_user(usb_led);
} }
@@ -32,16 +32,16 @@
} }
#define LAYOUT_65_ansi_blocker( \ #define LAYOUT_65_ansi_blocker( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F, \
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \
K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \
K40, K41, K43, K46, K4A, K4B, K4D, K4E, K4F \ K40, K41, K43, K46, K4A, K4B, K4D, K4E, K4F \
) { \ ) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E, K0F }, \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO, K0F }, \
{ K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \
{ KC_NO, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \
{ K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, KC_NO, K4D, K4E, K4F }, \ { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, KC_NO, K4D, K4E, K4F }, \
} }
+38
View File
@@ -0,0 +1,38 @@
/* Copyright 2018 Yiancar
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define XXX KC_NO
#include "quantum.h"
#include "../../wilba_tech/wt_rgb_backlight_keycodes.h"
#include "via.h"
// This a shortcut to help you visually see your layout.
#define LAYOUT_60_ansi( \
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, K2C, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
K40, K41, K42, K46, K4A, K4B, K4C, 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, XXX }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \
{ K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \
}
+148
View File
@@ -0,0 +1,148 @@
/*
Copyright 2018 Yiancar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x8968
#define PRODUCT_ID 0x4854
#define DEVICE_VER 0x0002
#define MANUFACTURER Yiancar-Designs
#define PRODUCT HS60 V2
#define DESCRIPTION GH60 compatible, tool free RGB keyboard
#define HS60_ANSI
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14
#define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 }
#define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 }
// To enable debugger set A13 A14 -> A5 A6
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
/* 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
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful 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
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* Bootmagic Lite key configuration */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0
/* Backlight options */
#define RGB_BACKLIGHT_ENABLED 1
#define RGB_BACKLIGHT_HS60
// they aren't really used if RGB_BACKLIGHT_HS60 defined
#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
#define RGB_BACKLIGHT_USE_ISO_ENTER 0
#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
// disable backlight after timeout in minutes, 0 = no timeout
#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
// the default brightness
#define RGB_BACKLIGHT_BRIGHTNESS 255
// the default effect (RGB test)
#define RGB_BACKLIGHT_EFFECT 6
// the default effect speed (0-3)
#define RGB_BACKLIGHT_EFFECT_SPEED 0
// the default color1 and color2
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
#define DRIVER_COUNT 2
#define DRIVER_LED_TOTAL 64
// These define which keys in the matrix are alphas/mods
// Used for backlight effects so colors are different for
// alphas vs. mods
// Each value is for a row, bit 0 is column 0
// Alpha=0 Mod=1
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0010000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0010000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111
#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 32
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE
+333
View File
@@ -0,0 +1,333 @@
{
"keyboard_name": "HS60v2",
"maintainer": "yiancar",
"url": "",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_60_ansi": {
"key_count": 61,
"layout": [
{
"label": "~",
"x": 0,
"y": 0
},
{
"label": "!",
"x": 1,
"y": 0
},
{
"label": "@",
"x": 2,
"y": 0
},
{
"label": "#",
"x": 3,
"y": 0
},
{
"label": "$",
"x": 4,
"y": 0
},
{
"label": "%",
"x": 5,
"y": 0
},
{
"label": "^",
"x": 6,
"y": 0
},
{
"label": "&",
"x": 7,
"y": 0
},
{
"label": "*",
"x": 8,
"y": 0
},
{
"label": "(",
"x": 9,
"y": 0
},
{
"label": ")",
"x": 10,
"y": 0
},
{
"label": "_",
"x": 11,
"y": 0
},
{
"label": "+",
"x": 12,
"y": 0
},
{
"label": "Backspace",
"x": 13,
"y": 0,
"w": 2
},
{
"label": "Tab",
"x": 0,
"y": 1,
"w": 1.5
},
{
"label": "Q",
"x": 1.5,
"y": 1
},
{
"label": "W",
"x": 2.5,
"y": 1
},
{
"label": "E",
"x": 3.5,
"y": 1
},
{
"label": "R",
"x": 4.5,
"y": 1
},
{
"label": "T",
"x": 5.5,
"y": 1
},
{
"label": "Y",
"x": 6.5,
"y": 1
},
{
"label": "U",
"x": 7.5,
"y": 1
},
{
"label": "I",
"x": 8.5,
"y": 1
},
{
"label": "O",
"x": 9.5,
"y": 1
},
{
"label": "P",
"x": 10.5,
"y": 1
},
{
"label": "{",
"x": 11.5,
"y": 1
},
{
"label": "}",
"x": 12.5,
"y": 1
},
{
"label": "|",
"x": 13.5,
"y": 1,
"w": 1.5
},
{
"label": "Caps Lock",
"x": 0,
"y": 2,
"w": 1.75
},
{
"label": "A",
"x": 1.75,
"y": 2
},
{
"label": "S",
"x": 2.75,
"y": 2
},
{
"label": "D",
"x": 3.75,
"y": 2
},
{
"label": "F",
"x": 4.75,
"y": 2
},
{
"label": "G",
"x": 5.75,
"y": 2
},
{
"label": "H",
"x": 6.75,
"y": 2
},
{
"label": "J",
"x": 7.75,
"y": 2
},
{
"label": "K",
"x": 8.75,
"y": 2
},
{
"label": "L",
"x": 9.75,
"y": 2
},
{
"label": ":",
"x": 10.75,
"y": 2
},
{
"label": "\"",
"x": 11.75,
"y": 2
},
{
"label": "Enter",
"x": 12.75,
"y": 2,
"w": 2.25
},
{
"label": "Shift",
"x": 0,
"y": 3,
"w": 2.25
},
{
"label": "Z",
"x": 2.25,
"y": 3
},
{
"label": "X",
"x": 3.25,
"y": 3
},
{
"label": "C",
"x": 4.25,
"y": 3
},
{
"label": "V",
"x": 5.25,
"y": 3
},
{
"label": "B",
"x": 6.25,
"y": 3
},
{
"label": "N",
"x": 7.25,
"y": 3
},
{
"label": "M",
"x": 8.25,
"y": 3
},
{
"label": "<",
"x": 9.25,
"y": 3
},
{
"label": ">",
"x": 10.25,
"y": 3
},
{
"label": "?",
"x": 11.25,
"y": 3
},
{
"label": "Shift",
"x": 12.25,
"y": 3,
"w": 2.75
},
{
"label": "Ctrl",
"x": 0,
"y": 4,
"w": 1.25
},
{
"label": "Win",
"x": 1.25,
"y": 4,
"w": 1.25
},
{
"label": "Alt",
"x": 2.5,
"y": 4,
"w": 1.25
},
{
"x": 3.75,
"y": 4,
"w": 6.25
},
{
"label": "Alt",
"x": 10,
"y": 4,
"w": 1.25
},
{
"label": "Win",
"x": 11.25,
"y": 4,
"w": 1.25
},
{
"label": "Menu",
"x": 12.5,
"y": 4,
"w": 1.25
},
{
"label": "Ctrl",
"x": 13.75,
"y": 4,
"w": 1.25
}
]
}
}
}
@@ -1,10 +1,5 @@
#pragma once #pragma once
// Include overwrites for specific keymap
#define HS60_ANSI
#undef PRODUCT_ID
#define PRODUCT_ID 0x4854
// disable backlight after timeout in minutes, 0 = no timeout // disable backlight after timeout in minutes, 0 = no timeout
#undef RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT #undef RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT
#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 20 #define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 20
@@ -10,7 +10,7 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
# comment out to disable the options. # comment out to disable the options.
# #
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug CONSOLE_ENABLE = no # Console for debug
@@ -23,7 +23,7 @@ NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plu
CIE1931_CURVE = yes CIE1931_CURVE = yes
LAYOUTS = 60_ansi 60_iso LAYOUTS = 60_ansi
# project specific files # project specific files
SRC = keyboards/wilba_tech/wt_main.c \ SRC = keyboards/wilba_tech/wt_main.c \
+148
View File
@@ -0,0 +1,148 @@
/*
Copyright 2018 Yiancar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x8968
#define PRODUCT_ID 0x4855
#define DEVICE_VER 0x0002
#define MANUFACTURER Yiancar-Designs
#define PRODUCT HS60 V2
#define DESCRIPTION GH60 compatible, tool free RGB keyboard
#define HS60_HHKB
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14
#define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 }
#define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 }
// To enable debugger set A13 A14 -> A5 A6
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW
/* 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
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is userful 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
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* Bootmagic Lite key configuration */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0
/* Backlight options */
#define RGB_BACKLIGHT_ENABLED 1
#define RGB_BACKLIGHT_HS60
// they aren't really used if RGB_BACKLIGHT_HS60 defined
#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0
#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0
#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0
#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0
#define RGB_BACKLIGHT_USE_ISO_ENTER 0
#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0
// disable backlight when USB suspended (PC sleep/hibernate/shutdown)
#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0
// disable backlight after timeout in minutes, 0 = no timeout
#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
// the default brightness
#define RGB_BACKLIGHT_BRIGHTNESS 255
// the default effect (RGB test)
#define RGB_BACKLIGHT_EFFECT 6
// the default effect speed (0-3)
#define RGB_BACKLIGHT_EFFECT_SPEED 0
// the default color1 and color2
#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
#define DRIVER_COUNT 2
#define DRIVER_LED_TOTAL 64
// These define which keys in the matrix are alphas/mods
// Used for backlight effects so colors are different for
// alphas vs. mods
// Each value is for a row, bit 0 is column 0
// Alpha=0 Mod=1
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111
#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
// Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 32
// VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE
@@ -23,34 +23,6 @@
// This a shortcut to help you visually see your layout. // This a shortcut to help you visually see your layout.
#define LAYOUT_60_iso( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
K40, K41, K42, K46, K4A, K4B, K4C, 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, XXX }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \
{ K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \
}
#define LAYOUT_60_ansi( \
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, K2C, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
K40, K41, K42, K46, K4A, K4B, K4C, 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, XXX }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \
{ K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \
}
#define LAYOUT_60_hhkb( \ #define LAYOUT_60_hhkb( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \
+12
View File
@@ -0,0 +1,12 @@
{
"keyboard_name": "HS60v2",
"maintainer": "yiancar",
"url": "",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_60_hhkb": {
"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":14, "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":2.25}, {"x":0, "y":3, "w":2.25}, {"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}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.5}, {"x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"x":11, "y":4, "w":1.5}, {"x":12.5, "y":4}, {"x":13.5, "y":4, "w":1.5}]
}
}
}
@@ -18,6 +18,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Include overwrites for specific keymap */ /* Include overwrites for specific keymap */
#define HS60_ANSI #undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR
#undef PRODUCT_ID #define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 255 }, .index = 3-1 } //red
#define PRODUCT_ID 0x4854
+31
View File
@@ -0,0 +1,31 @@
# MCU name
MCU = STM32F303
# Do not put the microcontroller into power saving mode
# when we get USB suspend event. We want it to keep updating
# backlight effects.
OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
# Build Options
# comment out to disable the options.
#
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
AUDIO_ENABLE = no # Audio output on port C6
NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in
#SERIAL_LINK_ENABLE = yes
CIE1931_CURVE = yes
# project specific files
SRC = keyboards/wilba_tech/wt_main.c \
keyboards/wilba_tech/wt_rgb_backlight.c \
drivers/issi/is31fl3733.c \
quantum/color.c \
drivers/arm/i2c_master.c
File diff suppressed because it is too large. Load diff
@@ -82,6 +82,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
*/ */
/* Bootmagic Lite key configuration */
#define BOOTMAGIC_LITE_ROW 0
#define BOOTMAGIC_LITE_COLUMN 0
/* Backlight options */ /* Backlight options */
#define RGB_BACKLIGHT_ENABLED 1 #define RGB_BACKLIGHT_ENABLED 1
@@ -136,7 +140,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Backlight config starts after VIA's EEPROM usage, // Backlight config starts after VIA's EEPROM usage,
// dynamic keymaps start after this. // dynamic keymaps start after this.
#define VIA_EEPROM_CUSTOM_CONFIG_SIZE 31 #define VIA_EEPROM_CUSTOM_CONFIG_SIZE 32
// VIA lighting is handled by the keyboard-level code // VIA lighting is handled by the keyboard-level code
#define VIA_CUSTOM_LIGHTING_ENABLE #define VIA_CUSTOM_LIGHTING_ENABLE
+76
View File
@@ -0,0 +1,76 @@
{
"keyboard_name": "HS60v2",
"maintainer": "yiancar",
"url": "",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_60_iso": {
"key_count": 62,
"layout": [
{"label":"\\u00ac", "x":0, "y":0},
{"label":"!", "x":1, "y":0},
{"label":"\"", "x":2, "y":0},
{"label":"\\u00a3", "x":3, "y":0},
{"label":"$", "x":4, "y":0},
{"label":"%", "x":5, "y":0},
{"label":"^", "x":6, "y":0},
{"label":"&", "x":7, "y":0},
{"label":"*", "x":8, "y":0},
{"label":"(", "x":9, "y":0},
{"label":")", "x":10, "y":0},
{"label":"_", "x":11, "y":0},
{"label":"+", "x":12, "y":0},
{"label":"Backspace", "x":13, "y":0, "w":2},
{"label":"Tab", "x":0, "y":1, "w":1.5},
{"label":"Q", "x":1.5, "y":1},
{"label":"W", "x":2.5, "y":1},
{"label":"E", "x":3.5, "y":1},
{"label":"R", "x":4.5, "y":1},
{"label":"T", "x":5.5, "y":1},
{"label":"Y", "x":6.5, "y":1},
{"label":"U", "x":7.5, "y":1},
{"label":"I", "x":8.5, "y":1},
{"label":"O", "x":9.5, "y":1},
{"label":"P", "x":10.5, "y":1},
{"label":"{", "x":11.5, "y":1},
{"label":"}", "x":12.5, "y":1},
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
{"label":"A", "x":1.75, "y":2},
{"label":"S", "x":2.75, "y":2},
{"label":"D", "x":3.75, "y":2},
{"label":"F", "x":4.75, "y":2},
{"label":"G", "x":5.75, "y":2},
{"label":"H", "x":6.75, "y":2},
{"label":"J", "x":7.75, "y":2},
{"label":"K", "x":8.75, "y":2},
{"label":"L", "x":9.75, "y":2},
{"label":":", "x":10.75, "y":2},
{"label":"@", "x":11.75, "y":2},
{"label":"~", "x":12.75, "y":2},
{"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2},
{"label":"Shift", "x":0, "y":3, "w":1.25},
{"label":"|", "x":1.25, "y":3},
{"label":"Z", "x":2.25, "y":3},
{"label":"X", "x":3.25, "y":3},
{"label":"C", "x":4.25, "y":3},
{"label":"V", "x":5.25, "y":3},
{"label":"B", "x":6.25, "y":3},
{"label":"N", "x":7.25, "y":3},
{"label":"M", "x":8.25, "y":3},
{"label":"<", "x":9.25, "y":3},
{"label":">", "x":10.25, "y":3},
{"label":"?", "x":11.25, "y":3},
{"label":"Shift", "x":12.25, "y":3, "w":2.75},
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
{"label":"Win", "x":1.25, "y":4, "w":1.25},
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
{"x":3.75, "y":4, "w":6.25},
{"label":"AltGr", "x":10, "y":4, "w":1.25},
{"label":"Win", "x":11.25, "y":4, "w":1.25},
{"label":"Menu", "x":12.5, "y":4, "w":1.25},
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25}
]
}
}
}
+38
View File
@@ -0,0 +1,38 @@
/* Copyright 2018 Yiancar
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define XXX KC_NO
#include "quantum.h"
#include "../../wilba_tech/wt_rgb_backlight_keycodes.h"
#include "via.h"
// This a shortcut to help you visually see your layout.
#define LAYOUT_60_iso( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
K40, K41, K42, K46, K4A, K4B, K4C, 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, XXX }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \
{ K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \
}
+33
View File
@@ -0,0 +1,33 @@
# MCU name
MCU = STM32F303
# Do not put the microcontroller into power saving mode
# when we get USB suspend event. We want it to keep updating
# backlight effects.
OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
# Build Options
# comment out to disable the options.
#
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
AUDIO_ENABLE = no # Audio output on port C6
NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in
#SERIAL_LINK_ENABLE = yes
CIE1931_CURVE = yes
LAYOUTS = 60_iso
# project specific files
SRC = keyboards/wilba_tech/wt_main.c \
keyboards/wilba_tech/wt_rgb_backlight.c \
drivers/issi/is31fl3733.c \
quantum/color.c \
drivers/arm/i2c_master.c
@@ -1,23 +0,0 @@
/*
Copyright 2018 Yiancar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Include overwrites for specific keymap */
#define HS60_ANSI
#undef PRODUCT_ID
#define PRODUCT_ID 0x4854
@@ -1,37 +0,0 @@
/*
Copyright 2018 Yiancar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Include overwrites for specific keymap */
#define HS60_HHKB
#undef PRODUCT_ID
#define PRODUCT_ID 0x4855
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111
#undef RGB_BACKLIGHT_CAPS_LOCK_INDICATOR
#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 255 }, .index = 3-1 } //red
-34
View File
@@ -1,34 +0,0 @@
/*
Copyright 2018 Yiancar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Include overwrites for specific keymap */
#define HS60_HHKB
#undef PRODUCT_ID
#define PRODUCT_ID 0x4855
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111
@@ -1,34 +0,0 @@
/*
Copyright 2018 Yiancar
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Include overwrites for specific keymap */
#define HS60_HHKB
#undef PRODUCT_ID
#define PRODUCT_ID 0x4855
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_0
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_1
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_2
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_3
#undef RGB_BACKLIGHT_ALPHAS_MODS_ROW_4
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111
+2 -2
View File
@@ -17,7 +17,7 @@ Due to the RGB implementation, the HS60 is currently not compatible with communi
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
make hs60/v2:default make hs60/v2/<layout>:default
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information.
@@ -34,4 +34,4 @@ See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools)
- Unplug - Unplug
- Hold Escape - Hold Escape
- Plug In - Plug In
- Flash using QMK Toolbox or dfu-util (`make hs60/v2:<keymap>:dfu-util`) - Flash using QMK Toolbox or dfu-util (`make hs60/v2/<layout>:<keymap>:dfu-util`)
+2 -1
View File
@@ -13,6 +13,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef RGB_BACKLIGHT_HS60 #ifndef RGB_BACKLIGHT_HS60
#error RGB_BACKLIGHT_M60_A not defined, recheck config.h #error RGB_BACKLIGHT_HS60 not defined, recheck config.h
#endif #endif
+12 -1
View File
@@ -16,10 +16,21 @@
#include "j80.h" #include "j80.h"
void keyboard_pre_init_kb(void) {
led_init_ports();
keyboard_pre_init_user();
}
void led_init_ports(void) {
setPinOutput(D0);
setPinOutput(D1);
setPinOutput(D6);
}
bool led_update_kb(led_t led_state) { bool led_update_kb(led_t led_state) {
if (led_update_user(led_state)) { if (led_update_user(led_state)) {
writePin(D1, led_state.caps_lock);
writePin(D0, led_state.num_lock); writePin(D0, led_state.num_lock);
writePin(D1, led_state.caps_lock);
writePin(D6, led_state.scroll_lock); writePin(D6, led_state.scroll_lock);
} }
return true; return true;
Loaded 100 of 211 files, more files were not shown because too many files have changed in this diff. Show more