commit
a139ad9db3
@ -1,7 +1,9 @@ |
|||||||
A QMK collaborator is a keyboard maker/designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users/customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements: |
# Becoming a QMK Collaborator |
||||||
|
|
||||||
* **Have a PCB available for sale** - unfortunately there's just too much variation and complications with handwired keyboards. |
A QMK collaborator is a keyboard maker or designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users and customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements: |
||||||
* **Maintain the your keyboard's directory** - this may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core. |
|
||||||
* **Approve and merge your keyboard's keymap pull requests** - we like to encourage users to contribute their keymaps for others to see and work from when creating their own. |
* **Have a PCB available for sale.** Unfortunately there's just too much variation and complications with handwired keyboards. |
||||||
|
* **Maintain your keyboard in QMK.** This may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core that might break or render any custom code redundant. |
||||||
|
* **Approve and merge keymap pull requests for your keyboard.** We like to encourage users to contribute their keymaps for others to see and work from when creating their own. |
||||||
|
|
||||||
If you feel you meet these requirements, shoot us an email at hello@qmk.fm with an introduction and some links to your keyboard! |
If you feel you meet these requirements, shoot us an email at hello@qmk.fm with an introduction and some links to your keyboard! |
||||||
|
@ -0,0 +1,48 @@ |
|||||||
|
# List of Useful Core Functions To Make Your Keyboard Better |
||||||
|
|
||||||
|
There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. |
||||||
|
|
||||||
|
## (OLKB) Tri Layers |
||||||
|
|
||||||
|
There are actually separate functions that you can use there, depending on what you're after. |
||||||
|
|
||||||
|
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`. |
||||||
|
|
||||||
|
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this. |
||||||
|
|
||||||
|
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. |
||||||
|
|
||||||
|
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. |
||||||
|
|
||||||
|
## Setting the Persistent Default Layer |
||||||
|
|
||||||
|
Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you. |
||||||
|
|
||||||
|
To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). |
||||||
|
|
||||||
|
This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. |
||||||
|
|
||||||
|
To configure the default layer sounds, you would want to define this in your `config.h` file, like this: |
||||||
|
|
||||||
|
```c |
||||||
|
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ |
||||||
|
SONG(COLEMAK_SOUND), \ |
||||||
|
SONG(DVORAK_SOUND) \ |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
|
||||||
|
?> There are a large number of predefined songs in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) that you can use. |
||||||
|
|
||||||
|
## Reseting the keyboard |
||||||
|
|
||||||
|
There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that. |
||||||
|
|
||||||
|
And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader. |
||||||
|
|
||||||
|
## Wiping the EEPROM (Persistent Storage) |
||||||
|
|
||||||
|
If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. |
||||||
|
|
||||||
|
To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. |
||||||
|
|
@ -0,0 +1,104 @@ |
|||||||
|
/* Copyright 2018 Jack Humbert
|
||||||
|
* 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/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
/* This library is only valid for STM32 processors.
|
||||||
|
* This library follows the convention of the AVR i2c_master library. |
||||||
|
* As a result addresses are expected to be already shifted (addr << 1). |
||||||
|
* I2CD1 is the default driver which corresponds to pins B6 and B7. This |
||||||
|
* can be changed. |
||||||
|
* Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that |
||||||
|
* STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. Pins B6 and B7 are used |
||||||
|
* but using any other I2C pins should be trivial. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "i2c_master.h" |
||||||
|
#include <string.h> |
||||||
|
#include <hal.h> |
||||||
|
|
||||||
|
static uint8_t i2c_address; |
||||||
|
|
||||||
|
// This configures the I2C clock to 400Mhz assuming a 72Mhz clock
|
||||||
|
// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html
|
||||||
|
static const I2CConfig i2cconfig = { |
||||||
|
STM32_TIMINGR_PRESC(15U) | |
||||||
|
STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) | |
||||||
|
STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U), |
||||||
|
0, |
||||||
|
0 |
||||||
|
}; |
||||||
|
|
||||||
|
void i2c_init(void) |
||||||
|
{ |
||||||
|
palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time
|
||||||
|
chThdSleepMilliseconds(10); |
||||||
|
|
||||||
|
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); |
||||||
|
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); |
||||||
|
|
||||||
|
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||||
|
} |
||||||
|
|
||||||
|
// This is usually not needed
|
||||||
|
uint8_t i2c_start(uint8_t address) |
||||||
|
{ |
||||||
|
i2c_address = address; |
||||||
|
i2cStart(&I2C_DRIVER, &i2cconfig); |
||||||
|
return 0; |
||||||
|
} |
||||||
|
|
||||||
|
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) |
||||||
|
{ |
||||||
|
i2c_address = address; |
||||||
|
i2cStart(&I2C_DRIVER, &i2cconfig); |
||||||
|
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); |
||||||
|
} |
||||||
|
|
||||||
|
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) |
||||||
|
{ |
||||||
|
i2c_address = address; |
||||||
|
i2cStart(&I2C_DRIVER, &i2cconfig); |
||||||
|
return i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); |
||||||
|
} |
||||||
|
|
||||||
|
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) |
||||||
|
{ |
||||||
|
i2c_address = devaddr; |
||||||
|
i2cStart(&I2C_DRIVER, &i2cconfig); |
||||||
|
|
||||||
|
uint8_t complete_packet[length + 1]; |
||||||
|
for(uint8_t i = 0; i < length; i++) |
||||||
|
{ |
||||||
|
complete_packet[i+1] = data[i]; |
||||||
|
} |
||||||
|
complete_packet[0] = regaddr; |
||||||
|
|
||||||
|
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); |
||||||
|
} |
||||||
|
|
||||||
|
uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) |
||||||
|
{ |
||||||
|
i2c_address = devaddr; |
||||||
|
i2cStart(&I2C_DRIVER, &i2cconfig); |
||||||
|
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); |
||||||
|
} |
||||||
|
|
||||||
|
// This is usually not needed. It releases the driver to allow pins to become GPIO again.
|
||||||
|
uint8_t i2c_stop(uint16_t timeout) |
||||||
|
{ |
||||||
|
i2cStop(&I2C_DRIVER); |
||||||
|
return 0; |
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
/* Copyright 2018 Jack Humbert
|
||||||
|
* Copyright 2018 Yiancar |
||||||
|
* |
||||||
|
* This program is free sofare: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Sofare Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
/* This library follows the convention of the AVR i2c_master library.
|
||||||
|
* As a result addresses are expected to be already shifted (addr << 1). |
||||||
|
* I2CD1 is the default driver which corresponds to pins B6 and B7. This |
||||||
|
* can be changed. |
||||||
|
* Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that |
||||||
|
* STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "ch.h" |
||||||
|
#include <hal.h> |
||||||
|
|
||||||
|
#ifndef I2C_DRIVER |
||||||
|
#define I2C_DRIVER I2CD1 |
||||||
|
#endif |
||||||
|
|
||||||
|
void i2c_init(void); |
||||||
|
uint8_t i2c_start(uint8_t address); |
||||||
|
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); |
||||||
|
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); |
||||||
|
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); |
||||||
|
uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout); |
||||||
|
uint8_t i2c_stop(uint16_t timeout); |
@ -1,262 +0,0 @@ |
|||||||
/* Copyright 2017 Jason Williams
|
|
||||||
* Copyright 2018 Jack Humbert |
|
||||||
* |
|
||||||
* 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 "is31fl3731.h" |
|
||||||
#include <avr/interrupt.h> |
|
||||||
#include <avr/io.h> |
|
||||||
#include <util/delay.h> |
|
||||||
#include <string.h> |
|
||||||
#include "i2c_master.h" |
|
||||||
#include "progmem.h" |
|
||||||
|
|
||||||
// This is a 7-bit address, that gets left-shifted and bit 0
|
|
||||||
// set to 0 for write, 1 for read (as per I2C protocol)
|
|
||||||
// The address will vary depending on your wiring:
|
|
||||||
// 0b1110100 AD <-> GND
|
|
||||||
// 0b1110111 AD <-> VCC
|
|
||||||
// 0b1110101 AD <-> SCL
|
|
||||||
// 0b1110110 AD <-> SDA
|
|
||||||
#define ISSI_ADDR_DEFAULT 0x74 |
|
||||||
|
|
||||||
#define ISSI_REG_CONFIG 0x00 |
|
||||||
#define ISSI_REG_CONFIG_PICTUREMODE 0x00 |
|
||||||
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 |
|
||||||
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 |
|
||||||
|
|
||||||
#define ISSI_CONF_PICTUREMODE 0x00 |
|
||||||
#define ISSI_CONF_AUTOFRAMEMODE 0x04 |
|
||||||
#define ISSI_CONF_AUDIOMODE 0x08 |
|
||||||
|
|
||||||
#define ISSI_REG_PICTUREFRAME 0x01 |
|
||||||
|
|
||||||
#define ISSI_REG_SHUTDOWN 0x0A |
|
||||||
#define ISSI_REG_AUDIOSYNC 0x06 |
|
||||||
|
|
||||||
#define ISSI_COMMANDREGISTER 0xFD |
|
||||||
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
|
||||||
|
|
||||||
#ifndef ISSI_TIMEOUT |
|
||||||
#define ISSI_TIMEOUT 100 |
|
||||||
#endif |
|
||||||
|
|
||||||
#ifndef ISSI_PERSISTENCE |
|
||||||
#define ISSI_PERSISTENCE 0 |
|
||||||
#endif |
|
||||||
|
|
||||||
// Transfer buffer for TWITransmitData()
|
|
||||||
uint8_t g_twi_transfer_buffer[20]; |
|
||||||
|
|
||||||
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
|
|
||||||
// Storing them like this is optimal for I2C transfers to the registers.
|
|
||||||
// We could optimize this and take out the unused registers from these
|
|
||||||
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
|
||||||
// probably not worth the extra complexity.
|
|
||||||
uint8_t g_pwm_buffer[DRIVER_COUNT][144]; |
|
||||||
bool g_pwm_buffer_update_required = false; |
|
||||||
|
|
||||||
uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; |
|
||||||
bool g_led_control_registers_update_required = false; |
|
||||||
|
|
||||||
// This is the bit pattern in the LED control registers
|
|
||||||
// (for matrix A, add one to register for matrix B)
|
|
||||||
//
|
|
||||||
// reg - b7 b6 b5 b4 b3 b2 b1 b0
|
|
||||||
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
|
|
||||||
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
|
|
||||||
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
|
|
||||||
// 0x06 - - , - , - , - , - ,B02,B01,B00
|
|
||||||
// 0x08 - - , - , - , - , - , - , - , -
|
|
||||||
// 0x0A - B17,B16,B15, - , - , - , - , -
|
|
||||||
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
|
|
||||||
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
|
||||||
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
|
||||||
|
|
||||||
|
|
||||||
void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data ) |
|
||||||
{ |
|
||||||
g_twi_transfer_buffer[0] = reg; |
|
||||||
g_twi_transfer_buffer[1] = data; |
|
||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0 |
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { |
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) |
|
||||||
break; |
|
||||||
} |
|
||||||
#else |
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); |
|
||||||
#endif |
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) |
|
||||||
{ |
|
||||||
// assumes bank is already selected
|
|
||||||
|
|
||||||
// transmit PWM registers in 9 transfers of 16 bytes
|
|
||||||
// g_twi_transfer_buffer[] is 20 bytes
|
|
||||||
|
|
||||||
// iterate over the pwm_buffer contents at 16 byte intervals
|
|
||||||
for ( int i = 0; i < 144; i += 16 ) { |
|
||||||
// set the first register, e.g. 0x24, 0x34, 0x44, etc.
|
|
||||||
g_twi_transfer_buffer[0] = 0x24 + i; |
|
||||||
// copy the data from i to i+15
|
|
||||||
// device will auto-increment register for data after the first byte
|
|
||||||
// thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer
|
|
||||||
for ( int j = 0; j < 16; j++ ) { |
|
||||||
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; |
|
||||||
} |
|
||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0 |
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { |
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) |
|
||||||
break; |
|
||||||
} |
|
||||||
#else |
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); |
|
||||||
#endif |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_init( uint8_t addr ) |
|
||||||
{ |
|
||||||
// In order to avoid the LEDs being driven with garbage data
|
|
||||||
// in the LED driver's PWM registers, first enable software shutdown,
|
|
||||||
// then set up the mode and other settings, clear the PWM registers,
|
|
||||||
// then disable software shutdown.
|
|
||||||
|
|
||||||
// select "function register" bank
|
|
||||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); |
|
||||||
|
|
||||||
// enable software shutdown
|
|
||||||
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 ); |
|
||||||
// this delay was copied from other drivers, might not be needed
|
|
||||||
_delay_ms( 10 ); |
|
||||||
|
|
||||||
// picture mode
|
|
||||||
IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE ); |
|
||||||
// display frame 0
|
|
||||||
IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 ); |
|
||||||
// audio sync off
|
|
||||||
IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 ); |
|
||||||
|
|
||||||
// select bank 0
|
|
||||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); |
|
||||||
|
|
||||||
// turn off all LEDs in the LED control register
|
|
||||||
for ( int i = 0x00; i <= 0x11; i++ ) |
|
||||||
{ |
|
||||||
IS31FL3731_write_register( addr, i, 0x00 ); |
|
||||||
} |
|
||||||
|
|
||||||
// turn off all LEDs in the blink control register (not really needed)
|
|
||||||
for ( int i = 0x12; i <= 0x23; i++ ) |
|
||||||
{ |
|
||||||
IS31FL3731_write_register( addr, i, 0x00 ); |
|
||||||
} |
|
||||||
|
|
||||||
// set PWM on all LEDs to 0
|
|
||||||
for ( int i = 0x24; i <= 0xB3; i++ ) |
|
||||||
{ |
|
||||||
IS31FL3731_write_register( addr, i, 0x00 ); |
|
||||||
} |
|
||||||
|
|
||||||
// select "function register" bank
|
|
||||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); |
|
||||||
|
|
||||||
// disable software shutdown
|
|
||||||
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 ); |
|
||||||
|
|
||||||
// select bank 0 and leave it selected.
|
|
||||||
// most usage after initialization is just writing PWM buffers in bank 0
|
|
||||||
// as there's not much point in double-buffering
|
|
||||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) |
|
||||||
{ |
|
||||||
if ( index >= 0 && index < DRIVER_LED_TOTAL ) { |
|
||||||
is31_led led = g_is31_leds[index]; |
|
||||||
|
|
||||||
// Subtract 0x24 to get the second index of g_pwm_buffer
|
|
||||||
g_pwm_buffer[led.driver][led.r - 0x24] = red; |
|
||||||
g_pwm_buffer[led.driver][led.g - 0x24] = green; |
|
||||||
g_pwm_buffer[led.driver][led.b - 0x24] = blue; |
|
||||||
g_pwm_buffer_update_required = true; |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) |
|
||||||
{ |
|
||||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) |
|
||||||
{ |
|
||||||
IS31FL3731_set_color( i, red, green, blue ); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) |
|
||||||
{ |
|
||||||
is31_led led = g_is31_leds[index]; |
|
||||||
|
|
||||||
uint8_t control_register_r = (led.r - 0x24) / 8; |
|
||||||
uint8_t control_register_g = (led.g - 0x24) / 8; |
|
||||||
uint8_t control_register_b = (led.b - 0x24) / 8; |
|
||||||
uint8_t bit_r = (led.r - 0x24) % 8; |
|
||||||
uint8_t bit_g = (led.g - 0x24) % 8; |
|
||||||
uint8_t bit_b = (led.b - 0x24) % 8; |
|
||||||
|
|
||||||
if ( red ) { |
|
||||||
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); |
|
||||||
} else { |
|
||||||
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); |
|
||||||
} |
|
||||||
if ( green ) { |
|
||||||
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); |
|
||||||
} else { |
|
||||||
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); |
|
||||||
} |
|
||||||
if ( blue ) { |
|
||||||
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); |
|
||||||
} else { |
|
||||||
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); |
|
||||||
} |
|
||||||
|
|
||||||
g_led_control_registers_update_required = true; |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) |
|
||||||
{ |
|
||||||
if ( g_pwm_buffer_update_required ) |
|
||||||
{ |
|
||||||
IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] ); |
|
||||||
IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] ); |
|
||||||
} |
|
||||||
g_pwm_buffer_update_required = false; |
|
||||||
} |
|
||||||
|
|
||||||
void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) |
|
||||||
{ |
|
||||||
if ( g_led_control_registers_update_required ) |
|
||||||
{ |
|
||||||
for ( int i=0; i<18; i++ ) |
|
||||||
{ |
|
||||||
IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] ); |
|
||||||
IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] ); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
@ -0,0 +1,271 @@ |
|||||||
|
/* Copyright 2017 Jason Williams
|
||||||
|
* Copyright 2018 Jack Humbert |
||||||
|
* |
||||||
|
* 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/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#ifdef __AVR__ |
||||||
|
#include <avr/interrupt.h> |
||||||
|
#include <avr/io.h> |
||||||
|
#include <util/delay.h> |
||||||
|
#else |
||||||
|
#include "wait.h" |
||||||
|
#endif |
||||||
|
|
||||||
|
#include "is31fl3731.h" |
||||||
|
#include <string.h> |
||||||
|
#include "i2c_master.h" |
||||||
|
#include "progmem.h" |
||||||
|
|
||||||
|
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||||
|
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||||
|
// The address will vary depending on your wiring:
|
||||||
|
// 0b1110100 AD <-> GND
|
||||||
|
// 0b1110111 AD <-> VCC
|
||||||
|
// 0b1110101 AD <-> SCL
|
||||||
|
// 0b1110110 AD <-> SDA
|
||||||
|
#define ISSI_ADDR_DEFAULT 0x74 |
||||||
|
|
||||||
|
#define ISSI_REG_CONFIG 0x00 |
||||||
|
#define ISSI_REG_CONFIG_PICTUREMODE 0x00 |
||||||
|
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 |
||||||
|
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 |
||||||
|
|
||||||
|
#define ISSI_CONF_PICTUREMODE 0x00 |
||||||
|
#define ISSI_CONF_AUTOFRAMEMODE 0x04 |
||||||
|
#define ISSI_CONF_AUDIOMODE 0x08 |
||||||
|
|
||||||
|
#define ISSI_REG_PICTUREFRAME 0x01 |
||||||
|
|
||||||
|
#define ISSI_REG_SHUTDOWN 0x0A |
||||||
|
#define ISSI_REG_AUDIOSYNC 0x06 |
||||||
|
|
||||||
|
#define ISSI_COMMANDREGISTER 0xFD |
||||||
|
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
||||||
|
|
||||||
|
#ifndef ISSI_TIMEOUT |
||||||
|
#define ISSI_TIMEOUT 100 |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef ISSI_PERSISTENCE |
||||||
|
#define ISSI_PERSISTENCE 0 |
||||||
|
#endif |
||||||
|
|
||||||
|
// Transfer buffer for TWITransmitData()
|
||||||
|
uint8_t g_twi_transfer_buffer[20]; |
||||||
|
|
||||||
|
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
|
||||||
|
// Storing them like this is optimal for I2C transfers to the registers.
|
||||||
|
// We could optimize this and take out the unused registers from these
|
||||||
|
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
||||||
|
// probably not worth the extra complexity.
|
||||||
|
uint8_t g_pwm_buffer[DRIVER_COUNT][144]; |
||||||
|
bool g_pwm_buffer_update_required = false; |
||||||
|
|
||||||
|
uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; |
||||||
|
bool g_led_control_registers_update_required = false; |
||||||
|
|
||||||
|
// This is the bit pattern in the LED control registers
|
||||||
|
// (for matrix A, add one to register for matrix B)
|
||||||
|
//
|
||||||
|
// reg - b7 b6 b5 b4 b3 b2 b1 b0
|
||||||
|
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
|
||||||
|
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
|
||||||
|
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
|
||||||
|
// 0x06 - - , - , - , - , - ,B02,B01,B00
|
||||||
|
// 0x08 - - , - , - , - , - , - , - , -
|
||||||
|
// 0x0A - B17,B16,B15, - , - , - , - , -
|
||||||
|
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
|
||||||
|
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
||||||
|
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
||||||
|
|
||||||
|
|
||||||
|
void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data ) |
||||||
|
{ |
||||||
|
g_twi_transfer_buffer[0] = reg; |
||||||
|
g_twi_transfer_buffer[1] = data; |
||||||
|
|
||||||
|
#if ISSI_PERSISTENCE > 0 |
||||||
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { |
||||||
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) |
||||||
|
break; |
||||||
|
} |
||||||
|
#else |
||||||
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) |
||||||
|
{ |
||||||
|
// assumes bank is already selected
|
||||||
|
|
||||||
|
// transmit PWM registers in 9 transfers of 16 bytes
|
||||||
|
// g_twi_transfer_buffer[] is 20 bytes
|
||||||
|
|
||||||
|
// iterate over the pwm_buffer contents at 16 byte intervals
|
||||||
|
for ( int i = 0; i < 144; i += 16 ) { |
||||||
|
// set the first register, e.g. 0x24, 0x34, 0x44, etc.
|
||||||
|
g_twi_transfer_buffer[0] = 0x24 + i; |
||||||
|
// copy the data from i to i+15
|
||||||
|
// device will auto-increment register for data after the first byte
|
||||||
|
// thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer
|
||||||
|
for ( int j = 0; j < 16; j++ ) { |
||||||
|
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; |
||||||
|
} |
||||||
|
|
||||||
|
#if ISSI_PERSISTENCE > 0 |
||||||
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { |
||||||
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) |
||||||
|
break; |
||||||
|
} |
||||||
|
#else |
||||||
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); |
||||||
|
#endif |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_init( uint8_t addr ) |
||||||
|
{ |
||||||
|
// In order to avoid the LEDs being driven with garbage data
|
||||||
|
// in the LED driver's PWM registers, first enable software shutdown,
|
||||||
|
// then set up the mode and other settings, clear the PWM registers,
|
||||||
|
// then disable software shutdown.
|
||||||
|
|
||||||
|
// select "function register" bank
|
||||||
|
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); |
||||||
|
|
||||||
|
// enable software shutdown
|
||||||
|
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 ); |
||||||
|
// this delay was copied from other drivers, might not be needed
|
||||||
|
#ifdef __AVR__ |
||||||
|
_delay_ms( 10 ); |
||||||
|
#else |
||||||
|
wait_ms(10); |
||||||
|
#endif |
||||||
|
|
||||||
|
// picture mode
|
||||||
|
IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE ); |
||||||
|
// display frame 0
|
||||||
|
IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 ); |
||||||
|
// audio sync off
|
||||||
|
IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 ); |
||||||
|
|
||||||
|
// select bank 0
|
||||||
|
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); |
||||||
|
|
||||||
|
// turn off all LEDs in the LED control register
|
||||||
|
for ( int i = 0x00; i <= 0x11; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3731_write_register( addr, i, 0x00 ); |
||||||
|
} |
||||||
|
|
||||||
|
// turn off all LEDs in the blink control register (not really needed)
|
||||||
|
for ( int i = 0x12; i <= 0x23; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3731_write_register( addr, i, 0x00 ); |
||||||
|
} |
||||||
|
|
||||||
|
// set PWM on all LEDs to 0
|
||||||
|
for ( int i = 0x24; i <= 0xB3; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3731_write_register( addr, i, 0x00 ); |
||||||
|
} |
||||||
|
|
||||||
|
// select "function register" bank
|
||||||
|
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); |
||||||
|
|
||||||
|
// disable software shutdown
|
||||||
|
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 ); |
||||||
|
|
||||||
|
// select bank 0 and leave it selected.
|
||||||
|
// most usage after initialization is just writing PWM buffers in bank 0
|
||||||
|
// as there's not much point in double-buffering
|
||||||
|
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) |
||||||
|
{ |
||||||
|
if ( index >= 0 && index < DRIVER_LED_TOTAL ) { |
||||||
|
is31_led led = g_is31_leds[index]; |
||||||
|
|
||||||
|
// Subtract 0x24 to get the second index of g_pwm_buffer
|
||||||
|
g_pwm_buffer[led.driver][led.r - 0x24] = red; |
||||||
|
g_pwm_buffer[led.driver][led.g - 0x24] = green; |
||||||
|
g_pwm_buffer[led.driver][led.b - 0x24] = blue; |
||||||
|
g_pwm_buffer_update_required = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) |
||||||
|
{ |
||||||
|
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3731_set_color( i, red, green, blue ); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) |
||||||
|
{ |
||||||
|
is31_led led = g_is31_leds[index]; |
||||||
|
|
||||||
|
uint8_t control_register_r = (led.r - 0x24) / 8; |
||||||
|
uint8_t control_register_g = (led.g - 0x24) / 8; |
||||||
|
uint8_t control_register_b = (led.b - 0x24) / 8; |
||||||
|
uint8_t bit_r = (led.r - 0x24) % 8; |
||||||
|
uint8_t bit_g = (led.g - 0x24) % 8; |
||||||
|
uint8_t bit_b = (led.b - 0x24) % 8; |
||||||
|
|
||||||
|
if ( red ) { |
||||||
|
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); |
||||||
|
} else { |
||||||
|
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); |
||||||
|
} |
||||||
|
if ( green ) { |
||||||
|
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); |
||||||
|
} else { |
||||||
|
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); |
||||||
|
} |
||||||
|
if ( blue ) { |
||||||
|
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); |
||||||
|
} else { |
||||||
|
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); |
||||||
|
} |
||||||
|
|
||||||
|
g_led_control_registers_update_required = true; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) |
||||||
|
{ |
||||||
|
if ( g_pwm_buffer_update_required ) |
||||||
|
{ |
||||||
|
IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] ); |
||||||
|
IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] ); |
||||||
|
} |
||||||
|
g_pwm_buffer_update_required = false; |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) |
||||||
|
{ |
||||||
|
if ( g_led_control_registers_update_required ) |
||||||
|
{ |
||||||
|
for ( int i=0; i<18; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] ); |
||||||
|
IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] ); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,253 @@ |
|||||||
|
/* Copyright 2017 Jason Williams
|
||||||
|
* Copyright 2018 Jack Humbert |
||||||
|
* 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/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#ifdef __AVR__ |
||||||
|
#include <avr/interrupt.h> |
||||||
|
#include <avr/io.h> |
||||||
|
#include <util/delay.h> |
||||||
|
#else |
||||||
|
#include "wait.h" |
||||||
|
#endif |
||||||
|
|
||||||
|
#include "is31fl3733.h" |
||||||
|
#include <string.h> |
||||||
|
#include "i2c_master.h" |
||||||
|
#include "progmem.h" |
||||||
|
|
||||||
|
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||||
|
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||||
|
// The address will vary depending on your wiring:
|
||||||
|
// 00 <-> GND
|
||||||
|
// 01 <-> SCL
|
||||||
|
// 10 <-> SDA
|
||||||
|
// 11 <-> VCC
|
||||||
|
// ADDR1 represents A1:A0 of the 7-bit address.
|
||||||
|
// ADDR2 represents A3:A2 of the 7-bit address.
|
||||||
|
// The result is: 0b101(ADDR2)(ADDR1)
|
||||||
|
#define ISSI_ADDR_DEFAULT 0x50 |
||||||
|
|
||||||
|
#define ISSI_COMMANDREGISTER 0xFD |
||||||
|
#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE |
||||||
|
#define ISSI_INTERRUPTMASKREGISTER 0xF0 |
||||||
|
#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 |
||||||
|
|
||||||
|
#define ISSI_PAGE_LEDCONTROL 0x00 //PG0
|
||||||
|
#define ISSI_PAGE_PWM 0x01 //PG1
|
||||||
|
#define ISSI_PAGE_AUTOBREATH 0x02 //PG2
|
||||||
|
#define ISSI_PAGE_FUNCTION 0x03 //PG3
|
||||||
|
|
||||||
|
#define ISSI_REG_CONFIGURATION 0x00 //PG3
|
||||||
|
#define ISSI_REG_GLOBALCURRENT 0x01 //PG3
|
||||||
|
#define ISSI_REG_RESET 0x11// PG3
|
||||||
|
#define ISSI_REG_SWPULLUP 0x0F //PG3
|
||||||
|
#define ISSI_REG_CSPULLUP 0x10 //PG3
|
||||||
|
|
||||||
|
#ifndef ISSI_TIMEOUT |
||||||
|
#define ISSI_TIMEOUT 100 |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef ISSI_PERSISTENCE |
||||||
|
#define ISSI_PERSISTENCE 0 |
||||||
|
#endif |
||||||
|
|
||||||
|
// Transfer buffer for TWITransmitData()
|
||||||
|
uint8_t g_twi_transfer_buffer[20]; |
||||||
|
|
||||||
|
// These buffers match the IS31FL3733 PWM registers.
|
||||||
|
// The control buffers match the PG0 LED On/Off registers.
|
||||||
|
// Storing them like this is optimal for I2C transfers to the registers.
|
||||||
|
// We could optimize this and take out the unused registers from these
|
||||||
|
// buffers and the transfers in IS31FL3733_write_pwm_buffer() but it's
|
||||||
|
// probably not worth the extra complexity.
|
||||||
|
uint8_t g_pwm_buffer[DRIVER_COUNT][192]; |
||||||
|
bool g_pwm_buffer_update_required = false; |
||||||
|
|
||||||
|
uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 }, { 0 } }; |
||||||
|
bool g_led_control_registers_update_required = false; |
||||||
|
|
||||||
|
void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data ) |
||||||
|
{ |
||||||
|
g_twi_transfer_buffer[0] = reg; |
||||||
|
g_twi_transfer_buffer[1] = data; |
||||||
|
|
||||||
|
#if ISSI_PERSISTENCE > 0 |
||||||
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { |
||||||
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) |
||||||
|
break; |
||||||
|
} |
||||||
|
#else |
||||||
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) |
||||||
|
{ |
||||||
|
// assumes PG1 is already selected
|
||||||
|
|
||||||
|
// transmit PWM registers in 12 transfers of 16 bytes
|
||||||
|
// g_twi_transfer_buffer[] is 20 bytes
|
||||||
|
|
||||||
|
// iterate over the pwm_buffer contents at 16 byte intervals
|
||||||
|
for ( int i = 0; i < 192; i += 16 ) { |
||||||
|
g_twi_transfer_buffer[0] = i; |
||||||
|
// copy the data from i to i+15
|
||||||
|
// device will auto-increment register for data after the first byte
|
||||||
|
// thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer
|
||||||
|
for ( int j = 0; j < 16; j++ ) { |
||||||
|
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; |
||||||
|
} |
||||||
|
|
||||||
|
#if ISSI_PERSISTENCE > 0 |
||||||
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { |
||||||
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) |
||||||
|
break; |
||||||
|
} |
||||||
|
#else |
||||||
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); |
||||||
|
#endif |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_init( uint8_t addr ) |
||||||
|
{ |
||||||
|
// In order to avoid the LEDs being driven with garbage data
|
||||||
|
// in the LED driver's PWM registers, shutdown is enabled last.
|
||||||
|
// Set up the mode and other settings, clear the PWM registers,
|
||||||
|
// then disable software shutdown.
|
||||||
|
|
||||||
|
// Unlock the command register.
|
||||||
|
IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); |
||||||
|
|
||||||
|
// Select PG0
|
||||||
|
IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); |
||||||
|
// Turn off all LEDs.
|
||||||
|
for ( int i = 0x00; i <= 0x17; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3733_write_register( addr, i, 0x00 ); |
||||||
|
} |
||||||
|
|
||||||
|
// Unlock the command register.
|
||||||
|
IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); |
||||||
|
|
||||||
|
// Select PG1
|
||||||
|
IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); |
||||||
|
// Set PWM on all LEDs to 0
|
||||||
|
// No need to setup Breath registers to PWM as that is the default.
|
||||||
|
for ( int i = 0x00; i <= 0xBF; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3733_write_register( addr, i, 0x00 ); |
||||||
|
} |
||||||
|
|
||||||
|
// Unlock the command register.
|
||||||
|
IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); |
||||||
|
|
||||||
|
// Select PG3
|
||||||
|
IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION ); |
||||||
|
// Set global current to maximum.
|
||||||
|
IS31FL3733_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF ); |
||||||
|
// Disable software shutdown.
|
||||||
|
IS31FL3733_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 ); |
||||||
|
|
||||||
|
// Wait 10ms to ensure the device has woken up.
|
||||||
|
#ifdef __AVR__ |
||||||
|
_delay_ms( 10 ); |
||||||
|
#else |
||||||
|
wait_ms(10); |
||||||
|
#endif |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) |
||||||
|
{ |
||||||
|
if ( index >= 0 && index < DRIVER_LED_TOTAL ) { |
||||||
|
is31_led led = g_is31_leds[index]; |
||||||
|
|
||||||
|
g_pwm_buffer[led.driver][led.r] = red; |
||||||
|
g_pwm_buffer[led.driver][led.g] = green; |
||||||
|
g_pwm_buffer[led.driver][led.b] = blue; |
||||||
|
g_pwm_buffer_update_required = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) |
||||||
|
{ |
||||||
|
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3733_set_color( i, red, green, blue ); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) |
||||||
|
{ |
||||||
|
is31_led led = g_is31_leds[index]; |
||||||
|
|
||||||
|
uint8_t control_register_r = led.r / 8; |
||||||
|
uint8_t control_register_g = led.g / 8; |
||||||
|
uint8_t control_register_b = led.b / 8; |
||||||
|
uint8_t bit_r = led.r % 8; |
||||||
|
uint8_t bit_g = led.g % 8; |
||||||
|
uint8_t bit_b = led.b % 8; |
||||||
|
|
||||||
|
if ( red ) { |
||||||
|
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); |
||||||
|
} else { |
||||||
|
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); |
||||||
|
} |
||||||
|
if ( green ) { |
||||||
|
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); |
||||||
|
} else { |
||||||
|
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); |
||||||
|
} |
||||||
|
if ( blue ) { |
||||||
|
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); |
||||||
|
} else { |
||||||
|
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); |
||||||
|
} |
||||||
|
|
||||||
|
g_led_control_registers_update_required = true; |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) |
||||||
|
{ |
||||||
|
if ( g_pwm_buffer_update_required ) |
||||||
|
{ |
||||||
|
// Firstly we need to unlock the command register and select PG1
|
||||||
|
IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); |
||||||
|
IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); |
||||||
|
|
||||||
|
IS31FL3733_write_pwm_buffer( addr1, g_pwm_buffer[0] ); |
||||||
|
//IS31FL3733_write_pwm_buffer( addr2, g_pwm_buffer[1] );
|
||||||
|
} |
||||||
|
g_pwm_buffer_update_required = false; |
||||||
|
} |
||||||
|
|
||||||
|
void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) |
||||||
|
{ |
||||||
|
if ( g_led_control_registers_update_required ) |
||||||
|
{ |
||||||
|
// Firstly we need to unlock the command register and select PG0
|
||||||
|
IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); |
||||||
|
IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); |
||||||
|
for ( int i=0; i<24; i++ ) |
||||||
|
{ |
||||||
|
IS31FL3733_write_register(addr1, i, g_led_control_registers[0][i] ); |
||||||
|
//IS31FL3733_write_register(addr2, i, g_led_control_registers[1][i] );
|
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,255 @@ |
|||||||
|
/* Copyright 2017 Jason Williams
|
||||||
|
* Copyright 2018 Jack Humbert |
||||||
|
* 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/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
|
||||||
|
#ifndef IS31FL3733_DRIVER_H |
||||||
|
#define IS31FL3733_DRIVER_H |
||||||
|
|
||||||
|
#include <stdint.h> |
||||||
|
#include <stdbool.h> |
||||||
|
|
||||||
|
typedef struct is31_led { |
||||||
|
uint8_t driver:2; |
||||||
|
uint8_t r; |
||||||
|
uint8_t g; |
||||||
|
uint8_t b; |
||||||
|
} __attribute__((packed)) is31_led; |
||||||
|
|
||||||
|
extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; |
||||||
|
|
||||||
|
void IS31FL3733_init( uint8_t addr ); |
||||||
|
void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data ); |
||||||
|
void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); |
||||||
|
|
||||||
|
void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); |
||||||
|
void IS31FL3733_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); |
||||||
|
|
||||||
|
void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); |
||||||
|
|
||||||
|
// This should not be called from an interrupt
|
||||||
|
// (eg. from a timer interrupt).
|
||||||
|
// Call this while idle (in between matrix scans).
|
||||||
|
// If the buffer is dirty, it will update the driver with the buffer.
|
||||||
|
void IS31FL3733_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); |
||||||
|
void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); |
||||||
|
|
||||||
|
#define A_1 0x00 |
||||||
|
#define A_2 0x01 |
||||||
|
#define A_3 0x02 |
||||||
|
#define A_4 0x03 |
||||||
|
#define A_5 0x04 |
||||||
|
#define A_6 0x05 |
||||||
|
#define A_7 0x06 |
||||||
|
#define A_8 0x07 |
||||||
|
#define A_9 0x08 |
||||||
|
#define A_10 0x09 |
||||||
|
#define A_11 0x0A |
||||||
|
#define A_12 0x0B |
||||||
|
#define A_13 0x0C |
||||||
|
#define A_14 0x0D |
||||||
|
#define A_15 0x0E |
||||||
|
#define A_16 0x0F |
||||||
|
|
||||||
|
#define B_1 0x10 |
||||||
|
#define B_2 0x11 |
||||||
|
#define B_3 0x12 |
||||||
|
#define B_4 0x13 |
||||||
|
#define B_5 0x14 |
||||||
|
#define B_6 0x15 |
||||||
|
#define B_7 0x16 |
||||||
|
#define B_8 0x17 |
||||||
|
#define B_9 0x18 |
||||||
|
#define B_10 0x19 |
||||||
|
#define B_11 0x1A |
||||||
|
#define B_12 0x1B |
||||||
|
#define B_13 0x1C |
||||||
|
#define B_14 0x1D |
||||||
|
#define B_15 0x1E |
||||||
|
#define B_16 0x1F |
||||||
|
|
||||||
|
#define C_1 0x20 |
||||||
|
#define C_2 0x21 |
||||||
|
#define C_3 0x22 |
||||||
|
#define C_4 0x23 |
||||||
|
#define C_5 0x24 |
||||||
|
#define C_6 0x25 |
||||||
|
#define C_7 0x26 |
||||||
|
#define C_8 0x27 |
||||||
|
#define C_9 0x28 |
||||||
|
#define C_10 0x29 |
||||||
|
#define C_11 0x2A |
||||||
|
#define C_12 0x2B |
||||||
|
#define C_13 0x2C |
||||||
|
#define C_14 0x2D |
||||||
|
#define C_15 0x2E |
||||||
|
#define C_16 0x2F |
||||||
|
|
||||||
|
#define D_1 0x30 |
||||||
|
#define D_2 0x31 |
||||||
|
#define D_3 0x32 |
||||||
|
#define D_4 0x33 |
||||||
|
#define D_5 0x34 |
||||||
|
#define D_6 0x35 |
||||||
|
#define D_7 0x36 |
||||||
|
#define D_8 0x37 |
||||||
|
#define D_9 0x38 |
||||||
|
#define D_10 0x39 |
||||||
|
#define D_11 0x3A |
||||||
|
#define D_12 0x3B |
||||||
|
#define D_13 0x3C |
||||||
|
#define D_14 0x3D |
||||||
|
#define D_15 0x3E |
||||||
|
#define D_16 0x3F |
||||||
|
|
||||||
|
#define E_1 0x40 |
||||||
|
#define E_2 0x41 |
||||||
|
#define E_3 0x42 |
||||||
|
#define E_4 0x43 |
||||||
|
#define E_5 0x44 |
||||||
|
#define E_6 0x45 |
||||||
|
#define E_7 0x46 |
||||||
|
#define E_8 0x47 |
||||||
|
#define E_9 0x48 |
||||||
|
#define E_10 0x49 |
||||||
|
#define E_11 0x4A |
||||||
|
#define E_12 0x4B |
||||||
|
#define E_13 0x4C |
||||||
|
#define E_14 0x4D |
||||||
|
#define E_15 0x4E |
||||||
|
#define E_16 0x4F |
||||||
|
|
||||||
|
#define F_1 0x50 |
||||||
|
#define F_2 0x51 |
||||||
|
#define F_3 0x52 |
||||||
|
#define F_4 0x53 |
||||||
|
#define F_5 0x54 |
||||||
|
#define F_6 0x55 |
||||||
|
#define F_7 0x56 |
||||||
|
#define F_8 0x57 |
||||||
|
#define F_9 0x58 |
||||||
|
#define F_10 0x59 |
||||||
|
#define F_11 0x5A |
||||||
|
#define F_12 0x5B |
||||||
|
#define F_13 0x5C |
||||||
|
#define F_14 0x5D |
||||||
|
#define F_15 0x5E |
||||||
|
#define F_16 0x5F |
||||||
|
|
||||||
|
#define G_1 0x60 |
||||||
|
#define G_2 0x61 |
||||||
|
#define G_3 0x62 |
||||||
|
#define G_4 0x63 |
||||||
|
#define G_5 0x64 |
||||||
|
#define G_6 0x65 |
||||||
|
#define G_7 0x66 |
||||||
|
#define G_8 0x67 |
||||||
|
#define G_9 0x68 |
||||||
|
#define G_10 0x69 |
||||||
|
#define G_11 0x6A |
||||||
|
#define G_12 0x6B |
||||||
|
#define G_13 0x6C |
||||||
|
#define G_14 0x6D |
||||||
|
#define G_15 0x6E |
||||||
|
#define G_16 0x6F |
||||||
|
|
||||||
|
#define H_1 0x70 |
||||||
|
#define H_2 0x71 |
||||||
|
#define H_3 0x72 |
||||||
|
#define H_4 0x73 |
||||||
|
#define H_5 0x74 |
||||||
|
#define H_6 0x75 |
||||||
|
#define H_7 0x76 |
||||||
|
#define H_8 0x77 |
||||||
|
#define H_9 0x78 |
||||||
|
#define H_10 0x79 |
||||||
|
#define H_11 0x7A |
||||||
|
#define H_12 0x7B |
||||||
|
#define H_13 0x7C |
||||||
|
#define H_14 0x7D |
||||||
|
#define H_15 0x7E |
||||||
|
#define H_16 0x7F |
||||||
|
|
||||||
|
#define I_1 0x80 |
||||||
|
#define I_2 0x81 |
||||||
|
#define I_3 0x82 |
||||||
|
#define I_4 0x83 |
||||||
|
#define I_5 0x84 |
||||||
|
#define I_6 0x85 |
||||||
|
#define I_7 0x86 |
||||||
|
#define I_8 0x87 |
||||||
|
#define I_9 0x88 |
||||||
|
#define I_10 0x89 |
||||||
|
#define I_11 0x8A |
||||||
|
#define I_12 0x8B |
||||||
|
#define I_13 0x8C |
||||||
|
#define I_14 0x8D |
||||||
|
#define I_15 0x8E |
||||||
|
#define I_16 0x8F |
||||||
|
|
||||||
|
#define J_1 0x90 |
||||||
|
#define J_2 0x91 |
||||||
|
#define J_3 0x92 |
||||||
|
#define J_4 0x93 |
||||||
|
#define J_5 0x94 |
||||||
|
#define J_6 0x95 |
||||||
|
#define J_7 0x96 |
||||||
|
#define J_8 0x97 |
||||||
|
#define J_9 0x98 |
||||||
|
#define J_10 0x99 |
||||||
|
#define J_11 0x9A |
||||||
|
#define J_12 0x9B |
||||||
|
#define J_13 0x9C |
||||||
|
#define J_14 0x9D |
||||||
|
#define J_15 0x9E |
||||||
|
#define J_16 0x9F |
||||||
|
|
||||||
|
#define K_1 0xA0 |
||||||
|
#define K_2 0xA1 |
||||||
|
#define K_3 0xA2 |
||||||
|
#define K_4 0xA3 |
||||||
|
#define K_5 0xA4 |
||||||
|
#define K_6 0xA5 |
||||||
|
#define K_7 0xA6 |
||||||
|
#define K_8 0xA7 |
||||||
|
#define K_9 0xA8 |
||||||
|
#define K_10 0xA9 |
||||||
|
#define K_11 0xAA |
||||||
|
#define K_12 0xAB |
||||||
|
#define K_13 0xAC |
||||||
|
#define K_14 0xAD |
||||||
|
#define K_15 0xAE |
||||||
|
#define K_16 0xAF |
||||||
|
|
||||||
|
#define L_1 0xB0 |
||||||
|
#define L_2 0xB1 |
||||||
|
#define L_3 0xB2 |
||||||
|
#define L_4 0xB3 |
||||||
|
#define L_5 0xB4 |
||||||
|
#define L_6 0xB5 |
||||||
|
#define L_7 0xB6 |
||||||
|
#define L_8 0xB7 |
||||||
|
#define L_9 0xB8 |
||||||
|
#define L_10 0xB9 |
||||||
|
#define L_11 0xBA |
||||||
|
#define L_12 0xBB |
||||||
|
#define L_13 0xBC |
||||||
|
#define L_14 0xBD |
||||||
|
#define L_15 0xBE |
||||||
|
#define L_16 0xBF |
||||||
|
|
||||||
|
#endif // IS31FL3733_DRIVER_H
|
@ -0,0 +1,43 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* 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 "1up60hse.h" |
||||||
|
|
||||||
|
void matrix_init_kb(void) { |
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user(); |
||||||
|
} |
||||||
|
|
||||||
|
void matrix_scan_kb(void) { |
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user(); |
||||||
|
} |
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { |
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record); |
||||||
|
} |
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) { |
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led); |
||||||
|
} |
@ -0,0 +1,39 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* 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/>.
|
||||||
|
*/ |
||||||
|
#ifndef KB_H |
||||||
|
#define KB_H |
||||||
|
|
||||||
|
#include "quantum.h" |
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments representing the physical
|
||||||
|
// layout of the board and position of the keys
|
||||||
|
// The second converts the arguments into a two-dimensional array which
|
||||||
|
// represents the switch matrix.
|
||||||
|
#define LAYOUT_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, K1D, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \
|
||||||
|
K40, K41, K42, K45, K49, K4A, K4B, K4D \
|
||||||
|
) { \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \
|
||||||
|
{ K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, K4D } \
|
||||||
|
} |
||||||
|
#endif |
@ -0,0 +1,224 @@ |
|||||||
|
/*
|
||||||
|
Copyright 2018 MechMerlin |
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 2 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "config_common.h" |
||||||
|
|
||||||
|
/* USB Device descriptor parameter */ |
||||||
|
#define VENDOR_ID 0xFEED |
||||||
|
#define PRODUCT_ID 0x0000 |
||||||
|
#define DEVICE_VER 0x0001 |
||||||
|
#define MANUFACTURER 1upkeyboards |
||||||
|
#define PRODUCT 1up60hse |
||||||
|
#define DESCRIPTION A custom 60% keyboard |
||||||
|
|
||||||
|
/* key matrix size */ |
||||||
|
#define MATRIX_ROWS 5 |
||||||
|
#define MATRIX_COLS 14 |
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments |
||||||
|
* |
||||||
|
* Change this to how you wired your keyboard |
||||||
|
* COLS: AVR pins used for columns, left to right |
||||||
|
* ROWS: AVR pins used for rows, top to bottom |
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) |
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) |
||||||
|
* |
||||||
|
*/ |
||||||
|
#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } |
||||||
|
#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, E6, D1, D0, D2, D3, D5, D6, D7 } |
||||||
|
#define UNUSED_PINS |
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ |
||||||
|
#define DIODE_DIRECTION COL2ROW |
||||||
|
|
||||||
|
#define BACKLIGHT_PIN B7 |
||||||
|
#define BACKLIGHT_BREATHING |
||||||
|
#define BACKLIGHT_LEVELS 5 |
||||||
|
|
||||||
|
#define RGB_DI_PIN F0 |
||||||
|
#ifdef RGB_DI_PIN |
||||||
|
#define RGBLIGHT_ANIMATIONS |
||||||
|
#define RGBLED_NUM 14 |
||||||
|
#define RGBLIGHT_HUE_STEP 8 |
||||||
|
#define RGBLIGHT_SAT_STEP 8 |
||||||
|
#define RGBLIGHT_VAL_STEP 8 |
||||||
|
#endif |
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ |
||||||
|
#define DEBOUNCING_DELAY 5 |
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */ |
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */ |
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
||||||
|
#define LOCKING_SUPPORT_ENABLE |
||||||
|
/* Locking resynchronize hack */ |
||||||
|
#define LOCKING_RESYNC_ENABLE |
||||||
|
|
||||||
|
/* 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 */ |
||||||
|
#define IS_COMMAND() ( \ |
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
) |
||||||
|
|
||||||
|
/* control how magic key switches layers */ |
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */ |
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP1 H
|
||||||
|
//#define MAGIC_KEY_HELP2 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_ALT1 ESC
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#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 PAUSE
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options |
||||||
|
* These options are also useful to firmware size reduction. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* disable debug print */ |
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */ |
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */ |
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 |
||||||
|
*/ |
||||||
|
|
@ -0,0 +1,12 @@ |
|||||||
|
{ |
||||||
|
"keyboard_name": "1up60hse", |
||||||
|
"url": "", |
||||||
|
"maintainer": "qmk", |
||||||
|
"width": 15, |
||||||
|
"height": 5, |
||||||
|
"layouts": { |
||||||
|
"LAYOUT_60_ansi": { |
||||||
|
"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}] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
// place overrides here
|
@ -0,0 +1,44 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
#include QMK_KEYBOARD_H |
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
||||||
|
[0] = LAYOUT_60_ansi( |
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RGUI, KC_RCTL), |
||||||
|
|
||||||
|
[1] = LAYOUT_60_ansi( |
||||||
|
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_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
||||||
|
|
||||||
|
[2] = LAYOUT_60_ansi( |
||||||
|
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_STEP, BL_DEC, BL_INC, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), |
||||||
|
}; |
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
@ -0,0 +1,6 @@ |
|||||||
|
# 1up60hse default keymap |
||||||
|
|
||||||
|
This is the default keymap provided by [1upkeyboards](https://www.1upkeyboards.com). |
||||||
|
|
||||||
|
## Notes |
||||||
|
- Software reset key is located on `Esc` on the third layer. |
@ -0,0 +1,15 @@ |
|||||||
|
# 1up60hse (hot swap edition) |
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
A 60% PCB with USB C, RGB underglow, backlighting, hotswappable switches, and a standard ANSI layout. |
||||||
|
|
||||||
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) |
||||||
|
Hardware Supported: 1up60hse 60% PCB. |
||||||
|
Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-pcb-hse/) |
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment): |
||||||
|
|
||||||
|
make 1upkeyboards/1up60hse:default |
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). |
@ -0,0 +1,72 @@ |
|||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
|
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
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
|
||||||
|
LAYOUTS = 60_ansi
|
@ -0,0 +1,130 @@ |
|||||||
|
//****************************************************************************//
|
||||||
|
// raffle's keymap for the 1up60rgb. //
|
||||||
|
// emulates my pok3r layout and adds RGB control + firmware reset/debug //
|
||||||
|
// layers //
|
||||||
|
//****************************************************************************//
|
||||||
|
|
||||||
|
//************************ dependencies + definitions ************************//
|
||||||
|
#include QMK_KEYBOARD_H |
||||||
|
|
||||||
|
// create names for layers
|
||||||
|
enum layers { |
||||||
|
_typing, |
||||||
|
_raise, |
||||||
|
_rgb, |
||||||
|
_adjust |
||||||
|
}; |
||||||
|
|
||||||
|
// define layer mods
|
||||||
|
#define RAISE MO(_raise) |
||||||
|
#define RGB MO(_rgb) |
||||||
|
|
||||||
|
// define mod masks for making multi-key macros
|
||||||
|
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) |
||||||
|
#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) |
||||||
|
#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) |
||||||
|
|
||||||
|
//********************************** Layers **********************************//
|
||||||
|
// define layers
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
||||||
|
// typing layer to handle basic typing
|
||||||
|
[_typing] = LAYOUT_all |
||||||
|
( |
||||||
|
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, |
||||||
|
KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, |
||||||
|
RAISE, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RGB, KC_RCTL |
||||||
|
), |
||||||
|
// raise layer to handle function & nav keys
|
||||||
|
[_raise] = LAYOUT_all |
||||||
|
( |
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, |
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, |
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, |
||||||
|
KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS |
||||||
|
), |
||||||
|
// rgb layer for pretty backlight colors
|
||||||
|
[_rgb] = LAYOUT_all |
||||||
|
( |
||||||
|
RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, RGB_VAI, RGB_HUD, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, RGB_SAI, RGB_VAD,RGB_SAD, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO |
||||||
|
), |
||||||
|
// adjust to handle firmware debug + reset mode
|
||||||
|
[_adjust] = LAYOUT_all |
||||||
|
( |
||||||
|
RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, |
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO |
||||||
|
) |
||||||
|
}; |
||||||
|
|
||||||
|
//***************************** Function bodies *****************************//
|
||||||
|
// enable tri-layer state for _raise + _rgb = _adjust
|
||||||
|
uint32_t layer_state_set_user(uint32_t state) { |
||||||
|
return update_tri_layer_state(state, _raise, _rgb, _adjust); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// scan matrix
|
||||||
|
void matrix_scan_user(void) { |
||||||
|
} |
||||||
|
|
||||||
|
// support for standard mod state keys (caps lock, scroll lock, etc.)
|
||||||
|
void led_set_user(uint8_t usb_led) { |
||||||
|
|
||||||
|
if (usb_led & (1 << USB_LED_NUM_LOCK)) { |
||||||
|
|
||||||
|
} else { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { |
||||||
|
DDRB |= (1 << 2); PORTB &= ~(1 << 2); |
||||||
|
} else { |
||||||
|
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); |
||||||
|
} |
||||||
|
|
||||||
|
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { |
||||||
|
|
||||||
|
} else { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
if (usb_led & (1 << USB_LED_COMPOSE)) { |
||||||
|
|
||||||
|
} else { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
if (usb_led & (1 << USB_LED_KANA)) { |
||||||
|
|
||||||
|
} else { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
//*********** Empty fxns from default map that I'm not modifying ***********//
|
||||||
|
// onboard macro support
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { |
||||||
|
; |
||||||
|
|
||||||
|
switch (id) { |
||||||
|
|
||||||
|
} |
||||||
|
return MACRO_NONE; |
||||||
|
} |
||||||
|
|
||||||
|
// initialize matrix
|
||||||
|
void matrix_init_user(void) { |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,43 @@ |
|||||||
|
## raffle's keymap |
||||||
|
The default keymap is just enough to get started. This keymap adds a pok3r-like |
||||||
|
raise layer, backlight RGB control layer, and firmware reset/debug adjust layer |
||||||
|
for ANSI layouts. |
||||||
|
|
||||||
|
In the default layer, the following modifications are made (using standard ANSI |
||||||
|
keys for LHS): |
||||||
|
|
||||||
|
- `CAPS` = `LCTRL` |
||||||
|
- `LCTRL` = `RAISE` |
||||||
|
- `APP` = `RGB` |
||||||
|
- `LCTRL` + `APP` (`RAISE` + `RGB`) = `ADJUST` |
||||||
|
- `GRV` = `ESC` |
||||||
|
|
||||||
|
Additionally, the pok3r's `SHIFT` + `ESC` for `~` is maintained (with either `SHIFT`). |
||||||
|
|
||||||
|
### Raise Layer |
||||||
|
Emulates standard pok3r layout (without the onboard macro keys) |
||||||
|
|
||||||
|
Highlights: |
||||||
|
|
||||||
|
- `IJKL` for arrow keys |
||||||
|
- `H`/`N` for `HOME`/`END` |
||||||
|
- `U`/`P` for `PGUP`/`PGDN` |
||||||
|
- `1` - `=` for `F1` - `F12` |
||||||
|
- `Y` for calculator |
||||||
|
|
||||||
|
Other standard keys from the pok3r layout are carried over. See the keymap or |
||||||
|
the pok3r documentation for details. |
||||||
|
|
||||||
|
### RGB Layer |
||||||
|
Uses navigation keys from `RAISE` layer for RGB adjustment |
||||||
|
|
||||||
|
- `I`/`K` for Value (brightness) Increase/Decrease |
||||||
|
- `U`/`P` for Hue (color) Increase/Decrease |
||||||
|
- `H`/`N` for Saturation Incrase/Decrease |
||||||
|
- `GRV` to toggle RGB on/off |
||||||
|
- `1`-`9` to activate QMK's predefined RGB animations |
||||||
|
|
||||||
|
### Adjust Layer |
||||||
|
|
||||||
|
- `GRV` activates firmware reset for flashing |
||||||
|
- `1` enters debug mode |
@ -0,0 +1,5 @@ |
|||||||
|
# 1UP Keyboards |
||||||
|
|
||||||
|
Website: [1UP Keyboards](https://www.1upkeyboards.com/) |
||||||
|
Discord: [Server Invite](https://discordapp.com/invite/c6SYn8) |
||||||
|
YouTube: [skiwithpete](https://www.youtube.com/user/skiwithpete) |
@ -1,4 +1,5 @@ |
|||||||
#include "tv44.h" |
|
||||||
|
#include "5x5.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
|
@ -0,0 +1,57 @@ |
|||||||
|
|
||||||
|
#ifndef FIVEX5_H |
||||||
|
#define FIVEX5_H |
||||||
|
|
||||||
|
#include "quantum.h" |
||||||
|
#define ___ KC_NO |
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
|
||||||
|
#define LAYOUT_ortho_5x5( \ |
||||||
|
K00, K01, K02, K03, K04, \
|
||||||
|
K10, K11, K12, K13, K14, \
|
||||||
|
K20, K21, K22, K23, K24, \
|
||||||
|
K30, K31, K32, K33, K34, \
|
||||||
|
K40, K41, K42, K43, K44 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K10, K11, K12, K13, K14, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K20, K21, K22, K23, K24, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K30, K31, K32, K33, K34, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K40, K41, K42, K43, K44, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \
|
||||||
|
} |
||||||
|
|
||||||
|
#define LAYOUT_ortho_5x10( \ |
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, \
|
||||||
|
K40, K41, K42, K43, K44, K45, K46, K47, K48, K49 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, ___, ___, ___, ___, ___}, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \
|
||||||
|
} |
||||||
|
|
||||||
|
#define LAYOUT_ortho_5x15( \ |
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, \
|
||||||
|
K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \
|
||||||
|
} |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,208 @@ |
|||||||
|
|
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "config_common.h" |
||||||
|
|
||||||
|
/* USB Device descriptor parameter */ |
||||||
|
#define VENDOR_ID 0xFEED |
||||||
|
#define PRODUCT_ID 0x0A0C |
||||||
|
#define DEVICE_VER 0x05B5 |
||||||
|
#define MANUFACTURER di0ib |
||||||
|
#define PRODUCT The 5x5 Keyboard |
||||||
|
#define DESCRIPTION A 25 or 50 or 75 key keyboard |
||||||
|
|
||||||
|
/* key matrix size */ |
||||||
|
#define MATRIX_ROWS 5 |
||||||
|
#define MATRIX_COLS 15 |
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments |
||||||
|
* |
||||||
|
* Change this to how you wired your keyboard |
||||||
|
* COLS: AVR pins used for columns, left to right |
||||||
|
* ROWS: AVR pins used for rows, top to bottom |
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) |
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) |
||||||
|
* |
||||||
|
*/ |
||||||
|
#define MATRIX_ROW_PINS { B2, D1, D0, D4, C6 } |
||||||
|
#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } |
||||||
|
#define UNUSED_PINS |
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ |
||||||
|
#define DIODE_DIRECTION COL2ROW |
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
// #define RGB_DI_PIN E2
|
||||||
|
// #ifdef RGB_DI_PIN
|
||||||
|
// #define RGBLIGHT_ANIMATIONS
|
||||||
|
// #define RGBLED_NUM 16
|
||||||
|
// #define RGBLIGHT_HUE_STEP 8
|
||||||
|
// #define RGBLIGHT_SAT_STEP 8
|
||||||
|
// #define RGBLIGHT_VAL_STEP 8
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ |
||||||
|
#define DEBOUNCING_DELAY 5 |
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */ |
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */ |
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
||||||
|
#define LOCKING_SUPPORT_ENABLE |
||||||
|
/* Locking resynchronize hack */ |
||||||
|
#define LOCKING_RESYNC_ENABLE |
||||||
|
|
||||||
|
/* 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 */ |
||||||
|
#define IS_COMMAND() ( \ |
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
) |
||||||
|
|
||||||
|
/* control how magic key switches layers */ |
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */ |
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP1 H
|
||||||
|
//#define MAGIC_KEY_HELP2 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_ALT1 ESC
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#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 PAUSE
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options |
||||||
|
* These options are also useful to firmware size reduction. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* disable debug print */ |
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */ |
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */ |
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 |
||||||
|
*/ |
@ -0,0 +1,5 @@ |
|||||||
|
|
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
// place overrides here
|
@ -0,0 +1,139 @@ |
|||||||
|
|
||||||
|
#include QMK_KEYBOARD_H |
||||||
|
|
||||||
|
#define PAD 0 |
||||||
|
#define _QW 1 |
||||||
|
#define NUM 2 |
||||||
|
#define DIR 3 |
||||||
|
|
||||||
|
// Readability keycodes
|
||||||
|
#define _______ KC_TRNS |
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
||||||
|
|
||||||
|
/* Single 5x5 board only
|
||||||
|
* .--------------------------------------------. |
||||||
|
* | QWERTY | / | * | - | | |
||||||
|
* |--------+--------+--------+--------+--------| |
||||||
|
* | 7 | 8 | 9 | + | | |
||||||
|
* |--------+--------+--------+--------+--------| |
||||||
|
* | 4 | 5 | 6 | + | | |
||||||
|
* |--------+--------+--------+--------+--------| |
||||||
|
* | 1 | 2 | 3 | ENTER | | |
||||||
|
* |--------+--------+--------+--------+--------| |
||||||
|
* | 0 | 0 | . | ENTER | | |
||||||
|
* '--------------------------------------------' |
||||||
|
*/ |
||||||
|
|
||||||
|
[PAD] = LAYOUT_ortho_5x5( |
||||||
|
DF(_QW), KC_PSLS, KC_PAST, KC_PMNS, _______, |
||||||
|
KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, _______, |
||||||
|
KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, |
||||||
|
KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, |
||||||
|
KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PENT, _______ |
||||||
|
), |
||||||
|
|
||||||
|
/* QWERTY
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------. |
||||||
|
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | |
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------' |
||||||
|
*/ |
||||||
|
|
||||||
|
[_QW] = LAYOUT_ortho_5x15( |
||||||
|
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, |
||||||
|
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, |
||||||
|
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, |
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, |
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT |
||||||
|
), |
||||||
|
|
||||||
|
/* NUMBERS
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------. |
||||||
|
* | | | | | | | | | | | | | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | |
||||||
|
* | | | | | | | | | | |CTRLhold| | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | | | | | | | ENTER | SHIFT | | | | | | | | |
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------' |
||||||
|
*/ |
||||||
|
|
||||||
|
[NUM] = LAYOUT_ortho_5x15( |
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
||||||
|
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, |
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, |
||||||
|
_______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, |
||||||
|
_______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ |
||||||
|
), |
||||||
|
|
||||||
|
/* DIRECTIONS
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------. |
||||||
|
* | | | | | | | | | | | | | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | | P-Brk | | | | | | | RGUI | ALT | | | | | | |
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| |
||||||
|
* | KEYPAD | | | | | | | | | | | | | | | |
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------' |
||||||
|
*/ |
||||||
|
|
||||||
|
[DIR] = LAYOUT_ortho_5x15( |
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, |
||||||
|
RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, |
||||||
|
KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, |
||||||
|
_______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, |
||||||
|
DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ |
||||||
|
), |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = { |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) |
||||||
|
{ |
||||||
|
// MACRODOWN only works in this function
|
||||||
|
switch(id) { |
||||||
|
case 0: |
||||||
|
if (record->event.pressed) { |
||||||
|
register_code(KC_RSFT); |
||||||
|
} else { |
||||||
|
unregister_code(KC_RSFT); |
||||||
|
} |
||||||
|
break; |
||||||
|
} |
||||||
|
return MACRO_NONE; |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void matrix_scan_user(void) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,23 @@ |
|||||||
|
# 5x5 |
||||||
|
|
||||||
|
 |
||||||
|
=== |
||||||
|
|
||||||
|
**Modular Keypad/Keyboard** |
||||||
|
The basic unit is a 5x5 matrix with 25 keys. Up to 3 of these can be connected to each other side by side. |
||||||
|
5x5, 5x10, and 5x15 matrices are possible. |
||||||
|
There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. |
||||||
|
**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** |
||||||
|
|
||||||
|
* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/5x5) |
||||||
|
|
||||||
|
Keyboard Maintainer: QMK Community |
||||||
|
Hardware Supported: 5x5 PCB |
||||||
|
Hardware Availability: [5x5 project on 40% Keyboards](http://www.40percent.club/2018/04/5x5.html) |
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment): |
||||||
|
|
||||||
|
make 5x5:default |
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. |
||||||
|
First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. |
@ -0,0 +1,74 @@ |
|||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
# Bootloader
|
||||||
|
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||||
|
# different sizes, comment this out, and the correct address will be loaded
|
||||||
|
# automatically (+60). See bootloader.mk for all options.
|
||||||
|
BOOTLOADER = caterina
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
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
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
|
||||||
|
LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15
|
@ -0,0 +1,224 @@ |
|||||||
|
/*
|
||||||
|
Copyright 2018 MechMerlin |
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU General Public License as published by |
||||||
|
the Free Software Foundation, either version 2 of the License, or |
||||||
|
(at your option) any later version. |
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU General Public License for more details. |
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License |
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include "config_common.h" |
||||||
|
|
||||||
|
/* USB Device descriptor parameter */ |
||||||
|
#define VENDOR_ID 0xFEED |
||||||
|
#define PRODUCT_ID 0x0000 |
||||||
|
#define DEVICE_VER 0x0001 |
||||||
|
#define MANUFACTURER Alf |
||||||
|
#define PRODUCT dc60 |
||||||
|
#define DESCRIPTION custom 60% keyboard |
||||||
|
|
||||||
|
/* key matrix size */ |
||||||
|
#define MATRIX_ROWS 5 |
||||||
|
#define MATRIX_COLS 15 |
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments |
||||||
|
* |
||||||
|
* Change this to how you wired your keyboard |
||||||
|
* COLS: AVR pins used for columns, left to right |
||||||
|
* ROWS: AVR pins used for rows, top to bottom |
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) |
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) |
||||||
|
* |
||||||
|
*/ |
||||||
|
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } |
||||||
|
#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } |
||||||
|
#define UNUSED_PINS |
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ |
||||||
|
#define DIODE_DIRECTION COL2ROW |
||||||
|
|
||||||
|
#define BACKLIGHT_PIN B6 |
||||||
|
#define BACKLIGHT_BREATHING |
||||||
|
#define BACKLIGHT_LEVELS 5 |
||||||
|
|
||||||
|
#define RGB_DI_PIN E6 |
||||||
|
#ifdef RGB_DI_PIN |
||||||
|
#define RGBLIGHT_ANIMATIONS |
||||||
|
#define RGBLED_NUM 20 |
||||||
|
#define RGBLIGHT_HUE_STEP 8 |
||||||
|
#define RGBLIGHT_SAT_STEP 8 |
||||||
|
#define RGBLIGHT_VAL_STEP 8 |
||||||
|
#endif |
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ |
||||||
|
#define DEBOUNCING_DELAY 5 |
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */ |
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */ |
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ |
||||||
|
#define LOCKING_SUPPORT_ENABLE |
||||||
|
/* Locking resynchronize hack */ |
||||||
|
#define LOCKING_RESYNC_ENABLE |
||||||
|
|
||||||
|
/* 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 */ |
||||||
|
#define IS_COMMAND() ( \ |
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
) |
||||||
|
|
||||||
|
/* control how magic key switches layers */ |
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */ |
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP1 H
|
||||||
|
//#define MAGIC_KEY_HELP2 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_ALT1 ESC
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#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 PAUSE
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options |
||||||
|
* These options are also useful to firmware size reduction. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* disable debug print */ |
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */ |
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */ |
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 |
||||||
|
*/ |
||||||
|
|
@ -0,0 +1,49 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* 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 "dc60.h" |
||||||
|
|
||||||
|
void matrix_init_kb(void) { |
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user(); |
||||||
|
} |
||||||
|
|
||||||
|
void matrix_scan_kb(void) { |
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user(); |
||||||
|
} |
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) { |
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record); |
||||||
|
} |
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) { |
||||||
|
if (usb_led & (1 << USB_LED_CAPS_LOCK)) { |
||||||
|
DDRB |= (1 << 7); |
||||||
|
PORTB &= ~(1 << 7); |
||||||
|
} else { |
||||||
|
DDRB &= ~(1 << 7); |
||||||
|
PORTB &= ~(1 << 7); |
||||||
|
} |
||||||
|
|
||||||
|
led_set_user(usb_led); |
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* 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/>.
|
||||||
|
*/ |
||||||
|
#ifndef DC60_H |
||||||
|
#define DC60_H |
||||||
|
|
||||||
|
#include "quantum.h" |
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The following is an example using the Planck MIT layout
|
||||||
|
// The first section contains all of the arguments representing the physical
|
||||||
|
// layout of the board and position of the keys
|
||||||
|
// The second converts the arguments into a two-dimensional array which
|
||||||
|
// represents the switch matrix.
|
||||||
|
#define LAYOUT( \ |
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE, \
|
||||||
|
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
||||||
|
K20, 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, K3E, \
|
||||||
|
K40, K42, K43, K45, K47, K48, K4A, K4B, K4C, K4D, K4E \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \
|
||||||
|
{ K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
|
||||||
|
{ K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \
|
||||||
|
{ K40, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \
|
||||||
|
} |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,12 @@ |
|||||||
|
{ |
||||||
|
"keyboard_name": "dc60", |
||||||
|
"url": "", |
||||||
|
"maintainer": "qmk", |
||||||
|
"width": 15, |
||||||
|
"height": 5, |
||||||
|
"layouts": { |
||||||
|
"LAYOUT": { |
||||||
|
"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}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
// place overrides here
|
@ -0,0 +1,70 @@ |
|||||||
|
/* Copyright 2018 MechMerlin
|
||||||
|
* |
||||||
|
* This program is free software: you can redistribute it and/or modify |
||||||
|
* it under the terms of the GNU General Public License as published by |
||||||
|
* the Free Software Foundation, either version 2 of the License, or |
||||||
|
* (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/ |
||||||
|
#include QMK_KEYBOARD_H |
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
||||||
|
[0] = LAYOUT( |
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, |
||||||
|
KC_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_SPACE, KC_SPACE, KC_SPACE, KC_RALT, MO(1), KC_RGUI, KC_RGUI, KC_RCTL |
||||||
|
), |
||||||
|
|
||||||
|
[1] = LAYOUT( |
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, |
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, |
||||||
|
KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, |
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS |
||||||
|
), |
||||||
|
}; |
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = { |
||||||
|
|
||||||
|
}; |
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) |
||||||
|
{ |
||||||
|
// MACRODOWN only works in this function
|
||||||
|
switch(id) { |
||||||
|
case 0: |
||||||
|
if (record->event.pressed) { |
||||||
|
register_code(KC_RSFT); |
||||||
|
} else { |
||||||
|
unregister_code(KC_RSFT); |
||||||
|
} |
||||||
|
break; |
||||||
|
} |
||||||
|
return MACRO_NONE; |
||||||
|
}; |
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void matrix_scan_user(void) { |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) { |
||||||
|
|
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
# The default keymap for dc60 |
@ -0,0 +1,15 @@ |
|||||||
|
# dc60 |
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
A 60% PCB sold with the Alf DC60. |
||||||
|
|
||||||
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) |
||||||
|
Hardware Supported: DC60 PCB |
||||||
|
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=96616.0) |
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment): |
||||||
|
|
||||||
|
make alf/dc60:default |
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). |
@ -0,0 +1,70 @@ |
|||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
|
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
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
@ -0,0 +1,15 @@ |
|||||||
|
# X2 |
||||||
|
|
||||||
|
 |
||||||
|
|
||||||
|
A customizable 60% keyboard. |
||||||
|
|
||||||
|
Keyboard Maintainer: QMK Community |
||||||
|
Hardware Supported: ALF X2 60% |
||||||
|
Hardware Availability: [zFrontier](https://en.zfrontier.com/products/group-buy-alf-x2-60) |
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment): |
||||||
|
|
||||||
|
make alf/x2:default |
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). |
@ -0,0 +1 @@ |
|||||||
|
#include "x2.h" |
@ -1 +0,0 @@ |
|||||||
#include "alf_x2.h" |
|
@ -1,15 +0,0 @@ |
|||||||
# ALF X2 |
|
||||||
|
|
||||||
 |
|
||||||
|
|
||||||
A customizable 60% keyboard. |
|
||||||
|
|
||||||
Keyboard Maintainer: QMK Community |
|
||||||
Hardware Supported: ALF X2 60% |
|
||||||
Hardware Availability: [zFrontier](https://en.zfrontier.com/products/group-buy-alf-x2-60) |
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment): |
|
||||||
|
|
||||||
make alf_x2:default |
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. |
|
@ -0,0 +1 @@ |
|||||||
|
#include "at101_blackheart.h" |
@ -0,0 +1,28 @@ |
|||||||
|
#ifndef at101_blackheart_H |
||||||
|
#define at101_blackheart_H |
||||||
|
|
||||||
|
#include "quantum.h" |
||||||
|
|
||||||
|
#define LAYOUT( \ |
||||||
|
K0000, K0100, K0001, K0101, K0002, K0102, K0003, K0103, K0004, K0104, K0005, K0105, K0006, K0106, K0007, K0107, \
|
||||||
|
K0200, K0300, K0201, K0301, K0202, K0302, K0203, K0303, K0204, K0304, K0205, K0305, K0206, K0306, K0207, K0307, K0208, K0308, K0209, K0309, K0009, \
|
||||||
|
K0400, K0500, K0401, K0501, K0402, K0502, K0403, K0503, K0404, K0504, K0405, K0505, K0406, K0506, K0407, K0507, K0408, K0508, K0409, K0509, K0109, \
|
||||||
|
K0600, K0700, K0601, K0701, K0602, K0702, K0603, K0703, K0604, K0704, K0605, K0705, K0606, K0608, K0708, K0609, K0709, \
|
||||||
|
K0800, K1101, K0900, K0801, K0901, K0802, K0902, K0803, K0903, K0804, K0904, K0805, K0905, K0806, K0807, K0808, K0908, K0809, K0909, \
|
||||||
|
K1000, K1100, K1001, K1102, K1005, K1105, K1006, K1106, K1007, K1107, K1008, K1108, K1009 \
|
||||||
|
) { \
|
||||||
|
{ K0000, K0001, K0002, K0003, K0004, K0005, K0006, K0007, KC_NO, K0009 }, \
|
||||||
|
{ K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, KC_NO, K0109 }, \
|
||||||
|
{ K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209 }, \
|
||||||
|
{ K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309 }, \
|
||||||
|
{ K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409 }, \
|
||||||
|
{ K0500, K0501, K0502, K0503, K0504, K0505, K0506, K0507, K0508, K0509 }, \
|
||||||
|
{ K0600, K0601, K0602, K0603, K0604, K0605, K0606, KC_NO, K0608, K0609 }, \
|
||||||
|
{ K0700, K0701, K0702, K0703, K0704, K0705, KC_NO, KC_NO, K0708, K0709 }, \
|
||||||
|
{ K0800, K0801, K0802, K0803, K0804, K0805, K0806, K0807, K0808, K0809 }, \
|
||||||
|
{ K0900, K0901, K0902, K0903, K0904, K0905, KC_NO, KC_NO, K0908, K0909 }, \
|
||||||
|
{ K1000, K1001, KC_NO, KC_NO, KC_NO, K1005, K1006, K1007, K1008, K1009 }, \
|
||||||
|
{ K1100, K1101, K1102, KC_NO, KC_NO, K1105, K1106, K1107, K1108, KC_NO } \
|
||||||
|
} |
||||||
|
|
||||||
|
#endif |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue