Merge branch 'master' into hf/shinydox

internal/led_qa
Erez Zukerman 7 years ago
commit 5272218ac9

@ -11,6 +11,7 @@
"*.h": "c",
"*.c": "c",
"*.cpp": "cpp",
"*.hpp": "cpp"
"*.hpp": "cpp",
"xstddef": "c"
}
}
}

@ -117,7 +117,7 @@ endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
OPT_DEFS += -DRGB_MATRIX_ENABLE
SRC += is31fl3731.c
SRC += TWIlib.c
SRC += i2c_master.c
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgb_matrix.c
CIE1931_CURVE = yes

@ -81,7 +81,6 @@ These are the effects that are currently available:
enum rgb_matrix_effects {
RGB_MATRIX_SOLID_COLOR = 1,
RGB_MATRIX_SOLID_REACTIVE,
RGB_MATRIX_ALPHAS_MODS,
RGB_MATRIX_DUAL_BEACON,
RGB_MATRIX_GRADIENT_UP_DOWN,
@ -94,6 +93,7 @@ These are the effects that are currently available:
RGB_MATRIX_RAINBOW_MOVING_CHEVRON,
RGB_MATRIX_JELLYBEAN_RAINDROPS,
#ifdef RGB_MATRIX_KEYPRESSES
RGB_MATRIX_SOLID_REACTIVE,
RGB_MATRIX_SPLASH,
RGB_MATRIX_MULTISPLASH,
RGB_MATRIX_SOLID_SPLASH,
@ -118,7 +118,7 @@ A similar function works in the keymap as `rgb_matrix_indicators_user`.
#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
#define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect)
#define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1
## EEPROM storage

@ -19,8 +19,10 @@ First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feat
This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options:
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
* `ACTION_TAP_DANCE_DUAL_ROLE(kc, layer)`: Sends the `kc` keycode when tapped once, or moves to `layer`. (this functions like the `TO` layer keycode).
* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
** `ACTION_TAP_DANCE_FN_ADVANCED_TIME(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn, tap_specific_tapping_term)`: This functions identically to the `ACTION_TAP_DANCE_FN_ADVANCED` function, but uses a custom tapping term for it, instead of the predefined `TAPPING_TERM`.
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.

@ -14,7 +14,7 @@ The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`,
The `<target>` means the following
* If no target is given, then it's the same as `all` below
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
* `dfu`, `teensy` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
* `dfu`, `teensy`, `avrdude` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.

@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css" title="light">
<link rel="stylesheet" href="qmk.css" title="dark" disabled>
<link rel="stylesheet" href="sidebar.css" />
</head>
<body>
<div id="app"></div>

@ -0,0 +1,10 @@
.sidebar-toggle {
position: absolute;
top: 0;
bottom: auto;
left: 0;
}
.search {
margin-top: 40px;
}

@ -1,232 +0,0 @@
/*
* TWIlib.c
*
* Created: 6/01/2014 10:41:33 PM
* Author: Chris Herring
* http://www.chrisherring.net/all/tutorial-interrupt-driven-twi-interface-for-avr-part1/
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include "TWIlib.h"
#include "util/delay.h"
void TWIInit()
{
TWIInfo.mode = Ready;
TWIInfo.errorCode = 0xFF;
TWIInfo.repStart = 0;
// Set pre-scalers (no pre-scaling)
TWSR = 0;
// Set bit rate
TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
// Enable TWI and interrupt
TWCR = (1 << TWIE) | (1 << TWEN);
}
uint8_t isTWIReady()
{
if ( (TWIInfo.mode == Ready) | (TWIInfo.mode == RepeatedStartSent) )
{
return 1;
}
else
{
return 0;
}
}
uint8_t TWITransmitData(void *const TXdata, uint8_t dataLen, uint8_t repStart)
{
if (dataLen <= TXMAXBUFLEN)
{
// Wait until ready
while (!isTWIReady()) {_delay_us(1);}
// Set repeated start mode
TWIInfo.repStart = repStart;
// Copy data into the transmit buffer
uint8_t *data = (uint8_t *)TXdata;
for (int i = 0; i < dataLen; i++)
{
TWITransmitBuffer[i] = data[i];
}
// Copy transmit info to global variables
TXBuffLen = dataLen;
TXBuffIndex = 0;
// If a repeated start has been sent, then devices are already listening for an address
// and another start does not need to be sent.
if (TWIInfo.mode == RepeatedStartSent)
{
TWIInfo.mode = Initializing;
TWDR = TWITransmitBuffer[TXBuffIndex++]; // Load data to transmit buffer
TWISendTransmit(); // Send the data
}
else // Otherwise, just send the normal start signal to begin transmission.
{
TWIInfo.mode = Initializing;
TWISendStart();
}
}
else
{
return 1; // return an error if data length is longer than buffer
}
return 0;
}
uint8_t TWIReadData(uint8_t TWIaddr, uint8_t bytesToRead, uint8_t repStart)
{
// Check if number of bytes to read can fit in the RXbuffer
if (bytesToRead < RXMAXBUFLEN)
{
// Reset buffer index and set RXBuffLen to the number of bytes to read
RXBuffIndex = 0;
RXBuffLen = bytesToRead;
// Create the one value array for the address to be transmitted
uint8_t TXdata[1];
// Shift the address and AND a 1 into the read write bit (set to write mode)
TXdata[0] = (TWIaddr << 1) | 0x01;
// Use the TWITransmitData function to initialize the transfer and address the slave
TWITransmitData(TXdata, 1, repStart);
}
else
{
return 0;
}
return 1;
}
ISR (TWI_vect)
{
switch (TWI_STATUS)
{
// ----\/ ---- MASTER TRANSMITTER OR WRITING ADDRESS ----\/ ---- //
case TWI_MT_SLAW_ACK: // SLA+W transmitted and ACK received
// Set mode to Master Transmitter
TWIInfo.mode = MasterTransmitter;
case TWI_START_SENT: // Start condition has been transmitted
case TWI_MT_DATA_ACK: // Data byte has been transmitted, ACK received
if (TXBuffIndex < TXBuffLen) // If there is more data to send
{
TWDR = TWITransmitBuffer[TXBuffIndex++]; // Load data to transmit buffer
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
TWISendTransmit(); // Send the data
}
// This transmission is complete however do not release bus yet
else if (TWIInfo.repStart)
{
TWIInfo.errorCode = 0xFF;
TWISendStart();
}
// All transmissions are complete, exit
else
{
TWIInfo.mode = Ready;
TWIInfo.errorCode = 0xFF;
TWISendStop();
}
break;
// ----\/ ---- MASTER RECEIVER ----\/ ---- //
case TWI_MR_SLAR_ACK: // SLA+R has been transmitted, ACK has been received
// Switch to Master Receiver mode
TWIInfo.mode = MasterReceiver;
// If there is more than one byte to be read, receive data byte and return an ACK
if (RXBuffIndex < RXBuffLen-1)
{
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
TWISendACK();
}
// Otherwise when a data byte (the only data byte) is received, return NACK
else
{
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
TWISendNACK();
}
break;
case TWI_MR_DATA_ACK: // Data has been received, ACK has been transmitted.
/// -- HANDLE DATA BYTE --- ///
TWIReceiveBuffer[RXBuffIndex++] = TWDR;
// If there is more than one byte to be read, receive data byte and return an ACK
if (RXBuffIndex < RXBuffLen-1)
{
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
TWISendACK();
}
// Otherwise when a data byte (the only data byte) is received, return NACK
else
{
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
TWISendNACK();
}
break;
case TWI_MR_DATA_NACK: // Data byte has been received, NACK has been transmitted. End of transmission.
/// -- HANDLE DATA BYTE --- ///
TWIReceiveBuffer[RXBuffIndex++] = TWDR;
// This transmission is complete however do not release bus yet
if (TWIInfo.repStart)
{
TWIInfo.errorCode = 0xFF;
TWISendStart();
}
// All transmissions are complete, exit
else
{
TWIInfo.mode = Ready;
TWIInfo.errorCode = 0xFF;
TWISendStop();
}
break;
// ----\/ ---- MT and MR common ----\/ ---- //
case TWI_MR_SLAR_NACK: // SLA+R transmitted, NACK received
case TWI_MT_SLAW_NACK: // SLA+W transmitted, NACK received
case TWI_MT_DATA_NACK: // Data byte has been transmitted, NACK received
case TWI_LOST_ARBIT: // Arbitration has been lost
// Return error and send stop and set mode to ready
if (TWIInfo.repStart)
{
TWIInfo.errorCode = TWI_STATUS;
TWISendStart();
}
// All transmissions are complete, exit
else
{
TWIInfo.mode = Ready;
TWIInfo.errorCode = TWI_STATUS;
TWISendStop();
}
break;
case TWI_REP_START_SENT: // Repeated start has been transmitted
// Set the mode but DO NOT clear TWINT as the next data is not yet ready
TWIInfo.mode = RepeatedStartSent;
break;
// ----\/ ---- SLAVE RECEIVER ----\/ ---- //
// TODO IMPLEMENT SLAVE RECEIVER FUNCTIONALITY
// ----\/ ---- SLAVE TRANSMITTER ----\/ ---- //
// TODO IMPLEMENT SLAVE TRANSMITTER FUNCTIONALITY
// ----\/ ---- MISCELLANEOUS STATES ----\/ ---- //
case TWI_NO_RELEVANT_INFO: // It is not really possible to get into this ISR on this condition
// Rather, it is there to be manually set between operations
break;
case TWI_ILLEGAL_START_STOP: // Illegal START/STOP, abort and return error
TWIInfo.errorCode = TWI_ILLEGAL_START_STOP;
TWIInfo.mode = Ready;
TWISendStop();
break;
}
}

@ -1,82 +0,0 @@
/*
* TWIlib.h
*
* Created: 6/01/2014 10:38:42 PM
* Author: Chris Herring
* http://www.chrisherring.net/all/tutorial-interrupt-driven-twi-interface-for-avr-part1/
*/
#ifndef TWILIB_H_
#define TWILIB_H_
// TWI bit rate (was 100000)
#define TWI_FREQ 400000
// Get TWI status
#define TWI_STATUS (TWSR & 0xF8)
// Transmit buffer length
#define TXMAXBUFLEN 20
// Receive buffer length
#define RXMAXBUFLEN 20
// Global transmit buffer
uint8_t TWITransmitBuffer[TXMAXBUFLEN];
// Global receive buffer
volatile uint8_t TWIReceiveBuffer[RXMAXBUFLEN];
// Buffer indexes
volatile int TXBuffIndex; // Index of the transmit buffer. Is volatile, can change at any time.
int RXBuffIndex; // Current index in the receive buffer
// Buffer lengths
int TXBuffLen; // The total length of the transmit buffer
int RXBuffLen; // The total number of bytes to read (should be less than RXMAXBUFFLEN)
typedef enum {
Ready,
Initializing,
RepeatedStartSent,
MasterTransmitter,
MasterReceiver,
SlaceTransmitter,
SlaveReciever
} TWIMode;
typedef struct TWIInfoStruct{
TWIMode mode;
uint8_t errorCode;
uint8_t repStart;
}TWIInfoStruct;
TWIInfoStruct TWIInfo;
// TWI Status Codes
#define TWI_START_SENT 0x08 // Start sent
#define TWI_REP_START_SENT 0x10 // Repeated Start sent
// Master Transmitter Mode
#define TWI_MT_SLAW_ACK 0x18 // SLA+W sent and ACK received
#define TWI_MT_SLAW_NACK 0x20 // SLA+W sent and NACK received
#define TWI_MT_DATA_ACK 0x28 // DATA sent and ACK received
#define TWI_MT_DATA_NACK 0x30 // DATA sent and NACK received
// Master Receiver Mode
#define TWI_MR_SLAR_ACK 0x40 // SLA+R sent, ACK received
#define TWI_MR_SLAR_NACK 0x48 // SLA+R sent, NACK received
#define TWI_MR_DATA_ACK 0x50 // Data received, ACK returned
#define TWI_MR_DATA_NACK 0x58 // Data received, NACK returned
// Miscellaneous States
#define TWI_LOST_ARBIT 0x38 // Arbitration has been lost
#define TWI_NO_RELEVANT_INFO 0xF8 // No relevant information available
#define TWI_ILLEGAL_START_STOP 0x00 // Illegal START or STOP condition has been detected
#define TWI_SUCCESS 0xFF // Successful transfer, this state is impossible from TWSR as bit2 is 0 and read only
#define TWISendStart() (TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN)|(1<<TWIE)) // Send the START signal, enable interrupts and TWI, clear TWINT flag to resume transfer.
#define TWISendStop() (TWCR = (1<<TWINT)|(1<<TWSTO)|(1<<TWEN)|(1<<TWIE)) // Send the STOP signal, enable interrupts and TWI, clear TWINT flag.
#define TWISendTransmit() (TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWIE)) // Used to resume a transfer, clear TWINT and ensure that TWI and interrupts are enabled.
#define TWISendACK() (TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWIE)|(1<<TWEA)) // FOR MR mode. Resume a transfer, ensure that TWI and interrupts are enabled and respond with an ACK if the device is addressed as a slave or after it receives a byte.
#define TWISendNACK() (TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWIE)) // FOR MR mode. Resume a transfer, ensure that TWI and interrupts are enabled but DO NOT respond with an ACK if the device is addressed as a slave or after it receives a byte.
// Function declarations
uint8_t TWITransmitData(void *const TXdata, uint8_t dataLen, uint8_t repStart);
void TWIInit(void);
uint8_t TWIReadData(uint8_t TWIaddr, uint8_t bytesToRead, uint8_t repStart);
uint8_t isTWIReady(void);
#endif // TWICOMMS_H_

@ -0,0 +1,149 @@
/* Library made by: g4lvanix
* Github repository: https://github.com/g4lvanix/I2C-master-lib
*/
#include <avr/io.h>
#include <util/twi.h>
#include "i2c_master.h"
#define F_SCL 400000UL // SCL frequency
#define Prescaler 1
#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16 ) / 2)
void i2c_init(void)
{
TWBR = (uint8_t)TWBR_val;
}
uint8_t i2c_start(uint8_t address)
{
// reset TWI control register
TWCR = 0;
// transmit START condition
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
// wait for end of transmission
while( !(TWCR & (1<<TWINT)) );
// check if the start condition was successfully transmitted
if((TWSR & 0xF8) != TW_START){ return 1; }
// load slave address into data register
TWDR = address;
// start transmission of address
TWCR = (1<<TWINT) | (1<<TWEN);
// wait for end of transmission
while( !(TWCR & (1<<TWINT)) );
// check if the device has acknowledged the READ / WRITE mode
uint8_t twst = TW_STATUS & 0xF8;
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
return 0;
}
uint8_t i2c_write(uint8_t data)
{
// load data into data register
TWDR = data;
// start transmission of data
TWCR = (1<<TWINT) | (1<<TWEN);
// wait for end of transmission
while( !(TWCR & (1<<TWINT)) );
if( (TWSR & 0xF8) != TW_MT_DATA_ACK ){ return 1; }
return 0;
}
uint8_t i2c_read_ack(void)
{
// start TWI module and acknowledge data after reception
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
// wait for end of transmission
while( !(TWCR & (1<<TWINT)) );
// return received data from TWDR
return TWDR;
}
uint8_t i2c_read_nack(void)
{
// start receiving without acknowledging reception
TWCR = (1<<TWINT) | (1<<TWEN);
// wait for end of transmission
while( !(TWCR & (1<<TWINT)) );
// return received data from TWDR
return TWDR;
}
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length)
{
if (i2c_start(address | I2C_WRITE)) return 1;
for (uint16_t i = 0; i < length; i++)
{
if (i2c_write(data[i])) return 1;
}
i2c_stop();
return 0;
}
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length)
{
if (i2c_start(address | I2C_READ)) return 1;
for (uint16_t i = 0; i < (length-1); i++)
{
data[i] = i2c_read_ack();
}
data[(length-1)] = i2c_read_nack();
i2c_stop();
return 0;
}
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
{
if (i2c_start(devaddr | 0x00)) return 1;
i2c_write(regaddr);
for (uint16_t i = 0; i < length; i++)
{
if (i2c_write(data[i])) return 1;
}
i2c_stop();
return 0;
}
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
{
if (i2c_start(devaddr)) return 1;
i2c_write(regaddr);
if (i2c_start(devaddr | 0x01)) return 1;
for (uint16_t i = 0; i < (length-1); i++)
{
data[i] = i2c_read_ack();
}
data[(length-1)] = i2c_read_nack();
i2c_stop();
return 0;
}
void i2c_stop(void)
{
// transmit STOP condition
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
}

@ -0,0 +1,22 @@
/* Library made by: g4lvanix
* Github repository: https://github.com/g4lvanix/I2C-master-lib
*/
#ifndef I2C_MASTER_H
#define I2C_MASTER_H
#define I2C_READ 0x01
#define I2C_WRITE 0x00
void i2c_init(void);
uint8_t i2c_start(uint8_t address);
uint8_t i2c_write(uint8_t data);
uint8_t i2c_read_ack(void);
uint8_t i2c_read_nack(void);
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length);
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length);
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
void i2c_stop(void);
#endif // I2C_MASTER_H

@ -20,7 +20,7 @@
#include <avr/io.h>
#include <util/delay.h>
#include <string.h>
#include "TWIlib.h"
#include "i2c_master.h"
#include "progmem.h"
// This is a 7-bit address, that gets left-shifted and bit 0
@ -50,7 +50,7 @@
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
// Transfer buffer for TWITransmitData()
uint8_t g_twi_transfer_buffer[TXMAXBUFLEN];
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.
@ -80,17 +80,11 @@ bool g_led_control_registers_update_required = false;
void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data )
{
g_twi_transfer_buffer[0] = (addr << 1) | 0x00;
g_twi_transfer_buffer[1] = reg;
g_twi_transfer_buffer[2] = data;
// Set the error code to have no relevant information
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
// Continuously attempt to transmit data until a successful transmission occurs
//while ( TWIInfo.errorCode != 0xFF )
//{
TWITransmitData( g_twi_transfer_buffer, 3, 0 );
//}
g_twi_transfer_buffer[0] = reg;
g_twi_transfer_buffer[1] = data;
//Transmit data until succesful
while(i2c_transmit(addr << 1, g_twi_transfer_buffer,2) != 0);
}
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
@ -100,29 +94,21 @@ void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
// transmit PWM registers in 9 transfers of 16 bytes
// g_twi_transfer_buffer[] is 20 bytes
// set the I2C address
g_twi_transfer_buffer[0] = (addr << 1) | 0x00;
// 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[1] = 0x24 + i;
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[2 + j] = pwm_buffer[i + j];
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
}
// Set the error code to have no relevant information
TWIInfo.errorCode = TWI_NO_RELEVANT_INFO;
// Continuously attempt to transmit data until a successful transmission occurs
while ( TWIInfo.errorCode != 0xFF )
{
TWITransmitData( g_twi_transfer_buffer, 16 + 2, 0 );
}
//Transmit buffer until succesful
while(i2c_transmit(addr << 1, g_twi_transfer_buffer,17) != 0);
}
}

@ -63,4 +63,19 @@
K400, K401, K403, K406, K410, K411, K413, K414 \
)
/* HHKB Variant */
#define LAYOUT_60_hhkb( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
K401, K403, K406, K411, K413 \
) LAYOUT_all( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \
K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
KC_NO,K401, K403, K406, KC_NO,K411, K413, KC_NO \
)
#endif

@ -19,6 +19,9 @@
"LAYOUT_60_ansi_split_bs_rshift": {
"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":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":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"label":"Alt", "x":10, "y":4, "w":1.5}, {"label":"Win", "x":11.5, "y":4}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
},
"LAYOUT_60_hhkb": {
"layout": [{"label":"Esc", "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":"|", "x":13, "y":0}, {"label":"~", "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":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "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":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}]
}
}
}

@ -55,4 +55,4 @@ BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
AUDIO_ENABLE ?= no
RGBLIGHT_ENABLE ?= yes
LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift
LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift 60_hhkb

@ -0,0 +1,23 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include QMK_KEYBOARD_CONFIG_H
#define PREVENT_STUCK_MODIFIERS
#define SPACE_COUNT 3
#define TEMPLATE( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
{ K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO }\
}
#endif

@ -0,0 +1 @@
// This space intentionally left blank

@ -1 +1,30 @@
#include "ca66.h"
#include "config.h"
void bootmagic_lite(void)
{
// The lite version of TMK's bootmagic.
// 100% less potential for accidentally making the
// keyboard do stupid things.
// We need multiple scans because debouncing can't be turned off.
matrix_scan();
wait_ms(DEBOUNCING_DELAY);
matrix_scan();
// If the Esc (matrix 0,0) is held down on power up,
// reset the EEPROM valid state and jump to bootloader.
if ( matrix_get_row(0) & (1<<0) )
{
// Set the TMK/QMK EEPROM state as invalid.
eeconfig_disable();
// Jump to bootloader.
bootloader_jump();
}
}
void matrix_init_kb(void)
{
bootmagic_lite();
matrix_init_user();
}

@ -6,9 +6,11 @@ Keyboard Maintainer: [James Underwood](https://github.com/ju0)
Hardware Supported: naKey
Hardware Availability: [ckeys.org](https://ckeys.org)
To build this keyboard, follow the [build guide](https://ckeys.org/tutorials/nakey-numpad-build-guide/).
Make example for this keyboard (after setting up your build environment):
make nakey:default
make ckeys/nakey: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.
@ -18,7 +20,7 @@ For the full Quantum feature list, see [the parent readme](/).
## Building
Download or clone the whole firmware and navigate to the root folder. Once your dev env is setup, you'll be able to type `make naKey-default` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
Download or clone the whole firmware and navigate to the root folder. Once your dev env is setup, you'll be able to type `make ckeys/nakey:default` to generate your .hex - you can then use the Teensy Loader to program your .hex file.
(Note: replace naKey with the name of your keyboard.)
@ -26,7 +28,7 @@ Depending on which keymap you would like to use, you will have to compile slight
### Default
To build with the default keymap, simply run `make naKey-default`.
To build with the default keymap, simply run `make ckeys/nakey:default`.
### Other Keymaps

@ -5,15 +5,15 @@ Obelus
Keyboard Maintaintainers: [Ethan Madden](https://github.com/jetpacktuxedo), [James Underwood](https://github.com/ju0)
Hardware Supported: Obelus
Hardware Availability: C-Keys soldering workshops, /u/MonkeyPlusPlus
Hardware Availability: [C-Keys soldering workshops](https://ckeys.org/workshops/), [/u/MonkeyPlusPlus](https://www.reddit.com/user/monkeyplusplus)
Make example for this keyboard (after setting up your build environment):
make obelus:default
make ckeys/obelus:default
Or to make and flash:
make obelus:default:dfu
make ckeys/obelus:default:dfu
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) and [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.

@ -0,0 +1,9 @@
# Ckeys.org
[ckeys](https://ckeys.org/) is a mechanical keyboard based non profit, located in Seattle, Washington.
In addition, to hosting the [Seattle Mechanical Keyboard Meetups](https://ckeys.org/events/), they have [soldering workshops](https://ckeys.org/workshops/) featuring hardware hosted in this repository.
* Supported Hardware
* The Obelus - 4x4 Macropad
* naKey - Through hole numpad

@ -91,5 +91,20 @@
{ K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \
}
#define LAYOUT_60_ansi( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
K400, K401, K403, K406, K410, K411, K413, K414 \
) { \
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
{ K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
{ K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \
{ K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
{ K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 } \
}
#endif

@ -27,6 +27,10 @@
"LAYOUT_all": {
"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}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"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}]
},
"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,17 @@
#ifndef CONFIG_KEYMAP_H
#define CONFIG_KEYMAP_H
#include "../../config.h"
// help for fast typist+dual function keys?
#define PERMISSIVE_HOLD
/* speed up mousekeys a bit */
#define MOUSEKEY_DELAY 50
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_MAX_SPEED 8
#define MOUSEKEY_TIME_TO_MAX 30
#define MOUSEKEY_WHEEL_MAX_SPEED 8
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
#endif

@ -0,0 +1,92 @@
#include QMK_KEYBOARD_H
#include "xtonhasvim.h"
enum layers {
_QWERTY,
_FUN,
_MOVE,
_MOUSE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,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_LALT, KC_LGUI, VIM_START, TG(_MOUSE), KC_SPC, KC_RGUI, KC_RALT, X_____X, KC_RCTL, MO(_FUN)),
[_FUN] = LAYOUT(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______,
TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_MOVE] = LAYOUT(
X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X,
X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, X_____X, X_____X,
X_____X, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X, X_____X,
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______,
TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_MOUSE] = LAYOUT(
X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X,
X_____X, X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X, X_____X, X_____X,
X_____X, X_____X,KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, X_____X,
_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______,
TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_EDIT] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
TO(_QWERTY), _______, _______, VIM_START, _______, _______, _______, _______, _______, _______, _______),
[_CMD] = LAYOUT(
X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X,
X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, X_____X, X_____X,
VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, X_____X,
VIM_SHIFT, X_____X, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT,X_____X,
TO(_QWERTY), _______, _______, TO(_QWERTY), X_____X, X_____X, _______, _______, _______, _______, _______),
};
#define LED_BIT 1 << 2
#define LED_MASK ~(1 << 2)
void user_led_on(void) {
DDRB |= LED_BIT;
PORTB &= LED_MASK;
}
void user_led_off(void) {
DDRB &= ~LED_BIT;
PORTB &= LED_MASK;
}
void matrix_init_user(void) {
user_led_off();
}
uint32_t layer_state_set_user(uint32_t state) {
static uint32_t last_state = 0;
if(last_state != state) {
switch (biton32(state)) {
case _CMD:
user_led_on();
break;
default:
user_led_off();
break;
}
last_state = state;
}
return state;
}

@ -0,0 +1,10 @@
# Xton has a DZ60 and it's Vimtastic!
Mine has a split spacebar, no arrowkeys and an opaque case. Changes from the default layout:
* Vim mode toggled by hitting left spacebar (see `users/xtonhasvim`). Reusing the capslock LED to indicate VIM is on.
* Momentary directional control by holding down `;`.
* Mousekeys toggled with middle space button.
* Escape is dual-function with control (which replaces capslock AS IT SHOULD BE).
* Bottom left key is the "halp my kb doesn't work" key that always dumps you back to QWERTY.

@ -53,4 +53,6 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
LAYOUTS = 60_ansi

@ -34,8 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define MASTER_RIGHT
// #define EE_HANDS
#define TAPPING_TERM 120
#define TAPPING_TOGGLE 3
/* Use RGB Underglow */
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS

@ -17,7 +17,7 @@ extern keymap_config_t keymap_config;
#define _ADJUST 4
enum custom_keycodes {
QWERTY = SAFE_RANGE, // デフォルトレイヤー用
QWERTY = SAFE_RANGE, // QWERTYレイヤーへ
MCR1, // マクロ1
MCR2, // マクロ2
MCR3, // マクロ3
@ -35,14 +35,17 @@ enum custom_keycodes {
#define KC_RASE LT(_RAISE, KC_HENK) // タップで変換 ホールドでRaise
#define KC_LSLB MT(MOD_LSFT, JP_LBRC) // タップで[ ホールドで左Shift
#define KC_RSRB MT(MOD_RSFT, JP_RBRC) // タップで] ホールドで右Shift
#define KC_ALTB MT(MOD_LALT, KC_TAB) // タップでTAB ホールドで左ALT
#define KC_ESCA LT(_ADJUST,KC_ESC) // タップでESC ホールドでADJUSTレイヤーon
#define KC_ALTB MT(MOD_LALT, KC_TAB) // タップでTAB ホールドで左Alt
#define CTL_ZH CTL_T(KC_ZKHK) // タップで半角/全角 ホールドで左Control (Windows)
#define WN_CAPS S(KC_CAPS) // Caps Lock (Windows)
#define KC_ALPS LALT(KC_PSCR) // Alt + PrintScreen
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define GAME DF(_GAME)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
/* QWERTY // WindowsでJIS配列時のデフォルトキーマップ
* ,-------------------------------------------------------. ,-------------------------------------------------------.
* |Tab/Alt| Q | W | E | R | T | - | | ~ | Y | U | I | O | P | BSPC |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
@ -50,97 +53,123 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | [/Sft | Z | X | C | V | B | F2 | | Home | N | M | , | . | / | ]/Sft |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | TT | GUI | \ | Esc/ | LOWER | Enter | Del | | End | Space | RAISE | Left | Down | Up | Right |
* |(_GAME)| | |_ADJUST| | | | | | | | | | | |
* |WN CAPS| GUI | \ | Esc | | Enter | Del | | End | Space | | Left | Down | Up | Right |
* | | | | | LOWER | | | | | | RAISE | | | | |
* `-------------------------------------------------------' `-------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
KC_ALTB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, JP_TILD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
CTL_ZH, KC_A, KC_S, KC_D, KC_F, KC_G, JP_LPRN, JP_RPRN, KC_H, KC_J, KC_K, KC_L, WN_SCLN, JP_QUOT, \
KC_LSLB, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_HOME, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSRB, \
TT(_GAME),KC_LGUI, JP_YEN, KC_ESCA, KC_LOWR, KC_ENT, KC_DEL, KC_END, KC_SPC, KC_RASE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
KC_ALTB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, JP_TILD, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
CTL_ZH, KC_A, KC_S, KC_D, KC_F, KC_G, JP_LPRN, JP_RPRN, KC_H, KC_J, KC_K, KC_L, WN_SCLN, JP_QUOT, \
KC_LSLB, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_HOME, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSRB, \
WN_CAPS, KC_LGUI, JP_YEN, KC_ESC, KC_LOWR, KC_ENT, KC_DEL, KC_END, KC_SPC, KC_RASE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* LOWER
/* LOWER // 数字入力用レイヤー
* ,-------------------------------------------------------. ,-------------------------------------------------------.
* |Tab/Alt| 1 | 2 | 3 | 4 | 5 | 6 | | Esc | 7 | 8 | 9 | O | = | BSPC |
* | | 1 | 2 | 3 | 4 | 5 | 6 | | Esc | 7 | 8 | 9 | . | = | |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* |ZH/Ctrl| F1 | F2 | F3 | F4 | F5 | F6 | | F2 | 4 | 5 | 6 | - | / | Enter |
* | | F1 | F2 | F3 | F4 | F5 | F6 | | F2 | 4 | 5 | 6 | - | / | Enter |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | Shift | F7 | F8 | F9 | F10 | F11 | F12 | | Home | 1 | 2 | 3 | + | * | Shift |
* | Shift | F7 | F8 | F9 | F10 | F11 | F12 | | | 1 | 2 | 3 | + | * | Shift |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* |XXXXXXX| GUI |XXXXXXX| Esc | | Enter | Del | | End | 0 | . | Left | Down | Up | Right |
* | | |XXXXXXX| | | | | | | 0 | | | | | |
* `-------------------------------------------------------' `-------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_ESC, KC_7, KC_8, KC_9, KC_0, JP_EQL, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F2, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PSLS, KC_ENT, \
KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PAST, KC_RSFT, \
_______, _______, XXXXXXX, KC_ESC, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, _______, _______ \
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_ESC, KC_7, KC_8, KC_9, KC_PDOT, JP_EQL, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F2, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PSLS, KC_ENT, \
KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PAST, KC_RSFT, \
_______, _______, XXXXXXX, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______, _______ \
),
/* RAISE
/* RAISE // 記号入力用レイヤー
* ,-------------------------------------------------------. ,-------------------------------------------------------.
* |Tab/Alt| ! | @ | # | $ | % | _ | | ` | ^ | & | Ins | \ |PrntScr| BSPC |
* | | ! | @ | # | $ | % | _ | | ` | ^ | & | Ins | \ |PrntScr| |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* |ZH/Ctrl|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| { | | } | Left | Down | Up | Right | ; | " |
* | |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| { | | } | Left | Down | Up | Right | ; | " |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | Shift |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| |PageUp |XXXXXXX|XXXXXXX| < | > | ? | Shift |
* | Shift |M-PLAY |M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR| |PageUp |XXXXXXX|XXXXXXX| < | > | ? | Shift |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* |XXXXXXX| GUI | | | Esc |XXXXXXX| Enter | Del | |PageDwn| Space | | Left | Down | Up | Right |
* | | | | | | | | | |PageDwn| | | | | | |
* `-------------------------------------------------------' `-------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
_______, KC_EXLM, JP_AT, KC_HASH, KC_DLR, KC_PERC, JP_UNDS, JP_GRV, JP_CIRC, JP_AMPR, KC_INS, JP_YEN, KC_ALPS, _______, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, JP_LCBR, JP_RCBR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, JP_DQT, \
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, KC_LT, KC_GT, KC_QUES, KC_RSFT, \
_______, _______, JP_PIPE, KC_ESC, XXXXXXX, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ \
_______, KC_EXLM, JP_AT, KC_HASH, KC_DLR, KC_PERC, JP_UNDS, JP_GRV, JP_CIRC, JP_AMPR, KC_INS, JP_YEN, KC_ALPS, _______, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, JP_LCBR, JP_RCBR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_SCLN, JP_DQT, \
KC_LSFT, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, KC_PGUP, XXXXXXX, XXXXXXX, KC_LT, KC_GT, KC_QUES, KC_RSFT, \
_______, _______, JP_PIPE, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______ \
),
/* GAME
/* GAME // 左手はゲーム用レイヤー、右手はNumPad
* ,-------------------------------------------------------. ,-------------------------------------------------------.
* | Esc | Q | W | E | R | T |PrntScr| | | | | | | | |
* | Tab | Q | W | E | R | T |PrntScr| | Esc | 7 | 8 | 9 | . | = | BSPC |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | Ctrl | A | S | D | F | G | F5 | | | | | | | | |
* | Ctrl | A | S | D | F | G | F1 | | F2 | 4 | 5 | 6 | - | / | Enter |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | Shift | Z | X | C | V | B | F2 | |PageUp | | | | | | |
* | Shift | Z | X | C | V | B | F2 | | Home | 1 | 2 | 3 | + | * | Shift |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | | GUI | Tab | Alt | Space | Enter | Del | |PageDwn| Space |XXXXXXX| Left | Down | Up | Right |
* | Del | GUI | Alt | Esc | LOWER | Space | Enter | | End | 0 | RAISE | Left | Down | Up | Right |
* `-------------------------------------------------------' `-------------------------------------------------------'
*/
[_GAME] = KEYMAP( \
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ALPS, _______, _______, _______, _______, _______, _______, _______, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, JP_LBRC, _______, _______, _______, _______, _______, _______, _______, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_PGUP, _______, _______, _______, _______, _______, _______, \
_______, KC_LGUI, KC_TAB, KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_PGDN, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ALPS, KC_ESC, KC_P7, KC_P8, KC_P9, KC_PDOT, JP_EQL, KC_BSPC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_F2, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_PSLS, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_HOME, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PAST, KC_RSFT, \
KC_DEL, KC_LGUI, KC_LALT, KC_ESC, LOWER, KC_SPC, KC_ENT, KC_PGDN, KC_P0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* ADJUST
/* ADJUST // 設定用レイヤー (LOWER+RAISE)
* ,-------------------------------------------------------. ,-------------------------------------------------------.
* |RGB_TOG| MCR1 | MCR2 | MCR3 |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|PLAY_M1|PLAY_M2|REC_M1 |REC_M2 |STP_REC| BSPC |
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | RESET |RGB_MOD|_PLAIN |_BREATH|RGB_HuI|RGB_SaI|RGB_VaI| |XXXXXXX|QWERTY |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|
* | RESET | | | | | | | |XXXXXXX|XXXXXXX|QWERTY | GAME |XXXXXXX|XXXXXXX|XXXXXXX|
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | Shift |_RAINBW|_SNAKE |_GRADIE|RGB_HuD|RGB_SaD|RGB_VaD| |XXXXXXX| M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR|
* | Shift | | | | | | | |XXXXXXX| M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR|
* |-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
* | DEBUG |XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| Left | Down | Up | Right |
* | DEBUG |XXXXXXX|XXXXXXX| | |XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX| | Left | Down | Up | Right |
* `-------------------------------------------------------' `-------------------------------------------------------'
*/
[_ADJUST] = KEYMAP( \
RGB_TOG, MCR1, MCR2, MCR3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, DYN_REC_START1, DYN_REC_START2, DYN_REC_STOP, KC_BSPC, \
RESET, RGB_MOD, RGB_M_P, RGB_M_B, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, QWERTY, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
KC_LSFT, RGB_M_R, RGB_M_SN,RGB_M_G, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, \
DEBUG, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
RGB_TOG, MCR1, MCR2, MCR3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, DYN_REC_START1, DYN_REC_START2, DYN_REC_STOP, KC_BSPC, \
RESET, RGB_MOD, RGB_M_P, RGB_M_B, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, QWERTY, GAME, XXXXXXX, XXXXXXX, XXXXXXX, \
KC_LSFT, RGB_M_R, RGB_M_SN,RGB_M_G, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPRV, KC_MNXT, \
DEBUG, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
// RGB Underglow使用時のレイヤー毎のカラー切り替え
uint32_t layer_state_set_keymap (uint32_t state) {
return state;
}
void matrix_init_user(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_enable();
rgblight_setrgb_teal();
#endif
}
uint32_t layer_state_set_user(uint32_t state) {
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#ifdef RGBLIGHT_ENABLE
switch (biton32(state)) {
case _RAISE:
rgblight_setrgb_chartreuse(); // RAISE:シャルトリューズ
break;
case _LOWER:
rgblight_setrgb_pink(); // LOWER:ピンク
break;
case _ADJUST:
rgblight_setrgb_red(); // ADJUST:レッド
break;
default: // for any other layers, or the default layer
rgblight_setrgb_teal(); // 他:ティール
break;
}
#endif
return state;
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
@ -151,7 +180,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
@ -171,19 +200,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
break;
case MCR1:
if (record->event.pressed) {
SEND_STRING("hogehoge"); // 送信文字列
SEND_STRING("hoge"); // 送信文字列
}
return false;
break;
case MCR2:
if (record->event.pressed) {
SEND_STRING("hogehogehoge"SS_TAP(X_ENTER)); // 送信文字列
SEND_STRING("hogehoge"SS_TAP(X_ENTER)); // 送信文字列
}
return false;
break;
case MCR3:
if (record->event.pressed) {
SEND_STRING("hoge@hoge.co.jp"); // 送信文字列
SEND_STRING("hoge@hoge.hoge"); // 送信文字列
}
return false;
break;

@ -6,62 +6,62 @@ Designed for Japanese Keyboardists using JIS on the Ergo42.
````
QWERTY
,-------------------------------------------------------. ,-------------------------------------------------------.
|Tab/Alt| Q | W | E | R | T | - | | ~ | Y | U | I | O | P | BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
|ZH/Ctrl| A | S | D | F | G | ( | | ) | H | J | K | L | : | ' |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| [/Sft | Z | X | C | V | B | F2 | | Home | N | M | , | . | / | ]/Sft |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| TT | GUI | \ | Esc/ | LOWER | Enter | Del | | End | Space | RAISE | Left | Down | Up | Right |
|(_GAME)| | |_ADJUST| –³•ÏŠ·| | | | | | •ÏŠ· | | | | |
`-------------------------------------------------------' `-------------------------------------------------------'
,-------------------------------------------------------. ,-------------------------------------------------------.
|Tab/Alt| Q | W | E | R | T | - | | ~ | Y | U | I | O | P | BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
|ZH/Ctrl| A | S | D | F | G | ( | | ) | H | J | K | L | : | ' |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| [/Sft | Z | X | C | V | B | F2 | | Home | N | M | , | . | / | ]/Sft |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
|WN CAPS| GUI | \ | Esc | MHEN/ | Enter | Del | | End | Space | HENK/ | Left | Down | Up | Right |
| | | | | LOWER | | | | | | RAISE | | | | |
`-------------------------------------------------------' `-------------------------------------------------------'
LOWER
,-------------------------------------------------------. ,-------------------------------------------------------.
|Tab/Alt| 1 | 2 | 3 | 4 | 5 | 6 | | Esc | 7 | 8 | 9 | O | = | BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Ctrl | F1 | F2 | F3 | F4 | F5 | F6 | | F2 | 4 | 5 | 6 | - | / | Enter |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift | F7 | F8 | F9 | F10 | F11 | F12 | | Home | 1 | 2 | 3 | + | * | Shift |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
|XXXXXXX| GUI |XXXXXXX| Esc | | Enter | Del | | End | 0 | . | Left | Down | Up | Right |
`-------------------------------------------------------' `-------------------------------------------------------'
,-------------------------------------------------------. ,-------------------------------------------------------.
| | 1 | 2 | 3 | 4 | 5 | 6 | | Esc | 7 | 8 | 9 | . | = | |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| | F1 | F2 | F3 | F4 | F5 | F6 | | F2 | 4 | 5 | 6 | - | / | Enter |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift | F7 | F8 | F9 | F10 | F11 | F12 | | | 1 | 2 | 3 | + | * | Shift |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| | |XXXXXXX| | | | | | | 0 | | | | | |
`-------------------------------------------------------' `-------------------------------------------------------'
RAISE
,-------------------------------------------------------. ,-------------------------------------------------------.
|Tab/Alt| ! | @ | # | $ | % | _ | | ` | ^ | & | Ins | \ |PrntScr| BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Ctrl |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| { | | } | Left | Down | Up | Right | ; | " |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| |PageUp |XXXXXXX|XXXXXXX| < | > | ? | Shift |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
|XXXXXXX| GUI | | | Esc |XXXXXXX| Enter | Del | |PageDwn| Space | | Left | Down | Up | Right |
`-------------------------------------------------------' `-------------------------------------------------------'
GAME
,-------------------------------------------------------. ,-------------------------------------------------------.
| Esc | Q | W | E | R | T |PrntScr| | | | | | | | |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Ctrl | A | S | D | F | G | F5 | | | | | | | | |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift | Z | X | C | V | B | F2 | |PageUp | | | | | | |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| | GUI | Tab | Alt | Space | Enter | Del | |PageDwn| Space |XXXXXXX| Left | Down | Up | Right |
`-------------------------------------------------------' `-------------------------------------------------------'
,-------------------------------------------------------. ,-------------------------------------------------------.
| | ! | @ | # | $ | % | _ | | ` | ^ | & | Ins | \ |PrntScr| |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX| { | | } | Left | Down | Up | Right | ; | " |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| | M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR| |PageUp |XXXXXXX|XXXXXXX| < | > | ? | Shift |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| | | | | | | | | |PageDwn| | | | | | |
`-------------------------------------------------------' `-------------------------------------------------------'
ADJUST
,-------------------------------------------------------. ,-------------------------------------------------------.
|RGB_TOG| MCR1 | MCR2 | MCR3 |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|PLAY_M1|PLAY_M2|REC_M1 |REC_M2 |STP_REC| BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| RESET |RGB_MOD|_PLAIN |_BREATH|RGB_HuI|RGB_SaI|RGB_VaI| |XXXXXXX|QWERTY |XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|XXXXXXX|
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift |_RAINBW|_SNAKE |_GRADIE|RGB_HuD|RGB_SaD|RGB_VaD| |XXXXXXX| M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR|
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| DEBUG |XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX|XXXXXXX| Left | Down | Up | Right |
`-------------------------------------------------------' `-------------------------------------------------------'
,-------------------------------------------------------. ,-------------------------------------------------------.
|RGB_TOG| MCR1 | MCR2 | MCR3 |XXXXXXX|XXXXXXX|XXXXXXX| |XXXXXXX|PLAY_M1|PLAY_M2|REC_M1 |REC_M2 |STP_REC| BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| RESET | | | | | | | |XXXXXXX|XXXXXXX|QWERTY | GAME |XXXXXXX|XXXXXXX|XXXXXXX|
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift | | | | | | | |XXXXXXX| M-PLAY|M-MUTE |VOL_DWN|VOL_UP |PREV_TR|NEXT_TR|
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| DEBUG |XXXXXXX|XXXXXXX| | |XXXXXXX|XXXXXXX| |XXXXXXX|XXXXXXX| | Left | Down | Up | Right |
`-------------------------------------------------------' `-------------------------------------------------------'
GAME
,-------------------------------------------------------. ,-------------------------------------------------------.
| Tab | Q | W | E | R | T |PrntScr| | Esc | 7 | 8 | 9 | . | = | BSPC |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Ctrl | A | S | D | F | G | F1 | | F2 | 4 | 5 | 6 | - | / | Enter |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Shift | Z | X | C | V | B | F2 | | Home | 1 | 2 | 3 | + | * | Shift |
|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------|
| Del | GUI | Alt | Esc | LOWER | Space | Enter | | End | 0 | RAISE | Left | Down | Up | Right |
`-------------------------------------------------------' `-------------------------------------------------------'
````
## Notes
Supports RGB Underglow and Dynamic Macros.
Supports RGB Underglow color sync to layer switching.

@ -0,0 +1,49 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FACEW_CONFIG_H
#define FACEW_CONFIG_H
#include "config_common.h"
#define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D
#define MANUFACTURER NotActuallyWinkeyless
#define PRODUCT facew
#define RGBLED_NUM 16
#define MATRIX_ROWS 8
#define MATRIX_COLS 11
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6}
#define UNUSED_PINS
#define DIODE_DIRECTION COL2ROW
#define DEBOUNCING_DELAY 5
#define NO_BACKLIGHT_CLOCK
#define BACKLIGHT_LEVELS 1
#define RGBLIGHT_ANIMATIONS
#define NO_UART 1
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
#endif

@ -0,0 +1,66 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "facew.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
#include <avr/pgmspace.h>
#include "action_layer.h"
#include "i2c.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
#endif
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) {
DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
}
void backlight_set(uint8_t level) {
if (level == 0) {
// Turn out the lights
PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6);
} else {
// Turn on the lights
PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6);
}
}

@ -0,0 +1,57 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FACEW_H
#define FACEW_H
#include "quantum.h"
#define LAYOUT_all( \
K61, K71, K72, K73, K74, K64, K65, K75, K76, K77, K78, K68, K66, K10, K60,\
K11, K01, K02, K03, K04, K14, K15, K05, K06, K07, K08, K18, K16, K20, \
K12, K21, K22, K23, K24, K34, K35, K25, K26, K27, K28, K38, K40, \
K19, K13, K41, K42, K43, K44, K54, K55, K45, K46, K47, K58, K49, K50,\
K09, K00, K39, K30, K59, K69, K57, K29\
){ \
{ KC_NO, K01, K02, K03, K04, K05, K06, K07, K08, K09, K00}, \
{ KC_NO, K11, K12, K13, K14, K15, K16, KC_NO, K18, K19, K10}, \
{ KC_NO, K21, K22, K23, K24, K25, K26, K27, K28, K29, K20}, \
{ KC_NO, KC_NO, KC_NO, KC_NO, K34, K35, KC_NO, KC_NO, K38, K39, K30}, \
{ KC_NO, K41, K42, K43, K44, K45, K46, K47, KC_NO, K49, K40}, \
{ KC_NO, KC_NO, KC_NO, KC_NO, K54, K55, KC_NO, K57, K58, K59, K50}, \
{ KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, KC_NO, K68, K69, K60}, \
{ KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, KC_NO, KC_NO}, \
}
#define LAYOUT_60_ansi( \
K61, K71, K72, K73, K74, K64, K65, K75, K76, K77, K78, K68, K66, K60,\
K11, K01, K02, K03, K04, K14, K15, K05, K06, K07, K08, K18, K16, K20, \
K12, K21, K22, K23, K24, K34, K35, K25, K26, K27, K28, K38, K40, \
K19, K41, K42, K43, K44, K54, K55, K45, K46, K47, K58, K49, \
K09, K00, K39, K30, K59, K69, K57, K29\
){ \
{ KC_NO, K01, K02, K03, K04, K05, K06, K07, K08, K09, K00}, \
{ KC_NO, K11, K12, KC_NO, K14, K15, K16, KC_NO, K18, K19, KC_NO}, \
{ KC_NO, K21, K22, K23, K24, K25, K26, K27, K28, K29, K20}, \
{ KC_NO, KC_NO, KC_NO, KC_NO, K34, K35, KC_NO, KC_NO, K38, K39, K30}, \
{ KC_NO, K41, K42, K43, K44, K45, K46, K47, KC_NO, K49, K40}, \
{ KC_NO, KC_NO, KC_NO, KC_NO, K54, K55, KC_NO, K57, K58, K59, KC_NO}, \
{ KC_NO, K61, KC_NO, KC_NO, K64, K65, K66, KC_NO, K68, K69, K60}, \
{ KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, KC_NO, KC_NO}, \
}
#endif

@ -0,0 +1,106 @@
/*
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Please do not modify this file
#include <avr/io.h>
#include <util/twi.h>
#include "i2c.h"
void i2c_set_bitrate(uint16_t bitrate_khz) {
uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
if (bitrate_div >= 16) {
bitrate_div = (bitrate_div - 16) / 2;
}
TWBR = bitrate_div;
}
void i2c_init(void) {
// set pull-up resistors on I2C bus pins
PORTC |= 0b11;
i2c_set_bitrate(400);
// enable TWI (two-wire interface)
TWCR |= (1 << TWEN);
// enable TWI interrupt and slave address ACK
TWCR |= (1 << TWIE);
TWCR |= (1 << TWEA);
}
uint8_t i2c_start(uint8_t address) {
// reset TWI control register
TWCR = 0;
// begin transmission and wait for it to end
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the start condition was successfully transmitted
if ((TWSR & 0xF8) != TW_START) {
return 1;
}
// transmit address and wait
TWDR = address;
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the device has acknowledged the READ / WRITE mode
uint8_t twst = TW_STATUS & 0xF8;
if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
return 1;
}
return 0;
}
void i2c_stop(void) {
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
}
uint8_t i2c_write(uint8_t data) {
TWDR = data;
// transmit data and wait
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
return 1;
}
return 0;
}
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
if (i2c_start(address)) {
return 1;
}
for (uint16_t i = 0; i < length; i++) {
if (i2c_write(data[i])) {
return 1;
}
}
i2c_stop();
return 0;
}

@ -0,0 +1,27 @@
/*
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Please do not modify this file
#ifndef __I2C_H__
#define __I2C_H__
void i2c_init(void);
void i2c_set_bitrate(uint16_t bitrate_khz);
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
#endif

@ -0,0 +1,16 @@
{
"keyboard_name": "FaceW",
"url": "",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_all": {
"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":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}]
},
"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,43 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = 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_BSLS, KC_GRV,
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_BSPC,
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_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL
),
[1] = 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_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_DEL,
MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS, KC_TRNS, MO(2),
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[2] = LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
MO(1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
};

@ -0,0 +1,51 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = 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_NO, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_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_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, TG(2),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL
),
[1] = 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_NO, KC_DEL,
KC_TRNS, KC_TRNS, KC_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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[2] = LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT
),
[3] = LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
};

@ -0,0 +1,18 @@
MechMerlin's FaceW Sprit Edition Layout
======================
This is the preferred 60% layout used by u/merlin36, host of the [MechMerlin YouTube channel](www.youtube.com/mechmerlin).
## Keyboard Notes
- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com)
- Uses ps2avru instead of ps2avrgb
- To put in reset mode hold `q` while inserting the USB cable
- Use flashing instructions from ps2avrgb QMK port
## Keymap Notes
- Does not support any form of inswitch lighting as Merlin hates them.
- Arrow toggle switch to the right of right shift
- Reset is FN + Left Shift + R
### Build
To build this keymap, simply run `make facew:mechmerlin` from the qmk_firmware directory.

@ -0,0 +1,106 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <avr/io.h>
#include <util/delay.h>
#include "matrix.h"
#ifndef DEBOUNCE
#define DEBOUNCE 5
#endif
static uint8_t debouncing = DEBOUNCE;
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
void matrix_init(void) {
// all outputs for rows high
DDRB = 0xFF;
PORTB = 0xFF;
// all inputs for columns
DDRA = 0x00;
DDRC &= ~(0x111111<<2);
DDRD &= ~(1<<PIND7);
// all columns are pulled-up
PORTA = 0xFF;
PORTC |= (0b111111<<2);
PORTD |= (1<<PIND7);
// initialize matrix state: all keys off
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix[row] = 0x00;
matrix_debouncing[row] = 0x00;
}
}
void matrix_set_row_status(uint8_t row) {
DDRB = (1 << row);
PORTB = ~(1 << row);
}
uint8_t bit_reverse(uint8_t x) {
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
return x;
}
uint8_t matrix_scan(void) {
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_set_row_status(row);
_delay_us(5);
matrix_row_t cols = (
// cols 0..7, PORTA 0 -> 7
(~PINA) & 0xFF
) | (
// cols 8..13, PORTC 7 -> 0
bit_reverse((~PINC) & 0xFF) << 8
) | (
// col 14, PORTD 7
((~PIND) & (1 << PIND7)) << 7
);
if (matrix_debouncing[row] != cols) {
matrix_debouncing[row] = cols;
debouncing = DEBOUNCE;
}
}
if (debouncing) {
if (--debouncing) {
_delay_ms(1);
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
}
}
matrix_scan_user();
return 1;
}
inline matrix_row_t matrix_get_row(uint8_t row) {
return matrix[row];
}
void matrix_print(void) {
}

@ -0,0 +1,24 @@
# FaceW
A 60% no frills keyboard.
The FaceW is a special run of the WKL B.Face sourced from Sprit that doesn't have underglow RGB LEDs
but does have in switch LEDs. Also unlike the B.Face, it is based on ps2avru instead of ps2avrGB. It
is designed and manufactured in Korea. It originally uses BootMapperClient for programming but
can now also use QMK.
Keyboard Maintainer: [MechMerlin](www.github.com/mechmerlin)
Hardware Supported: FaceW Sprit Edition PCB
Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=1352
## Keyboard Notes
- The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com)
- Uses ps2avru instead of ps2avrgb
- To put in reset mode hold `q` while inserting the USB cable
- When flashing, type `bootloadHID -r yourfile.hex` and wait awhile
Make example for this keyboard (after setting up your build environment):
make facew: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,52 @@
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name
MCU = atmega32a
PROTOCOL = VUSB
# unsupported features for now
NO_UART = yes
NO_SUSPEND_POWER_DOWN = yes
# processor frequency
F_CPU = 12000000
# 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 = bootloadHID
# build options
BOOTMAGIC_ENABLE = yes
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = no
RGBLIGHT_CUSTOM_DRIVER = yes
OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
CUSTOM_MATRIX = yes
SRC = matrix.c i2c.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
LAYOUTS = 60_ansi

@ -0,0 +1,396 @@
/* Name: usbconfig.h
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
* Author: Christian Starkjohann
* Creation Date: 2005-04-01
* Tabsize: 4
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
*/
#ifndef __usbconfig_h_included__
#define __usbconfig_h_included__
#include "config.h"
/*
General Description:
This file is an example configuration (with inline documentation) for the USB
driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
wire the lines to any other port, as long as D+ is also wired to INT0 (or any
other hardware interrupt, as long as it is the highest level interrupt, see
section at the end of this file).
*/
/* ---------------------------- Hardware Config ---------------------------- */
#define USB_CFG_IOPORTNAME D
/* This is the port where the USB bus is connected. When you configure it to
* "B", the registers PORTB, PINB and DDRB will be used.
*/
#define USB_CFG_DMINUS_BIT 3
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
* This may be any bit in the port.
*/
#define USB_CFG_DPLUS_BIT 2
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
* This may be any bit in the port. Please note that D+ must also be connected
* to interrupt pin INT0! [You can also use other interrupts, see section
* "Optional MCU Description" below, or you can connect D- to the interrupt, as
* it is required if you use the USB_COUNT_SOF feature. If you use D- for the
* interrupt, the USB interrupt will also be triggered at Start-Of-Frame
* markers every millisecond.]
*/
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
* 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
* require no crystal, they tolerate +/- 1% deviation from the nominal
* frequency. All other rates require a precision of 2000 ppm and thus a
* crystal!
* Since F_CPU should be defined to your actual clock rate anyway, you should
* not need to modify this setting.
*/
#define USB_CFG_CHECK_CRC 0
/* Define this to 1 if you want that the driver checks integrity of incoming
* data packets (CRC checks). CRC checks cost quite a bit of code size and are
* currently only available for 18 MHz crystal clock. You must choose
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
*/
/* ----------------------- Optional Hardware Config ------------------------ */
/* #define USB_CFG_PULLUP_IOPORTNAME D */
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
* V+, you can connect and disconnect the device from firmware by calling
* the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
* This constant defines the port on which the pullup resistor is connected.
*/
/* #define USB_CFG_PULLUP_BIT 4 */
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
* above) where the 1.5k pullup resistor is connected. See description
* above for details.
*/
/* --------------------------- Functional Range ---------------------------- */
#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
/* Define this to 1 if you want to compile a version with two endpoints: The
* default control endpoint 0 and an interrupt-in endpoint (any other endpoint
* number).
*/
#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
/* Define this to 1 if you want to compile a version with three endpoints: The
* default control endpoint 0, an interrupt-in endpoint 3 (or the number
* configured below) and a catch-all default interrupt-in endpoint as above.
* You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
*/
#define USB_CFG_EP3_NUMBER 3
/* If the so-called endpoint 3 is used, it can now be configured to any other
* endpoint number (except 0) with this macro. Default if undefined is 3.
*/
/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
/* The above macro defines the startup condition for data toggling on the
* interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
* Since the token is toggled BEFORE sending any data, the first packet is
* sent with the oposite value of this configuration!
*/
#define USB_CFG_IMPLEMENT_HALT 0
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
* for endpoint 1 (interrupt endpoint). Although you may not need this feature,
* it is required by the standard. We have made it a config option because it
* bloats the code considerably.
*/
#define USB_CFG_SUPPRESS_INTR_CODE 0
/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
* want to send any data over them. If this macro is defined to 1, functions
* usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
* you need the interrupt-in endpoints in order to comply to an interface
* (e.g. HID), but never want to send any data. This option saves a couple
* of bytes in flash memory and the transmit buffers in RAM.
*/
#define USB_CFG_INTR_POLL_INTERVAL 1
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
* interval. The value is in milliseconds and must not be less than 10 ms for
* low speed devices.
*/
#define USB_CFG_IS_SELF_POWERED 0
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
* device is powered from the USB bus.
*/
#define USB_CFG_MAX_BUS_POWER 500
/* Set this variable to the maximum USB bus power consumption of your device.
* The value is in milliamperes. [It will be divided by two since USB
* communicates power requirements in units of 2 mA.]
*/
#define USB_CFG_IMPLEMENT_FN_WRITE 1
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
* transfers. Set it to 0 if you don't need it and want to save a couple of
* bytes.
*/
#define USB_CFG_IMPLEMENT_FN_READ 0
/* Set this to 1 if you need to send control replies which are generated
* "on the fly" when usbFunctionRead() is called. If you only want to send
* data from a static buffer, set it to 0 and return the data from
* usbFunctionSetup(). This saves a couple of bytes.
*/
#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
* You must implement the function usbFunctionWriteOut() which receives all
* interrupt/bulk data sent to any endpoint other than 0. The endpoint number
* can be found in 'usbRxToken'.
*/
#define USB_CFG_HAVE_FLOWCONTROL 0
/* Define this to 1 if you want flowcontrol over USB data. See the definition
* of the macros usbDisableAllRequests() and usbEnableAllRequests() in
* usbdrv.h.
*/
#define USB_CFG_DRIVER_FLASH_PAGE 0
/* If the device has more than 64 kBytes of flash, define this to the 64 k page
* where the driver's constants (descriptors) are located. Or in other words:
* Define this to 1 for boot loaders on the ATMega128.
*/
#define USB_CFG_LONG_TRANSFERS 0
/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
* in a single control-in or control-out transfer. Note that the capability
* for long transfers increases the driver size.
*/
/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
/* This macro is a hook if you want to do unconventional things. If it is
* defined, it's inserted at the beginning of received message processing.
* If you eat the received message and don't want default processing to
* proceed, do a return after doing your things. One possible application
* (besides debugging) is to flash a status LED on each packet.
*/
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
/* This macro is a hook if you need to know when an USB RESET occurs. It has
* one parameter which distinguishes between the start of RESET state and its
* end.
*/
/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
* received.
*/
#define USB_COUNT_SOF 1
/* define this macro to 1 if you need the global variable "usbSofCount" which
* counts SOF packets. This feature requires that the hardware interrupt is
* connected to D- instead of D+.
*/
/* #ifdef __ASSEMBLER__
* macro myAssemblerMacro
* in YL, TCNT0
* sts timer0Snapshot, YL
* endm
* #endif
* #define USB_SOF_HOOK myAssemblerMacro
* This macro (if defined) is executed in the assembler module when a
* Start Of Frame condition is detected. It is recommended to define it to
* the name of an assembler macro which is defined here as well so that more
* than one assembler instruction can be used. The macro may use the register
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
* immediately after an SOF pulse may be lost and must be retried by the host.
* What can you do with this hook? Since the SOF signal occurs exactly every
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
* designs running on the internal RC oscillator.
* Please note that Start Of Frame detection works only if D- is wired to the
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
*/
#define USB_CFG_CHECK_DATA_TOGGLING 0
/* define this macro to 1 if you want to filter out duplicate data packets
* sent by the host. Duplicates occur only as a consequence of communication
* errors, when the host does not receive an ACK. Please note that you need to
* implement the filtering yourself in usbFunctionWriteOut() and
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
* for each control- and out-endpoint to check for duplicate packets.
*/
#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
/* define this macro to 1 if you want the function usbMeasureFrameLength()
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
*/
#define USB_USE_FAST_CRC 0
/* The assembler module has two implementations for the CRC algorithm. One is
* faster, the other is smaller. This CRC routine is only used for transmitted
* messages where timing is not critical. The faster routine needs 31 cycles
* per byte while the smaller one needs 61 to 69 cycles. The faster routine
* may be worth the 32 bytes bigger code size if you transmit lots of data and
* run the AVR close to its limit.
*/
/* -------------------------- Device Description --------------------------- */
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
/* USB vendor ID for the device, low byte first. If you have registered your
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
* *** IMPORTANT NOTE ***
* This template uses obdev's shared VID/PID pair for Vendor Class devices
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
/* This is the ID of the product, low byte first. It is interpreted in the
* scope of the vendor ID. If you have registered your own VID with usb.org
* or if you have licensed a PID from somebody else, define it here. Otherwise
* you may use one of obdev's free shared VID/PID pairs. See the file
* USB-IDs-for-free.txt for details!
* *** IMPORTANT NOTE ***
* This template uses obdev's shared VID/PID pair for Vendor Class devices
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
/* Version number of the device: Minor number first, then major number.
*/
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
#define USB_CFG_VENDOR_NAME_LEN 13
/* These two values define the vendor name returned by the USB device. The name
* must be given as a list of characters under single quotes. The characters
* are interpreted as Unicode (UTF-16) entities.
* If you don't want a vendor name string, undefine these macros.
* ALWAYS define a vendor name containing your Internet domain name if you use
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
* details.
*/
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
#define USB_CFG_DEVICE_NAME_LEN 8
/* Same as above for the device name. If you don't want a device name, undefine
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
* you use a shared VID/PID.
*/
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
/* Same as above for the serial number. If you don't want a serial number,
* undefine the macros.
* It may be useful to provide the serial number through other means than at
* compile time. See the section about descriptor properties below for how
* to fine tune control over USB descriptors such as the string descriptor
* for the serial number.
*/
#define USB_CFG_DEVICE_CLASS 0
#define USB_CFG_DEVICE_SUBCLASS 0
/* See USB specification if you want to conform to an existing device class.
* Class 0xff is "vendor specific".
*/
#define USB_CFG_INTERFACE_CLASS 3 /* HID */
#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
/* See USB specification if you want to conform to an existing device class or
* protocol. The following classes must be set at interface level:
* HID class is 3, no subclass and protocol required (but may be useful!)
* CDC class is 2, use subclass 2 and protocol 1 for ACM
*/
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
/* Define this to the length of the HID report descriptor, if you implement
* an HID device. Otherwise don't define it or define it to 0.
* If you use this define, you must add a PROGMEM character array named
* "usbHidReportDescriptor" to your code which contains the report descriptor.
* Don't forget to keep the array and this define in sync!
*/
/* #define USB_PUBLIC static */
/* Use the define above if you #include usbdrv.c instead of linking against it.
* This technique saves a couple of bytes in flash memory.
*/
/* ------------------- Fine Control over USB Descriptors ------------------- */
/* If you don't want to use the driver's default USB descriptors, you can
* provide our own. These can be provided as (1) fixed length static data in
* flash memory, (2) fixed length static data in RAM or (3) dynamically at
* runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
* information about this function.
* Descriptor handling is configured through the descriptor's properties. If
* no properties are defined or if they are 0, the default descriptor is used.
* Possible properties are:
* + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
* at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
* used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
* you want RAM pointers.
* + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
* in static memory is in RAM, not in flash memory.
* + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
* the driver must know the descriptor's length. The descriptor itself is
* found at the address of a well known identifier (see below).
* List of static descriptor names (must be declared PROGMEM if in flash):
* char usbDescriptorDevice[];
* char usbDescriptorConfiguration[];
* char usbDescriptorHidReport[];
* char usbDescriptorString0[];
* int usbDescriptorStringVendor[];
* int usbDescriptorStringDevice[];
* int usbDescriptorStringSerialNumber[];
* Other descriptors can't be provided statically, they must be provided
* dynamically at runtime.
*
* Descriptor properties are or-ed or added together, e.g.:
* #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
*
* The following descriptors are defined:
* USB_CFG_DESCR_PROPS_DEVICE
* USB_CFG_DESCR_PROPS_CONFIGURATION
* USB_CFG_DESCR_PROPS_STRINGS
* USB_CFG_DESCR_PROPS_STRING_0
* USB_CFG_DESCR_PROPS_STRING_VENDOR
* USB_CFG_DESCR_PROPS_STRING_PRODUCT
* USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
* USB_CFG_DESCR_PROPS_HID
* USB_CFG_DESCR_PROPS_HID_REPORT
* USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
*
* Note about string descriptors: String descriptors are not just strings, they
* are Unicode strings prefixed with a 2 byte header. Example:
* int serialNumberDescriptor[] = {
* USB_STRING_DESCRIPTOR_HEADER(6),
* 'S', 'e', 'r', 'i', 'a', 'l'
* };
*/
#define USB_CFG_DESCR_PROPS_DEVICE 0
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
#define USB_CFG_DESCR_PROPS_STRINGS 0
#define USB_CFG_DESCR_PROPS_STRING_0 0
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID 0
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
#define usbMsgPtr_t unsigned short
/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
* a scalar type here because gcc generates slightly shorter code for scalar
* arithmetics than for pointer arithmetics. Remove this define for backward
* type compatibility or define it to an 8 bit type if you use data in RAM only
* and all RAM is below 256 bytes (tiny memory model in IAR CC).
*/
/* ----------------------- Optional MCU Description ------------------------ */
/* The following configurations have working defaults in usbdrv.h. You
* usually don't need to set them explicitly. Only if you want to run
* the driver on a device which is not yet supported or with a compiler
* which is not fully supported (such as IAR C) or if you use a differnt
* interrupt than INT0, you may have to define some of these.
*/
/* #define USB_INTR_CFG MCUCR */
/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE GIMSK */
/* #define USB_INTR_ENABLE_BIT INT0 */
/* #define USB_INTR_PENDING GIFR */
/* #define USB_INTR_PENDING_BIT INTF0 */
/* #define USB_INTR_VECTOR INT0_vect */
/* Set INT1 for D- falling edge to count SOF */
/* #define USB_INTR_CFG EICRA */
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE EIMSK */
#define USB_INTR_ENABLE_BIT INT1
/* #define USB_INTR_PENDING EIFR */
#define USB_INTR_PENDING_BIT INTF1
#define USB_INTR_VECTOR INT1_vect
#endif /* __usbconfig_h_included__ */

@ -87,4 +87,6 @@
/* 7 */ { KA7, KB7, KC7, KD7, KE7, KF7, KG7, KH7, KI7, KJ7, KC_NO, KC_NO, KC_NO, KC_NO, KO7, KC_NO, KQ7, KR7 } \
}
#define LAYOUT_tkl_ansi KEYMAP_TKL
#endif

@ -68,4 +68,6 @@ AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
CUSTOM_MATRIX = yes
SRC += matrix.c
SRC += matrix.c
LAYOUTS = tkl_ansi

@ -5,7 +5,7 @@
"width": 14.5,
"height": 5,
"layouts": {
"KEYMAP": {
"LAYOUT": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":10.5, "y":0}, {"x":11.5, "y":0}, {"x":12.5, "y":0}, {"x":13.5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7.5, "y":3}, {"x":8.5, "y":3}, {"x":9.5, "y":3}, {"x":10.5, "y":3}, {"x":11.5, "y":3}, {"x":12.5, "y":3}, {"x":13.5, "y":3}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7.5, "y":4}, {"x":8.5, "y":4}, {"x":9.5, "y":4}]
}
}

@ -8,4 +8,4 @@ RGBLIGHT_ENABLE = yes
AUDIO_ENABLE = yes
NKRO_ENABLE = yes
BACKLIGHT_ENABLE = no
SWAP_HANDS_ENABLE = yes

@ -183,7 +183,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// `----+----+----' `----+----+----'
),
[_ADJUST] = KEYMAP(
[_ADJUST] = LAYOUT(
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
GAMING , DVORAK, WORKMAN, COLEMAK, QWERTY , KC_RST, _______, _______, _______, _______, KC_PWR, RESET,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|

@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// `----+----+----' `----+----+----'
),
[_LOWER] = KEYMAP(
[_LOWER] = LAYOUT(
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
NO_TILD,KC_EXLM,NO_AT ,KC_HASH,NO_DLR ,KC_PERC, NO_CIRC,NO_AMPR,NO_ASTR,NO_SLSH,NO_LPRN,NO_RPRN,
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|
@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// `-------+-------+-------' `-------+-------+-------'
),
[_RAISE] = KEYMAP(
[_RAISE] = LAYOUT(
//,-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------.
KC_F12 ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,
//|-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------|

@ -27,6 +27,8 @@ enum custom_keycodes {
ONEHANDL,
RLAYER,
LLAYER,
RLOCK,
LLOCK,
DUAL,
CONFIG,
};
@ -44,13 +46,15 @@ enum {
/* LAYERS */
#define KC_LLAY LLAYER
#define KC_RLAY RLAYER
#define KC_RLOK RLOCK
#define KC_LLOK LLOCK
#define KC_QWER QWERTY
#define KC_DVOR DVORAK
#define KC_COLE COLEMAK
#define KC_ONER ONEHANDR
#define KC_ONEL ONEHANDL
#define KC_DUAL DUAL
#define KC_CONF OSL(_CONFIG)
#define KC_CONF CONFIG
/* Custom Shortened Keys */
#define KC_MCTB LCTL(KC_TAB)
@ -71,7 +75,7 @@ enum {
#define KC_BLUP BL_INC
#define KC_BLDN BL_DEC
#define KC_SYSR KC_SYSREQ
#define KC_FLASH RESET
#define KC_REST RESET
/* Tap Dance */
#define KC_LGUA TD(TD_LGUIAPP)
@ -82,13 +86,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
LEAD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
XXXX, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
CTEC, A , S , D , F , G , H , J , K , L ,SCLN,ENT ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
SHCL, Z , X , C , V , B ,XXXX, XXXX, N , M ,COMM,DOT ,SLSH,RSFT,
SHCL, Z , X , C , V , B ,LLOK, RLOK, N , M ,COMM,DOT ,SLSH,RSFT,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LALT,LLAY,TAB , SPC ,RLAY,LGUA
// `----+----+----' `----+----+----'
@ -96,13 +100,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_COLEMAK] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
LEAD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
XXXX, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,DEL ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
CTEC, A , R , S , T , D , H , N , E , I ,SCLN,ENT ,
CTEC, A , R , S , T , D , H , N , E , I , O ,ENT ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
SHCL, Z , X , C , V , B ,XXXX, XXXX, K , M ,COMM,DOT ,SLSH,RSFT,
SHCL, Z , X , C , V , B ,LLOK, RLOK, K , M ,COMM,DOT ,SLSH,RSFT,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LALT,LLAY,TAB , SPC ,RLAY,LGUA
// `----+----+----' `----+----+----'
@ -110,13 +114,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DVORAK] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
LEAD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
XXXX, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
CTEC, A , O , E , U , I , D , H , T , N , S ,ENT ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
SHCL,SCLN, Q , J , K , X ,XXXX, XXXX, B , M , W , V , Z ,EQL ,
SHCL,SCLN, Q , J , K , X ,LLOK, RLOK, B , M , W , V , Z ,EQL ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LALT,LLAY,TAB , SPC ,RLAY,LGUA
// `----+----+----' `----+----+----'
@ -138,7 +142,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ONEHANDL] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, 5 , 4 , 3 , 2 , 1 ,LEAD,
XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, 5 , 4 , 3 , 2 , 1 ,XXXX,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, T , R , E , W , Q ,TAB ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
@ -152,14 +156,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_RLAYER] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
,XXXX,XXXX,XXXX,XXXX,XXXX, MUTE,VOLD,VOLU,BLDN,BLUP, ,
,SLCK,SYSR,PSCR,INS ,PAUS, MUTE,VOLD,VOLU,BLDN,BLUP, ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,TILD,GRV ,EQL ,LBRC,RBRC, PGUP,ASTR, UP ,AMPR,CIRC, ,
,TILD,GRV ,EQL ,LBRC,RBRC, ASTR,HOME, UP ,PGUP,PLUS, ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,EXLM,PIPE,DLR ,LPRN,RPRN, HOME,LEFT,DOWN,RGHT,END ,QUOT,
,EXLM,PIPE,DLR ,LPRN,RPRN, AMPR,LEFT,DOWN,RGHT,MINS,QUOT,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
, AT ,HASH,PERC,LCBR,RCBR,LGUI, ,PGDN,UNDS,MINS,PLUS,BSLS, ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, AT ,HASH,PERC,LCBR,RCBR, , ,CIRC,END ,UNDS,PGDN,BSLS, ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
),
@ -172,7 +176,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,XXXX,MCST,DOWN,MCTB,ENT , SLSH, 4 , 5 , 6 ,MINS, ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
,XXXX,XXXX,BSPC,SPC ,SINS,F11 , F12 ,EQL , 1 , 2 , 3 ,DOT , ,
,XXXX,XXXX,BSPC,SINS,SPC ,F11 , F12 ,EQL , 1 , 2 , 3 ,DOT , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , 0 , ,
// `----+----+----' `----+----+----'
@ -180,7 +184,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_DUAL] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
,XXXX,XXXX,PSCR,INS ,XXXX, XXXX,SLEP,SLCK,PAUS,SYSR,XXXX,
,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,MS_U,XXXX,XXXX,MCAD,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
@ -194,7 +198,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_CONFIG] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
FLASH,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX,
REST,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
XXXX,QWER,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,ONER,XXXX,XXXX,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
@ -237,6 +241,11 @@ void persistent_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}
/* Variables for layer light toggling */
static uint16_t currentBL = 0;
static uint16_t rlocked = 0;
static uint16_t llocked = 0;
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
@ -263,14 +272,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case CONFIG:
if (record->event.pressed) {
set_single_persistent_default_layer(_CONFIG);
backlight_toggle();
}
return false;
break;
case RLAYER:
if (record->event.pressed) {
layer_on(_RLAYER);
update_tri_layer(_RLAYER, _LLAYER, _DUAL);
/* add logic to toggle backlight change when on a layer */
currentBL = get_backlight_level();
if ( currentBL == 0 || currentBL == 1 ) {
backlight_set(5);
} else {
backlight_set(0);
}
} else {
unregister_code(KC_LGUI);
rlocked = 0;
layer_off(_RLAYER);
update_tri_layer(_RLAYER, _LLAYER, _DUAL);
if ( llocked == 0 ) {
backlight_set(currentBL);
} else {
}
}
return false;
break;
@ -278,9 +306,51 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
layer_on(_LLAYER);
update_tri_layer(_RLAYER, _LLAYER, _DUAL);
/* add logic to toggle backlight change when on a layer */
currentBL = get_backlight_level();
if ( currentBL == 0 || currentBL == 1 ) {
backlight_set(5);
} else {
backlight_set(0);
}
} else {
llocked = 0;
layer_off(_LLAYER);
update_tri_layer(_RLAYER, _LLAYER, _DUAL);
if ( rlocked == 0 ) {
backlight_set(currentBL);
} else {
}
}
return false;
break;
case RLOCK:
if (record->event.pressed) {
layer_on(_RLAYER);
/* add logic to toggle backlight change when on a layer */
rlocked = 1;
currentBL = get_backlight_level();
if ( currentBL == 0 || currentBL == 1 ) {
backlight_set(5);
} else {
backlight_set(0);
}
} else {
}
return false;
break;
case LLOCK:
if (record->event.pressed) {
layer_on(_LLAYER);
/* add logic to toggle backlight change when on a layer */
llocked = 1;
currentBL = get_backlight_level();
if ( currentBL == 0 || currentBL == 1 ) {
backlight_set(5);
} else {
backlight_set(0);
}
} else {
}
return false;
break;

@ -20,3 +20,23 @@ void matrix_init_kb(void) {
matrix_init_user();
};
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}},
{{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}},
{{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}},
{{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}},
{{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}},
/* Right hand, matrix positions */
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}},
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}},
};
#endif

@ -20,3 +20,23 @@ void matrix_init_kb(void) {
matrix_init_user();
};
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}},
{{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}},
{{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}},
{{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}},
{{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}},
/* Right hand, matrix positions */
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}},
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}},
};
#endif

@ -20,3 +20,23 @@ void matrix_init_kb(void) {
matrix_init_user();
};
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}},
{{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}},
{{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}},
{{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}},
{{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}},
/* Right hand, matrix positions */
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}},
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}},
};
#endif

@ -67,6 +67,28 @@ void matrix_init_user(void); // TODO port this to other PS2AVRGB boards
{ K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
}
#define KC_KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
KEYMAP_GRID( \
KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
)
#define KEYMAP KEYMAP_MIT
#define LAYOUT_ortho_4x12 KEYMAP_GRID
#define LAYOUT_2U_space KEYMAP_MIT
#define LAYOUT_planck_mit KEYMAP_MIT
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
#define LAYOUT_kc_ortho_4x12 KC_KEYMAP
#endif

@ -1,70 +0,0 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
#include "quantum.h"
// #include "keycode.h"
// #include "action.h"
#define KEYMAP_GRID( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_MIT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K3X, KC_NO, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_OFFSET( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
}
#define KEYMAP KEYMAP_GRID
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#endif

@ -1,6 +1,4 @@
#include "jj40.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
#include "keymap_uk.h"
extern keymap_config_t keymap_config;
@ -54,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP(\
[_QWERTY] = LAYOUT_ortho_4x12(\
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC ,\
MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) ,\
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT ,\
@ -72,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn |
* `-----------------------------------------------------------------------------------'
*/
[_FUNC] = KEYMAP(\
[_FUNC] = LAYOUT_ortho_4x12(\
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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT ,\
KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) ,\
@ -90,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP(\
[_LOWER] = LAYOUT_ortho_4x12(\
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC ,\
LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) ,\
KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) ,\
@ -108,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Mouse| | | | | Alt | Enter|Raise | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP(\
[_RAISE] = LAYOUT_ortho_4x12(\
KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN ,\
KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) ,\
_______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) ,\
@ -126,7 +124,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = KEYMAP(\
[_ADJUST] = LAYOUT_ortho_4x12(\
M(0), RESET, QWERTY, BL_ON, BL_OFF, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL ,\
KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ ,\
TG(_MAC), RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ ,\
@ -144,7 +142,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_MOUSE] = KEYMAP(\
[_MOUSE] = LAYOUT_ortho_4x12(\
KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______,\
KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______,\
@ -162,42 +160,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_FUNC2] = KEYMAP(\
[_FUNC2] = LAYOUT_ortho_4x12(\
_______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______,\
_______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______,\
_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98), \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_MAC]= KEYMAP(\
[_MAC]= LAYOUT_ortho_4x12(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 \
),
[_MLWR] = KEYMAP(\
[_MLWR] = LAYOUT_ortho_4x12(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_MRSE] = KEYMAP(\
[_MRSE] = LAYOUT_ortho_4x12(\
_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) ,\
_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_MFNC]= KEYMAP(\
[_MFNC]= LAYOUT_ortho_4x12(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ,\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_MFNC2] = KEYMAP(\
[_MFNC2] = LAYOUT_ortho_4x12(\
_______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______,\
_______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______,\
_______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99), \

@ -1,5 +1,4 @@
#include "jj40.h"
#include "action_layer.h"
#include QMK_KEYBOARD_H
#define LT_1 RALT(KC_1)
#define LT_2 RALT(KC_2)
@ -64,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | Fn | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_2U_space( \
KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -86,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | | | Alt |Lower|| Space | | Home | PgDn | PgUp | End |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_2U_space( \
KC_GRV, LT_A_OG, LT_C_CA, LT_E_OG, LT_E_DO, LT_I_OG, LT_S_CA, LT_U_OG, LT_U_MA, LT_Z_CA, KC_MINS, KC_BSPC, \
KC_TAB, LT_EXLM, LT_AT, LT_HASH, LT_DLR, LT_PERC, LT_CIRC, LT_AMPR, LT_ASTR, KC_LPRN, KC_RPRN, KC_DEL , \
KC_LSFT, KC_PEQL, KC_PPLS, KC_PMNS, KC_PIPE, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_LCBR, KC_RCBR, KC_INS , \
@ -108,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | | | Alt | | Space |Raise|| Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_2U_space( \
KC_GRV, LT_1, LT_2, LT_3, LT_4, LT_5, LT_6, LT_7, LT_8, LT_9, LT_0, KC_BSPC, \
KC_TAB, LT_4, LT_5, LT_6, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, \
KC_LSFT, LT_7, LT_8, LT_9, LT_0, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -131,7 +130,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl |||Fn||| Mode | Alt | | Space |MPrev |MStop |MNext |MPlay | Lock |
* `-----------------------------------------------------------------------------------'
*/
[_FUNC] = KEYMAP( \
[_FUNC] = LAYOUT_2U_space( \
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_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_BRTG, BL_INC, _______, _______, _______, KC_VOLU, \
KC_LSFT, KC_CALC, RGB_HUD, RGB_SAD, RGB_VAD, KC_WBAK, KC_WFWD, BL_DEC, _______, _______, KC_PSCR, KC_VOLD, \

@ -1,5 +1,5 @@
#include "jj40.h"
#include "action_layer.h"
#include QMK_KEYBOARD_H
#define _QWERTY 0
#define _LOWER 1
@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_2U_space( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_2U_space( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_2U_space( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \

@ -1,70 +0,0 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
#include "quantum.h"
// #include "keycode.h"
// #include "action.h"
#define KEYMAP_GRID( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_MIT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K3X, KC_NO, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_OFFSET( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
}
#define KEYMAP KEYMAP_GRID
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#endif

@ -1,9 +1,4 @@
#include "jj40.h"
#include "action_layer.h"
#include "eeconfig.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#include QMK_KEYBOARD_H
#define _QWERTY 0
#define _LOWER 1
@ -31,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | Del | Alt | GUI |Lower | Space|Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
@ -49,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | nkro | Alt | NKRO |Lower | PgDn | PgUp |Raise | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_ortho_4x12( \
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_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, \
KC_LSFT, KC_PSCR, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, _______, _______, BL_ON, BL_STEP, KC_ENT, \
@ -67,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | | Alt | |Lower | | |Raise | 0 | | Home | End |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_ortho_4x12( \
KC_CAPS, KC_MINS, KC_PLUS, KC_EQL, KC_LPRN, KC_RPRN, _______, KC_7, KC_8, KC_9, KC_BSPC, KC_DEL, \
KC_LOCK, KC_TILD, KC_UNDS, _______,KC_LBRC, KC_RBRC, _______, KC_4, KC_5, KC_6, _______, _______, \
KC_INS, KC_GRV, KC_BSLS, KC_PIPE, KC_LCBR, KC_RCBR, _______, KC_1, KC_2, KC_3, KC_DOT, _______, \

@ -1,5 +1,4 @@
#include "jj40.h"
#include "action_layer.h"
#include QMK_KEYBOARD_H
#define _QWERTY 0
#define _LOWER 1
@ -36,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_2U_space( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -54,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play | |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_2U_space( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, \
@ -72,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | Prev | Play | Next | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_2U_space( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, \
@ -90,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Qwerty| 0 | . | . |Enter |Enter | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = KEYMAP( \
[_NUMPAD] = LAYOUT_2U_space( \
KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \
KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \
_______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \

@ -15,8 +15,7 @@ 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 "jj40.h"
#include "action_layer.h"
#include QMK_KEYBOARD_H
#ifdef KEYMAP
#undef KEYMAP

@ -1,70 +0,0 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
#include "quantum.h"
// #include "keycode.h"
// #include "action.h"
#define KEYMAP_GRID( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_MIT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K3X, KC_NO, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_OFFSET( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
}
#define KEYMAP KEYMAP_GRID
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#endif

@ -1,5 +1,4 @@
#include "jj40.h"
#include "action_layer.h"
#include QMK_KEYBOARD_H
enum jj40_layers {
_QWERTY,
@ -27,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Fn | Ctrl | Alt | GUI |Space |Lower |Raise |Space | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \
@ -45,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_ENT, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, KC_PIPE, \
@ -63,13 +62,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_ENT, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, KC_BSLS, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Functions
* Note: Terminal uses Calculator shortcut, change your OS keyboard shortcut appropriately.
* ,-----------------------------------------------------------------------------------.
@ -86,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | |||Fn||| Mode | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_FUNC] = KEYMAP( \
[_FUNC] = LAYOUT_ortho_4x12( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
_______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_BRTG, BL_INC, _______, _______, _______, KC_VOLU, \
_______, KC_CALC, RGB_HUD, RGB_SAD, RGB_VAD, KC_WBAK, KC_WFWD, BL_DEC, _______, _______, KC_PSCR, KC_VOLD, \

@ -1,70 +0,0 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
#include "quantum.h"
// #include "keycode.h"
// #include "action.h"
#define KEYMAP_GRID( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_MIT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K3X, KC_NO, K38, K34, K33, K32, K31 } \
}
#define KEYMAP_OFFSET( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \
) \
{ \
{ K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
{ K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
{ K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \
}
#define KEYMAP KEYMAP_GRID
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#endif

@ -1,6 +1,4 @@
#include "jj40.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -28,42 +26,42 @@ enum jj40_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, SHFTENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \
KC_PSCR, KC_BSPC, KC_LALT, _______, LEFTY, KC_LGUI, KC_SPC, RIGHTY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
[_DVORAK] = KEYMAP( \
[_DVORAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
CTLESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, SHFTENT, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_SLSH, \
KC_PSCR, KC_LGUI, KC_LALT, KC_CAPS, LEFTY, KC_BSPC, KC_SPC, RIGHTY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
[_GAME] = KEYMAP( \
[_GAME] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, _______, _______, _______, QWERTY, \
CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, _______, _______, _______, _______, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, _______, _______, _______, _______, \
KC_LCTL, KC_1, KC_2, KC_3, LEFTY, KC_SPC, KC_BSPC, RIGHTY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \
),
[_LEFTY] = KEYMAP( \
[_LEFTY] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, _______, _______, _______, _______, _______, _______, KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, KC_INS, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
),
[_RIGHTY] = KEYMAP( \
[_RIGHTY] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, _______, KC_EQL, KC_MINS, KC_BSLS, KC_SLSH, _______, _______, \
_______, KC_F5, KC_F6, KC_F7, KC_F8, _______, _______, _______, _______, _______, _______, _______,
_______, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______ \
),
[_DUAL] = KEYMAP( \
[_DUAL] = LAYOUT_ortho_4x12( \
RESET, _______, _______, _______, _______, QWERTY, GAME, _______, _______, _______, BL_BRTG, RESET, \
_______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, AG_NORM, AG_SWAP, _______, _______, _______, BL_TOGG, _______, \
_______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, TG_NKRO, _______, _______, _______, _______, _______, \

@ -56,3 +56,5 @@ SRC = matrix.c i2c.c backlight.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
LAYOUTS = ortho_4x12 planck_mit planck_grid

@ -13,6 +13,8 @@ USB report options are supported.
Hardware Supported: JJ50 with the ATmega32a chip.
Hardware Availability: The JJ50 PCB is available from kprepublic on AliExpress and suchlike.
This version by Wayne K Jones (github.com/WarmCatUK)
## Installing and Building
@ -70,8 +72,10 @@ And flash the compiled hex file with `HIDBootFlash`. Simply put the board in fla
1. Try plugging the board in while pressing `Backspace` (`Key below the top right key`). This will force it to boot only the bootloader without loading the firmware. Once this is done, just reflash the board with the original firmware.
2. Sometimes USB hubs can act weird, so try connecting the board directly to your computer or plugging/unplugging the USB hub.
3. If you get an error such as "Resource Unavailable" when attemting to flash on Linux, you may want to compile and run `tools/usb_detach.c`. See `tools/README.md` for more info.
4. I was occasionally finding that I wasn't flashing changes that I was making to my keymap. If that happens, simply force rebuild by making with:
4. I was occasionally finding that I wasn't flashing changes that I was making to my keymap. If that happens, remove the previous build and simply force rebuild by making with:
```
$ rm jj50_default.hex
$ make -B jj50:default
$ make -B jj50:default:program
```

@ -0,0 +1,212 @@
/**
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
* Kenneth A. (github.com/krusli | krusli.me)
*/
#include "backlight.h"
#include "quantum.h"
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "backlight_custom.h"
#include "breathing_custom.h"
// DEBUG
#include <stdlib.h>
#include <stdio.h>
// Port D: digital pins of the AVR chipset
#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital)
#define CAPSLOCK_PORT (1 << 2) // 2nd pin
#define BACKLIGHT_PORT (1 << 4) // 4th pin
#define SCROLLLOCK_PORT (1 << 6) // 6th pin
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask
#define PWM_MAX 0xFF
#define TIMER_TOP 255 // 8 bit PWM
extern backlight_config_t backlight_config;
/**
* References
* Port Registers: https://www.arduino.cc/en/Reference/PortManipulation
* TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b
* Timers: http://www.avrbeginners.net/architecture/timers/timers.html
* 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/
* PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware
*/
// @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states.
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
// turn on
DDRD |= NUMLOCK_PORT;
PORTD |= NUMLOCK_PORT;
} else {
// turn off
DDRD &= ~NUMLOCK_PORT;
PORTD &= ~NUMLOCK_PORT;
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRD |= CAPSLOCK_PORT;
PORTD |= CAPSLOCK_PORT;
} else {
DDRD &= ~CAPSLOCK_PORT;
PORTD &= ~CAPSLOCK_PORT;
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
DDRD |= SCROLLLOCK_PORT;
PORTD |= SCROLLLOCK_PORT;
} else {
DDRD &= ~SCROLLLOCK_PORT;
PORTD &= ~SCROLLLOCK_PORT;
}
}
#ifdef BACKLIGHT_ENABLE
// sets up Timer 1 for 8-bit PWM
void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE
// default 8 bit mode
TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH
TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW
// clear output compare value A
// outb(OCR1AH, 0);
// outb(OCR1AL, 0);
// clear output comparator registers for B
OCR1BH = 0; // outb(OCR1BH, 0);
OCR1BL = 0; // outb(OCR1BL, 0);
}
bool is_init = false;
void timer1Init(void) {
// timer1SetPrescaler(TIMER1PRESCALE)
// set to DIV/64
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE;
// reset TCNT1
TCNT1H = 0; // outb(TCNT1H, 0);
TCNT1L = 0; // outb(TCNT1L, 0);
// TOIE1: Timer Overflow Interrupt Enable (Timer 1);
TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1);
is_init = true;
}
void timer1UnInit(void) {
// set prescaler back to NONE
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP
// disable timer overflow interrupt
TIMSK &= ~_BV(TOIE1); // overflow bit?
setPWM(0);
is_init = false;
}
// handle TCNT1 overflow
//! Interrupt handler for tcnt1 overflow interrupt
ISR(TIMER1_OVF_vect, ISR_NOBLOCK)
{
// sei();
// handle breathing here
#ifdef BACKLIGHT_BREATHING
if (is_breathing()) {
custom_breathing_handler();
}
#endif
// TODO call user defined function
}
// enable timer 1 PWM
// timer1PWMBOn()
void timer1PWMBEnable(void) {
// turn on channel B (OC1B) PWM output
// set OC1B as non-inverted PWM
TCCR1A |= _BV(COM1B1);
TCCR1A &= ~_BV(COM1B0);
}
// disable timer 1 PWM
// timer1PWMBOff()
void timer1PWMBDisable(void) {
TCCR1A &= ~_BV(COM1B1);
TCCR1A &= ~_BV(COM1B0);
}
void enableBacklight(void) {
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
}
void disableBacklight(void) {
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
}
void startPWM(void) {
timer1Init();
timer1PWMBEnable();
enableBacklight();
}
void stopPWM(void) {
timer1UnInit();
disableBacklight();
timer1PWMBDisable();
}
void b_led_init_ports(void) {
/* turn backlight on/off depending on user preference */
#if BACKLIGHT_ON_STATE == 0
// DDRx register: sets the direction of Port D
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
#else
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
#endif
timer1PWMSetup();
startPWM();
#ifdef BACKLIGHT_BREATHING
breathing_enable();
#endif
}
void b_led_set(uint8_t level) {
if (level > BACKLIGHT_LEVELS) {
level = BACKLIGHT_LEVELS;
}
setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS));
}
// called every matrix scan
void b_led_task(void) {
// do nothing for now
}
void setPWM(uint16_t xValue) {
if (xValue > TIMER_TOP) {
xValue = TIMER_TOP;
}
OCR1B = xValue; // timer1PWMBSet(xValue);
}
#endif // BACKLIGHT_ENABLE

@ -0,0 +1,15 @@
/**
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
* Kenneth A. (github.com/krusli | krusli.me)
*/
#ifndef BACKLIGHT_CUSTOM_H
#define BACKLIGHT_CUSTOM_H
#include <avr/pgmspace.h>
void b_led_init_ports(void);
void b_led_set(uint8_t level);
void b_led_task(void);
void setPWM(uint16_t xValue);
#endif // BACKLIGHT_CUSTOM_H

@ -0,0 +1,140 @@
/**
* Breathing effect code for PS2AVRGB boards (ATMEGA32A)
* Works in conjunction with `backlight.c`.
*
* Code adapted from `quantum.c` to register with the existing TIMER1 overflow
* handler in `backlight.c` instead of setting up its own timer.
* Kenneth A. (github.com/krusli | krusli.me)
*/
#ifdef BACKLIGHT_ENABLE
#ifdef BACKLIGHT_BREATHING
#include "backlight_custom.h"
#ifndef BREATHING_PERIOD
#define BREATHING_PERIOD 6
#endif
#define breathing_min() do {breathing_counter = 0;} while (0)
#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0)
// TODO make this share code with quantum.c
#define BREATHING_NO_HALT 0
#define BREATHING_HALT_OFF 1
#define BREATHING_HALT_ON 2
#define BREATHING_STEPS 128
static uint8_t breathing_period = BREATHING_PERIOD;
static uint8_t breathing_halt = BREATHING_NO_HALT;
static uint16_t breathing_counter = 0;
static bool breathing = false;
bool is_breathing(void) {
return breathing;
}
// See http://jared.geek.nz/2013/feb/linear-led-pwm
static uint16_t cie_lightness(uint16_t v) {
if (v <= 5243) // if below 8% of max
return v / 9; // same as dividing by 900%
else {
uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
// to get a useful result with integer division, we shift left in the expression above
// and revert what we've done again after squaring.
y = y * y * y >> 8;
if (y > 0xFFFFUL) // prevent overflow
return 0xFFFFU;
else
return (uint16_t) y;
}
}
void breathing_enable(void) {
breathing = true;
breathing_counter = 0;
breathing_halt = BREATHING_NO_HALT;
// interrupt already registered
}
void breathing_pulse(void) {
if (get_backlight_level() == 0)
breathing_min();
else
breathing_max();
breathing_halt = BREATHING_HALT_ON;
// breathing_interrupt_enable();
breathing = true;
}
void breathing_disable(void) {
breathing = false;
// backlight_set(get_backlight_level());
b_led_set(get_backlight_level()); // custom implementation of backlight_set()
}
void breathing_self_disable(void)
{
if (get_backlight_level() == 0)
breathing_halt = BREATHING_HALT_OFF;
else
breathing_halt = BREATHING_HALT_ON;
}
void breathing_toggle(void) {
if (is_breathing())
breathing_disable();
else
breathing_enable();
}
void breathing_period_set(uint8_t value)
{
if (!value)
value = 1;
breathing_period = value;
}
void breathing_period_default(void) {
breathing_period_set(BREATHING_PERIOD);
}
void breathing_period_inc(void)
{
breathing_period_set(breathing_period+1);
}
void breathing_period_dec(void)
{
breathing_period_set(breathing_period-1);
}
/* To generate breathing curve in python:
* from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
*/
static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// Use this before the cie_lightness function.
static inline uint16_t scale_backlight(uint16_t v) {
return v / BACKLIGHT_LEVELS * get_backlight_level();
}
void custom_breathing_handler(void) {
uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS;
// resetting after one period to prevent ugly reset at overflow.
breathing_counter = (breathing_counter + 1) % (breathing_period * 244);
uint8_t index = breathing_counter / interval % BREATHING_STEPS;
if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
{
// breathing_interrupt_disable();
}
setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U)));
}
#endif // BACKLIGHT_BREATHING
#endif // BACKLIGHT_ENABLE

@ -35,11 +35,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 15
#define DIODE_DIRECTION ROW2COL
#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 3
//#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 12
//#define RGB_DI_PIN C0
#define RGBLED_NUM 5
#define RGB_DI_PIN E2
#define RGBLED_NUM 12
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 12
#define RGBLIGHT_SAT_STEP 15

@ -16,7 +16,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "jj50.h"
#include "rgblight.h"
#include <avr/pgmspace.h>
@ -24,22 +23,72 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "i2c.h"
#include "quantum.h"
#include "backlight.h"
#include "backlight_custom.h"
// for keyboard subdirectory level init functions
// @Override
void matrix_init_kb(void) {
// call user level keymaps, if any
matrix_init_user();
}
#ifdef BACKLIGHT_ENABLE
/// Overrides functions in `quantum.c`
void backlight_init_ports(void) {
b_led_init_ports();
}
void backlight_task(void) {
b_led_task();
}
void backlight_set(uint8_t level) {
b_led_set(level);
}
#endif
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
// custom RGB driver
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
for (uint8_t i=0; i<RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
__attribute__ ((weak))
void matrix_scan_user(void) {
bool rgb_init = false;
void matrix_scan_kb(void) {
// if LEDs were previously on before poweroff, turn them back on
if (rgb_init == false && rgblight_config.enable) {
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
rgb_init = true;
}
rgblight_task();
}
#else
void matrix_scan_kb(void) {
#endif
matrix_scan_user();
/* Nothing else for now. */
}
__attribute__((weak)) // overridable
void matrix_init_user(void) {
}
__attribute__((weak)) // overridable
void matrix_scan_user(void) {
}

@ -20,11 +20,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
#include "quantum.h"
#include "quantum_keycodes.h"
#include "keycode.h"
#include "action.h"
#define KEYMAP( \
void matrix_init_user(void);
#define LAYOUT( \
K011, K010, K009, K008, K004, K005, K006, K007, K003, K002, K201, K000, \
K111, K110, K109, K108, K104, K105, K106, K107, K103, K102, K001, K100, \
K211, K210, K209, K208, K204, K205, K206, K207, K203, K202, K101, K200, \

@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public LicensezZZ
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "jj50.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
#include "rgblight.h"
@ -25,9 +25,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define _DEFLT 0
#define _RAISE 1
#define _LOWER 2
#define _FN 3
enum custom_keycodes {
P_MACRO = SAFE_RANGE
};
// GBP £ Macro (sends alt 156 - windows users only)
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch(keycode) {
case P_MACRO:
SEND_STRING(SS_DOWN(X_LALT));
SEND_STRING(SS_TAP(X_KP_1));
SEND_STRING(SS_TAP(X_KP_5));
SEND_STRING(SS_TAP(X_KP_6));
SEND_STRING(SS_UP(X_LALT));
return false; break;
}
}
return true;
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |
@ -36,20 +57,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | (Hold for shift / tap for enter)
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* | _FN | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DEFLT] = KEYMAP( \
[_DEFLT] = LAYOUT( \
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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT),\
BL_TOGG, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC,KC_SPC, MO(_RAISE),KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
MO(_FN), KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER),KC_SPC,KC_SPC,MO(_RAISE),KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
@ -63,15 +83,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT( \
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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
RESET, BL_INC, RGB_SAI, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, BL_DEC, _______, _______, _______, _______, _______, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \
RESET, BL_INC, RGB_SAI, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, BL_DEC, _______, _______, _______, _______, _______, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
@ -85,12 +105,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT( \
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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
RESET, _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_PIPE, \
RESET, _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, _______, _______, _______, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
)
BL_STEP, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Fn
* ,-----------------------------------------------------------------------------------.
* | | | £ | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | |BL_OFF|BL_DEC|BL_INC|BL_ON |
* `-----------------------------------------------------------------------------------'
*/
[_FN] = LAYOUT( \
_______, _______, P_MACRO, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, BL_OFF, BL_DEC, BL_INC, BL_ON \
)
};

@ -1,5 +1,6 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
Modified 2018 by Wayne K Jones <github.com/WarmCatUK>
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
@ -36,17 +37,20 @@ void matrix_init(void) {
// all inputs for columns
DDRA = 0x00;
DDRC &= ~(0x111111<<2);
DDRD &= ~(1<<PIND7);
//----> DDRD &= ~(1<<PIND7);
// Port D not used on this keyboard
// all columns are pulled-up
PORTA = 0xFF;
PORTC |= (0b111111<<2);
//PORTD |= (1<<PIND7);
// Port D not used on this keyboard
// initialize matrix state: all keys off
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix[row] = 0x00;
matrix_debouncing[row] = 0x00;
}
matrix_init_quantum(); // missing from original port by Luiz
}
void matrix_set_row_status(uint8_t row) {
@ -72,9 +76,6 @@ uint8_t matrix_scan(void) {
) | (
// cols 8..13, PORTC 7 -> 0
bit_reverse((~PINC) & 0xFF) << 8
) | (
// col 14, PORTD 7
((~PIND) & (1 << PIND7)) << 7
);
if (matrix_debouncing[row] != cols) {
@ -92,8 +93,8 @@ uint8_t matrix_scan(void) {
}
}
}
matrix_scan_user();
matrix_scan_quantum(); // also missing in original PS2AVRGB implementation
//matrix_scan_user();
return 1;
}

@ -36,16 +36,30 @@ BOOTMAGIC_ENABLE = yes
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = no
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes
NKRO_ENABLE = no
# Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
OPT_DEFS = -DDEBUG_LEVEL=0
DISABLE_WS2812 = no
KEY_LOCK_ENABLE = yes
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
#OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
CUSTOM_MATRIX = yes
SRC = matrix.c i2c.c
SRC = matrix.c i2c.c backlight.c
ifndef QUANTUM_DIR
include ../../../../Makefile
endif
# programming options
PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex

@ -241,8 +241,8 @@ section at the end of this file).
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
/* Version number of the device: Minor number first, then major number.
*/
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
#define USB_CFG_VENDOR_NAME_LEN 13
#define USB_CFG_VENDOR_NAME 'K', 'P', 'R', 'e', 'p', 'u', 'b', 'l', 'i', 'c'
#define USB_CFG_VENDOR_NAME_LEN 10
/* These two values define the vendor name returned by the USB device. The name
* must be given as a list of characters under single quotes. The characters
* are interpreted as Unicode (UTF-16) entities.
@ -251,8 +251,8 @@ section at the end of this file).
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
* details.
*/
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
#define USB_CFG_DEVICE_NAME_LEN 8
#define USB_CFG_DEVICE_NAME 'J','J','5','0',' ','K','e','y','b','o','a','r','d'
#define USB_CFG_DEVICE_NAME_LEN 13
/* Same as above for the device name. If you don't want a device name, undefine
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
* you use a shared VID/PID.

@ -1,6 +1,4 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
#include "keymap_german.h"
extern keymap_config_t keymap_config;

@ -1,11 +1,5 @@
#include "lets_split.h"
#include "bootloader.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
#include "LUFA/Drivers/Peripheral/TWI.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
#ifdef SSD1306OLED
#include "ssd1306.h"
#endif

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,4 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -40,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT(
[_QWERTY] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -58,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
[_COLEMAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -76,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
[_DVORAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
@ -94,7 +92,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT( \
[_LOWER] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
@ -112,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT( \
[_RAISE] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
@ -130,7 +128,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT( \
[_ADJUST] = LAYOUT_ortho_4x12( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \

@ -4,12 +4,7 @@
// Also, I like me some numpad
#include "lets_split.h"
#include "action_layer.h"
#ifdef AUDIO_ENABLE
#include "audio.h"
#endif
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -14,9 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,8 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "action_util.h"
#include "debug.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -43,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Numpad| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -61,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = KEYMAP( \
[_COLEMAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -79,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = KEYMAP( \
[_DVORAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
@ -97,7 +96,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
@ -115,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, \
@ -133,7 +132,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Qwerty| 0 | . | . |Enter |Enter | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = KEYMAP( \
[_NUMPAD] = LAYOUT_ortho_4x12( \
KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \
KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \
_______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \
@ -151,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = KEYMAP( \
[_ADJUST] = LAYOUT_ortho_4x12( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern rgblight_config_t rgblight_config;
extern keymap_config_t keymap_config;

@ -1,9 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -58,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Lock | Home | End | Alt | Lower| GUI | | Space| Raise| Left | Down | Up | Right|
* `-----------------------------------------' `-----------------------------------------'
*/
[_NORMAN] = KEYMAP( \
[_NORMAN] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_SCLN, KC_BSPC, \
CTL_ESC, KC_A, KC_S, KC_E, KC_T, KC_G, KC_Y, KC_N, KC_I, KC_O, KC_H, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \
@ -76,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Lock | Home | End | Alt | Lower| GUI | | . | Raise| 0 | Spot |Chrome| |
* `-----------------------------------------' `-----------------------------------------'
*/
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT_ortho_4x12( \
_______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PEQL, _______, \
_______, KC_F5, KC_F6, KC_F8, KC_F9, XXXXXXX, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_DEL, \
_______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_PSLS, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, \
@ -94,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Lock | Home | End | Alt | Lower| GUI | | Space| Raise| Left | Down | Up | Right|
* `-----------------------------------------' `-----------------------------------------'
*/
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT_ortho_4x12( \
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
_______, SH_SUDO, SH_GOUP, SLACK, SH_TERM, OUTLOOK, KC_EQL, KC_MINS, KC_BSLS, KC_LBRC, KC_RBRC, KC_GRV, \
_______, SH_CLRH, SH_CLRE, SH_HOME, SH_END, SH_RSCH, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, SCN_SHT, _______, \
@ -112,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | Lower| | | | Raise| | | | |
* `-----------------------------------------' `-----------------------------------------'
*/
[_ADJUST] = KEYMAP( \
[_ADJUST] = LAYOUT_ortho_4x12( \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, AU_ON, AU_OFF, XXXXXXX, NORMAN, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
//Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,9 +1,8 @@
// Waples layout for Let's Split (rev2)
// Made changes from the default
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -1,6 +1,5 @@
#include "lets_split.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;

@ -27,5 +27,6 @@
)
#define KC_LAYOUT_ortho_4x12 LAYOUT_kc
#define LAYOUT_kc_ortho_4x12 LAYOUT_kc
#endif

@ -1,6 +1,4 @@
#include "levinson.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -41,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -59,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
[_COLEMAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
@ -77,7 +75,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
[_DVORAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
@ -95,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT( \
[_LOWER] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
@ -113,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT( \
[_RAISE] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
@ -131,7 +129,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT( \
[_ADJUST] = LAYOUT_ortho_4x12( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \

@ -121,7 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT( \
[_ADJUST] = LAYOUT_ortho_4x12( \
_______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \

@ -1,6 +1,4 @@
#include "levinson.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
@ -28,7 +26,7 @@ extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = KC_KEYMAP(
[_BASE] = KC_LAYOUT_ortho_4x12(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
TAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
@ -40,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_FN1] = KC_KEYMAP(
[_FN1] = KC_LAYOUT_ortho_4x12(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
GRV, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
@ -52,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),
[_FN2] = KC_KEYMAP(
[_FN2] = KC_LAYOUT_ortho_4x12(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
@ -60,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,RHUD,RSAD,RVAD, , , , , , , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,RTOG,RMOD, , , , , , , , ,
,RTOG,RMOD, , , , , , , , ,
//`----+----+----+----+----+----' `----+----+----+----+----+----'
),

@ -24,5 +24,6 @@
)
#define KC_LAYOUT_ortho_4x12 LAYOUT_kc
#define LAYOUT_kc_ortho_4x12 LAYOUT_kc
#endif

@ -35,17 +35,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 8
#define MATRIX_COLS 15
#define RGB_DI_PIN C0
#define RGBLED_NUM 12
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 12
#define RGBLIGHT_SAT_STEP 15
#define RGBLIGHT_VAL_STEP 18
#define NO_UART 1
#define TAPPING_TERM 200
#define RGB_DI_PIN C0
#define RGBLED_NUM 12
#define RGBLIGHT_ANIMATIONS
/*
* Keyboard Matrix Assignments

@ -0,0 +1,11 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#define TAPPING_TERM 200
#define RGBLIGHT_HUE_STEP 12
#define RGBLIGHT_SAT_STEP 15
#define RGBLIGHT_VAL_STEP 18
#endif

@ -13,9 +13,8 @@
* 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 "mt40.h"
#include "action_layer.h"
#include "rgblight.h"
#include QMK_KEYBOARD_H
#define _______ KC_TRNS
#define OOOOOOO KC_TRNS
@ -30,7 +29,7 @@
#define C_ENT MT(MOD_RCTL, KC_ENT)
/*
/*
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+------+------+------+------+------+------+------|
@ -42,31 +41,31 @@
* `-----------------------------------------------------------------------------------'
*/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP(
[0] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
C_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, C_ENT, \
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \
C_LCTL, C_LGUI, MOD_LALT, MO(3), MO(1), KC_SPC, KC_SPC, MO(2), MO(4), MOD_RALT, C_RGUI, C_RCTL),
[1] = KEYMAP(
[1] = LAYOUT_ortho_4x12(
_______, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, \
_______, KC_F5, KC_F6, KC_F7, KC_F8, RGB_VAD, RGB_VAI, KC_P4, KC_P5, KC_P6, KC_PAST, _______, \
_______, KC_F1, KC_F2, KC_F3, KC_F4, BL_TOGG, BL_INC, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_PGUP, \
_______, _______, _______, _______, OOOOOOO, _______, _______, KC_P0, KC_PDOT, KC_PENT, KC_PPLS, KC_PGDN),
[2] = KEYMAP(
[2] = LAYOUT_ortho_4x12(
_______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_EQL, KC_LBRC, KC_RBRC, KC_NUBS, \
KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, OOOOOOO, KC_HOME, KC_PGDOWN, KC_PGUP, KC_END),
[3] = KEYMAP(
[3] = LAYOUT_ortho_4x12(
_______, _______, _______, _______, _______, _______, KC_COPY, KC_PGUP, _______, _______, KC_PASTE, KC_DEL, \
_______, _______, _______, KC_PGDN, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, \
_______, _______, KC_CUT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, OOOOOOO, _______, _______, _______, _______, _______, _______, _______, _______),
[4] = KEYMAP(
[4] = LAYOUT_ortho_4x12(
_______, _______, _______, _______, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, \
KC_PSCR, KC_INS, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, \
KC_CAPS, _______, KC_MPLY, KC_MRWD, KC_MFFD, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, \
@ -75,10 +74,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2),
[2] = ACTION_LAYER_MOMENTARY(3),
[3] = ACTION_LAYER_MOMENTARY(4),
};

@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <util/delay.h>
#include "matrix.h"
#include "config.h"
#ifndef DEBOUNCE
# define DEBOUNCE 5
@ -29,6 +30,26 @@ static uint8_t debouncing = DEBOUNCE;
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
matrix_scan_user();
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void matrix_init(void) {
// all outputs for rows high
DDRB = 0xFF;
@ -47,6 +68,7 @@ void matrix_init(void) {
matrix[row] = 0x00;
matrix_debouncing[row] = 0x00;
}
matrix_init_kb();
}
void matrix_set_row_status(uint8_t row) {
@ -93,7 +115,7 @@ uint8_t matrix_scan(void) {
}
}
matrix_scan_user();
matrix_scan_kb();
return 1;
}

@ -38,6 +38,7 @@ void rgblight_set(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
void matrix_scan_kb(void) {
rgblight_task();
matrix_init_user();
}

@ -16,9 +16,8 @@
#ifndef MT40_H
#define MT40_H
#include "quantum_keycodes.h"
#include "keycode.h"
#include "action.h"
#include "quantum.h"
// This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout
@ -40,48 +39,24 @@
{ KC_NO, KC_NO, K09, K19, K29, KC_NO, K2B, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K08, K18, K28 } \
}
/* #define KC_KEYMAP( \ */
/* k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ */
/* k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ */
/* k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ */
/* k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ */
/* ) \ */
/* { \ */
/* { KC_##k31, KC_##k32, KC_##k33, KC_NO, KC_##k34, KC_##k35, KC_NO, KC_NO, KC_NO, KC_NO, KC_##k37, KC_NO, KC_NO, KC_NO, KC_NO }, \ */
/* { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##k2a, KC_NO, KC_NO, KC_NO }, \ */
/* { KC_##k30, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_NO, KC_NO, KC_NO, KC_##k1b, KC_##k1a, KC_NO, KC_NO, KC_NO }, \ */
/* { KC_##k10, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##k0a, KC_NO, KC_NO, KC_NO }, \ */
/* { KC_##k00, 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_##k0b }, \ */
/* { KC_NO, KC_NO, KC_##k06, KC_##k16, KC_##k26, KC_##k36, KC_##k38, KC_##k3a, KC_##k17, KC_##k07, KC_NO, KC_NO, KC_##k3b, KC_##k39, KC_##k27 } \ */
/* { KC_NO, KC_NO, KC_##k09, KC_##k19, KC_##k29, KC_NO, KC_NO, KC_##k2b, KC_##k18, KC_##k08, KC_NO, KC_NO, KC_NO, KC_NO, KC_##k28 } \ */
/* } */
#define KC_KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
KEYMAP( \
KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
)
#define LAYOUT KEYMAP
#define LAYOUT_ortho_4x12 KEYMAP
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
#define LAYOUT_kc_ortho_4x12 KC_KEYMAP
/* #define FR_A KC_A */
/* #define FR_B KC_B */
/* #define FR_C KC_C */
/* #define FR_D KC_D */
/* #define FR_E KC_E */
/* #define FR_F KC_F */
/* #define FR_G KC_G */
/* #define FR_H KC_H */
/* #define FR_I KC_I */
/* #define FR_J KC_J */
/* #define FR_K KC_K */
/* #define FR_L KC_L */
/* #define FR_M KC_M */
/* #define FR_N KC_N */
/* #define FR_O KC_O */
/* #define FR_P KC_P */
/* #define FR_Q KC_Q */
/* #define FR_R KC_R */
/* #define FR_S KC_S */
/* #define FR_T KC_T */
/* #define FR_U KC_U */
/* #define FR_V KC_V */
/* #define FR_W KC_W */
/* #define FR_X KC_X */
/* #define FR_Y KC_Y */
/* #define FR_Z KC_Z */
#endif

@ -11,7 +11,7 @@ F_CPU = 12000000
# 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
# different sizes, comment this out, and the correct address will be loaded
# automatically (+60). See bootloader.mk for all options.
BOOTLOADER = bootloadHID
@ -39,3 +39,6 @@ SRC = matrix.c i2c.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
LAYOUTS = ortho_4x12 planck_mit planck_grid
LAYOUTS_HAS_RGB = no

@ -2,40 +2,28 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[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_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT},
{KC_LCTL, KC_LGUI, KC_CAPS, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT}
},
[1] = {
{KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS},
{KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, 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},
{RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
},
[2] = {
{KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS},
{KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS},
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
}
[0] = LAYOUT_ortho_4x12(
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT,
KC_LCTL, KC_LGUI, KC_CAPS, KC_LALT, MO(1), KC_SPC, KC_SPC, MO(2), KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_ortho_4x12(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, 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,
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[2] = LAYOUT_ortho_4x12(
KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
keyevent_t event = record->event;
switch (id) {
case 1:
// do nothing for now
if (event.pressed) {
;
}
}
return MACRO_NONE;
}
void matrix_init_user(void) {
}

@ -25,12 +25,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Caps | Esc | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_QWERTY] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
KC_CAPS, KC_ESC, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Lower
* ,-----------------------------------------------------------------------------------.
@ -43,12 +43,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______},
{_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), S(KC_BSLS), _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
[_LOWER] = LAYOUT_ortho_4x12(
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), S(KC_BSLS), _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),
/* Raise
* ,-----------------------------------------------------------------------------------.
@ -61,12 +61,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______},
{_______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______},
{_______, KC_DEL, KC_END, KC_PGDN, KC_NLCK, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
[_RAISE] = LAYOUT_ortho_4x12(
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
_______, KC_INS, KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______,
_______, KC_DEL, KC_END, KC_PGDN, KC_NLCK, _______, _______, KC_GRV, KC_BSLS, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
@ -79,12 +79,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{_______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_POWER},
{_______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_MOD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
[_ADJUST] = LAYOUT_ortho_4x12(
_______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_POWER,
_______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_HUI, RGB_HUD, RGB_MOD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {

@ -15,7 +15,6 @@
*/
#include QMK_KEYBOARD_H
#include "action_layer.h"
extern keymap_config_t keymap_config;
@ -53,12 +52,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_QWERTY] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Colemak
* ,-----------------------------------------------------------------------------------.
@ -71,12 +70,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = {
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
{KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_COLEMAK] = LAYOUT_ortho_4x12(
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Dvorak
* ,-----------------------------------------------------------------------------------.
@ -89,12 +88,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = {
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
{KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
},
[_DVORAK] = LAYOUT_ortho_4x12(
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Lower
* ,-----------------------------------------------------------------------------------.
@ -107,12 +106,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
[_LOWER] = LAYOUT_ortho_4x12(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),
/* Raise
* ,-----------------------------------------------------------------------------------.
@ -125,12 +124,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
},
[_RAISE] = LAYOUT_ortho_4x12(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
),
/* Plover layer (http://opensteno.org)
* ,-----------------------------------------------------------------------------------.
@ -144,12 +143,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------------------------------'
*/
[_PLOVER] = {
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
},
[_PLOVER] = LAYOUT_ortho_4x12(
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1,
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
),
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
@ -162,12 +161,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL },
{_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
}
[_ADJUST] = LAYOUT_ortho_4x12(
_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL ,
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};

@ -21,3 +21,4 @@ When adding your keymap to this list, keep it organised alphabetically (select l
- **default** default layout from KBDFans
- **mason**
- **planck** Planck default layout
- **xtonhasvim** A Planck-like layout with a few tweaks and a vim emulation layer.

@ -0,0 +1,49 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
#define MUSIC_MASK (keycode != KC_NO)
/*
* 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 2
// help for fast typist+dual function keys?
#define PERMISSIVE_HOLD
/* disable debug print */
#define NO_DEBUG
/* disable print */
#define NO_PRINT
/* speed up mousekeys a bit */
#define MOUSEKEY_DELAY 50
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_MAX_SPEED 8
#define MOUSEKEY_TIME_TO_MAX 30
#define MOUSEKEY_WHEEL_MAX_SPEED 8
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
#endif

@ -0,0 +1,200 @@
/* Copyright 2015-2017 Christon DeWan
*
* 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
#include "action_layer.h"
#include "xtonhasvim.h"
/************************************
* states
************************************/
enum layers {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST,
_MOVE,
_MOUSE
};
/************************************
* keymaps!
************************************/
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Ctrl*| A* | S | D | F | G | H | J | K | L | ;* | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Mouse| | Alt | GUI |Lower*| Space |Raise*| GUI | Alt | | Vim |
* `-----------------------------------------------------------------------------------'
*
* - Ctrl acts as Esc when tapped.
* - Holding A or ; switches to movement layer.
* - Raise and Lower are one-shot layers.
*/
[_QWERTY] = {
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
{LCTL_T(KC_ESC), LT(_MOVE,KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT},
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) },
{TG(_MOUSE), X_____X, KC_LALT, KC_LGUI, OSL(_LOWER), KC_SPC, KC_SPC, OSL(_RAISE), KC_LGUI, KC_LALT, X_____X, VIM_START }
},
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Bail | | | | | | | | Bail | |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = {
{KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC},
{KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY},
{X_____X, TO(_QWERTY), _______, _______, _______, KC_BSPC, KC_BSPC, OSL(_ADJUST), _______, _______, TO(_QWERTY), X_____X}
},
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Bail | | | | | | | | Bail | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = {
{KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC},
{KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS},
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY},
{X_____X, TO(_QWERTY), _______, _______, OSL(_ADJUST), X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X}
},
/* Adjust (Lower + Raise)
* ,-------------------------------------------------------------------------------------.
* |RGBPlain| Reset| | | | | | | | | | Del |
* |--------+------+------+------+------+-------------+------+------+------+------+------|
* |RGBMode-| | |Aud on|Audoff|AGnorm|AGswap| | | | |Lite+ |
* |--------+------+------+------+------+------|------+------+------+------+------+------|
* |RGBMode+|Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | |Lite- |
* |--------+------+------+------+------+------+------+------+------+------+------+------|
* | RGB | Bail | | | | | | | | Bail | |
* `-------------------------------------------------------------------------------------'
*/
[_ADJUST] = {
{RGB_MODE_PLAIN, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL },
{RGB_MODE_REVERSE, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, RGB_VAI},
{RGB_MODE_FORWARD, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, RGB_VAD},
{RGB_TOG, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X}
},
/* movement layer (hold semicolon)
*/
[_MOVE] = {
{TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X},
{_______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X},
{_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______},
{X_____X, TO(_QWERTY), _______, _______, _______, X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X}
},
/* mouse layer
*/
[_MOUSE] = {
{TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X },
{_______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X},
{_______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______},
{_______, TO(_QWERTY), _______, _______, _______, X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X}
},
/* vim edit mode. just has an escape -> _CMD key */
[_EDIT] = {
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{VIM_START, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
{_______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), _______}
},
/* vim command layer.
*/
[_CMD] = {
{X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X},
{VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X},
{VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT},
{X_____X, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X}
}
};
/** Set just 4 LEDs closest to the user. Slightly less annoying to bystanders.*/
void rgbflag(uint8_t r, uint8_t g, uint8_t b) {
for(int i = 0; i < RGBLED_NUM; i++){
switch(i) {
case 9 ... 12:
// rgblight_setrgb_at(r,g,b,i);
led[i].r = r;
led[i].g = g;
led[i].b = b;
break;
default:
// rgblight_setrgb_at(0,0,0,i);
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
break;
}
}
rgblight_set();
}
uint32_t layer_state_set_user(uint32_t state) {
if(rgblight_get_mode() == 1) {
switch (biton32(state)) {
case _RAISE:
case _LOWER:
case _ADJUST:
rgbflag(0x00, 0x00, 0xFF);
break;
case _MOVE:
case _MOUSE:
rgbflag(0xFF, 0x00, 0x00);
break;
case _CMD:
rgbflag(0x00, 0xFF, 0x00);
break;
case _EDIT:
rgbflag(0x7A, 0x00, 0xFF);
break;
default: // for any other layers, or the default layer
rgbflag(0x00, 0xFF, 0xFF);
break;
}
}
return state;
}

@ -0,0 +1,9 @@
# Xton has a tiny keyboard! With Vim!
Based on the standard Planck layout with a few changes:
* Escape moved to dual-function with control.
* Dedicated movement and mouse layers.
* Top and middle row swapped in `_RAISE` and `_LOWER` because I never use F-keys.
* Vim layers! See `users/xtonhasvim`.

@ -0,0 +1,6 @@
ifndef QUANTUM_DIR
include ../../../../Makefile
endif
MOUSEKEY_ENABLE = yes
BACKLIGHT_ENABLE = no

@ -29,7 +29,23 @@
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \
}
// Used to create a keymap using only KC_ prefixed keys
#define KC_KEYMAP( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
LAYOUT_grid( \
KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
)
#define LAYOUT LAYOUT_grid
#define LAYOUT_ortho_4x12 LAYOUT_grid
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
#define LAYOUT_kc_ortho_4x12 KC_KEYMAP
#endif

@ -66,3 +66,7 @@ API_SYSEX_ENABLE = no
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LAYOUTS = ortho_4x12 planck_mit planck_grid
LAYOUTS_HAS_RGB = no

@ -35,4 +35,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define MASTER_RIGHT
#define EE_HANDS
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \
}
#endif
#endif

@ -19,11 +19,7 @@ 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 "orthodox.h"
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@ -39,10 +35,7 @@ extern keymap_config_t keymap_config;
enum custom_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
RAISE,
ADJUST,
DVORAK
};
// Fillers to make layering more clear
@ -50,113 +43,71 @@ enum custom_keycodes {
#define XXXXXXX KC_NO
#define LS__SPC MT(MOD_LSFT, KC_SPC)
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT( \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, LOWER, KC_BSPC, KC_ENT, KC_RALT, LS__SPC, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI \
),
[_COLEMAK] = KEYMAP(\
[_COLEMAK] = LAYOUT(\
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH, KC_LGUI \
),
[_DVORAK] = KEYMAP(\
[_DVORAK] = LAYOUT(\
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \
KC_LCTL, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LGUI \
),
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCTL, _______, _______, KC_RCTL, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, _______, _______, KC_F12, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \
),
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, _______, _______, KC_F12, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \
),
[_ADJUST] = KEYMAP( \
[_ADJUST] = LAYOUT( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, QWERTY , COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, QWERTY , COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \
)
};
#ifdef AUDIO_ENABLE
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
persistent_default_layer_set(1UL<<_QWERTY);
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
persistent_default_layer_set(1UL<<_COLEMAK);
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
set_single_persistent_default_layer(_DVORAK);
}
return false;
break;

@ -57,25 +57,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TAB, _________________WORKMAN_L2________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________WORKMAN_R2________________, KC_MINS,
KC_MLSF, _________________WORKMAN_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________WORKMAN_R3________________, KC_LGUI
),
[_MODS] = LAYOUT(\
[_MODS] = LAYOUT_wrapper(\
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
[_LOWER] = LAYOUT(\
[_LOWER] = LAYOUT_wrapper(\
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, _______
),
[_RAISE] = LAYOUT(\
[_RAISE] = LAYOUT_wrapper(\
KC_GRV, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_BSPC,
_______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_HOME, KC_END, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, _______
),
[_ADJUST] = LAYOUT(\
[_ADJUST] = LAYOUT_wrapper(\
KC_MAKE,KC_RESET, EPRM, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_SMOD,RGB_HUI, CK_TOGG, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, TG(_MODS),
KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY

@ -19,11 +19,8 @@ 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 "orthodox.h"
#include "action_layer.h"
#include "eeconfig.h"
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
@ -53,25 +50,25 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KEYMAP( \
[_QWERTY] = LAYOUT( \
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, TT(_RAISE), TT(_LOWER), TT(_LOWER), TT(_RAISE), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, NAV_TAP, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT \
),
[_LOWER] = KEYMAP( \
[_LOWER] = LAYOUT( \
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_INS, _______, _______, CC_PRN, CC_BRC, CC_CBR, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU \
),
[_RAISE] = KEYMAP( \
[_RAISE] = LAYOUT( \
KC_CAPS, KC_AMPR, KC_ASTR, KC_UNDS, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_EQL, _______, _______, \
_______, KC_DLR, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, _______, \
CC_ARRW, KC_EXLM, KC_AT, KC_HASH, KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_DOT, KC_BSLS, KC_PIPE \
),
[_NAV] = KEYMAP( \
[_NAV] = LAYOUT( \
_______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, _______, \
_______, _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \

@ -12,7 +12,7 @@
#endif
// Used to create a keymap using only KC_ prefixed keys
#define KC_KEYMAP( \
#define LAYOUT_kc( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, L16, L18, R10, R12, R13, R14, R15, R16, R17, R18, \
L20, L21, L22, L23, L24, L25, L26, L27, L28, R20, R21, R22, R23, R24, R25, R26, R27, R28 \

@ -1,11 +1,11 @@
{
"keyboard_name": "Monkeebs Orthodox Rev.1",
"maintainer": "qmk",
"width": 17,
"height": 17.24,
"keyboard_name": "Monkeebs Orthodox Rev.1",
"maintainer": "qmk",
"width": 17,
"height": 17.24,
"layouts": {
"KEYMAP": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}]
"LAYOUT": {
"layout": [{"label":"TAB", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":13, "y":0}, {"label":"U", "x":14, "y":0}, {"label":"I", "x":15, "y":0}, {"label":"O", "x":16, "y":0}, {"x":17, "y":0}, {"x":17, "y":0}, {"label":"P", "x":17, "y":0}, {"label":"BSPC", "x":18, "y":0}, {"label":"ESC", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"LEFT", "x":7, "y":1}, {"label":"DOWN", "x":8, "y":1}, {"label":"UP", "x":10, "y":1}, {"label":"RGHT", "x":11, "y":1}, {"label":"H", "x":13, "y":1}, {"label":"J", "x":14, "y":1}, {"label":"K", "x":15, "y":1}, {"label":"L", "x":16, "y":1}, {"label":";", "x":17, "y":1}, {"label":"'", "x":18, "y":1}, {"label":"CTRL", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"LOWER", "x":6, "y":2}, {"label":"BSPC", "x":7, "y":2}, {"label":"ENT", "x":8, "y":2}, {"label":"RALT", "x":10, "y":2}, {"label":"SPC", "x":11, "y":2}, {"label":"RAISE", "x":12, "y":2}, {"label":"N", "x":13, "y":2}, {"label":"M", "x":14, "y":2}, {"label":",", "x":15, "y":2}, {"label":".", "x":16, "y":2}, {"label":"/", "x":17, "y":2}, {"label":"LGUI", "x":18, "y":2}]
}
}
}

@ -33,3 +33,18 @@ void matrix_init_kb(void) {
matrix_init_user();
};
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}, {6,3}, {7,3}, {8,3}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}, {6,4}, {7,4}, {8,4}},
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}, {6,5}, {7,5}, {8,5}},
/* Right hand, matrix positions */
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}, {6,2}, {7,2}, {8,2}},
};
#endif

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//void promicro_bootloader_jmp(bool program);
#define KEYMAP( \
#define LAYOUT( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, L16, L18, R10, R12, R13, R14, R15, R16, R17, R18, \
L20, L21, L22, L23, L24, L25, L26, L27, L28, R20, R21, R22, R23, R24, R25, R26, R27, R28 \

@ -1,11 +1,11 @@
{
"keyboard_name": "Monkeebs Orthodox Rev.3",
"maintainer": "qmk",
"width": 17,
"height": 17.24,
"keyboard_name": "Monkeebs Orthodox Rev.3",
"maintainer": "qmk",
"width": 17,
"height": 17.24,
"layouts": {
"KEYMAP": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}]
"LAYOUT": {
"layout": [{"label":"TAB", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":13, "y":0}, {"label":"U", "x":14, "y":0}, {"label":"I", "x":15, "y":0}, {"label":"O", "x":16, "y":0}, {"x":17, "y":0}, {"x":17, "y":0}, {"label":"P", "x":17, "y":0}, {"label":"BSPC", "x":18, "y":0}, {"label":"ESC", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"LEFT", "x":7, "y":1}, {"label":"DOWN", "x":8, "y":1}, {"label":"UP", "x":10, "y":1}, {"label":"RGHT", "x":11, "y":1}, {"label":"H", "x":13, "y":1}, {"label":"J", "x":14, "y":1}, {"label":"K", "x":15, "y":1}, {"label":"L", "x":16, "y":1}, {"label":";", "x":17, "y":1}, {"label":"'", "x":18, "y":1}, {"label":"CTRL", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"LOWER", "x":6, "y":2}, {"label":"BSPC", "x":7, "y":2}, {"label":"ENT", "x":8, "y":2}, {"label":"RALT", "x":10, "y":2}, {"label":"SPC", "x":11, "y":2}, {"label":"RAISE", "x":12, "y":2}, {"label":"N", "x":13, "y":2}, {"label":"M", "x":14, "y":2}, {"label":",", "x":15, "y":2}, {"label":".", "x":16, "y":2}, {"label":"/", "x":17, "y":2}, {"label":"LGUI", "x":18, "y":2}]
}
}
}

@ -33,3 +33,18 @@ void matrix_init_kb(void) {
matrix_init_user();
};
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}, {6,3}, {7,3}, {8,3}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}, {6,4}, {7,4}, {8,4}},
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}, {6,5}, {7,5}, {8,5}},
/* Right hand, matrix positions */
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}, {6,2}, {7,2}, {8,2}},
};
#endif

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//void promicro_bootloader_jmp(bool program);
#define KEYMAP( \
#define LAYOUT( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, L16, L18, R10, R12, R13, R14, R15, R16, R17, R18, \
L20, L21, L22, L23, L24, L25, L26, L27, L28, R20, R21, R22, R23, R24, R25, R26, R27, R28 \

@ -1,11 +1,11 @@
{
"keyboard_name": "Monkeebs Orthodox Rev.3",
"maintainer": "qmk",
"width": 17,
"height": 17.24,
"keyboard_name": "Monkeebs Orthodox Rev.3",
"maintainer": "qmk",
"width": 17,
"height": 17.24,
"layouts": {
"KEYMAP": {
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}]
"LAYOUT": {
"layout": [{"label":"TAB", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":13, "y":0}, {"label":"U", "x":14, "y":0}, {"label":"I", "x":15, "y":0}, {"label":"O", "x":16, "y":0}, {"x":17, "y":0}, {"x":17, "y":0}, {"label":"P", "x":17, "y":0}, {"label":"BSPC", "x":18, "y":0}, {"label":"ESC", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"LEFT", "x":7, "y":1}, {"label":"DOWN", "x":8, "y":1}, {"label":"UP", "x":10, "y":1}, {"label":"RGHT", "x":11, "y":1}, {"label":"H", "x":13, "y":1}, {"label":"J", "x":14, "y":1}, {"label":"K", "x":15, "y":1}, {"label":"L", "x":16, "y":1}, {"label":";", "x":17, "y":1}, {"label":"'", "x":18, "y":1}, {"label":"CTRL", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"LOWER", "x":6, "y":2}, {"label":"BSPC", "x":7, "y":2}, {"label":"ENT", "x":8, "y":2}, {"label":"RALT", "x":10, "y":2}, {"label":"SPC", "x":11, "y":2}, {"label":"RAISE", "x":12, "y":2}, {"label":"N", "x":13, "y":2}, {"label":"M", "x":14, "y":2}, {"label":",", "x":15, "y":2}, {"label":".", "x":16, "y":2}, {"label":"/", "x":17, "y":2}, {"label":"LGUI", "x":18, "y":2}]
}
}
}

@ -33,3 +33,18 @@ void matrix_init_kb(void) {
matrix_init_user();
};
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
/* Left hand, matrix positions */
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}, {6,3}, {7,3}, {8,3}},
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}, {6,4}, {7,4}, {8,4}},
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}, {6,5}, {7,5}, {8,5}},
/* Right hand, matrix positions */
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}},
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}},
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}, {6,2}, {7,2}, {8,2}},
};
#endif

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//void promicro_bootloader_jmp(bool program);
#define KEYMAP( \
#define LAYOUT( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, L16, L18, R10, R12, R13, R14, R15, R16, R17, R18, \
L20, L21, L22, L23, L24, L25, L26, L27, L28, R20, R21, R22, R23, R24, R25, R26, R27, R28 \

@ -0,0 +1,28 @@
{
"keyboard_name": "paladin64",
"url": "",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_all": {
"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":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}]
},
"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}]
},
"LAYOUT_infinity": {
"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":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":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"label":"Alt", "x":10, "y":4, "w":1.5}, {"label":"Win", "x":11.5, "y":4}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
},
"LAYOUT_aek_103": {
"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.5}, {"label":"Win", "x":1.5, "y":4, "w":1.25}, {"label":"Alt", "x":2.75, "y":4, "w":1.5}, {"x":4.25, "y":4, "w":6.5}, {"label":"Alt", "x":10.75, "y":4, "w":1.5}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
},
"LAYOUT_iso": {
"layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"AltGr", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
}
}
}

@ -1,10 +1,10 @@
#include "paladin64.h"
#include QMK_KEYBOARD_H
const uint16_t PROGMEM fn_actions[] = {};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY */
KEYMAP(
LAYOUT_all(
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_GRV, KC_BSLS,
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_BSPC,
MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_APP, KC_RGUI, KC_RALT, KC_LCTL),
/* DVORAK */
KEYMAP(
LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_GRV, KC_BSLS,
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC,
MO(3), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT,
@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_APP, KC_RGUI, KC_RALT, KC_RCTL),
/* COLEMAK */
KEYMAP(
LAYOUT_all(
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_GRV, KC_BSLS,
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC,
MO(3), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT,
@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_APP, KC_RGUI, KC_RALT, KC_RCTL),
/* FUNCTION */
KEYMAP(
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_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_BSPC,
KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS,
@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, KC_TRNS, RGB_TOG),
/* AutoMouse */
KEYMAP(
LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,

@ -3,7 +3,7 @@
#include "quantum.h"
#define KEYMAP( \
#define LAYOUT_all( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
@ -20,4 +20,73 @@
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
}
#define LAYOUT_iso( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \
K30, K40, K50, K60, K70, K00, K20 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ KC_NO, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
}
#define LAYOUT_60_ansi( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \
K30, K40, K50, K60, K70, K00, K10, K20 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
}
#define LAYOUT_infinity( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \
K30, K40, K50, K60, K70, K00, K10, K20 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
}
#define LAYOUT_aek_103( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \
K30, K40, K50, K60, K70, K00, K20 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ KC_NO, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
}
#endif

@ -58,3 +58,5 @@ RGBLIGHT_ENABLE ?= yes
#PS2_MOUSE_ENABLE ?= yes
#PS2_USE_USART ?= yes
#PS2_USE_INT ?= yes
LAYOUTS = 60_ansi

@ -0,0 +1,58 @@
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER Play Keyboard
#define PRODUCT pk60
#define DESCRIPTION A 60% keyboard PCB
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
/* key matrix pins */
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, F7, B5, B4, D7, D6, B3, B2 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* number of backlight levels */
#define BACKLIGHT_PIN B7
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 5
#endif
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS
#define RGB_DI_PIN E2
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 12
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif
#endif

@ -0,0 +1,32 @@
{
"keyboard_name": "pk60",
"url": "",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_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":"Del", "x":13, "y":0}, {"label":"Bs", "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":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":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":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}]
},
"LAYOUT_iso": {
"layout": [{"label":"~", "x":0, "y":0.25}, {"label":"!", "x":1, "y":0.25}, {"label":"@", "x":2, "y":0.25}, {"label":"#", "x":3, "y":0.25}, {"label":"$", "x":4, "y":0.25}, {"label":"%", "x":5, "y":0.25}, {"label":"^", "x":6, "y":0.25}, {"label":"&", "x":7, "y":0.25}, {"label":"*", "x":8, "y":0.25}, {"label":"(", "x":9, "y":0.25}, {"label":")", "x":10, "y":0.25}, {"label":"_", "x":11, "y":0.25}, {"label":"+", "x":12, "y":0.25}, {"label":"Del", "x":13, "y":0.25}, {"label":"Bs", "x":14, "y":0.25}, {"label":"Tab", "x":0, "y":1.25, "w":1.5}, {"label":"Q", "x":1.5, "y":1.25}, {"label":"W", "x":2.5, "y":1.25}, {"label":"E", "x":3.5, "y":1.25}, {"label":"R", "x":4.5, "y":1.25}, {"label":"T", "x":5.5, "y":1.25}, {"label":"Y", "x":6.5, "y":1.25}, {"label":"U", "x":7.5, "y":1.25}, {"label":"I", "x":8.5, "y":1.25}, {"label":"O", "x":9.5, "y":1.25}, {"label":"P", "x":10.5, "y":1.25}, {"label":"{", "x":11.5, "y":1.25}, {"label":"}", "x":12.5, "y":1.25}, {"label":"Enter", "x":13.75, "y":1.25, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, {"label":"A", "x":1.75, "y":2.25}, {"label":"S", "x":2.75, "y":2.25}, {"label":"D", "x":3.75, "y":2.25}, {"label":"F", "x":4.75, "y":2.25}, {"label":"G", "x":5.75, "y":2.25}, {"label":"H", "x":6.75, "y":2.25}, {"label":"J", "x":7.75, "y":2.25}, {"label":"K", "x":8.75, "y":2.25}, {"label":"L", "x":9.75, "y":2.25}, {"label":":", "x":10.75, "y":2.25}, {"label":"@", "x":11.75, "y":2.25}, {"label":"~", "x":12.75, "y":2.25}, {"label":"Shift", "x":0, "y":3.25, "w":1.25}, {"label":"|", "x":1.25, "y":3.25}, {"label":"Z", "x":2.25, "y":3.25}, {"label":"X", "x":3.25, "y":3.25}, {"label":"C", "x":4.25, "y":3.25}, {"label":"V", "x":5.25, "y":3.25}, {"label":"B", "x":6.25, "y":3.25}, {"label":"N", "x":7.25, "y":3.25}, {"label":"M", "x":8.25, "y":3.25}, {"label":"<", "x":9.25, "y":3.25}, {"label":">", "x":10.25, "y":3.25}, {"label":"?", "x":11.25, "y":3.25}, {"label":"Shift", "x":12.25, "y":3.25, "w":1.75}, {"x":14, "y":3.25}, {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, {"x":3.75, "y":4.25, "w":6.25}, {"label":"Alt", "x":10, "y":4.25, "w":1.25}, {"label":"Win", "x":11.25, "y":4.25, "w":1.25}, {"label":"Menu", "x":12.5, "y":4.25, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4.25, "w":1.25}]
},
"LAYOUT_225u_arrow": {
"layout": [{"label":"~", "x":0, "y":0.25}, {"label":"!", "x":1, "y":0.25}, {"label":"@", "x":2, "y":0.25}, {"label":"#", "x":3, "y":0.25}, {"label":"$", "x":4, "y":0.25}, {"label":"%", "x":5, "y":0.25}, {"label":"^", "x":6, "y":0.25}, {"label":"&", "x":7, "y":0.25}, {"label":"*", "x":8, "y":0.25}, {"label":"(", "x":9, "y":0.25}, {"label":")", "x":10, "y":0.25}, {"label":"_", "x":11, "y":0.25}, {"label":"+", "x":12, "y":0.25}, {"label":"Del", "x":13, "y":0.25}, {"label":"Bs", "x":14, "y":0.25}, {"label":"Tab", "x":0, "y":1.25, "w":1.5}, {"label":"Q", "x":1.5, "y":1.25}, {"label":"W", "x":2.5, "y":1.25}, {"label":"E", "x":3.5, "y":1.25}, {"label":"R", "x":4.5, "y":1.25}, {"label":"T", "x":5.5, "y":1.25}, {"label":"Y", "x":6.5, "y":1.25}, {"label":"U", "x":7.5, "y":1.25}, {"label":"I", "x":8.5, "y":1.25}, {"label":"O", "x":9.5, "y":1.25}, {"label":"P", "x":10.5, "y":1.25}, {"label":"{", "x":11.5, "y":1.25}, {"label":"}", "x":12.5, "y":1.25}, {"label":"|", "x":13.5, "y":1.25, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, {"label":"A", "x":1.75, "y":2.25}, {"label":"S", "x":2.75, "y":2.25}, {"label":"D", "x":3.75, "y":2.25}, {"label":"F", "x":4.75, "y":2.25}, {"label":"G", "x":5.75, "y":2.25}, {"label":"H", "x":6.75, "y":2.25}, {"label":"J", "x":7.75, "y":2.25}, {"label":"K", "x":8.75, "y":2.25}, {"label":"L", "x":9.75, "y":2.25}, {"label":":", "x":10.75, "y":2.25}, {"label":"\"", "x":11.75, "y":2.25}, {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, {"label":"Shift", "x":0, "y":3.25, "w":2.25}, {"label":"Z", "x":2.25, "y":3.25}, {"label":"X", "x":3.25, "y":3.25}, {"label":"C", "x":4.25, "y":3.25}, {"label":"V", "x":5.25, "y":3.25}, {"label":"B", "x":6.25, "y":3.25}, {"label":"N", "x":7.25, "y":3.25}, {"label":"M", "x":8.25, "y":3.25}, {"label":"<", "x":9.25, "y":3.25}, {"label":">", "x":10.25, "y":3.25}, {"label":"Shift", "x":11.25, "y":3.25, "w":1.75}, {"label":"Up", "x":13, "y":3.25}, {"x":14, "y":3.25}, {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, {"x":3.75, "y":4.25, "w":6.25}, {"label":"Alt", "x":10, "y":4.25}, {"label":"Ctrl", "x":11, "y":4.25}, {"label":"Left", "x":12, "y":4.25}, {"label":"Down", "x":13, "y":4.25}, {"label":"Right", "x":14, "y":4.25}]
},
"LAYOUT_2u_arrow": {
"layout": [{"label":"~", "x":0, "y":0.25}, {"label":"!", "x":1, "y":0.25}, {"label":"@", "x":2, "y":0.25}, {"label":"#", "x":3, "y":0.25}, {"label":"$", "x":4, "y":0.25}, {"label":"%", "x":5, "y":0.25}, {"label":"^", "x":6, "y":0.25}, {"label":"&", "x":7, "y":0.25}, {"label":"*", "x":8, "y":0.25}, {"label":"(", "x":9, "y":0.25}, {"label":")", "x":10, "y":0.25}, {"label":"_", "x":11, "y":0.25}, {"label":"+", "x":12, "y":0.25}, {"label":"Del", "x":13, "y":0.25}, {"label":"Bs", "x":14, "y":0.25}, {"label":"Tab", "x":0, "y":1.25, "w":1.5}, {"label":"Q", "x":1.5, "y":1.25}, {"label":"W", "x":2.5, "y":1.25}, {"label":"E", "x":3.5, "y":1.25}, {"label":"R", "x":4.5, "y":1.25}, {"label":"T", "x":5.5, "y":1.25}, {"label":"Y", "x":6.5, "y":1.25}, {"label":"U", "x":7.5, "y":1.25}, {"label":"I", "x":8.5, "y":1.25}, {"label":"O", "x":9.5, "y":1.25}, {"label":"P", "x":10.5, "y":1.25}, {"label":"{", "x":11.5, "y":1.25}, {"label":"}", "x":12.5, "y":1.25}, {"label":"|", "x":13.5, "y":1.25, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, {"label":"A", "x":1.75, "y":2.25}, {"label":"S", "x":2.75, "y":2.25}, {"label":"D", "x":3.75, "y":2.25}, {"label":"F", "x":4.75, "y":2.25}, {"label":"G", "x":5.75, "y":2.25}, {"label":"H", "x":6.75, "y":2.25}, {"label":"J", "x":7.75, "y":2.25}, {"label":"K", "x":8.75, "y":2.25}, {"label":"L", "x":9.75, "y":2.25}, {"label":":", "x":10.75, "y":2.25}, {"label":"\"", "x":11.75, "y":2.25}, {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, {"label":"Shift", "x":0, "y":3.25, "w":2}, {"label":"Z", "x":2, "y":3.25}, {"label":"X", "x":3, "y":3.25}, {"label":"C", "x":4, "y":3.25}, {"label":"V", "x":5, "y":3.25}, {"label":"B", "x":6, "y":3.25}, {"label":"N", "x":7, "y":3.25}, {"label":"M", "x":8, "y":3.25}, {"label":"<", "x":9, "y":3.25}, {"label":">", "x":10, "y":3.25}, {"label":"?", "x":11, "y":3.25}, {"label":"Shift", "x":12, "y":3.25}, {"label":"Up", "x":13, "y":3.25}, {"x":14, "y":3.25}, {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, {"x":3.75, "y":4.25, "w":6.25}, {"label":"Alt", "x":10, "y":4.25}, {"label":"Ctrl", "x":11, "y":4.25}, {"label":"Left", "x":12, "y":4.25}, {"label":"Down", "x":13, "y":4.25}, {"label":"Right", "x":14, "y":4.25}]
},
"LAYOUT_minila": {
"layout": [{"label":"~", "x":0, "y":0.25}, {"label":"!", "x":1, "y":0.25}, {"label":"@", "x":2, "y":0.25}, {"label":"#", "x":3, "y":0.25}, {"label":"$", "x":4, "y":0.25}, {"label":"%", "x":5, "y":0.25}, {"label":"^", "x":6, "y":0.25}, {"label":"&", "x":7, "y":0.25}, {"label":"*", "x":8, "y":0.25}, {"label":"(", "x":9, "y":0.25}, {"label":")", "x":10, "y":0.25}, {"label":"_", "x":11, "y":0.25}, {"label":"+", "x":12, "y":0.25}, {"label":"Del", "x":13, "y":0.25}, {"label":"Bs", "x":14, "y":0.25}, {"label":"Tab", "x":0, "y":1.25, "w":1.5}, {"label":"Q", "x":1.5, "y":1.25}, {"label":"W", "x":2.5, "y":1.25}, {"label":"E", "x":3.5, "y":1.25}, {"label":"R", "x":4.5, "y":1.25}, {"label":"T", "x":5.5, "y":1.25}, {"label":"Y", "x":6.5, "y":1.25}, {"label":"U", "x":7.5, "y":1.25}, {"label":"I", "x":8.5, "y":1.25}, {"label":"O", "x":9.5, "y":1.25}, {"label":"P", "x":10.5, "y":1.25}, {"label":"{", "x":11.5, "y":1.25}, {"label":"}", "x":12.5, "y":1.25}, {"label":"|", "x":13.5, "y":1.25, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, {"label":"A", "x":1.75, "y":2.25}, {"label":"S", "x":2.75, "y":2.25}, {"label":"D", "x":3.75, "y":2.25}, {"label":"F", "x":4.75, "y":2.25}, {"label":"G", "x":5.75, "y":2.25}, {"label":"H", "x":6.75, "y":2.25}, {"label":"J", "x":7.75, "y":2.25}, {"label":"K", "x":8.75, "y":2.25}, {"label":"L", "x":9.75, "y":2.25}, {"label":":", "x":10.75, "y":2.25}, {"label":"\"", "x":11.75, "y":2.25}, {"label":"Enter", "x":12.75, "y":2.25, "w":2.25}, {"label":"Shift", "x":0, "y":3.25, "w":2}, {"label":"Z", "x":2, "y":3.25}, {"label":"X", "x":3, "y":3.25}, {"label":"C", "x":4, "y":3.25}, {"label":"V", "x":5, "y":3.25}, {"label":"B", "x":6, "y":3.25}, {"label":"N", "x":7, "y":3.25}, {"label":"M", "x":8, "y":3.25}, {"label":"<", "x":9, "y":3.25}, {"label":">", "x":10, "y":3.25}, {"label":"?", "x":11, "y":3.25}, {"label":"Shift", "x":12, "y":3.25}, {"label":"Up", "x":13, "y":3.25}, {"x":14, "y":3.25}, {"label":"Ctrl", "x":0, "y":4.25, "w":1.75}, {"label":"Win", "x":1.75, "y":4.25, "w":1.25}, {"label":"Alt", "x":3, "y":4.25, "w":1.25}, {"x":4.25, "y":4.25, "w":1.25}, {"x":5.5, "y":4.25, "w":3}, {"label":"Alt", "x":8.5, "y":4.25, "w":1.25}, {"label":"Ctrl", "x":9.75, "y":4.25, "w":1.25}, {"x":11, "y":4.25}, {"label":"Left", "x":12, "y":4.25}, {"label":"Down", "x":13, "y":4.25}, {"label":"Right", "x":14, "y":4.25}]
},
"LAYOUT_all": {
"layout": [{"label":"~", "x":0, "y":0.25}, {"label":"!", "x":1, "y":0.25}, {"label":"@", "x":2, "y":0.25}, {"label":"#", "x":3, "y":0.25}, {"label":"$", "x":4, "y":0.25}, {"label":"%", "x":5, "y":0.25}, {"label":"^", "x":6, "y":0.25}, {"label":"&", "x":7, "y":0.25}, {"label":"*", "x":8, "y":0.25}, {"label":"(", "x":9, "y":0.25}, {"label":")", "x":10, "y":0.25}, {"label":"_", "x":11, "y":0.25}, {"label":"+", "x":12, "y":0.25}, {"label":"Del", "x":13, "y":0.25}, {"label":"Bs", "x":14, "y":0.25}, {"label":"Tab", "x":0, "y":1.25, "w":1.5}, {"label":"Q", "x":1.5, "y":1.25}, {"label":"W", "x":2.5, "y":1.25}, {"label":"E", "x":3.5, "y":1.25}, {"label":"R", "x":4.5, "y":1.25}, {"label":"T", "x":5.5, "y":1.25}, {"label":"Y", "x":6.5, "y":1.25}, {"label":"U", "x":7.5, "y":1.25}, {"label":"I", "x":8.5, "y":1.25}, {"label":"O", "x":9.5, "y":1.25}, {"label":"P", "x":10.5, "y":1.25}, {"label":"{", "x":11.5, "y":1.25}, {"label":"}", "x":12.5, "y":1.25}, {"label":"|", "x":13.5, "y":1.25, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2.25, "w":1.75}, {"label":"A", "x":1.75, "y":2.25}, {"label":"S", "x":2.75, "y":2.25}, {"label":"D", "x":3.75, "y":2.25}, {"label":"F", "x":4.75, "y":2.25}, {"label":"G", "x":5.75, "y":2.25}, {"label":"H", "x":6.75, "y":2.25}, {"label":"J", "x":7.75, "y":2.25}, {"label":"K", "x":8.75, "y":2.25}, {"label":"L", "x":9.75, "y":2.25}, {"label":":", "x":10.75, "y":2.25}, {"label":"\"", "x":11.75, "y":2.25}, {"label":"\"", "x":12.75, "y":2.25}, {"label":"Enter", "x":13.75, "y":2.25, "w":1.25}, {"label":"Shift", "x":0, "y":3.25}, {"x":1, "y":3.25}, {"label":"Z", "x":2, "y":3.25}, {"label":"X", "x":3, "y":3.25}, {"label":"C", "x":4, "y":3.25}, {"label":"V", "x":5, "y":3.25}, {"label":"B", "x":6, "y":3.25}, {"label":"N", "x":7, "y":3.25}, {"label":"M", "x":8, "y":3.25}, {"label":"<", "x":9, "y":3.25}, {"label":">", "x":10, "y":3.25}, {"label":"?", "x":11, "y":3.25}, {"label":"Shift", "x":12, "y":3.25}, {"label":"Up", "x":13, "y":3.25}, {"x":14, "y":3.25}, {"label":"Ctrl", "x":0, "y":4.25, "w":1.25}, {"label":"Win", "x":1.25, "y":4.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":4.25, "w":1.25}, {"x":3.75, "y":4.25}, {"x":4.75, "y":4.25, "w":5.25}, {"label":"Alt", "x":10, "y":4.25}, {"label":"Ctrl", "x":11, "y":4.25}, {"label":"Left", "x":12, "y":4.25}, {"label":"Down", "x":13, "y":4.25}, {"label":"Right", "x":14, "y":4.25}]
}
}
}

@ -0,0 +1,59 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT_all(
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_NO, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, 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_NO, KC_RSFT, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(1), KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL),
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_TRNS, KC_DEL,
RESET, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_PSCR, KC_CALC,
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_SLCK, KC_TRNS,
KC_TRNS, KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
};
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
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)) {
DDRF |= (1 << 4); PORTF &= ~(1 << 4);
} else {
DDRF &= ~(1 << 4); PORTF &= ~(1 << 4);
}
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 {
}
}

@ -0,0 +1,3 @@
# Default Play Keyboard60 Layout
This is the default layout that comes flashed on every Play Keyboard60. All key pins are shown in the file.

@ -0,0 +1 @@
#include "pk60.h"

@ -0,0 +1,90 @@
#ifndef pk60_H
#define pk60_H
#include "quantum.h"
#define LAYOUT_ansi( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \
K40, K41, K42, K47, K49, K4A, K4C, K4D \
) { \
{ 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, KC_NO }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \
{ K40, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, K49, K4A, KC_NO, K4C, K4D, KC_NO } \
}
#define LAYOUT_iso( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \
K40, K41, K42, K47, K49, K4A, K4C, K4D \
) { \
{ 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, KC_NO, KC_NO }, \
{ K20, K21, 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, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, K49, K4A, KC_NO, K4C, K4D, KC_NO } \
}
#define LAYOUT_225u_arrow( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \
K40, K41, K42, K47, K49, K4A, K4B, K4C, K4D \
) { \
{ 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, KC_NO }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \
{ K40, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, K49, K4A, K4B, K4C, K4D, KC_NO } \
}
#define LAYOUT_2u_arrow( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
K40, K41, K42, K47, K49, K4A, K4B, K4C, K4D \
) { \
{ 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, KC_NO }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
{ K40, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, K49, K4A, K4B, K4C, K4D, KC_NO } \
}
#define LAYOUT_minila( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
K40, K41, K42, K43, K47, K48, K49, K4A, K4B, K4C, K4D \
) { \
{ 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, KC_NO }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
{ K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, K47, K48, K49, K4A, K4B, K4C, K4D, KC_NO } \
}
#define LAYOUT_all( \
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, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
K40, K41, K42, K43, K47, K48, K49, K4A, K4B, K4C, K4D \
) { \
{ 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, KC_NO }, \
{ K20, K21, 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, K3C, K3D, K3E }, \
{ K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, K47, K48, K49, K4A, K4B, K4C, K4D, KC_NO } \
}
#endif

@ -0,0 +1,13 @@
# Play Keyboard60
![Play Keyboard60](https://i.imgur.com/3pvC6I4.png)
A 60% keyboard PCB made by Play Keyboard.
It supports GH60 layout and mutultiple layouts like arrows, 2u shift, minila, etc.
Fitted with all stock GH60 cases, with WS2812 RGB underglow.
Keyboard Maintainer: [Barry Huang](https://github.com/yj7272098)
Hardware Supported: Play Keyboard60
Hardware Availability: [Play Keyboard](http://playkeyboard.qdm.com.tw/)
Powered by QMK Firmware.

@ -0,0 +1,56 @@
# MCU name
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*
BOOTLOADER=amtel-dfu
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes

@ -4,34 +4,38 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = {
/* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐
* Esc Q W E R T Y U I O P Bksp
* Esc Q W E R T Z U I O P Bksp
*
* Ctrl A S D F G H J K L ; : Entr
* Tab A S D F G H J K L ; : Entr
*
* Shft Z X C V B N M , < . > / ? ' "
* Shft Y X C V B N M , < . > / ? ' "
*
* Alt GUI \ | - _ = + Spce Spce ( ) [ { ] } Lr 1
* Ctrl Alt GUI - _ = + Spce \ | ( ) [ { ] } Lr 1
*
*/
{ 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_LCTL , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT } ,
{ KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT } ,
{ KC_LALT , KC_LGUI , KC_BSLS , KC_MINS , KC_EQL , KC_SPC , KC_SPC , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , MO(1) }
{ KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Z , KC_U , KC_I , KC_O , KC_P , KC_BSPC } ,
{ KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT } ,
{ KC_LSFT , KC_Y , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT } ,
{ KC_LCTL , KC_LALT , KC_LGUI , KC_MINS , KC_EQL , KC_SPC , KC_BSLS , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , MO(1) }
},
[1] = {
/* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐
* ~ 1 2 3 4 5 6 7 8 9 0 DEL
*
* ` ! @ # $ % * & BL+ BL- BLTg BLBr
* ` ! @ # $ % ^ & * ü ö ä
*
* Caps Home End PgUp PgDn F1 F2 F3 Left Down Up Rght
* Caps Home End PgUp PgDn INS F1 ß Left Down Up Rght
*
* Powr Rset VoUp VoDn Play Stop Prev Next Alt Ctrl GUI
* Powr Rset VoUp VoDn BLTg BLSt BLBr Shft Alt Ctrl GUI
*
*/
{ KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL } ,
{ KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , BL_INC , BL_DEC , BL_TOGG , BL_BRTG } ,
{ KC_CAPS , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_F1 , KC_F2 , KC_F3 , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT } ,
{ KC_PWR , RESET , KC_VOLU , KC_VOLD , KC_MPLY , KC_MSTP , KC_MPRV , KC_MNXT , KC_RALT , KC_RCTL , KC_RGUI , KC_TRNS }
{ KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL } ,
{ KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , UC(L'ü') , UC(L'ö') , UC(L'ä') } ,
{ KC_CAPS , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_INS , KC_F1 , UC(L'ß') , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT } ,
{ KC_PWR , RESET , KC_VOLU , KC_VOLD , BL_TOGG , BL_STEP , BL_BRTG , KC_RSFT , KC_RALT , KC_RCTL , KC_RGUI , KC_TRNS }
}
};
void matrix_init_user(void) {
set_unicode_input_mode(UC_LNX);
};

@ -0,0 +1,5 @@
AUTO_SHIFT_ENABLE = yes
AUTO_SHIFT_MODIFIERS = yes
BACKLIGHT_ENABLE = yes
UNICODE_ENABLE = yes
DEFAULT_FOLDER = planck/rev5

@ -1,5 +1,5 @@
/*
Copyright 2017 Danny Nguyen <danny@hexwire.com>
Copyright 2018 Mattia Dal Ben <matthewdibi@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

@ -28,28 +28,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* ,------------------------------------------------. ,------------------------------------------------.
* |\-Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |'-Lyr2|
* |`-Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |--Lyr2|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | è |
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | = |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | ò | à |
* | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | ; | ' |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | ù |-(Sft)|
* | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | \ |Shift |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* |<(Gui)| + | - |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space |ì(AlG)| Left | Down | Up | Right|
* | Gui | + | - |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space | Alt | Left | Down | Up | Right|
* `------------------------------------------------' `------------------------------------------------'
*/
[_QWERTY] = LAYOUT(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
LT(_NAV, KC_GRV) , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 ,MO(_SYMB), MO(_SYMB), KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,LT(_NAV, KC_MINS),
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T ,RALT(KC_LBRC), RALT(KC_RBRC) , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_LBRC,
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T ,KC_LBRC, KC_RBRC , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_EQL,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PGDN, KC_HOME , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_BSLASH,RSFT_T(KC_SLSH),
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PGDN, KC_HOME , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_BSLASH, KC_RSFT,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
LGUI_T(KC_NONUS_BSLASH),KC_PPLS,KC_PMNS,LALT_T(KC_PAST),LCTL_T(KC_PSLS),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, RALT_T(KC_EQL),KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT
KC_LGUI,KC_PPLS,KC_PMNS,LALT_T(KC_PAST),LCTL_T(KC_PSLS),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, KC_RALT,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT
//`----+----+----+----+----+----+----' `----+----+----+----+----+----+----'
),
@ -68,11 +68,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_SYMB] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
_______, KC_EXLM, RALT(KC_SCLN), RALT(KC_LCBR), RALT(KC_RCBR), KC_TILD, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX,
_______, RALT(KC_QUOT), KC_DLR , RALT(KC_LBRC), RALT(KC_RBRC), RALT(KC_EQL), _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX,
_______, KC_PERC, LSFT(KC_EQL) , LSFT(KC_8), LSFT(KC_9), RALT(KC_MINS), _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
_______, KC_EXLM, KC_AT , KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX,
_______, KC_HASH, KC_DLR , KC_LBRC, KC_RBRC, KC_GRV, _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX,
_______, KC_PERC, KC_CIRC, KC_LPRN, KC_RPRN, KC_TILD, _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX
),
/* Navigation

@ -1 +1 @@
# The default keymap for redox
# The default keymap for Redox

@ -0,0 +1,41 @@
/*
Copyright 2018 Mattia Dal Ben <matthewdibi@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* Use I2C or Serial, not both */
// #define USE_SERIAL
#define USE_I2C
/* Select hand configuration */
#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS
#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 14
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif

@ -0,0 +1,117 @@
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
extern rgblight_config_t rgblight_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _SYMB 1
#define _NAV 2
#define _ADJUST 3
enum custom_keycodes {
QWERTY = SAFE_RANGE,
SYMB,
NAV,
ADJUST,
};
// Fillers to make layering more clear
#define KC_ KC_TRNS
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* ,------------------------------------------------. ,------------------------------------------------.
* |\-Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |'-Lyr2|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | è |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | ò | à |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | ù |-(Sft)|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* |<(Gui)| + | - |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space |ì(AlG)| Left | Down | Up | Right|
* `------------------------------------------------' `------------------------------------------------'
*/
[_QWERTY] = LAYOUT(
//,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----.
LT(_NAV, KC_GRV) , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 ,MO(_SYMB), MO(_SYMB), KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,LT(_NAV, KC_MINS),
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T ,RALT(KC_LBRC), RALT(KC_RBRC) , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_LBRC,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT,
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PGDN, KC_HOME , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_BSLASH,RSFT_T(KC_SLSH),
//|----+----+----+----+----+----+----| |----+----+----+----+----+----+----|
LGUI_T(KC_NONUS_BSLASH),KC_PPLS,KC_PMNS,LALT_T(KC_PAST),LCTL_T(KC_PSLS),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, RALT_T(KC_EQL),KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT
//`----+----+----+----+----+----+----' `----+----+----+----+----+----+----'
),
/* Symbols
* ,------------------------------------------------. ,------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | # | $ | [ | ] | ~ | | | | | 4 | 5 | 6 | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | % | ^ | ( | ) | ` | | | | | 1 | 2 | 3 | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | | | | | | | | | | 0 | 0 | . | | |
* `------------------------------------------------' `------------------------------------------------'
*/
[_SYMB] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
_______, KC_EXLM, RALT(KC_SCLN), RALT(KC_LCBR), RALT(KC_RCBR), KC_TILD, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX,
_______, RALT(KC_QUOT), KC_DLR , RALT(KC_LBRC), RALT(KC_RBRC), RALT(KC_EQL), _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX,
_______, KC_PERC, LSFT(KC_EQL) , LSFT(KC_8), LSFT(KC_9), RALT(KC_MINS), _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX
),
/* Navigation
* ,------------------------------------------------. ,------------------------------------------------.
* | | | | | | | | | | | | | | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | |MOUS_U| |WHEL_U| | | | | | | | | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | |MOUS_L|MOUS_D|MOUS_R|WHEL_D| | | | | LEFT | DOWN | UP |RIGHT | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | | | | | | | | | | | | | | |
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
* | | | | |MOUS_1|MOUS_2| | | | | | | | | |
* `------------------------------------------------' `------------------------------------------------'
*/
[_NAV] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, KC_WH_U, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT,XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
[_ADJUST] = LAYOUT(
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,
XXXXXXX, RESET , RGB_M_P, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, KC_DEL, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
)
};
#ifdef AUDIO_ENABLE
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
#endif
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}

@ -0,0 +1 @@
# The italian keymap for Redox

@ -0,0 +1,5 @@
RGBLIGHT_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,24 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
#endif

@ -0,0 +1,163 @@
#include <util/twi.h>
#include <avr/io.h>
#include <stdlib.h>
#include <avr/interrupt.h>
#include <util/twi.h>
#include <stdbool.h>
#include "i2c.h"
#ifdef USE_I2C
// Limits the amount of we wait for any one i2c transaction.
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
// 9 bits, a single transaction will take around 90μs to complete.
//
// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit
// poll loop takes at least 8 clock cycles to execute
#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8
#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE)
volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
static volatile uint8_t slave_buffer_pos;
static volatile bool slave_has_register_set = false;
// Wait for an i2c operation to finish
inline static
void i2c_delay(void) {
uint16_t lim = 0;
while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
lim++;
// easier way, but will wait slightly longer
// _delay_us(100);
}
// Setup twi to run at 100kHz
void i2c_master_init(void) {
// no prescaler
TWSR = 0;
// Set TWI clock frequency to SCL_CLOCK. Need TWBR>10.
// Check datasheets for more info.
TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
}
// Start a transaction with the given i2c slave address. The direction of the
// transfer is set with I2C_READ and I2C_WRITE.
// returns: 0 => success
// 1 => error
uint8_t i2c_master_start(uint8_t address) {
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA);
i2c_delay();
// check that we started successfully
if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
return 1;
TWDR = address;
TWCR = (1<<TWINT) | (1<<TWEN);
i2c_delay();
if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
return 1; // slave did not acknowledge
else
return 0; // success
}
// Finish the i2c transaction.
void i2c_master_stop(void) {
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
uint16_t lim = 0;
while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
lim++;
}
// Write one byte to the i2c slave.
// returns 0 => slave ACK
// 1 => slave NACK
uint8_t i2c_master_write(uint8_t data) {
TWDR = data;
TWCR = (1<<TWINT) | (1<<TWEN);
i2c_delay();
// check if the slave acknowledged us
return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
}
// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
// if ack=0 the acknowledge bit is not set.
// returns: byte read from i2c device
uint8_t i2c_master_read(int ack) {
TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
i2c_delay();
return TWDR;
}
void i2c_reset_state(void) {
TWCR = 0;
}
void i2c_slave_init(uint8_t address) {
TWAR = address << 0; // slave i2c address
// TWEN - twi enable
// TWEA - enable address acknowledgement
// TWINT - twi interrupt flag
// TWIE - enable the twi interrupt
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
}
ISR(TWI_vect);
ISR(TWI_vect) {
uint8_t ack = 1;
switch(TW_STATUS) {
case TW_SR_SLA_ACK:
// this device has been addressed as a slave receiver
slave_has_register_set = false;
break;
case TW_SR_DATA_ACK:
// this device has received data as a slave receiver
// The first byte that we receive in this transaction sets the location
// of the read/write location of the slaves memory that it exposes over
// i2c. After that, bytes will be written at slave_buffer_pos, incrementing
// slave_buffer_pos after each write.
if(!slave_has_register_set) {
slave_buffer_pos = TWDR;
// don't acknowledge the master if this memory loctaion is out of bounds
if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) {
ack = 0;
slave_buffer_pos = 0;
}
slave_has_register_set = true;
} else {
i2c_slave_buffer[slave_buffer_pos] = TWDR;
BUFFER_POS_INC();
}
break;
case TW_ST_SLA_ACK:
case TW_ST_DATA_ACK:
// master has addressed this device as a slave transmitter and is
// requesting data.
TWDR = i2c_slave_buffer[slave_buffer_pos];
BUFFER_POS_INC();
break;
case TW_BUS_ERROR: // something went wrong, reset twi state
TWCR = 0;
default:
break;
}
// Reset everything, so we are ready for the next TWI interrupt
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
contacted_by_master = true;
}
#endif

@ -0,0 +1,50 @@
#ifndef I2C_H
#define I2C_H
#include <stdint.h>
#include "split_util.h"
#ifndef F_CPU
#define F_CPU 16000000UL
#endif
#define I2C_READ 1
#define I2C_WRITE 0
#define I2C_ACK 1
#define I2C_NACK 0
#define SLAVE_BUFFER_SIZE 0x10
// i2c SCL clock frequency
#define SCL_CLOCK 400000L
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
void i2c_master_init(void);
uint8_t i2c_master_start(uint8_t address);
void i2c_master_stop(void);
uint8_t i2c_master_write(uint8_t data);
uint8_t i2c_master_read(int);
void i2c_reset_state(void);
void i2c_slave_init(uint8_t address);
static inline unsigned char i2c_start_read(unsigned char addr) {
return i2c_master_start((addr << 1) | I2C_READ);
}
static inline unsigned char i2c_start_write(unsigned char addr) {
return i2c_master_start((addr << 1) | I2C_WRITE);
}
// from SSD1306 scrips
extern unsigned char i2c_rep_start(unsigned char addr);
extern void i2c_start_wait(unsigned char addr);
extern unsigned char i2c_readAck(void);
extern unsigned char i2c_readNak(void);
extern unsigned char i2c_read(unsigned char ack);
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
#endif

@ -0,0 +1,44 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 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/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* Use I2C or Serial, not both */
#define USE_SERIAL
// #define USE_I2C
/* Select hand configuration */
//#define MASTER_LEFT
// #define MASTER_RIGHT
#define EE_HANDS
#ifdef AUDIO_ENABLE
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(DVORAK_SOUND), \
SONG(COLEMAK_SOUND) \
}
#endif
#endif

@ -0,0 +1,199 @@
#include QMK_KEYBOARD_H
#include "action_layer.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _ADJUST 16
enum custom_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
RAISE,
ADJUST
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | GUI | Alt |Adjust|Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_ortho_4x12( \
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
KC_LCTRL,KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT_ortho_4x12( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* |RESET | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_ortho_4x12( \
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
RESET, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |RESET |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_ortho_4x12( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, RESET, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
),
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | |RGB_MOD|
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_ortho_4x12( \
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD \
)
};
void persistent_default_layer_set(uint16_t default_layer) {
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
}
return true;
}

@ -0,0 +1,3 @@
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

@ -0,0 +1,510 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* scan matrix
*/
#include <stdint.h>
#include <stdbool.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "wait.h"
#include "print.h"
#include "debug.h"
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "config.h"
#include "timer.h"
#include <print.h>
#if (defined(RGB_MIDI) | defined(RGBLIGHT_ANIMATIONS)) & defined(RGBLIGHT_ENABLE)
#include "rgblight.h"
#endif
#ifdef USE_I2C
# include "i2c.h"
#else // USE_SERIAL
# include "serial.h"
#endif
#ifndef DEBOUNCING_DELAY
# define DEBOUNCING_DELAY 5
#endif
#if (DEBOUNCING_DELAY > 0)
static uint16_t debouncing_time;
static bool debouncing = false;
#endif
#if (MATRIX_COLS <= 8)
# define print_matrix_header() print("\nr/c 01234567\n")
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
# define matrix_bitpop(i) bitpop(matrix[i])
# define ROW_SHIFTER ((uint8_t)1)
#else
# error "Currently only supports 8 COLS"
#endif
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
#define ERROR_DISCONNECT_COUNT 5
#define ROWS_PER_HAND (MATRIX_ROWS/2)
static uint8_t error_count = 0;
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
#if (DIODE_DIRECTION == COL2ROW)
static void init_cols(void);
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
static void unselect_rows(void);
static void select_row(uint8_t row);
static void unselect_row(uint8_t row);
#elif (DIODE_DIRECTION == ROW2COL)
static void init_rows(void);
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
static void unselect_cols(void);
static void unselect_col(uint8_t col);
static void select_col(uint8_t col);
#endif
__attribute__ ((weak))
void matrix_init_quantum(void) {
matrix_init_kb();
}
__attribute__ ((weak))
void matrix_scan_quantum(void) {
matrix_scan_kb();
}
__attribute__ ((weak))
void matrix_init_kb(void) {
matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
matrix_scan_user();
}
__attribute__ ((weak))
void matrix_init_user(void) {
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
inline
uint8_t matrix_rows(void) {
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void) {
return MATRIX_COLS;
}
bool has_usb(void) {
return UDADDR & _BV(ADDEN); // This will return true of a USB connection has been established
}
void matrix_init(void)
{
#ifdef DISABLE_JTAG
// JTAG disable for PORT F. write JTD bit twice within four cycles.
MCUCR |= (1<<JTD);
MCUCR |= (1<<JTD);
#endif
// initialize row and col
#if (DIODE_DIRECTION == COL2ROW)
unselect_rows();
init_cols();
#elif (DIODE_DIRECTION == ROW2COL)
unselect_cols();
init_rows();
#endif
TX_RX_LED_INIT;
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0;
matrix_debouncing[i] = 0;
}
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
timer_init();
#ifdef USE_I2C
i2c_slave_init(SLAVE_I2C_ADDRESS);
#else
serial_slave_init();
#endif
sei();
matrix_init_quantum();
while(!has_usb() || contacted_by_master){
matrix_slave_scan();
}
// Set up as master
#ifdef USE_I2C
i2c_reset_state();
i2c_master_init();
#else
serial_master_init();
#endif
}
uint8_t _matrix_scan(void)
{
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
#if (DIODE_DIRECTION == COL2ROW)
// Set row, read cols
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
# if (DEBOUNCING_DELAY > 0)
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
if (matrix_changed) {
debouncing = true;
debouncing_time = timer_read();
PORTD ^= (1 << 2);
}
# else
read_cols_on_row(matrix+offset, current_row);
# endif
}
#elif (DIODE_DIRECTION == ROW2COL)
// Set col, read rows
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
# if (DEBOUNCING_DELAY > 0)
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
if (matrix_changed) {
debouncing = true;
debouncing_time = timer_read();
}
# else
read_rows_on_col(matrix+offset, current_col);
# endif
}
#endif
# if (DEBOUNCING_DELAY > 0)
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
matrix[i+offset] = matrix_debouncing[i+offset];
}
debouncing = false;
}
# endif
return 1;
}
#ifdef USE_I2C
// Get rows from other half over i2c
int i2c_transaction(void) {
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE);
if (err) goto i2c_error;
// start of matrix stored at 0x00
err = i2c_master_write(0x00);
if (err) goto i2c_error;
// Start read
err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ);
if (err) goto i2c_error;
if (!err) {
int i;
for (i = 0; i < ROWS_PER_HAND-1; ++i) {
matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
}
matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
i2c_master_stop();
} else {
i2c_error: // the cable is disconnceted, or something else went wrong
i2c_reset_state();
return err;
}
return 0;
}
#else // USE_SERIAL
int serial_transaction(void) {
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
if (serial_update_buffers()) {
return 1;
}
for (int i = 0; i < ROWS_PER_HAND; ++i) {
matrix[slaveOffset+i] = serial_slave_buffer[i];
}
return 0;
}
#endif
uint8_t matrix_scan(void)
{
uint8_t ret = _matrix_scan();
#ifdef USE_I2C
if( i2c_transaction() ) {
#else // USE_SERIAL
if( serial_transaction() ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
error_count++;
if (error_count > ERROR_DISCONNECT_COUNT) {
// reset other half if disconnected
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
for (int i = 0; i < ROWS_PER_HAND; ++i) {
matrix[slaveOffset+i] = 0;
}
}
} else {
// turn off the indicator led on no error
TXLED0;
error_count = 0;
}
matrix_scan_quantum();
return ret;
}
void matrix_slave_scan(void) {
#if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE)
rgblight_task();
#endif
_matrix_scan();
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
#ifdef USE_I2C
for (int i = 0; i < ROWS_PER_HAND; ++i) {
i2c_slave_buffer[i] = matrix[offset+i];
}
#else // USE_SERIAL
for (int i = 0; i < ROWS_PER_HAND; ++i) {
serial_slave_buffer[i] = matrix[offset+i];
}
#endif
}
bool matrix_is_modified(void)
{
if (debouncing) return false;
return true;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & ((matrix_row_t)1<<col));
}
inline
matrix_row_t matrix_get_row(uint8_t row)
{
return matrix[row];
}
void matrix_print(void)
{
print("\nr/c 0123456789ABCDEF\n");
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
phex(row); print(": ");
pbin_reverse16(matrix_get_row(row));
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop16(matrix[i]);
}
return count;
}
#if (DIODE_DIRECTION == COL2ROW)
static void init_cols(void)
{
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
uint8_t pin = col_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
}
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
{
// Store last value of row prior to reading
matrix_row_t last_row_value = current_matrix[current_row];
// Clear data in matrix row
current_matrix[current_row] = 0;
// Select row and wait for row selecton to stabilize
select_row(current_row);
wait_us(30);
// For each col...
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
// Select the col pin to read (active low)
uint8_t pin = col_pins[col_index];
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
// Populate the matrix row with the state of the col pin
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
}
// Unselect row
unselect_row(current_row);
return (last_row_value != current_matrix[current_row]);
}
static void select_row(uint8_t row)
{
uint8_t pin = row_pins[row];
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
}
static void unselect_row(uint8_t row)
{
uint8_t pin = row_pins[row];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
static void unselect_rows(void)
{
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
uint8_t pin = row_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
}
#elif (DIODE_DIRECTION == ROW2COL)
static void init_rows(void)
{
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
uint8_t pin = row_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
}
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
{
bool matrix_changed = false;
// Select col and wait for col selecton to stabilize
select_col(current_col);
wait_us(30);
// For each row...
for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++)
{
// Store last value of row prior to reading
matrix_row_t last_row_value = current_matrix[row_index];
// Check row pin state
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
{
// Pin LO, set col bit
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
}
else
{
// Pin HI, clear col bit
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
}
// Determine if the matrix changed state
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
{
matrix_changed = true;
}
}
// Unselect col
unselect_col(current_col);
return matrix_changed;
}
static void select_col(uint8_t col)
{
uint8_t pin = col_pins[col];
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
}
static void unselect_col(uint8_t col)
{
uint8_t pin = col_pins[col];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
static void unselect_cols(void)
{
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
uint8_t pin = col_pins[x];
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
}
}
#endif

@ -0,0 +1,126 @@
Let's Split Vitamins Included
======
![Let's Split Vitamins included, assmebled in 3D printed case](https://i.imgur.com/btl0vNQ.jpg)
This readme and most of the code are from https://github.com/ahtn/tmk_keyboard/
**Hardware files for the Let's Split vitamins included are stored [here](http://github.com/duckle29/let-s-Split-v2/tree/onboardMCU)**
## First Time Setup
Clone the `qmk_firmware` repo and navigate to its top level directory. [Once your build environment is setup](https://docs.qmk.fm/getting_started_build_tools.html), you'll be able to generate the default .hex using the [build/compile instructions](https://docs.qmk.fm/build-compile-instructions) in the docs
If everything worked correctly you will see a file:
```bash
lets_split_vitamins_rev1_YOUR_KEYMAP_NAME.hex
```
If you want, you can flash the hex file to the keyboard right after compilation, by adding `:avrdude` to the end of the make command like so:
```bash
make lets_split_vitamins/rev1:default:avrdude
```
This will both compile the hex, and flash the connected half.
For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md.
Features
--------
For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md).
Some features supported by the firmware:
* Either half can connect to the computer via USB, or both halves can be used
independently.
* You only need 3 wires to connect the two halves. One for VCC, one for GND and one
for serial communication.
* Optional support for I2C connection between the two halves if for some
reason you require a faster connection between the two halves. Note this
requires an extra wire between halves and pull-up resistors on the data lines.
This is supported on the vitamins included.
The extra data line can also be used for ws2812 type LEDs.
If neither I2C nor RGB underglow is used, a TRS cable can be used instead of the 4wire TRRS cables.
Required Hardware
-----------------
|Amount| Description |
|--|--|
| 1 | PCB kit from novelkeys |
| 48 | MX compatible switches |
| 48 | 1U keycaps
| 2 | Half cases. A 3D model for the left half is available [here](https://cad.onshape.com/documents/c6e5ae250d1e24fe46c9ef6c/w/d69f7049c0921df3d2b241f9/e/ecc2b176ab52a6d77bc55051). Mirror that to get a right-half case. Plate cases will be designed in the future.
| 1 | USB-mini-B cable of your choice |
| 1 | TRS / TRRS cable
Optional Hardware
-----------------
A speaker can be hooked-up to the footprint on the PCBs. It is already enabled in the default firmware from github.
A strip of WS2812 LEDs can be hooked up too, a guide will be written on how to do that once I get mine in the mail.
The PCB and connectors can safely handle 1A of current, but the USB standard is only rated at 500mA. Keep that in mind when picking the amount of LEDs.
## Using I2C
On the left half PCB, there's two pads labled ***I2C Pullup*** if you want to use I2C, you need to bridge those two solder jumpers with a soldering iron.
You can change your configuration between serial and i2c by modifying your `config.h` file.
Notes on Software Configuration
-------------------------------
Configuring the firmware is similar to any other QMK project. One thing
to note is that `MATRIX_ROWS` in `config.h` is the total number of rows between
the two halves, so because the let's split vitamins included has 4 rows in each half, it's
`MATRIX_ROWS=8`.
Also, the current implementation assumes a maximum of 8 columns, but it would
not be very difficult to adapt it to support more if required.
## Entering bootloader
If the keyboard isn't new, and has been flashed before, you need to enter bootloader.
To enter bootloader, either use the assigned keys on the keymap, or if none have been put in the keymap, quickly short the reset to gnd twice. (Bottom pins of programming header, see image) ![Reset pins](https://i.imgur.com/LCXlv9W.png)
If using the default keymap, there's a reset key-combination on each half:
***Lower (SW23) and left-shift (SW13)*** on the left half, or
***Raise(SW44) and Enter(SW42)*** on the right half
It is recommended to add such reset keys to any custom keymaps. It shouldn't be necesarry to have one on each half, but the default layout has that.
The board exits bootloader mode after 8 seconds, if you haven't started flashing.
## EEPROM
If this is the first time you're flashing the boards, you have to flash EEPROM
0. If your keyboard is plugged in, unplug it
1. Open a terminal, and navigate to the qmk_firmware folder
2. Run `ls /dev | grep tty` Note down which ports you see
2. Plug the keyboard in, if it's new, it should enter bootloader, if it's not new, see **Entering bootloader** on how to enter bootloader mode
4. Right after entering bootloader, run `ls /dev | grep tty` again. There should be a new tty, this is the bootloader TTY, note it down. If nothing shows see **Entering bootloader** on how to enter bootloader mode
6. For the left hand side, run `avrdude -c avr109 -p m32u4 -P /dev/ttyS1 -U eeprom:w:"./keyboards/lets_split_vitamins/eeprom-lefthand.eep":a`
Replace ***/dev/ttyS1*** with the port you noted down earlier. If you're on windows using msys2, replace ***/dev/ttyS1*** with COM2, note that the number is one higher than the tty number.
Do the same For the right hand, but change the file to ***eeprom-righthand.eep***
Your EEPROM should be flashed :)
In the future, you shouldn't need to flash EEPROM (it will in fact wear the eeprom memory, so don't)
## Flashing
If you haven't flashed EEPROM before, do that first.
To flash keymaps onto the keyboard, use:
```bash
make lets_split_vitamins/rev1:[KEYMAP]:avrdude
```
from the qmk_firmware folder. Default being the default keymap.
You can plug either half into USB and it will work. you can also remove the TRS/TRRS cable, and plug both halves in. (which is why the default layout has reset on both halves)
Enjoy your keyboard! :D

@ -0,0 +1,92 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 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/>.
*/
#ifndef REV1_CONFIG_H
#define REV1_CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xBEE5
#define PRODUCT_ID 0xF33D
#define DEVICE_VER 0x0001
#define MANUFACTURER Duckle29
#define PRODUCT Lets Split sockets vitamins included
#define DESCRIPTION A split keyboard for the cheapish makers
/* key matrix size */
// Rows are doubled-up
#define MATRIX_ROWS 8
#define MATRIX_COLS 6
// wiring of each half
#define MATRIX_ROW_PINS { F5, F6, C7, F7 }
#define MATRIX_COL_PINS { F1, F4, E2, B6, D7, D6}
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* number of backlight levels */
// #define BACKLIGHT_LEVELS 3
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* 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
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
/* ws2812 RGB LED */
#define RGB_DI_PIN F0
#define RGBLIGHT_TIMER
#define RGBLED_NUM 16 // Number of LEDs
#define ws2812_PORTREG PORTF
#define ws2812_DDRREG DDRF
#define RGBLIGHT_ANIMATIONS
/* Audio settings */
#ifdef AUDIO_ENABLE
#define C6_AUDIO // Define this to enable the buzzer
#endif
/*
* 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
#endif

@ -0,0 +1,13 @@
#include "rev1.h"
#ifdef SSD1306OLED
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);
}
#endif
void matrix_init_kb(void) {
matrix_init_user();
};

@ -0,0 +1,40 @@
#ifndef REV1_H
#define REV1_H
#define DISABLE_JTAG // The keyboard uses PF4, PF5 and PF7, which are used by JTAG.
#define EE_HANDS // This isn't optional for the vitamins included
#include QMK_KEYBOARD_H
//void promicro_bootloader_jmp(bool program);
#include "quantum.h"
#ifdef USE_I2C
#include <stddef.h>
#ifdef __AVR__
#include <avr/io.h>
#include <avr/interrupt.h>
#endif
#endif
//void promicro_bootloader_jmp(bool program);
#define KEYMAP( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
) \
{ \
{ L00, L01, L02, L03, L04, L05 }, \
{ L10, L11, L12, L13, L14, L15 }, \
{ L20, L21, L22, L23, L24, L25 }, \
{ L30, L31, L32, L33, L34, L35 }, \
{ R00, R01, R02, R03, R04, R05 }, \
{ R10, R11, R12, R13, R14, R15 }, \
{ R20, R21, R22, R23, R24, R25 }, \
{ R30, R31, R32, R33, R34, R35 } \
}
#define LAYOUT_ortho_4x12 KEYMAP
#endif

@ -0,0 +1,5 @@
BACKLIGHT_ENABLE = no
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = yes
DEBUG_ENABLE = no
CONSOLE_ENABLE = no

@ -0,0 +1,75 @@
SRC += matrix.c \
i2c.c \
split_util.c \
serial.c \
ssd1306.c
# MCU name
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)
# 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
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
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 = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
USE_I2C = no
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
CUSTOM_MATRIX = yes
LAYOUTS = ortho_4x12
DEFAULT_FOLDER = vitamins_included/rev1

@ -0,0 +1,229 @@
/*
* WARNING: be careful changing this code, it is very timing dependent
*/
#ifndef F_CPU
#define F_CPU 16000000
#endif
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <stdbool.h>
#include "serial.h"
#ifndef USE_I2C
// Serial pulse period in microseconds. Its probably a bad idea to lower this
// value.
#define SERIAL_DELAY 24
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
#define SLAVE_DATA_CORRUPT (1<<0)
volatile uint8_t status = 0;
inline static
void serial_delay(void) {
_delay_us(SERIAL_DELAY);
}
inline static
void serial_output(void) {
SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
}
// make the serial pin an input with pull-up resistor
inline static
void serial_input(void) {
SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
}
inline static
uint8_t serial_read_pin(void) {
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
}
inline static
void serial_low(void) {
SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
}
inline static
void serial_high(void) {
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
}
void serial_master_init(void) {
serial_output();
serial_high();
}
void serial_slave_init(void) {
serial_input();
// Enable INT0
EIMSK |= _BV(INT0);
// Trigger on falling edge of INT0
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
}
// Used by the master to synchronize timing with the slave.
static
void sync_recv(void) {
serial_input();
// This shouldn't hang if the slave disconnects because the
// serial line will float to high if the slave does disconnect.
while (!serial_read_pin());
serial_delay();
}
// Used by the slave to send a synchronization signal to the master.
static
void sync_send(void) {
serial_output();
serial_low();
serial_delay();
serial_high();
}
// Reads a byte from the serial line
static
uint8_t serial_read_byte(void) {
uint8_t byte = 0;
serial_input();
for ( uint8_t i = 0; i < 8; ++i) {
byte = (byte << 1) | serial_read_pin();
serial_delay();
_delay_us(1);
}
return byte;
}
// Sends a byte with MSB ordering
static
void serial_write_byte(uint8_t data) {
uint8_t b = 8;
serial_output();
while( b-- ) {
if(data & (1 << b)) {
serial_high();
} else {
serial_low();
}
serial_delay();
}
}
// interrupt handle to be used by the slave device
ISR(SERIAL_PIN_INTERRUPT) {
sync_send();
uint8_t checksum = 0;
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
serial_write_byte(serial_slave_buffer[i]);
sync_send();
checksum += serial_slave_buffer[i];
}
serial_write_byte(checksum);
sync_send();
// wait for the sync to finish sending
serial_delay();
// read the middle of pulses
_delay_us(SERIAL_DELAY/2);
uint8_t checksum_computed = 0;
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
serial_master_buffer[i] = serial_read_byte();
sync_send();
checksum_computed += serial_master_buffer[i];
}
uint8_t checksum_received = serial_read_byte();
sync_send();
serial_input(); // end transaction
if ( checksum_computed != checksum_received ) {
status |= SLAVE_DATA_CORRUPT;
} else {
status &= ~SLAVE_DATA_CORRUPT;
}
contacted_by_master = true;
}
inline
bool serial_slave_DATA_CORRUPT(void) {
return status & SLAVE_DATA_CORRUPT;
}
// Copies the serial_slave_buffer to the master and sends the
// serial_master_buffer to the slave.
//
// Returns:
// 0 => no error
// 1 => slave did not respond
int serial_update_buffers(void) {
// this code is very time dependent, so we need to disable interrupts
cli();
// signal to the slave that we want to start a transaction
serial_output();
serial_low();
_delay_us(1);
// wait for the slaves response
serial_input();
serial_high();
_delay_us(SERIAL_DELAY);
// check if the slave is present
if (serial_read_pin()) {
// slave failed to pull the line low, assume not present
sei();
return 1;
}
// if the slave is present syncronize with it
sync_recv();
uint8_t checksum_computed = 0;
// receive data from the slave
for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
serial_slave_buffer[i] = serial_read_byte();
sync_recv();
checksum_computed += serial_slave_buffer[i];
}
uint8_t checksum_received = serial_read_byte();
sync_recv();
if (checksum_computed != checksum_received) {
sei();
return 1;
}
uint8_t checksum = 0;
// send data to the slave
for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
serial_write_byte(serial_master_buffer[i]);
sync_recv();
checksum += serial_master_buffer[i];
}
serial_write_byte(checksum);
sync_recv();
// always, release the line when not in use
serial_output();
serial_high();
sei();
return 0;
}
#endif

@ -0,0 +1,27 @@
#ifndef MY_SERIAL_H
#define MY_SERIAL_H
#include "config.h"
#include <stdbool.h>
#include "split_util.h"
/* TODO: some defines for interrupt setup */
#define SERIAL_PIN_DDR DDRD
#define SERIAL_PIN_PORT PORTD
#define SERIAL_PIN_INPUT PIND
#define SERIAL_PIN_MASK _BV(PD0)
#define SERIAL_PIN_INTERRUPT INT0_vect
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
#define SERIAL_MASTER_BUFFER_LENGTH 1
// Buffers for master - slave communication
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
void serial_master_init(void);
void serial_slave_init(void);
int serial_update_buffers(void);
bool serial_slave_data_corrupt(void);
#endif

@ -0,0 +1,20 @@
#include <avr/io.h>
#include <avr/wdt.h>
#include <avr/power.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include <avr/eeprom.h>
#include "split_util.h"
#include "matrix.h"
#include "keyboard.h"
#include "config.h"
#include "timer.h"
#include "debug.h"
volatile bool isLeftHand = true;
volatile bool contacted_by_master = false;
// this code runs before the usb and keyboard is initialized
void matrix_setup(void) {
isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
}

@ -0,0 +1,18 @@
#ifndef SPLIT_KEYBOARD_UTIL_H
#define SPLIT_KEYBOARD_UTIL_H
#include <stdbool.h>
#include "eeconfig.h"
#define SLAVE_I2C_ADDRESS 0x32
extern volatile bool isLeftHand;
extern volatile bool contacted_by_master;
bool has_usb(void);
// slave version of matix scan, defined in matrix.c
void matrix_slave_scan(void);
#endif

@ -0,0 +1,16 @@
#include QMK_KEYBOARD_H
#ifdef ONEHAND_ENABLE
__attribute__ ((weak))
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}},
{{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}},
{{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}},
{{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}},
{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}},
{{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}},
{{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}},
{{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}},
};
#endif

@ -0,0 +1,25 @@
#ifndef VITAMINS_INCLUDED_H
#define VITAMINS_INCLUDED_H
#include "quantum.h"
#include "rev1.h"
// Used to create a keymap using only KC_ prefixed keys
#define KC_KEYMAP( \
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
) \
KEYMAP( \
KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \
KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \
KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \
KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \
)
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
#endif

@ -4,8 +4,12 @@
"width": 15,
"height": 5,
"layouts": {
"LAYOUT_ALL": {
"LAYOUT_all": {
"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}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"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":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Win", "x":11, "y":4}, {"label":"Menu", "x":12, "y":4}, {"label":"Ctrl", "x":13, "y":4}, {"x":14, "y":4}]
},
"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}]
}
}
}

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
// TODO: THOSE ARE IDEAS:
@ -34,7 +34,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
LAYOUT_ALL(
LAYOUT_all(
KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \
KC_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_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, TD(0), KC_LALT, KC_SPC , KC_RALT, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function 1 Layers
LAYOUT_ALL(
LAYOUT_all(
RESET, 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_PAUS, KC_PSCR, \
KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_NO, KC_TRNS, \
@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDOWN, KC_END),
// 2: GUI/Function 2 Layer
LAYOUT_ALL(
LAYOUT_all(
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_PAUS, KC_PSCR, \
KC_TRNS, KC_TRNS, AC_G_W, AC_G_E, KC_TRNS, AC_G_T, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, AC_G_S, AC_G_D, KC_TRNS, KC_TRNS, AC_G_H, KC_TRNS, KC_TRNS, AC_G_L, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \
@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, AC_G_SPC, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDOWN, KC_END),
// 3: NumPad/Function 3 Toggle Layer
LAYOUT_ALL(
LAYOUT_all(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_7, KC_8, KC_9, KC_PSLS, KC_PMNS, KC_PPLS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_NO, KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, KC_NO, KC_4, KC_5, KC_6, KC_PAST, KC_NO, KC_NO, KC_NO, \
KC_TRNS, KC_NO, KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, KC_NO, KC_1, KC_2, KC_3, KC_PMNS, KC_PENT, KC_NO, KC_TRNS, \
@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_PENT, KC_PENT, KC_TRNS, KC_TRNS, KC_TRNS) ,
// TRaNSparent layer for reference
/* LAYOUT_ALL(
/* LAYOUT_all(
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_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, \

@ -1,10 +1,10 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
KEYMAP(
LAYOUT_all(
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_GRV, \
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_NO, KC_ENT, \
@ -13,7 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
// 1: Function Layer
KEYMAP(
LAYOUT_all(
KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, BL_DEC, BL_INC, KC_F13, KC_F14, \
KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \
@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
// 2: Cool Layer
KEYMAP(
LAYOUT_all(
RESET, BL_DEC, BL_INC, BL_ON, BL_OFF, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, RGB_MODE_PLAIN, KC_TRNS, \
KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
// Each layer gets a name for readability.
@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Ctrl|Gui |Alt | Space |FN|Left|Up|Down|Right|
* `-----------------------------------------------------------'
*/
[_BL] = LAYOUT_ALL(
[_BL] = LAYOUT_all(
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, \
MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT),
// Function Layer
[_FL] = LAYOUT_ALL(
[_FL] = 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_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_CALC, KC_INS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \
KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, \
@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END),
// Left Shift Layer
[_LS] = LAYOUT_ALL(
[_LS] = LAYOUT_all(
KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
// Right Shift Layer
[_RS] = LAYOUT_ALL(
[_RS] = LAYOUT_all(
KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \

@ -1,10 +1,10 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
LAYOUT_ALL(
LAYOUT_all(
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_GRV, \
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_NO, KC_ENT, \
@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function Layer
LAYOUT_ALL(
LAYOUT_all(
RESET, 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_F13, KC_F14, \
KC_NO, KC_WH_U, KC_UP, KC_WH_D, KC_BSPC,KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \
KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_DEL, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \

@ -1,10 +1,10 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
LAYOUT_ALL(
LAYOUT_all(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, \
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_NO, KC_ENT, \
@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, F(0), KC_NO, KC_RGUI, KC_RCTL),
// 1: Function Layer
LAYOUT_ALL(
LAYOUT_all(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_NO, \
KC_NO, KC_NO, KC_UP, KC_NO, KC_INSERT, KC_HOME, KC_PGUP, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_NO, KC_NO, KC_NO, \
KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL, KC_END, KC_PGDN, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_NO, KC_NO, KC_ENT, \

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
#define _BL 0
@ -7,7 +7,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
[_BL] = LAYOUT_ALL(
[_BL] = LAYOUT_all(
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_NO, \
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_NO, \
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_NUHS, KC_ENT, \
@ -15,7 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function Layer
[_FL] = LAYOUT_ALL(
[_FL] = LAYOUT_all(
RESET, 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_NO, \
KC_NO, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_TOGG, BL_DEC, BL_INC, KC_NO, \
KC_NO, KC_MPLY, KC_MSTP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ENT, \

@ -1,11 +1,11 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
#include "backlight.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
LAYOUT_ALL(
LAYOUT_all(
KC_LEAD, 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_GRV, 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_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_DOT, KC_ENT, \
@ -13,7 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, F(0), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT),
// 1: Function Layer
LAYOUT_ALL(
LAYOUT_all(
RESET, 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_F13, KC_F14, \
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, \

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
#define _______ KC_TRNS
@ -8,17 +8,17 @@
/* HHKB-like layout for standard 60% layout with split RShift */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = KEYMAP(
[_BASE] = LAYOUT_all(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, _______, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, 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_RSFT, F(0), \
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_NO, 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_RSFT, MO(1), \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, _______, KC_APP, KC_RCTL),
[_FN] = KEYMAP(
[_FN] = 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, _______, \
RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_INS, \
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_NO, _______ \
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_NO, _______, \
_______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______),
};

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
#define BASE 0
@ -9,7 +9,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
[BASE] = LAYOUT_ALL(
[BASE] = 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
CTL_SLSH, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(FN), KC_LEFT, KC_DOWN, KC_RIGHT
),
// 1: Function Layer
[FN] = LAYOUT_ALL(
[FN] = 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, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MRWD, KC_MFFD, KC_MSTP, \
KC_TRNS, RGB_TOG, RGB_VAD, KC_MUTE, KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \

@ -1,6 +1,6 @@
// XD60 Rev 2.0
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
//#include "action_tapping.h"
#include "backlight.h"
@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------'
*/
// 0: Base Layer
[_BL] = LAYOUT_ALL(
[_BL] = 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \
@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RCTL, MO(_FL), KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function Layer
[_FL] = LAYOUT_ALL(
[_FL] = 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, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG(_LK), _______, KC_HOME, _______, KC_END),
// 2: Lighting Keys
[_LK] = LAYOUT_ALL(
[_LK] = LAYOUT_all(
TO(_BL), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX, XXXXXXX, \
RESET , KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@ -16,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------'
*/
// 0: Base Layer
LAYOUT_ALL(
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_BSLS, KC_INS, \
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_BSPC, \
F(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_TRNS, KC_ENT, \
@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_CAPS, KC_RSFT, KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function Layer
LAYOUT_ALL(
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_TRNS, KC_TRNS, \
KC_TRNS, BL_TOGG, BL_STEP, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_DEL, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \

@ -1,10 +1,10 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
LAYOUT_ALL(
LAYOUT_all(
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_BSLS, KC_GRV, \
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_BSPC, \
F(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT),
// 1: Function Layer
LAYOUT_ALL(
LAYOUT_all(
RESET, 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_F13, KC_F14, \
KC_CAPS, KC_MPRV, KC_UP, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, \
F(0), KC_LEFT, KC_DOWN, KC_RIGHT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_ENT, \
@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LALT, KC_LGUI, KC_MPLY, KC_RGUI, KC_RALT, KC_HOME, KC_PGDOWN,KC_END),
// 2: RGB Layer
LAYOUT_ALL(
LAYOUT_all(
KC_NO, BL_TOGG, BL_STEP, 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, RGB_TOG, RGB_MOD, 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_SAI, RGB_VAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \

@ -1,10 +1,10 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
LAYOUT_ALL(
LAYOUT_all(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NO, \
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_NO, KC_ENT, \
@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, F(0), KC_RALT, KC_NO, KC_RGUI, KC_RCTL),
// 1: Function Layer
LAYOUT_ALL(
LAYOUT_all(
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_F13, KC_F14, \
KC_NO, KC_NO, KC_UP, KC_END, KC_NO, KC_NO, KC_CALC, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, \
KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_NO, KC_NO, KC_HOME, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_NO, KC_ENT, \

@ -1,4 +1,4 @@
#include "xd60.h"
#include QMK_KEYBOARD_H
#include "action_layer.h"
#define BASE 0
@ -9,7 +9,7 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// 0: Base Layer
[BASE] = LAYOUT_ALL(
[BASE] = LAYOUT_all(
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, \
CTL_SLSH, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \
@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
MO(FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
),
// 1: Function Layer
[FN] = LAYOUT_ALL(
[FN] = 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, RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, \
KC_TRNS, RGB_TOG, RGB_VAD, KC_MUTE, KC_VOLU, KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_ENT, \

@ -63,3 +63,5 @@ UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LAYOUTS = 60_ansi

@ -14,24 +14,38 @@
* B0 not connected
*/
inline void xd60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
inline void xd60_bl_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
inline void xd60_bl_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
inline void xd60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
inline void xd60_bl_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
inline void xd60_bl_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
/* XD60 Keymap Definition Macro */
#define LAYOUT_ALL( \
#define LAYOUT_all( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K47, K3D, K3C, \
K40, K41, K42, K45, K4A, K4B, K48, K4C, K4D \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
{ K40, K41, K42, KC_NO,KC_NO,K45, KC_NO,K47, K48, K49, K4A, K4B, K4C, K4D } \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
{ K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, K47, K48, K49, K4A, K4B, K4C, K4D } \
}
#define LAYOUT_60_ansi( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D }, \
{ K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \
}
#endif

@ -36,33 +36,33 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_QW] = { /* QWERTY */
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT },
{ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
{ KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL },
{ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC },
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT },
{ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT },
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
{ KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL },
},
/* FUNCTION
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | SELECT | CALC | MYCOMP | MAIL | | | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PR SCR |
* | SELECT | CALC | MYCOMP | MAIL | RGB HD | RGB HI | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | PREV | PLAY | NEXT | STOP | | | P4 | P5 | P6 | + | | | | | |
* | PREV | PLAY | NEXT | STOP | RGB SD | RGB SI | P4 | P5 | P6 | + | | RESET | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | VOL- | MUTE | VOL+ | | | | P1 | P2 | P3 | PENT | | | | | |
* | VOL- | MUTE | VOL+ | APP | RGB VD | RGB VI | P1 | P2 | P3 | PENT | | | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | RESET | | | FN | | | P0 | | P. | PENT | PENT | FN | | | |
* | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_FN] = { /* FUNCTION */
{ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 },
{ KC_MSEL, KC_CALC, KC_TRNS, KC_MAIL, KC_SPC, KC_SPC, KC_P7, KC_P8, KC_P9, KC_MINS, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_SPC, KC_SPC, KC_P6, KC_P5, KC_P4, KC_PLUS, KC_SPC, KC_TRNS, KC_SPC, KC_SPC, KC_SPC },
{ KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, KC_SPC, KC_SPC, KC_P3, KC_P2, KC_P1, KC_TRNS, KC_SPC, KC_SPC, KC_SPC, KC_TRNS, KC_TRNS },
{ RESET, KC_TRNS, KC_TRNS, MO(_FN), KC_SPC, KC_SPC, KC_KP_0, KC_TRNS, KC_PDOT, KC_PENT, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS },
{ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 },
{ KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS },
{ KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______ },
{ KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______ },
{ _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ },
}
};

@ -1 +1 @@
# The default keymap for xd75
# The default keymap for xd75, with led controls

@ -0,0 +1,83 @@
YMD75 / MT84
==========================
This is a port of the QMK firmware for boards that are based on the
ps2avrGB firmware, like the [ps2avrGB keyboard] (https://www.keyclack.com/product/gb-ps2avrgb/), for use on the YMD75, from YMDK. YMDK sell the board and name it "YMD75", however the PCB has "MT84" printed on both sides.
Most of the code was taken and amended from YMD96 and my port JJ50, which in itself was taken from ps2avrGB and amended by Andrew Novak.
Note that this is a complete replacement for the firmware, so you won't be
using Bootmapper Client to change any keyboard settings, since not all the
USB report options are supported.
Hardware Supported: YMD75/MT84 with the ATmega32a chip.
Hardware Availability: The YMD75/MT84 PCB is available from YMDK on AliExpress and suchlike.
This version by Wayne K Jones (github.com/WarmCatUK)
## Installing and Building
Make example for this keyboard (after setting up your build environment):
```
$ make ymd75:default:program
```
It should detect the keyboard and set it to bootloader mode automatically, prior to flashing firmware.
I've found that I need to remove the previous build/file before making a new one as it doesn't overwrite it; but this might just be my personal experience.
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.
Note that this is a complete replacement for the firmware, so you won't be
using Bootmapper Client to change any keyboard settings, since not all the
USB report options are supported.
In addition you may need the AVR toolchain and `bootloadHID` for flashing:
```
$ brew cask install crosspack-avr
$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
```
In order to use the `./program` script, which can reboot the board into
the bootloader, you'll need Python 2 with PyUSB installed:
```
$ pip install pyusb
```
If you prefer, you can just build it and flash the firmware directly with
`bootloadHID` if you boot the board while holding down `Left Control` to keep it
in the bootloader:
```
$ make ymd75
$ bootloadHID -r ymd75_default.hex
```
I dont use windows personally, but the following is from ymd96 regarding flashing the atmega32a:
Since the YMD75/MT84 uses an ATmega32a chip instead of the 32u4, you need to download [HIDBootFlash v.1.0](http://vusb.wikidot.com/project:hidbootflash) for Windows. If anyone knows of a Linux/Mac bootflasher that works, edit this readme!
On Windows, I use [MINGw](http://www.mingw.org/) to compile the keymaps. On Linux or OSX you can simply use the terminal.
Once you have those two pieces of software:
Build the keyboard with
```
$ make ymd75:default
```
If you make your own layout, change the `default` word to whatever your layout is.
And flash the compiled hex file with `HIDBootFlash`. Simply put the board in flashing mode by plugging it in while holding the key below the top right key, and click `find device`. Then you can specify the .hex file and flash it to the device.
## Troubleshooting
1. Try plugging the board in while pressing `Backspace` (`Key below the top right key`). This will force it to boot only the bootloader without loading the firmware. Once this is done, just reflash the board with the original firmware.
2. Sometimes USB hubs can act weird, so try connecting the board directly to your computer or plugging/unplugging the USB hub.
3. If you get an error such as "Resource Unavailable" when attemting to flash on Linux, you may want to compile and run `tools/usb_detach.c`. See `tools/README.md` for more info.
4. I was occasionally finding that I wasn't flashing changes that I was making to my keymap. If that happens, remove the previous build and simply force rebuild by making with:
```
$ rm ymd75_default.hex
$ make -B ymd75:default
$ make -B ymd75:default:program
```

@ -0,0 +1,215 @@
/**
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
* Kenneth A. (github.com/krusli | krusli.me)
Modified by Wayne K Jones (github.com/WarmCatUK) 2018
*/
#include "backlight.h"
#include "quantum.h"
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include "backlight_custom.h"
#include "breathing_custom.h"
// DEBUG
#include <stdlib.h>
#include <stdio.h>
// Port D: digital pins of the AVR chipset
//#define NUMLOCK_PORT (1 << 2) // 2nd pin of Port D (digital)
#define CAPSLOCK_PORT (1 << 1) // 1st pin
#define BACKLIGHT_PORT (1 << 4) // 4th pin
//#define SCROLLLOCK_PORT (1 << 6) // 6th pin
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask
#define PWM_MAX 0xFF
#define TIMER_TOP 255 // 8 bit PWM
extern backlight_config_t backlight_config;
/**
* References
* Port Registers: https://www.arduino.cc/en/Reference/PortManipulation
* TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b
* Timers: http://www.avrbeginners.net/architecture/timers/timers.html
* 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/
* PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware
*/
// @Override
// turn LEDs on and off depending on USB caps/num/scroll lock states.
void led_set_user(uint8_t usb_led) {
/*
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
// turn on
DDRD |= NUMLOCK_PORT;
PORTD |= NUMLOCK_PORT;
} else {
// turn off
DDRD &= ~NUMLOCK_PORT;
PORTD &= ~NUMLOCK_PORT;
}
*/
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRD |= CAPSLOCK_PORT;
PORTD |= CAPSLOCK_PORT;
} else {
DDRD &= ~CAPSLOCK_PORT;
PORTD &= ~CAPSLOCK_PORT;
}
/*
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
DDRD |= SCROLLLOCK_PORT;
PORTD |= SCROLLLOCK_PORT;
} else {
DDRD &= ~SCROLLLOCK_PORT;
PORTD &= ~SCROLLLOCK_PORT;
}
*/
}
#ifdef BACKLIGHT_ENABLE
// sets up Timer 1 for 8-bit PWM
void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE
// default 8 bit mode
TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH
TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW
// clear output compare value A
// outb(OCR1AH, 0);
// outb(OCR1AL, 0);
// clear output comparator registers for B
OCR1BH = 0; // outb(OCR1BH, 0);
OCR1BL = 0; // outb(OCR1BL, 0);
}
bool is_init = false;
void timer1Init(void) {
// timer1SetPrescaler(TIMER1PRESCALE)
// set to DIV/64
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE;
// reset TCNT1
TCNT1H = 0; // outb(TCNT1H, 0);
TCNT1L = 0; // outb(TCNT1L, 0);
// TOIE1: Timer Overflow Interrupt Enable (Timer 1);
TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1);
is_init = true;
}
void timer1UnInit(void) {
// set prescaler back to NONE
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP
// disable timer overflow interrupt
TIMSK &= ~_BV(TOIE1); // overflow bit?
setPWM(0);
is_init = false;
}
// handle TCNT1 overflow
//! Interrupt handler for tcnt1 overflow interrupt
ISR(TIMER1_OVF_vect, ISR_NOBLOCK)
{
// sei();
// handle breathing here
#ifdef BACKLIGHT_BREATHING
if (is_breathing()) {
custom_breathing_handler();
}
#endif
// TODO call user defined function
}
// enable timer 1 PWM
// timer1PWMBOn()
void timer1PWMBEnable(void) {
// turn on channel B (OC1B) PWM output
// set OC1B as non-inverted PWM
TCCR1A |= _BV(COM1B1);
TCCR1A &= ~_BV(COM1B0);
}
// disable timer 1 PWM
// timer1PWMBOff()
void timer1PWMBDisable(void) {
TCCR1A &= ~_BV(COM1B1);
TCCR1A &= ~_BV(COM1B0);
}
void enableBacklight(void) {
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
}
void disableBacklight(void) {
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
}
void startPWM(void) {
timer1Init();
timer1PWMBEnable();
enableBacklight();
}
void stopPWM(void) {
timer1UnInit();
disableBacklight();
timer1PWMBDisable();
}
void b_led_init_ports(void) {
/* turn backlight on/off depending on user preference */
#if BACKLIGHT_ON_STATE == 0
// DDRx register: sets the direction of Port D
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
#else
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
#endif
timer1PWMSetup();
startPWM();
#ifdef BACKLIGHT_BREATHING
breathing_enable();
#endif
}
void b_led_set(uint8_t level) {
if (level > BACKLIGHT_LEVELS) {
level = BACKLIGHT_LEVELS;
}
setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS));
}
// called every matrix scan
void b_led_task(void) {
// do nothing for now
}
void setPWM(uint16_t xValue) {
if (xValue > TIMER_TOP) {
xValue = TIMER_TOP;
}
OCR1B = xValue; // timer1PWMBSet(xValue);
}
#endif // BACKLIGHT_ENABLE

@ -0,0 +1,15 @@
/**
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
* Kenneth A. (github.com/krusli | krusli.me)
*/
#ifndef BACKLIGHT_CUSTOM_H
#define BACKLIGHT_CUSTOM_H
#include <avr/pgmspace.h>
void b_led_init_ports(void);
void b_led_set(uint8_t level);
void b_led_task(void);
void setPWM(uint16_t xValue);
#endif // BACKLIGHT_CUSTOM_H

@ -0,0 +1,140 @@
/**
* Breathing effect code for PS2AVRGB boards (ATMEGA32A)
* Works in conjunction with `backlight.c`.
*
* Code adapted from `quantum.c` to register with the existing TIMER1 overflow
* handler in `backlight.c` instead of setting up its own timer.
* Kenneth A. (github.com/krusli | krusli.me)
*/
#ifdef BACKLIGHT_ENABLE
#ifdef BACKLIGHT_BREATHING
#include "backlight_custom.h"
#ifndef BREATHING_PERIOD
#define BREATHING_PERIOD 6
#endif
#define breathing_min() do {breathing_counter = 0;} while (0)
#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0)
// TODO make this share code with quantum.c
#define BREATHING_NO_HALT 0
#define BREATHING_HALT_OFF 1
#define BREATHING_HALT_ON 2
#define BREATHING_STEPS 128
static uint8_t breathing_period = BREATHING_PERIOD;
static uint8_t breathing_halt = BREATHING_NO_HALT;
static uint16_t breathing_counter = 0;
static bool breathing = false;
bool is_breathing(void) {
return breathing;
}
// See http://jared.geek.nz/2013/feb/linear-led-pwm
static uint16_t cie_lightness(uint16_t v) {
if (v <= 5243) // if below 8% of max
return v / 9; // same as dividing by 900%
else {
uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
// to get a useful result with integer division, we shift left in the expression above
// and revert what we've done again after squaring.
y = y * y * y >> 8;
if (y > 0xFFFFUL) // prevent overflow
return 0xFFFFU;
else
return (uint16_t) y;
}
}
void breathing_enable(void) {
breathing = true;
breathing_counter = 0;
breathing_halt = BREATHING_NO_HALT;
// interrupt already registered
}
void breathing_pulse(void) {
if (get_backlight_level() == 0)
breathing_min();
else
breathing_max();
breathing_halt = BREATHING_HALT_ON;
// breathing_interrupt_enable();
breathing = true;
}
void breathing_disable(void) {
breathing = false;
// backlight_set(get_backlight_level());
b_led_set(get_backlight_level()); // custom implementation of backlight_set()
}
void breathing_self_disable(void)
{
if (get_backlight_level() == 0)
breathing_halt = BREATHING_HALT_OFF;
else
breathing_halt = BREATHING_HALT_ON;
}
void breathing_toggle(void) {
if (is_breathing())
breathing_disable();
else
breathing_enable();
}
void breathing_period_set(uint8_t value)
{
if (!value)
value = 1;
breathing_period = value;
}
void breathing_period_default(void) {
breathing_period_set(BREATHING_PERIOD);
}
void breathing_period_inc(void)
{
breathing_period_set(breathing_period+1);
}
void breathing_period_dec(void)
{
breathing_period_set(breathing_period-1);
}
/* To generate breathing curve in python:
* from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
*/
static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
// Use this before the cie_lightness function.
static inline uint16_t scale_backlight(uint16_t v) {
return v / BACKLIGHT_LEVELS * get_backlight_level();
}
void custom_breathing_handler(void) {
uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS;
// resetting after one period to prevent ugly reset at overflow.
breathing_counter = (breathing_counter + 1) % (breathing_period * 244);
uint8_t index = breathing_counter / interval % BREATHING_STEPS;
if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
{
// breathing_interrupt_disable();
}
setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U)));
}
#endif // BACKLIGHT_BREATHING
#endif // BACKLIGHT_ENABLE

@ -0,0 +1,54 @@
/*
Base Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
Modified 2017 Andrew Novak <ndrw.nvk@gmail.com>
Modified 2018 Wayne Jones (WarmCatUK) <waynekjones@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
#define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D
// TODO: share these strings with usbconfig.h
// Edit usbconfig.h to change these.
#define MANUFACTURER YMDK
#define PRODUCT ymd75 / mt84
#define DESCRIPTION 75% Keyboard
/* matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 15
#define DIODE_DIRECTION ROW2COL
#define BACKLIGHT_LEVELS 12
#define RGB_DI_PIN E2
#define RGBLED_NUM 16
#define RGBLIGHT_ANIMATIONS
#define RGBLIGHT_HUE_STEP 12
#define RGBLIGHT_SAT_STEP 15
#define RGBLIGHT_VAL_STEP 18
#define NO_UART 1
#define BOOTLOADHID_BOOTLOADER 1
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
#endif

@ -0,0 +1,104 @@
/*
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <avr/io.h>
#include <util/twi.h>
#include "i2c.h"
void i2c_set_bitrate(uint16_t bitrate_khz) {
uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
if (bitrate_div >= 16) {
bitrate_div = (bitrate_div - 16) / 2;
}
TWBR = bitrate_div;
}
void i2c_init(void) {
// set pull-up resistors on I2C bus pins
PORTC |= 0b11;
i2c_set_bitrate(400);
// enable TWI (two-wire interface)
TWCR |= (1 << TWEN);
// enable TWI interrupt and slave address ACK
TWCR |= (1 << TWIE);
TWCR |= (1 << TWEA);
}
uint8_t i2c_start(uint8_t address) {
// reset TWI control register
TWCR = 0;
// begin transmission and wait for it to end
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the start condition was successfully transmitted
if ((TWSR & 0xF8) != TW_START) {
return 1;
}
// transmit address and wait
TWDR = address;
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the device has acknowledged the READ / WRITE mode
uint8_t twst = TW_STATUS & 0xF8;
if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
return 1;
}
return 0;
}
void i2c_stop(void) {
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
}
uint8_t i2c_write(uint8_t data) {
TWDR = data;
// transmit data and wait
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
return 1;
}
return 0;
}
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
if (i2c_start(address)) {
return 1;
}
for (uint16_t i = 0; i < length; i++) {
if (i2c_write(data[i])) {
return 1;
}
}
i2c_stop();
return 0;
}

@ -0,0 +1,25 @@
/*
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __I2C_H__
#define __I2C_H__
void i2c_init(void);
void i2c_set_bitrate(uint16_t bitrate_khz);
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
#endif

@ -0,0 +1,12 @@
{
"keyboard_name": "ymd75",
"url": "",
"maintainer": "qmk",
"width": 16,
"height": 6,
"layouts": {
"LAYOUT": {
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Fn", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"End", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Page Up", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"Page Down", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"GUI", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}]
}
}
}

@ -0,0 +1,94 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
Modified 2018 Wayne K Jones <github.com/WarmCatUK>
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
#define _MAIN 0
#define _FN 1
enum custom_keycodes {
P_MACRO = SAFE_RANGE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: Main Layer
*
* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSCR DEL FN
*
* ` 1 2 3 4 5 6 7 8 9 0 - = BACKSPACE HOME
*
* TAB Q W E R T Y U I O P [ ] \ END
*
* CAPS A S D F G H J K L ; ' RETURN PG_UP
*
* LSHIFT Z X C V B N M , . / RSHIFT UP PG_DN
*
* LCTRL L_GUI L_ALT SPACE R_ALT R_CTRL LEFT DOWN RIGHT
*
*/
[_MAIN] = 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_PSCR, KC_DEL, MO(_FN),
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END,
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_PGUP,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
/* 1: Function Layer
*
* R_TOGR_MODR_HUIR_SAIR_VAIR_HUDR_SADR_VAD VOL- VOL+
*
* BLTOGBLINCBLDEC £
*
*
*
*
*
*
*
*
*
*/
[_FN] = LAYOUT(
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS,
BL_TOGG, BL_INC, BL_DEC, P_MACRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS ,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
};
// GBP £ Macro (sends alt 156 - windows users only)
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch(keycode) {
case P_MACRO:
SEND_STRING(SS_DOWN(X_LALT));
SEND_STRING(SS_TAP(X_KP_1));
SEND_STRING(SS_TAP(X_KP_5));
SEND_STRING(SS_TAP(X_KP_6));
SEND_STRING(SS_UP(X_LALT));
return false; break;
}
}
return true;
};

@ -0,0 +1,108 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
Modified 2018 by Wayne K Jones <github.com/WarmCatUK>
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 <avr/io.h>
#include <util/delay.h>
#include "matrix.h"
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif
static uint8_t debouncing = DEBOUNCE;
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
void matrix_init(void) {
// all outputs for rows high
DDRB = 0xFF;
PORTB = 0xFF;
// all inputs for columns
DDRA = 0x00;
DDRC &= ~(0x111111<<2);
DDRD &= ~(1<<PIND7);
// all columns are pulled-up
PORTA = 0xFF;
PORTC |= (0b111111<<2);
PORTD |= (1<<PIND7);
// initialize matrix state: all keys off
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix[row] = 0x00;
matrix_debouncing[row] = 0x00;
}
matrix_init_quantum(); // missing from original port by Luiz
}
void matrix_set_row_status(uint8_t row) {
DDRB = (1 << row);
PORTB = ~(1 << row);
}
uint8_t bit_reverse(uint8_t x) {
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
return x;
}
uint8_t matrix_scan(void) {
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_set_row_status(row);
_delay_us(5);
matrix_row_t cols = (
// cols 0..7, PORTA 0 -> 7
(~PINA) & 0xFF
) | (
// cols 8..13, PORTC 7 -> 0
bit_reverse((~PINC) & 0xFF) << 8
) | (
// col 14, PORTD 7
((~PIND) & (1 << PIND7)) << 7
);
if (matrix_debouncing[row] != cols) {
matrix_debouncing[row] = cols;
debouncing = DEBOUNCE;
}
}
if (debouncing) {
if (--debouncing) {
_delay_ms(1);
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
}
}
matrix_scan_quantum(); // also missing in original PS2AVRGB implementation
//matrix_scan_user();
return 1;
}
inline matrix_row_t matrix_get_row(uint8_t row) {
return matrix[row];
}
void matrix_print(void) {
}

@ -0,0 +1,74 @@
#!/usr/bin/env python
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function
import os
import sys
import time
import usb
if len(sys.argv) < 2:
print('Usage: %s <firmware.hex>' % sys.argv[0])
sys.exit(1)
print('Searching for ps2avrGB... ', end='')
dev = usb.core.find(idVendor=0x20A0, idProduct=0x422D)
if dev is None:
raise ValueError('Device not found')
print('Found', end='\n\n')
print('Device Information:')
print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor))
print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct))
print('Manufacturer: %s' % (dev.iManufacturer))
print('Serial: %s' % (dev.iSerialNumber))
print('Product: %s' % (dev.iProduct), end='\n\n')
print('Transferring control to bootloader... ', end='')
dev.set_configuration()
request_type = usb.util.build_request_type(
usb.util.CTRL_OUT,
usb.util.CTRL_TYPE_CLASS,
usb.util.CTRL_RECIPIENT_DEVICE)
USBRQ_HID_SET_REPORT = 0x09
HID_REPORT_OPTION = 0x0301
try:
dev.ctrl_transfer(
request_type,
USBRQ_HID_SET_REPORT,
HID_REPORT_OPTION,
0,
[0, 0, 0xFF] + [0] * 5
)
except usb.core.USBError:
# for some reason I keep getting USBError, but it works!
pass
# wait a bit until bootloader starts up
time.sleep(2)
print('OK')
print('Programming...')
if os.system('bootloadHID -r "%s"' % sys.argv[1]) == 0:
print('\nDone!')

@ -0,0 +1,66 @@
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
# Modified 2018 Wayne Jones (WarmCatUK) <waynekjones@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name
MCU = atmega32a
PROTOCOL = VUSB
# unsupported features for now
NO_UART = yes
NO_SUSPEND_POWER_DOWN = yes
# processor frequency
F_CPU = 12000000
# 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 = bootloadHID
# build options
BOOTMAGIC_ENABLE = yes
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = no
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes
NKRO_ENABLE = no
# Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
DISABLE_WS2812 = no
KEY_LOCK_ENABLE = yes
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
#OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
CUSTOM_MATRIX = yes
SRC = matrix.c i2c.c backlight.c
ifndef QUANTUM_DIR
include ../../../../Makefile
endif
# programming options
PROGRAM_CMD = ./keyboards/ps2avrGB/program $(TARGET).hex

@ -0,0 +1,396 @@
/* Name: usbconfig.h
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
* Author: Christian Starkjohann
* Creation Date: 2005-04-01
* Tabsize: 4
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
*/
#ifndef __usbconfig_h_included__
#define __usbconfig_h_included__
#include "config.h"
/*
General Description:
This file is an example configuration (with inline documentation) for the USB
driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
wire the lines to any other port, as long as D+ is also wired to INT0 (or any
other hardware interrupt, as long as it is the highest level interrupt, see
section at the end of this file).
*/
/* ---------------------------- Hardware Config ---------------------------- */
#define USB_CFG_IOPORTNAME D
/* This is the port where the USB bus is connected. When you configure it to
* "B", the registers PORTB, PINB and DDRB will be used.
*/
#define USB_CFG_DMINUS_BIT 3
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
* This may be any bit in the port.
*/
#define USB_CFG_DPLUS_BIT 2
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
* This may be any bit in the port. Please note that D+ must also be connected
* to interrupt pin INT0! [You can also use other interrupts, see section
* "Optional MCU Description" below, or you can connect D- to the interrupt, as
* it is required if you use the USB_COUNT_SOF feature. If you use D- for the
* interrupt, the USB interrupt will also be triggered at Start-Of-Frame
* markers every millisecond.]
*/
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
* 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
* require no crystal, they tolerate +/- 1% deviation from the nominal
* frequency. All other rates require a precision of 2000 ppm and thus a
* crystal!
* Since F_CPU should be defined to your actual clock rate anyway, you should
* not need to modify this setting.
*/
#define USB_CFG_CHECK_CRC 0
/* Define this to 1 if you want that the driver checks integrity of incoming
* data packets (CRC checks). CRC checks cost quite a bit of code size and are
* currently only available for 18 MHz crystal clock. You must choose
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
*/
/* ----------------------- Optional Hardware Config ------------------------ */
/* #define USB_CFG_PULLUP_IOPORTNAME D */
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
* V+, you can connect and disconnect the device from firmware by calling
* the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
* This constant defines the port on which the pullup resistor is connected.
*/
/* #define USB_CFG_PULLUP_BIT 4 */
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
* above) where the 1.5k pullup resistor is connected. See description
* above for details.
*/
/* --------------------------- Functional Range ---------------------------- */
#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
/* Define this to 1 if you want to compile a version with two endpoints: The
* default control endpoint 0 and an interrupt-in endpoint (any other endpoint
* number).
*/
#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
/* Define this to 1 if you want to compile a version with three endpoints: The
* default control endpoint 0, an interrupt-in endpoint 3 (or the number
* configured below) and a catch-all default interrupt-in endpoint as above.
* You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
*/
#define USB_CFG_EP3_NUMBER 3
/* If the so-called endpoint 3 is used, it can now be configured to any other
* endpoint number (except 0) with this macro. Default if undefined is 3.
*/
/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
/* The above macro defines the startup condition for data toggling on the
* interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
* Since the token is toggled BEFORE sending any data, the first packet is
* sent with the oposite value of this configuration!
*/
#define USB_CFG_IMPLEMENT_HALT 0
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
* for endpoint 1 (interrupt endpoint). Although you may not need this feature,
* it is required by the standard. We have made it a config option because it
* bloats the code considerably.
*/
#define USB_CFG_SUPPRESS_INTR_CODE 0
/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
* want to send any data over them. If this macro is defined to 1, functions
* usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
* you need the interrupt-in endpoints in order to comply to an interface
* (e.g. HID), but never want to send any data. This option saves a couple
* of bytes in flash memory and the transmit buffers in RAM.
*/
#define USB_CFG_INTR_POLL_INTERVAL 1
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
* interval. The value is in milliseconds and must not be less than 10 ms for
* low speed devices.
*/
#define USB_CFG_IS_SELF_POWERED 0
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
* device is powered from the USB bus.
*/
#define USB_CFG_MAX_BUS_POWER 500
/* Set this variable to the maximum USB bus power consumption of your device.
* The value is in milliamperes. [It will be divided by two since USB
* communicates power requirements in units of 2 mA.]
*/
#define USB_CFG_IMPLEMENT_FN_WRITE 1
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
* transfers. Set it to 0 if you don't need it and want to save a couple of
* bytes.
*/
#define USB_CFG_IMPLEMENT_FN_READ 0
/* Set this to 1 if you need to send control replies which are generated
* "on the fly" when usbFunctionRead() is called. If you only want to send
* data from a static buffer, set it to 0 and return the data from
* usbFunctionSetup(). This saves a couple of bytes.
*/
#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
* You must implement the function usbFunctionWriteOut() which receives all
* interrupt/bulk data sent to any endpoint other than 0. The endpoint number
* can be found in 'usbRxToken'.
*/
#define USB_CFG_HAVE_FLOWCONTROL 0
/* Define this to 1 if you want flowcontrol over USB data. See the definition
* of the macros usbDisableAllRequests() and usbEnableAllRequests() in
* usbdrv.h.
*/
#define USB_CFG_DRIVER_FLASH_PAGE 0
/* If the device has more than 64 kBytes of flash, define this to the 64 k page
* where the driver's constants (descriptors) are located. Or in other words:
* Define this to 1 for boot loaders on the ATMega128.
*/
#define USB_CFG_LONG_TRANSFERS 0
/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
* in a single control-in or control-out transfer. Note that the capability
* for long transfers increases the driver size.
*/
/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
/* This macro is a hook if you want to do unconventional things. If it is
* defined, it's inserted at the beginning of received message processing.
* If you eat the received message and don't want default processing to
* proceed, do a return after doing your things. One possible application
* (besides debugging) is to flash a status LED on each packet.
*/
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
/* This macro is a hook if you need to know when an USB RESET occurs. It has
* one parameter which distinguishes between the start of RESET state and its
* end.
*/
/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
* received.
*/
#define USB_COUNT_SOF 1
/* define this macro to 1 if you need the global variable "usbSofCount" which
* counts SOF packets. This feature requires that the hardware interrupt is
* connected to D- instead of D+.
*/
/* #ifdef __ASSEMBLER__
* macro myAssemblerMacro
* in YL, TCNT0
* sts timer0Snapshot, YL
* endm
* #endif
* #define USB_SOF_HOOK myAssemblerMacro
* This macro (if defined) is executed in the assembler module when a
* Start Of Frame condition is detected. It is recommended to define it to
* the name of an assembler macro which is defined here as well so that more
* than one assembler instruction can be used. The macro may use the register
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
* immediately after an SOF pulse may be lost and must be retried by the host.
* What can you do with this hook? Since the SOF signal occurs exactly every
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
* designs running on the internal RC oscillator.
* Please note that Start Of Frame detection works only if D- is wired to the
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
*/
#define USB_CFG_CHECK_DATA_TOGGLING 0
/* define this macro to 1 if you want to filter out duplicate data packets
* sent by the host. Duplicates occur only as a consequence of communication
* errors, when the host does not receive an ACK. Please note that you need to
* implement the filtering yourself in usbFunctionWriteOut() and
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
* for each control- and out-endpoint to check for duplicate packets.
*/
#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
/* define this macro to 1 if you want the function usbMeasureFrameLength()
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
*/
#define USB_USE_FAST_CRC 0
/* The assembler module has two implementations for the CRC algorithm. One is
* faster, the other is smaller. This CRC routine is only used for transmitted
* messages where timing is not critical. The faster routine needs 31 cycles
* per byte while the smaller one needs 61 to 69 cycles. The faster routine
* may be worth the 32 bytes bigger code size if you transmit lots of data and
* run the AVR close to its limit.
*/
/* -------------------------- Device Description --------------------------- */
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
/* USB vendor ID for the device, low byte first. If you have registered your
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
* *** IMPORTANT NOTE ***
* This template uses obdev's shared VID/PID pair for Vendor Class devices
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
/* This is the ID of the product, low byte first. It is interpreted in the
* scope of the vendor ID. If you have registered your own VID with usb.org
* or if you have licensed a PID from somebody else, define it here. Otherwise
* you may use one of obdev's free shared VID/PID pairs. See the file
* USB-IDs-for-free.txt for details!
* *** IMPORTANT NOTE ***
* This template uses obdev's shared VID/PID pair for Vendor Class devices
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
/* Version number of the device: Minor number first, then major number.
*/
#define USB_CFG_VENDOR_NAME 'Y', 'M', 'D', 'K'
#define USB_CFG_VENDOR_NAME_LEN 4
/* These two values define the vendor name returned by the USB device. The name
* must be given as a list of characters under single quotes. The characters
* are interpreted as Unicode (UTF-16) entities.
* If you don't want a vendor name string, undefine these macros.
* ALWAYS define a vendor name containing your Internet domain name if you use
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
* details.
*/
#define USB_CFG_DEVICE_NAME 'Y','M','D','7','5',' ','K','e','y','b','o','a','r','d'
#define USB_CFG_DEVICE_NAME_LEN 14
/* Same as above for the device name. If you don't want a device name, undefine
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
* you use a shared VID/PID.
*/
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
/* Same as above for the serial number. If you don't want a serial number,
* undefine the macros.
* It may be useful to provide the serial number through other means than at
* compile time. See the section about descriptor properties below for how
* to fine tune control over USB descriptors such as the string descriptor
* for the serial number.
*/
#define USB_CFG_DEVICE_CLASS 0
#define USB_CFG_DEVICE_SUBCLASS 0
/* See USB specification if you want to conform to an existing device class.
* Class 0xff is "vendor specific".
*/
#define USB_CFG_INTERFACE_CLASS 3 /* HID */
#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
/* See USB specification if you want to conform to an existing device class or
* protocol. The following classes must be set at interface level:
* HID class is 3, no subclass and protocol required (but may be useful!)
* CDC class is 2, use subclass 2 and protocol 1 for ACM
*/
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
/* Define this to the length of the HID report descriptor, if you implement
* an HID device. Otherwise don't define it or define it to 0.
* If you use this define, you must add a PROGMEM character array named
* "usbHidReportDescriptor" to your code which contains the report descriptor.
* Don't forget to keep the array and this define in sync!
*/
/* #define USB_PUBLIC static */
/* Use the define above if you #include usbdrv.c instead of linking against it.
* This technique saves a couple of bytes in flash memory.
*/
/* ------------------- Fine Control over USB Descriptors ------------------- */
/* If you don't want to use the driver's default USB descriptors, you can
* provide our own. These can be provided as (1) fixed length static data in
* flash memory, (2) fixed length static data in RAM or (3) dynamically at
* runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
* information about this function.
* Descriptor handling is configured through the descriptor's properties. If
* no properties are defined or if they are 0, the default descriptor is used.
* Possible properties are:
* + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
* at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
* used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
* you want RAM pointers.
* + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
* in static memory is in RAM, not in flash memory.
* + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
* the driver must know the descriptor's length. The descriptor itself is
* found at the address of a well known identifier (see below).
* List of static descriptor names (must be declared PROGMEM if in flash):
* char usbDescriptorDevice[];
* char usbDescriptorConfiguration[];
* char usbDescriptorHidReport[];
* char usbDescriptorString0[];
* int usbDescriptorStringVendor[];
* int usbDescriptorStringDevice[];
* int usbDescriptorStringSerialNumber[];
* Other descriptors can't be provided statically, they must be provided
* dynamically at runtime.
*
* Descriptor properties are or-ed or added together, e.g.:
* #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
*
* The following descriptors are defined:
* USB_CFG_DESCR_PROPS_DEVICE
* USB_CFG_DESCR_PROPS_CONFIGURATION
* USB_CFG_DESCR_PROPS_STRINGS
* USB_CFG_DESCR_PROPS_STRING_0
* USB_CFG_DESCR_PROPS_STRING_VENDOR
* USB_CFG_DESCR_PROPS_STRING_PRODUCT
* USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
* USB_CFG_DESCR_PROPS_HID
* USB_CFG_DESCR_PROPS_HID_REPORT
* USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
*
* Note about string descriptors: String descriptors are not just strings, they
* are Unicode strings prefixed with a 2 byte header. Example:
* int serialNumberDescriptor[] = {
* USB_STRING_DESCRIPTOR_HEADER(6),
* 'S', 'e', 'r', 'i', 'a', 'l'
* };
*/
#define USB_CFG_DESCR_PROPS_DEVICE 0
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
#define USB_CFG_DESCR_PROPS_STRINGS 0
#define USB_CFG_DESCR_PROPS_STRING_0 0
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID 0
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
#define usbMsgPtr_t unsigned short
/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
* a scalar type here because gcc generates slightly shorter code for scalar
* arithmetics than for pointer arithmetics. Remove this define for backward
* type compatibility or define it to an 8 bit type if you use data in RAM only
* and all RAM is below 256 bytes (tiny memory model in IAR CC).
*/
/* ----------------------- Optional MCU Description ------------------------ */
/* The following configurations have working defaults in usbdrv.h. You
* usually don't need to set them explicitly. Only if you want to run
* the driver on a device which is not yet supported or with a compiler
* which is not fully supported (such as IAR C) or if you use a differnt
* interrupt than INT0, you may have to define some of these.
*/
/* #define USB_INTR_CFG MCUCR */
/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE GIMSK */
/* #define USB_INTR_ENABLE_BIT INT0 */
/* #define USB_INTR_PENDING GIFR */
/* #define USB_INTR_PENDING_BIT INTF0 */
/* #define USB_INTR_VECTOR INT0_vect */
/* Set INT1 for D- falling edge to count SOF */
/* #define USB_INTR_CFG EICRA */
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE EIMSK */
#define USB_INTR_ENABLE_BIT INT1
/* #define USB_INTR_PENDING EIFR */
#define USB_INTR_PENDING_BIT INTF1
#define USB_INTR_VECTOR INT1_vect
#endif /* __usbconfig_h_included__ */

@ -0,0 +1,95 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ymd75.h"
//#include "rgblight.h"
#include <avr/pgmspace.h>
#include "action_layer.h"
#include "i2c.h"
#include "quantum.h"
#include "backlight.h"
#include "backlight_custom.h"
// for keyboard subdirectory level init functions
// @Override
void matrix_init_kb(void) {
// call user level keymaps, if any
matrix_init_user();
}
#ifdef BACKLIGHT_ENABLE
/// Overrides functions in `quantum.c`
void backlight_init_ports(void) {
b_led_init_ports();
}
void backlight_task(void) {
b_led_task();
}
void backlight_set(uint8_t level) {
b_led_set(level);
}
#endif
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
// custom RGB driver
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i=0; i<RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
bool rgb_init = false;
void matrix_scan_kb(void) {
// if LEDs were previously on before poweroff, turn them back on
if (rgb_init == false && rgblight_config.enable) {
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
rgb_init = true;
}
rgblight_task();
#else
void matrix_scan_kb(void) {
#endif
matrix_scan_user();
/* Nothing else for now. */
}
__attribute__((weak)) // overridable
void matrix_init_user(void) {
}
__attribute__((weak)) // overridable
void matrix_scan_user(void) {
}

@ -0,0 +1,57 @@
/*
Base Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
Modified 2017 Andrew Novak <ndrw.nvk@gmail.com>
Modified 2018 Wayne Jones (WarmCatUK) <waynekjones@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KEYMAP_COMMON_H
#define KEYMAP_COMMON_H
#include "quantum.h"
#include "quantum_keycodes.h"
#include "keycode.h"
#include "action.h"
void matrix_init_user(void);
#define LAYOUT( \
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
K00, K10, K20, K56, K57, KB0, KC0, K96, K76, K66 \
){ \
{ K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KD0, KC_NO }, \
{ K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \
{ K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KE2 }, \
{ K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \
{ K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \
{ K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \
{ K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \
{ K07, K17, K27, K37, K47, K57, K67, K77, KE0, KC_NO, KA7, KB7, KC7, KD7, KE7 } \
}
#endif

@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DEFLT] = KEYMAP_JJ50( \
[_DEFLT] = LAYOUT_jj50( \
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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP_JJ50( \
[_RAISE] = LAYOUT_jj50( \
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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_BSLS, \
@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP_JJ50( \
[_LOWER] = LAYOUT_jj50( \
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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_PIPE, \

@ -41,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ K700, K701, K702, K703, K704, K705, K706, KC_NO, K708, K709, K710, K711, K712, K713, K714 } \
}
#define KEYMAP_JJ50( \
#define LAYOUT_jj50( \
K011, K010, K009, K008, K004, K005, K006, K007, K003, K002, K201, K000, \
K111, K110, K109, K108, K104, K105, K106, K107, K103, K102, K001, K100, \
K211, K210, K209, K208, K204, K205, K206, K207, K203, K202, K101, K200, \

@ -11,7 +11,6 @@ It is used on his
## Keymap Notes
- Highly influenced by the KBP V60 and WKL B.Face standard layouts
- Does not support any form of inswitch or underglow lighting as Merlin hates them.
- Arrow toggle switch is FN + Space
### Build

@ -1,3 +1,68 @@
# 60_ansi
LAYOUT_60_ansi
This is the standard 60% ANSI keyboard layout.
## Requirements
### 1. Layout defined
A keyboard's `.h` file needs to have `LAYOUT_60_ansi` defined
```c
#define LAYOUT_60_ansi( \
K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \
K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \
K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \
K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \
K30, K40, K50, K60, K70, K00, K10, K20 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 } \
}
)
```
This layout needs to match the layout defined in
qmk_firmware/layouts/community/layout.json
### 2. Configuring rules.mk
`rules.mk` needs to have the following line:
LAYOUTS = 60_ansi
### 3. Defining a keymap
A keymap must be defined at
qmk_firmware/layouts/community/60_ansi/yourfoldername/keymap.c
This keymap must have a `LAYOUT_60_ansi` layout defined.
```c
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_60_ansi(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLASH, \
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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_LCTL, KC_LALT, KC_LGUI, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL),
};
```
## Usage
To make generate a hex file, type
make yourkeyboard:yourfoldername
This hex file will contain a keymap with layout `LAYOUT_60_ansi` derived from
qmk_firmware/layouts/community/60_ansi/yourfoldername/keymap.c

@ -3,9 +3,10 @@
#include QMK_KEYBOARD_CONFIG_H
#define PREVENT_STUCK_MODIFIERS
#define ENABLE_GAME_LAYER
#define LAYOUT( \
#define TEMPLATE( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \

@ -3,9 +3,10 @@
#include QMK_KEYBOARD_CONFIG_H
#define PREVENT_STUCK_MODIFIERS
#define ENABLE_GAME_LAYER
#define LAYOUT( \
#define TEMPLATE( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \

@ -0,0 +1,23 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include QMK_KEYBOARD_CONFIG_H
#define PREVENT_STUCK_MODIFIERS
#define ENABLE_GAME_LAYER
#define TEMPLATE( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \
) LAYOUT_60_hhkb( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \
K41, K42, K45, K48, K4C \
)
#endif //CONFIG_USER_H

@ -0,0 +1 @@
// This space intentionally left blank

@ -4,7 +4,7 @@
#include QMK_KEYBOARD_CONFIG_H
#define SPACE_COUNT 3
#define LAYOUT( \
#define TEMPLATE( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \

@ -0,0 +1,25 @@
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include QMK_KEYBOARD_CONFIG_H
#define PREVENT_STUCK_MODIFIERS
#define ENABLE_GAME_LAYER
#define TEMPLATE_TKL(\
KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \
KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \
KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \
) LAYOUT_tkl_ansi( \
KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \
KN2,KC_NO,KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \
KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \
)
#endif //CONFIG_USER_H

@ -0,0 +1,89 @@
#ifdef KEYBOARD_zeal60
#include "config.h"
#include "zeal60.h"
#include "zeal_backlight.h"
#include "action_layer.h"
#include "solarized.h"
#include "talljoe.h"
// from zeal_backlight.c
// we want to be able to set indicators for the spacebar stabs
// but they are not represented by a row/index.
extern zeal_backlight_config g_config;
void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led );
void set_backlight_defaults(void) {
uint8_t space;
uint8_t caps_lock;
map_row_column_to_led(3, 12, &caps_lock);
map_row_column_to_led(4, 7, &space);
zeal_backlight_config default_values = {
.use_split_backspace = USE_SPLIT_BACKSPACE,
.use_split_left_shift = USE_SPLIT_LEFT_SHIFT,
.use_split_right_shift = USE_SPLIT_RIGHT_SHIFT,
.use_7u_spacebar = USE_7U_SPACEBAR,
.use_iso_enter = USE_ISO_ENTER,
.disable_when_usb_suspended = 1,
.disable_after_timeout = 0,
.brightness = 255,
.effect = 10,
.color_1 = solarized.base2,
.color_2 = solarized.base02,
.caps_lock_indicator = { .index = caps_lock, .color = solarized.red },
.layer_1_indicator = { .index = space, .color = solarized.blue },
.layer_2_indicator = { .index = space, .color = solarized.yellow },
.layer_3_indicator = { .index = 254, .color = solarized.red },
.alphas_mods = {
BACKLIGHT_ALPHAS_MODS_ROW_0,
BACKLIGHT_ALPHAS_MODS_ROW_1,
BACKLIGHT_ALPHAS_MODS_ROW_2,
BACKLIGHT_ALPHAS_MODS_ROW_3,
BACKLIGHT_ALPHAS_MODS_ROW_4 }
};
memcpy(&g_config, &default_values, sizeof(zeal_backlight_config));
backlight_config_save();
solarized_t* S = &solarized;
HSV alphas = S->base2;
HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM(
S->red, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->red,
S->orange, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->orange,
S->green, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->green,
S->blue, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->blue, S->blue,
S->violet, S->magenta, S->yellow, alphas, S->yellow, S->magenta, S->violet, S->green
);
for (uint8_t row = 0; row < MATRIX_ROWS; ++row) {
for (uint8_t col = 0; col < MATRIX_COLS; ++col) {
backlight_set_key_color(row, col, custom_color_map[row][col]);
}
}
}
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
static uint8_t last_effect;
switch (keycode) {
case DFAULTS:
if (IS_PRESSED(record->event)) set_backlight_defaults();
return false;
case BL_TOGG:
if (IS_PRESSED(record->event)) {
if (g_config.effect) {
last_effect = g_config.effect;
g_config.effect = 0;
} else {
g_config.effect = last_effect;
}
}
return false;
case EFFECT...EFFECT_END:
if (IS_PRESSED(record->event)) {
uint8_t effect = keycode - EFFECT;
g_config.effect = effect;
backlight_config_save();
}
return false;
}
return true;
}
#endif

@ -0,0 +1,65 @@
#include QMK_KEYBOARD_H
#define BASE 0
#define HHKB 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* BASE Level: Default Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[BASE] = LAYOUT_60_hhkb( // default layer
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_BSLS, KC_GRV, \
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_BSPC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer HHKB: HHKB mode (HHKB Fn)
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| | | | | | | + | - | End | PgD | Dow | | | | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|------+------+----------------------+------+------+
| **** | **** | ******************** | **** | **** |
|------+------+----------------------+------+------+
*/
[HHKB] = LAYOUT_60_hhkb(
KC_PWR, 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_INS, KC_DEL, \
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
};

@ -0,0 +1,5 @@
["Esc","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=","|\n\\","~\n`"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"Delete"],
[{w:1.75},"Control","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:1.75},"Shift","Fn"],
[{x:1.5},"Os",{w:1.5},"Alt",{a:7,w:7},"",{a:4,w:1.5},"Alt","Os"]

@ -0,0 +1,3 @@
# 60_hhkb
LAYOUT_60_hhkb

@ -0,0 +1,11 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_tkl_ansi(\
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_PSCR,KC_SLCK,KC_PAUS, \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_INS ,KC_HOME,KC_PGUP, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL ,KC_END ,KC_PGDN, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_SCLN,KC_QUOT, KC_ENT, \
KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSFT, KC_UP, \
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \
};

@ -0,0 +1,6 @@
["Esc",{x:1},"F1","F2","F3","F4",{x:0.5},"F5","F6","F7","F8",{x:0.5},"F9","F10","F11","F12",{x:0.25},"PrtSc","Scroll Lock","Pause\nBreak"],
[{y:0.5},"~\n`","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace",{x:0.25},"Insert","Home","PgUp"],
[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\",{x:0.25},"Delete","End","PgDn"],
[{w:1.75},"Caps Lock","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"],
[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.75},"Shift",{x:1.25},"↑"],
[{w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6.25},"",{a:4,w:1.25},"Alt",{w:1.25},"Win",{w:1.25},"Menu",{w:1.25},"Ctrl",{x:0.25},"←","↓","→"]

@ -0,0 +1,3 @@
# tkl_ansi
LAYOUT_tkl_ansi

@ -90,7 +90,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH - 1])
return HID_PARSE_HIDStackOverflow;
memcpy((CurrStateTable + 1),
memmove(CurrStateTable + 1,
CurrStateTable,
sizeof(HID_ReportItem_t));

@ -331,7 +331,7 @@
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_EVENTS_C)
void USB_Event_Stub(void) ATTR_CONST;
void USB_Event_Stub(void);
#if defined(USB_CAN_BE_BOTH)
void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);

@ -18,7 +18,7 @@
#include "rgb_matrix.h"
#include <avr/io.h>
#include "TWIlib.h"
#include "i2c_master.h"
#include <util/delay.h>
#include <avr/interrupt.h>
#include "progmem.h"
@ -324,8 +324,8 @@ void rgb_matrix_raindrops(bool initialize) {
HSV hsv;
RGB rgb;
// Change one LED every tick
uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % DRIVER_LED_TOTAL : 255;
// Change one LED every tick, make sure speed is not 0
uint8_t led_to_change = ( g_tick & ( 0x0A / (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed) ) ) == 0 ? rand() % (DRIVER_LED_TOTAL) : 255;
for ( int i=0; i<DRIVER_LED_TOTAL; i++ )
{
@ -432,7 +432,7 @@ void rgb_matrix_rainbow_beacon(void) {
rgb_led led;
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
hsv.h = 1.5 * (led.point.y - 32.0)* cos(g_tick * PI / 128) + 1.5 * (led.point.x - 112.0) * sin(g_tick * PI / 128) + rgb_matrix_config.hue;
hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.y - 32.0)* cos(g_tick * PI / 128) + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.x - 112.0) * sin(g_tick * PI / 128) + rgb_matrix_config.hue;
rgb = hsv_to_rgb( hsv );
rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b );
}
@ -444,7 +444,7 @@ void rgb_matrix_rainbow_pinwheels(void) {
rgb_led led;
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
hsv.h = 2 * (led.point.y - 32.0)* cos(g_tick * PI / 128) + 2 * (66 - abs(led.point.x - 112.0)) * sin(g_tick * PI / 128) + rgb_matrix_config.hue;
hsv.h = (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.y - 32.0)* cos(g_tick * PI / 128) + (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (66 - abs(led.point.x - 112.0)) * sin(g_tick * PI / 128) + rgb_matrix_config.hue;
rgb = hsv_to_rgb( hsv );
rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b );
}
@ -458,7 +458,7 @@ void rgb_matrix_rainbow_moving_chevron(void) {
led = g_rgb_leds[i];
// uint8_t r = g_tick;
uint8_t r = 32;
hsv.h = 1.5 * abs(led.point.y - 32.0)* sin(r * PI / 128) + 1.5 * (led.point.x - (g_tick / 256.0 * 224)) * cos(r * PI / 128) + rgb_matrix_config.hue;
hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * abs(led.point.y - 32.0)* sin(r * PI / 128) + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.x - (g_tick / 256.0 * 224)) * cos(r * PI / 128) + rgb_matrix_config.hue;
rgb = hsv_to_rgb( hsv );
rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b );
}
@ -469,8 +469,8 @@ void rgb_matrix_jellybean_raindrops( bool initialize ) {
HSV hsv;
RGB rgb;
// Change one LED every tick
uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % DRIVER_LED_TOTAL : 255;
// Change one LED every tick, make sure speed is not 0
uint8_t led_to_change = ( g_tick & ( 0x0A / (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed) ) ) == 0 ? rand() % (DRIVER_LED_TOTAL) : 255;
for ( int i=0; i<DRIVER_LED_TOTAL; i++ )
{
@ -577,8 +577,10 @@ void rgb_matrix_custom(void) {
}
void rgb_matrix_task(void) {
static uint8_t toggle_enable_last = 255;
if (!rgb_matrix_config.enable) {
rgb_matrix_all_off();
toggle_enable_last = rgb_matrix_config.enable;
return;
}
// delay 1 second before driving LEDs or doing anything else
@ -618,8 +620,9 @@ void rgb_matrix_task(void) {
// detect change in effect, so each effect can
// have an optional initialization.
static uint8_t effect_last = 255;
bool initialize = effect != effect_last;
bool initialize = (effect != effect_last) || (rgb_matrix_config.enable != toggle_enable_last);
effect_last = effect;
toggle_enable_last = rgb_matrix_config.enable;
// this gets ticked at 20 Hz.
// each effect can opt to do calculations
@ -628,9 +631,6 @@ void rgb_matrix_task(void) {
case RGB_MATRIX_SOLID_COLOR:
rgb_matrix_solid_color();
break;
case RGB_MATRIX_SOLID_REACTIVE:
rgb_matrix_solid_reactive();
break;
case RGB_MATRIX_ALPHAS_MODS:
rgb_matrix_alphas_mods();
break;
@ -665,6 +665,9 @@ void rgb_matrix_task(void) {
rgb_matrix_jellybean_raindrops( initialize );
break;
#ifdef RGB_MATRIX_KEYPRESSES
case RGB_MATRIX_SOLID_REACTIVE:
rgb_matrix_solid_reactive();
break;
case RGB_MATRIX_SPLASH:
rgb_matrix_splash();
break;
@ -719,10 +722,8 @@ void rgb_matrix_indicators_user(void) {}
// }
void rgb_matrix_init_drivers(void) {
//sei();
// Initialize TWI
TWIInit();
i2c_init();
IS31FL3731_init( DRIVER_ADDR_1 );
IS31FL3731_init( DRIVER_ADDR_2 );
@ -830,8 +831,8 @@ void rgblight_step(void) {
void rgblight_step_reverse(void) {
rgb_matrix_config.mode--;
if (rgb_matrix_config.mode <= 1)
rgb_matrix_config.mode = (RGB_MATRIX_EFFECT_MAX - 1);
if (rgb_matrix_config.mode < 1)
rgb_matrix_config.mode = RGB_MATRIX_EFFECT_MAX - 1;
eeconfig_update_rgb_matrix(rgb_matrix_config.raw);
}

@ -64,7 +64,6 @@ typedef union {
enum rgb_matrix_effects {
RGB_MATRIX_SOLID_COLOR = 1,
RGB_MATRIX_SOLID_REACTIVE,
RGB_MATRIX_ALPHAS_MODS,
RGB_MATRIX_DUAL_BEACON,
RGB_MATRIX_GRADIENT_UP_DOWN,
@ -77,6 +76,7 @@ enum rgb_matrix_effects {
RGB_MATRIX_RAINBOW_MOVING_CHEVRON,
RGB_MATRIX_JELLYBEAN_RAINDROPS,
#ifdef RGB_MATRIX_KEYPRESSES
RGB_MATRIX_SOLID_REACTIVE,
RGB_MATRIX_SPLASH,
RGB_MATRIX_MULTISPLASH,
RGB_MATRIX_SOLID_SPLASH,

@ -36,6 +36,26 @@
#define rgblight_setrgb_magenta() rgblight_setrgb (0xFF, 0x00, 0xFF)
#define rgblight_setrgb_pink() rgblight_setrgb (0xFF, 0x80, 0xBF)
/* SET RGB List */
#define rgblight_setrgb_white_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0xFF, at)
#define rgblight_setrgb_red_at(at) rgblight_setrgb_at (0xFF, 0x00, 0x00, at)
#define rgblight_setrgb_coral_at(at) rgblight_setrgb_at (0xFF, 0x7C, 0x4D, at)
#define rgblight_setrgb_orange_at(at) rgblight_setrgb_at (0xFF, 0x80, 0x00, at)
#define rgblight_setrgb_goldenrod_at(at) rgblight_setrgb_at (0xD9, 0xA5, 0x21, at)
#define rgblight_setrgb_gold_at(at) rgblight_setrgb_at (0xFF, 0xD9, 0x00, at)
#define rgblight_setrgb_yellow_at(at) rgblight_setrgb_at (0xFF, 0xFF, 0x00, at)
#define rgblight_setrgb_chartreuse_at(at) rgblight_setrgb_at (0x80, 0xFF, 0x00, at)
#define rgblight_setrgb_green_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x00, at)
#define rgblight_setrgb_springgreen_at(at) rgblight_setrgb_at (0x00, 0xFF, 0x80, at)
#define rgblight_setrgb_turquoise_at(at) rgblight_setrgb_at (0x47, 0x6E, 0x6A, at)
#define rgblight_setrgb_teal_at(at) rgblight_setrgb_at (0x00, 0x80, 0x80, at)
#define rgblight_setrgb_cyan_at(at) rgblight_setrgb_at (0x00, 0xFF, 0xFF, at)
#define rgblight_setrgb_azure_at(at) rgblight_setrgb_at (0x99, 0xf5, 0xFF, at)
#define rgblight_setrgb_blue_at(at) rgblight_setrgb_at (0x00, 0x00, 0xFF, at)
#define rgblight_setrgb_purple_at(at) rgblight_setrgb_at (0x7A, 0x00, 0xFF, at)
#define rgblight_setrgb_magenta_at(at) rgblight_setrgb_at (0xFF, 0x00, 0xFF, at)
#define rgblight_setrgb_pink_at(at) rgblight_setrgb_at (0xFF, 0x80, 0xBF, at)
/* SET HSV List */
#define rgblight_sethsv_white() rgblight_sethsv ( 0, 0, 255)
#define rgblight_sethsv_red() rgblight_sethsv ( 0, 255, 255)
@ -56,4 +76,24 @@
#define rgblight_sethsv_magenta() rgblight_sethsv (300, 255, 255)
#define rgblight_sethsv_pink() rgblight_sethsv (330, 128, 255)
/* SET HSV List */
#define rgblight_sethsv_white_at(at) rgblight_sethsv_at ( 0, 0, 255, at)
#define rgblight_sethsv_red_at(at) rgblight_sethsv_at ( 0, 255, 255, at)
#define rgblight_sethsv_coral_at(at) rgblight_sethsv_at ( 16, 176, 255, at)
#define rgblight_sethsv_orange_at(at) rgblight_sethsv_at ( 39, 255, 255, at)
#define rgblight_sethsv_goldenrod_at(at) rgblight_sethsv_at ( 43, 218, 218, at)
#define rgblight_sethsv_gold_at(at) rgblight_sethsv_at ( 51, 255, 255, at)
#define rgblight_sethsv_yellow_at(at) rgblight_sethsv_at ( 60, 255, 255, at)
#define rgblight_sethsv_chartreuse_at(at) rgblight_sethsv_at ( 90, 255, 255, at)
#define rgblight_sethsv_green_at(at) rgblight_sethsv_at (120, 255, 255, at)
#define rgblight_sethsv_springgreen_at(at) rgblight_sethsv_at (150, 255, 255, at)
#define rgblight_sethsv_turquoise_at(at) rgblight_sethsv_at (174, 90, 112, at)
#define rgblight_sethsv_teal_at(at) rgblight_sethsv_at (180, 255, 128, at)
#define rgblight_sethsv_cyan_at(at) rgblight_sethsv_at (180, 255, 255, at)
#define rgblight_sethsv_azure_at(at) rgblight_sethsv_at (186, 102, 255, at)
#define rgblight_sethsv_blue_at(at) rgblight_sethsv_at (240, 255, 255, at)
#define rgblight_sethsv_purple_at(at) rgblight_sethsv_at (270, 255, 255, at)
#define rgblight_sethsv_magenta_at(at) rgblight_sethsv_at (300, 255, 255, at)
#define rgblight_sethsv_pink_at(at) rgblight_sethsv_at (330, 128, 255, at)
#endif

@ -1,5 +1,5 @@
/*
Copyright 2017 REPLACE_WITH_YOUR_NAME
Copyright 2018 REPLACE_WITH_YOUR_NAME
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
@ -48,7 +48,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
#define DIODE_DIRECTION COL2ROW
// #define BACKLIGHT_PIN B7
// #define BACKLIGHT_BREATHING
// #define BACKLIGHT_LEVELS 3

@ -1,4 +1,4 @@
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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

@ -1,4 +1,4 @@
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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

@ -1,4 +1,4 @@
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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

@ -1,4 +1,4 @@
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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

@ -0,0 +1,49 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
#define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D
#define MANUFACTURER You
#define PRODUCT %KEYBOARD%
#define RGBLED_NUM 16
#define MATRIX_ROWS 2
#define MATRIX_COLS 3
#define MATRIX_ROW_PINS { D0, D5 }
#define MATRIX_COL_PINS { F1, F0, B0 }
#define UNUSED_PINS
#define DIODE_DIRECTION COL2ROW
#define DEBOUNCING_DELAY 5
#define NO_BACKLIGHT_CLOCK
#define BACKLIGHT_LEVELS 1
#define RGBLIGHT_ANIMATIONS
#define NO_UART 1
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
#endif

@ -0,0 +1,106 @@
/*
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Please do not modify this file
#include <avr/io.h>
#include <util/twi.h>
#include "i2c.h"
void i2c_set_bitrate(uint16_t bitrate_khz) {
uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
if (bitrate_div >= 16) {
bitrate_div = (bitrate_div - 16) / 2;
}
TWBR = bitrate_div;
}
void i2c_init(void) {
// set pull-up resistors on I2C bus pins
PORTC |= 0b11;
i2c_set_bitrate(400);
// enable TWI (two-wire interface)
TWCR |= (1 << TWEN);
// enable TWI interrupt and slave address ACK
TWCR |= (1 << TWIE);
TWCR |= (1 << TWEA);
}
uint8_t i2c_start(uint8_t address) {
// reset TWI control register
TWCR = 0;
// begin transmission and wait for it to end
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the start condition was successfully transmitted
if ((TWSR & 0xF8) != TW_START) {
return 1;
}
// transmit address and wait
TWDR = address;
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the device has acknowledged the READ / WRITE mode
uint8_t twst = TW_STATUS & 0xF8;
if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
return 1;
}
return 0;
}
void i2c_stop(void) {
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
}
uint8_t i2c_write(uint8_t data) {
TWDR = data;
// transmit data and wait
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
return 1;
}
return 0;
}
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
if (i2c_start(address)) {
return 1;
}
for (uint16_t i = 0; i < length; i++) {
if (i2c_write(data[i])) {
return 1;
}
}
i2c_stop();
return 0;
}

@ -0,0 +1,27 @@
/*
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Please do not modify this file
#ifndef __I2C_H__
#define __I2C_H__
void i2c_init(void);
void i2c_set_bitrate(uint16_t bitrate_khz);
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
#endif

@ -0,0 +1,106 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <avr/io.h>
#include <util/delay.h>
#include "matrix.h"
#ifndef DEBOUNCE
#define DEBOUNCE 5
#endif
static uint8_t debouncing = DEBOUNCE;
static matrix_row_t matrix[MATRIX_ROWS];
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
void matrix_init(void) {
// all outputs for rows high
DDRB = 0xFF;
PORTB = 0xFF;
// all inputs for columns
DDRA = 0x00;
DDRC &= ~(0x111111<<2);
DDRD &= ~(1<<PIND7);
// all columns are pulled-up
PORTA = 0xFF;
PORTC |= (0b111111<<2);
PORTD |= (1<<PIND7);
// initialize matrix state: all keys off
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix[row] = 0x00;
matrix_debouncing[row] = 0x00;
}
}
void matrix_set_row_status(uint8_t row) {
DDRB = (1 << row);
PORTB = ~(1 << row);
}
uint8_t bit_reverse(uint8_t x) {
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
return x;
}
uint8_t matrix_scan(void) {
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
matrix_set_row_status(row);
_delay_us(5);
matrix_row_t cols = (
// cols 0..7, PORTA 0 -> 7
(~PINA) & 0xFF
) | (
// cols 8..13, PORTC 7 -> 0
bit_reverse((~PINC) & 0xFF) << 8
) | (
// col 14, PORTD 7
((~PIND) & (1 << PIND7)) << 7
);
if (matrix_debouncing[row] != cols) {
matrix_debouncing[row] = cols;
debouncing = DEBOUNCE;
}
}
if (debouncing) {
if (--debouncing) {
_delay_ms(1);
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
}
}
}
matrix_scan_user();
return 1;
}
inline matrix_row_t matrix_get_row(uint8_t row) {
return matrix[row];
}
void matrix_print(void) {
}

@ -0,0 +1,50 @@
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name
MCU = atmega32a
PROTOCOL = VUSB
# unsupported features for now
NO_UART = yes
NO_SUSPEND_POWER_DOWN = yes
# processor frequency
F_CPU = 12000000
# 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 = bootloadHID
# build options
BOOTMAGIC_ENABLE = yes
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = no
RGBLIGHT_CUSTOM_DRIVER = yes
OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
CUSTOM_MATRIX = yes
SRC = matrix.c i2c.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex

@ -0,0 +1,25 @@
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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 "%KEYBOARD%.h"
#include <avr/pgmspace.h>
#include "action_layer.h"
#include "i2c.h"
#include "quantum.h"
__attribute__ ((weak))
void matrix_scan_user(void) {
}

@ -0,0 +1,34 @@
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
*
* 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 %KEYBOARD_UPPERCASE%_H
#define %KEYBOARD_UPPERCASE%_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
// The second converts the arguments into a two-dimensional array
#define LAYOUT( \
k00, k01, k02, \
k10, k11 \
) \
{ \
{ k00, k01, k02 }, \
{ k10, KC_NO, k11 }, \
}
#endif

@ -0,0 +1,396 @@
/* Name: usbconfig.h
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
* Author: Christian Starkjohann
* Creation Date: 2005-04-01
* Tabsize: 4
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
*/
#ifndef __usbconfig_h_included__
#define __usbconfig_h_included__
#include "config.h"
/*
General Description:
This file is an example configuration (with inline documentation) for the USB
driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
wire the lines to any other port, as long as D+ is also wired to INT0 (or any
other hardware interrupt, as long as it is the highest level interrupt, see
section at the end of this file).
*/
/* ---------------------------- Hardware Config ---------------------------- */
#define USB_CFG_IOPORTNAME D
/* This is the port where the USB bus is connected. When you configure it to
* "B", the registers PORTB, PINB and DDRB will be used.
*/
#define USB_CFG_DMINUS_BIT 3
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
* This may be any bit in the port.
*/
#define USB_CFG_DPLUS_BIT 2
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
* This may be any bit in the port. Please note that D+ must also be connected
* to interrupt pin INT0! [You can also use other interrupts, see section
* "Optional MCU Description" below, or you can connect D- to the interrupt, as
* it is required if you use the USB_COUNT_SOF feature. If you use D- for the
* interrupt, the USB interrupt will also be triggered at Start-Of-Frame
* markers every millisecond.]
*/
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
* 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
* require no crystal, they tolerate +/- 1% deviation from the nominal
* frequency. All other rates require a precision of 2000 ppm and thus a
* crystal!
* Since F_CPU should be defined to your actual clock rate anyway, you should
* not need to modify this setting.
*/
#define USB_CFG_CHECK_CRC 0
/* Define this to 1 if you want that the driver checks integrity of incoming
* data packets (CRC checks). CRC checks cost quite a bit of code size and are
* currently only available for 18 MHz crystal clock. You must choose
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
*/
/* ----------------------- Optional Hardware Config ------------------------ */
/* #define USB_CFG_PULLUP_IOPORTNAME D */
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
* V+, you can connect and disconnect the device from firmware by calling
* the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
* This constant defines the port on which the pullup resistor is connected.
*/
/* #define USB_CFG_PULLUP_BIT 4 */
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
* above) where the 1.5k pullup resistor is connected. See description
* above for details.
*/
/* --------------------------- Functional Range ---------------------------- */
#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
/* Define this to 1 if you want to compile a version with two endpoints: The
* default control endpoint 0 and an interrupt-in endpoint (any other endpoint
* number).
*/
#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
/* Define this to 1 if you want to compile a version with three endpoints: The
* default control endpoint 0, an interrupt-in endpoint 3 (or the number
* configured below) and a catch-all default interrupt-in endpoint as above.
* You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
*/
#define USB_CFG_EP3_NUMBER 3
/* If the so-called endpoint 3 is used, it can now be configured to any other
* endpoint number (except 0) with this macro. Default if undefined is 3.
*/
/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
/* The above macro defines the startup condition for data toggling on the
* interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
* Since the token is toggled BEFORE sending any data, the first packet is
* sent with the oposite value of this configuration!
*/
#define USB_CFG_IMPLEMENT_HALT 0
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
* for endpoint 1 (interrupt endpoint). Although you may not need this feature,
* it is required by the standard. We have made it a config option because it
* bloats the code considerably.
*/
#define USB_CFG_SUPPRESS_INTR_CODE 0
/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
* want to send any data over them. If this macro is defined to 1, functions
* usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
* you need the interrupt-in endpoints in order to comply to an interface
* (e.g. HID), but never want to send any data. This option saves a couple
* of bytes in flash memory and the transmit buffers in RAM.
*/
#define USB_CFG_INTR_POLL_INTERVAL 1
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
* interval. The value is in milliseconds and must not be less than 10 ms for
* low speed devices.
*/
#define USB_CFG_IS_SELF_POWERED 0
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
* device is powered from the USB bus.
*/
#define USB_CFG_MAX_BUS_POWER 500
/* Set this variable to the maximum USB bus power consumption of your device.
* The value is in milliamperes. [It will be divided by two since USB
* communicates power requirements in units of 2 mA.]
*/
#define USB_CFG_IMPLEMENT_FN_WRITE 1
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
* transfers. Set it to 0 if you don't need it and want to save a couple of
* bytes.
*/
#define USB_CFG_IMPLEMENT_FN_READ 0
/* Set this to 1 if you need to send control replies which are generated
* "on the fly" when usbFunctionRead() is called. If you only want to send
* data from a static buffer, set it to 0 and return the data from
* usbFunctionSetup(). This saves a couple of bytes.
*/
#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
* You must implement the function usbFunctionWriteOut() which receives all
* interrupt/bulk data sent to any endpoint other than 0. The endpoint number
* can be found in 'usbRxToken'.
*/
#define USB_CFG_HAVE_FLOWCONTROL 0
/* Define this to 1 if you want flowcontrol over USB data. See the definition
* of the macros usbDisableAllRequests() and usbEnableAllRequests() in
* usbdrv.h.
*/
#define USB_CFG_DRIVER_FLASH_PAGE 0
/* If the device has more than 64 kBytes of flash, define this to the 64 k page
* where the driver's constants (descriptors) are located. Or in other words:
* Define this to 1 for boot loaders on the ATMega128.
*/
#define USB_CFG_LONG_TRANSFERS 0
/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
* in a single control-in or control-out transfer. Note that the capability
* for long transfers increases the driver size.
*/
/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
/* This macro is a hook if you want to do unconventional things. If it is
* defined, it's inserted at the beginning of received message processing.
* If you eat the received message and don't want default processing to
* proceed, do a return after doing your things. One possible application
* (besides debugging) is to flash a status LED on each packet.
*/
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
/* This macro is a hook if you need to know when an USB RESET occurs. It has
* one parameter which distinguishes between the start of RESET state and its
* end.
*/
/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
* received.
*/
#define USB_COUNT_SOF 1
/* define this macro to 1 if you need the global variable "usbSofCount" which
* counts SOF packets. This feature requires that the hardware interrupt is
* connected to D- instead of D+.
*/
/* #ifdef __ASSEMBLER__
* macro myAssemblerMacro
* in YL, TCNT0
* sts timer0Snapshot, YL
* endm
* #endif
* #define USB_SOF_HOOK myAssemblerMacro
* This macro (if defined) is executed in the assembler module when a
* Start Of Frame condition is detected. It is recommended to define it to
* the name of an assembler macro which is defined here as well so that more
* than one assembler instruction can be used. The macro may use the register
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
* immediately after an SOF pulse may be lost and must be retried by the host.
* What can you do with this hook? Since the SOF signal occurs exactly every
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
* designs running on the internal RC oscillator.
* Please note that Start Of Frame detection works only if D- is wired to the
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
*/
#define USB_CFG_CHECK_DATA_TOGGLING 0
/* define this macro to 1 if you want to filter out duplicate data packets
* sent by the host. Duplicates occur only as a consequence of communication
* errors, when the host does not receive an ACK. Please note that you need to
* implement the filtering yourself in usbFunctionWriteOut() and
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
* for each control- and out-endpoint to check for duplicate packets.
*/
#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
/* define this macro to 1 if you want the function usbMeasureFrameLength()
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
*/
#define USB_USE_FAST_CRC 0
/* The assembler module has two implementations for the CRC algorithm. One is
* faster, the other is smaller. This CRC routine is only used for transmitted
* messages where timing is not critical. The faster routine needs 31 cycles
* per byte while the smaller one needs 61 to 69 cycles. The faster routine
* may be worth the 32 bytes bigger code size if you transmit lots of data and
* run the AVR close to its limit.
*/
/* -------------------------- Device Description --------------------------- */
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
/* USB vendor ID for the device, low byte first. If you have registered your
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
* *** IMPORTANT NOTE ***
* This template uses obdev's shared VID/PID pair for Vendor Class devices
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
/* This is the ID of the product, low byte first. It is interpreted in the
* scope of the vendor ID. If you have registered your own VID with usb.org
* or if you have licensed a PID from somebody else, define it here. Otherwise
* you may use one of obdev's free shared VID/PID pairs. See the file
* USB-IDs-for-free.txt for details!
* *** IMPORTANT NOTE ***
* This template uses obdev's shared VID/PID pair for Vendor Class devices
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
* the implications!
*/
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
/* Version number of the device: Minor number first, then major number.
*/
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
#define USB_CFG_VENDOR_NAME_LEN 13
/* These two values define the vendor name returned by the USB device. The name
* must be given as a list of characters under single quotes. The characters
* are interpreted as Unicode (UTF-16) entities.
* If you don't want a vendor name string, undefine these macros.
* ALWAYS define a vendor name containing your Internet domain name if you use
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
* details.
*/
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
#define USB_CFG_DEVICE_NAME_LEN 8
/* Same as above for the device name. If you don't want a device name, undefine
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
* you use a shared VID/PID.
*/
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
/* Same as above for the serial number. If you don't want a serial number,
* undefine the macros.
* It may be useful to provide the serial number through other means than at
* compile time. See the section about descriptor properties below for how
* to fine tune control over USB descriptors such as the string descriptor
* for the serial number.
*/
#define USB_CFG_DEVICE_CLASS 0
#define USB_CFG_DEVICE_SUBCLASS 0
/* See USB specification if you want to conform to an existing device class.
* Class 0xff is "vendor specific".
*/
#define USB_CFG_INTERFACE_CLASS 3 /* HID */
#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
/* See USB specification if you want to conform to an existing device class or
* protocol. The following classes must be set at interface level:
* HID class is 3, no subclass and protocol required (but may be useful!)
* CDC class is 2, use subclass 2 and protocol 1 for ACM
*/
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
/* Define this to the length of the HID report descriptor, if you implement
* an HID device. Otherwise don't define it or define it to 0.
* If you use this define, you must add a PROGMEM character array named
* "usbHidReportDescriptor" to your code which contains the report descriptor.
* Don't forget to keep the array and this define in sync!
*/
/* #define USB_PUBLIC static */
/* Use the define above if you #include usbdrv.c instead of linking against it.
* This technique saves a couple of bytes in flash memory.
*/
/* ------------------- Fine Control over USB Descriptors ------------------- */
/* If you don't want to use the driver's default USB descriptors, you can
* provide our own. These can be provided as (1) fixed length static data in
* flash memory, (2) fixed length static data in RAM or (3) dynamically at
* runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
* information about this function.
* Descriptor handling is configured through the descriptor's properties. If
* no properties are defined or if they are 0, the default descriptor is used.
* Possible properties are:
* + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
* at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
* used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
* you want RAM pointers.
* + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
* in static memory is in RAM, not in flash memory.
* + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
* the driver must know the descriptor's length. The descriptor itself is
* found at the address of a well known identifier (see below).
* List of static descriptor names (must be declared PROGMEM if in flash):
* char usbDescriptorDevice[];
* char usbDescriptorConfiguration[];
* char usbDescriptorHidReport[];
* char usbDescriptorString0[];
* int usbDescriptorStringVendor[];
* int usbDescriptorStringDevice[];
* int usbDescriptorStringSerialNumber[];
* Other descriptors can't be provided statically, they must be provided
* dynamically at runtime.
*
* Descriptor properties are or-ed or added together, e.g.:
* #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
*
* The following descriptors are defined:
* USB_CFG_DESCR_PROPS_DEVICE
* USB_CFG_DESCR_PROPS_CONFIGURATION
* USB_CFG_DESCR_PROPS_STRINGS
* USB_CFG_DESCR_PROPS_STRING_0
* USB_CFG_DESCR_PROPS_STRING_VENDOR
* USB_CFG_DESCR_PROPS_STRING_PRODUCT
* USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
* USB_CFG_DESCR_PROPS_HID
* USB_CFG_DESCR_PROPS_HID_REPORT
* USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
*
* Note about string descriptors: String descriptors are not just strings, they
* are Unicode strings prefixed with a 2 byte header. Example:
* int serialNumberDescriptor[] = {
* USB_STRING_DESCRIPTOR_HEADER(6),
* 'S', 'e', 'r', 'i', 'a', 'l'
* };
*/
#define USB_CFG_DESCR_PROPS_DEVICE 0
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
#define USB_CFG_DESCR_PROPS_STRINGS 0
#define USB_CFG_DESCR_PROPS_STRING_0 0
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID 0
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
#define usbMsgPtr_t unsigned short
/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
* a scalar type here because gcc generates slightly shorter code for scalar
* arithmetics than for pointer arithmetics. Remove this define for backward
* type compatibility or define it to an 8 bit type if you use data in RAM only
* and all RAM is below 256 bytes (tiny memory model in IAR CC).
*/
/* ----------------------- Optional MCU Description ------------------------ */
/* The following configurations have working defaults in usbdrv.h. You
* usually don't need to set them explicitly. Only if you want to run
* the driver on a device which is not yet supported or with a compiler
* which is not fully supported (such as IAR C) or if you use a differnt
* interrupt than INT0, you may have to define some of these.
*/
/* #define USB_INTR_CFG MCUCR */
/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE GIMSK */
/* #define USB_INTR_ENABLE_BIT INT0 */
/* #define USB_INTR_PENDING GIFR */
/* #define USB_INTR_PENDING_BIT INTF0 */
/* #define USB_INTR_VECTOR INT0_vect */
/* Set INT1 for D- falling edge to count SOF */
/* #define USB_INTR_CFG EICRA */
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
/* #define USB_INTR_CFG_CLR 0 */
/* #define USB_INTR_ENABLE EIMSK */
#define USB_INTR_ENABLE_BIT INT1
/* #define USB_INTR_PENDING EIFR */
#define USB_INTR_PENDING_BIT INTF1
#define USB_INTR_VECTOR INT1_vect
#endif /* __usbconfig_h_included__ */

@ -258,10 +258,10 @@ void process_action(keyrecord_t *record, action_t action)
if (event.pressed) {
if (tap_count == 0) {
dprint("MODS_TAP: Oneshot: 0\n");
register_mods(mods);
register_mods(mods | get_oneshot_mods());
} else if (tap_count == 1) {
dprint("MODS_TAP: Oneshot: start\n");
set_oneshot_mods(mods);
set_oneshot_mods(mods | get_oneshot_mods());
#if defined(ONESHOT_TAP_TOGGLE) && ONESHOT_TAP_TOGGLE > 1
} else if (tap_count == ONESHOT_TAP_TOGGLE) {
dprint("MODS_TAP: Toggling oneshot");
@ -270,7 +270,7 @@ void process_action(keyrecord_t *record, action_t action)
register_mods(mods);
#endif
} else {
register_mods(mods);
register_mods(mods | get_oneshot_mods());
}
} else {
if (tap_count == 0) {

@ -1,3 +1,7 @@
SRC += talljoe.c
SRC += talljoe.c tapdance.c
EXTRAFLAGS+=-flto
TAP_DANCE_ENABLE=yes
CONSOLE_ENABLE=no
COMMAND_ENABLE=no

@ -3,66 +3,67 @@
#include "talljoe.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT(
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_ESC,
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_BSPC,
US_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, KC_SCLN, US_QUOT, US_ENT ,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO_ADJ ,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_APP , KC_RCTL, KC_PTT ),
[_WORKMAN] = LAYOUT(
[_BASE] = TEMPLATE_TKL(
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_PSCR, KC_SLCK, MO_ADJ ,
KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_INS , KC_HOME, KC_PGUP,
KC_TAB , KC_Q, KC_W, KC_E, KC_R, KC_T , KC_Y, KC_U, KC_I, KC_O, KC_P , KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL , KC_END , KC_PGDN,
US_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT ,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP ,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT , KC_LEFT, KC_DOWN, KC_RGHT),
[_WORKMAN] = TEMPLATE(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , KC_SCLN, _______, _______, _______,
_______, KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , US_SCLN, _______, _______, _______,
_______, KC_A , KC_S , KC_H , KC_T , KC_G , KC_Y , KC_N , KC_E , KC_O , KC_I , _______, _______,
_______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_NORMAN] = LAYOUT(
[_NORMAN] = TEMPLATE(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_Q , KC_W , KC_D , KC_F , KC_K , KC_J , KC_U , KC_R , KC_L , KC_SCLN, _______, _______, _______,
_______, KC_Q , KC_W , KC_D , KC_F , KC_K , KC_J , KC_U , KC_R , KC_L , US_SCLN, _______, _______, _______,
_______, KC_A , KC_S , KC_E , KC_T , KC_G , KC_Y , KC_N , KC_I , KC_O , KC_H , _______, _______,
_______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_DVORAK] = LAYOUT(
[_DVORAK] = TEMPLATE(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______,
_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y , KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL , _______,
_______, KC_A, KC_O, KC_E, KC_U, KC_I , KC_D, KC_H, KC_T, KC_N, KC_S, US_MINS, _______,
_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X , KC_B, KC_M, KC_W, KC_V, KC_Z, _______, _______,
_______, US_SCLN, KC_Q, KC_J, KC_K, KC_X , KC_B, KC_M, KC_W, KC_V, KC_Z, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
[_COLMAK] = LAYOUT(
[_COLMAK] = TEMPLATE(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_Q, KC_W, KC_F, KC_P, KC_G , KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, _______, _______,
_______, KC_Q, KC_W, KC_F, KC_P, KC_G , KC_J, KC_L, KC_U, KC_Y, US_SCLN, _______, _______, _______,
_______, KC_A, KC_R, KC_S, KC_T, KC_D , KC_H, KC_N, KC_E, KC_I, KC_O , _______, _______,
_______, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
#ifdef ENABLE_GAME_LAYER
[_GAME] = LAYOUT(
[_GAME] = TEMPLATE(
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_BSLS, KC_GRV,
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_BSPC,
MO_NAV , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT ,
KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, MO_ADJ ,
KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ),
#endif
[_NAV] = LAYOUT(
[_NAV] = TEMPLATE(
KC_GRV , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_TAB , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_VOLU, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN2, KC_BTN3, KC_DEL ,
US_CAPS, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_MUTE, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , KC_RCTL, TG_ADJ ,
KC_LSFT, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_VOLD, KC_END , KC_PGDN, KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, XXXXXXX,
KC_LSFT, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_VOLD, KC_END , KC_PGDN, KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP ,
KC_LCTL, KC_LGUI, KC_LALT, NV_SPC2, NV_SPC1, NV_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT ),
[_NUM] = LAYOUT(
[_NUM] = TEMPLATE(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, XXXXXXX, KC_DEL ,
US_CAPS, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_PPLS, KC_PENT, XXXXXXX,
KC_LSFT, KC_EQL, KC_PLUS, KC_BSLS, KC_PIPE, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PAST, KC_PSLS, XXXXXXX,
KC_LSFT, KC_EQL, KC_PLUS, KC_BSLS, KC_PIPE, KC_SCLN, XXXXXXX, KC_1, KC_2, KC_3, KC_PAST, KC_PSLS, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, NM_SPC2, NM_SPC1, NM_SPC3, KC_PDOT, KC_PCMM, KC_RCTL, KC_PTT ),
// Adjust layer is on the split-shift key; or NAV+Enter (for non-split keyboards)
[_ADJUST] = LAYOUT(
[_ADJUST] = TEMPLATE(
MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(6) , FX(7) , FX(8) , FX(9) , FX(10) , BR_DEC , BR_INC , XXXXXXX, MO_RST ,
XXXXXXX, H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, KC_DEL ,
XXXXXXX, H1_DEC , S1_DEC , H2_DEC , S2_DEC , EF_DEC , RGB_HUD, RGB_SAD, RGB_RMOD,RGB_M_K, RGB_M_B, RGB_M_G, TG_ADJ ,
TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX,
MO_RST , AG_NORM, AG_SWAP, XXXXXXX, BL_TOGG, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, TG_GAME),
MO_RST , AG_NORM, AG_SWAP, XXXXXXX, BL_STEP, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, TG_GAME),
// To Reset hit FN + ` + Esc
[_RESET] = LAYOUT(
[_RESET] = TEMPLATE(
RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET ,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
@ -98,6 +99,27 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef RGBLIGHT_ENABLE
static uint32_t savedRgbMode;
static uint16_t savedHue;
static uint8_t savedSat;
static uint8_t savedVal;
if (keycode == KC_ESC) {
if (record->event.pressed) {
savedRgbMode = rgblight_get_mode();
savedHue = rgblight_get_hue();
savedSat = rgblight_get_sat();
savedVal = rgblight_get_val();
rgblight_mode(1);
rgblight_setrgb(255, 0, 0);
} else {
rgblight_mode(savedRgbMode);
rgblight_sethsv(savedHue, savedSat, savedVal);
}
}
#endif
// If console is enabled, it will print the matrix position and status of each key pressed
#ifdef CONSOLE_ENABLE
xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed);

@ -28,6 +28,10 @@ enum layers {
_RESET = RESET_LAYER,
};
enum tap_dancers {
TD_SEMICOLON
};
#define _______ KC_TRNS
#define XXXXXXX KC_NO
@ -53,6 +57,7 @@ enum layers {
#define US_CAPS CTL_T(KC_ESC)
#define US_QUOT RCTL_T(KC_QUOT)
#define US_MINS RCTL_T(KC_QUOT)
#define US_SCLN TD(TD_SEMICOLON)
#define US_ENT LT(_NUM, KC_ENT)
#ifndef SPACE_COUNT
@ -105,4 +110,37 @@ enum layers {
#define FN_MO2 KC_NO
#endif
#ifdef TEMPLATE_TKL
#define _X_ KC_NO
#define TEMPLATE( \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KJ6, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \
KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KA5, \
KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1 \
) TEMPLATE_TKL ( \
KJ6, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, _X_, KA5, \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, _X_, _X_, _X_, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, _X_, _X_, _X_, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \
KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, _X_, \
KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, _X_, _X_, _X_ \
)
#else
#define TEMPLATE_TKL( \
KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \
KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \
KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \
) TEMPLATE( \
KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KJ6, \
KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, \
KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \
KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KA5, \
KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1 \
)
#endif
#endif

@ -0,0 +1,34 @@
//Tap Dance
#include "talljoe.h"
// Send semin-colon + enter on two taps
void tap_dance_semicolon(qk_tap_dance_state_t *state, void *user_data) {
switch(state->count) {
case 1:
register_code(KC_SCLN);
unregister_code(KC_SCLN);
break;
case 2:
register_code(KC_SCLN);
unregister_code(KC_SCLN);
uint8_t mods = get_mods();
if (mods) {
clear_mods();
}
register_code(KC_ENT);
unregister_code(KC_ENT);
if (mods) {
set_mods(mods);
}
reset_tap_dance(state);
break;
}
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_SEMICOLON] = ACTION_TAP_DANCE_FN(tap_dance_semicolon),
};

@ -0,0 +1,10 @@
# Xton has Vim!
Contains common code for Xton's vim emulation (vimulation?) layer.
Inspired/stolen from the `ergodox_ez/vim` keymap. Rewritten to be a more straightforward state machine and support more macros. Vim layers `_CMD` and `_EDIT` are designed to lay on top of an otherwise fully-functional layout. `_CMD` runs the entire vim state machine while `_EDIT` should lay across your base layer and mask off just the escape key.
Works via OSX text editing shortcuts, mainly MOD+arrow combinations. This has some limitations and only works on OSX.
The `_CMD` layer will temporarily disable itself while *CMD* or *ALT* are held down so that typical OSX shortcuts can be used without switching out of vim mode.

@ -0,0 +1 @@
SRC += xtonhasvim.c

@ -0,0 +1,615 @@
/* Copyright 2015-2017 Christon DeWan
*
* 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 "xtonhasvim.h"
/************************************
* helper foo
************************************/
#define PRESS(kc) register_code(kc)
#define RELEASE(kc) unregister_code(kc)
static void TAP(uint16_t keycode) {
PRESS(keycode);
RELEASE(keycode);
}
static void CMD(uint16_t keycode) {
PRESS(KC_LGUI);
TAP(keycode);
RELEASE(KC_LGUI);
}
static void CTRL(uint16_t keycode) {
PRESS(KC_LCTRL);
TAP(keycode);
RELEASE(KC_LCTRL);
}
static void SHIFT(uint16_t keycode) {
PRESS(KC_LSHIFT);
TAP(keycode);
RELEASE(KC_LSHIFT);
}
static void ALT(uint16_t keycode) {
PRESS(KC_LALT);
TAP(keycode);
RELEASE(KC_LALT);
}
static uint16_t vstate = VIM_START;
static bool yank_was_lines = false;
static bool SHIFTED = false;
static uint32_t mod_override_layer_state = 0;
static uint16_t mod_override_triggering_key = 0;
static void edit(void) { vstate = VIM_START; layer_on(_EDIT); layer_off(_CMD); }
#define EDIT edit()
static void simple_movement(uint16_t keycode) {
switch(keycode) {
case VIM_B:
PRESS(KC_LALT);
SHIFT(KC_LEFT); // select to start of this word
RELEASE(KC_LALT);
break;
case VIM_E:
PRESS(KC_LALT);
SHIFT(KC_RIGHT); // select to end of this word
RELEASE(KC_LALT);
break;
case VIM_H:
SHIFT(KC_LEFT);
break;
case VIM_J:
CMD(KC_LEFT);
SHIFT(KC_DOWN);
SHIFT(KC_DOWN);
break;
case VIM_K:
CMD(KC_LEFT);
TAP(KC_DOWN);
SHIFT(KC_UP);
SHIFT(KC_UP);
break;
case VIM_L:
SHIFT(KC_RIGHT);
break;
case VIM_W:
PRESS(KC_LALT);
SHIFT(KC_RIGHT); // select to end of this word
SHIFT(KC_RIGHT); // select to end of next word
SHIFT(KC_LEFT); // select to start of next word
RELEASE(KC_LALT);
break;
}
}
__attribute__ ((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
return true;
}
#define PASS_THRU process_record_keymap(keycode, record)
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if(record->event.pressed && layer_state_is(_CMD) && IS_MOD(keycode)) {
mod_override_layer_state = layer_state;
mod_override_triggering_key = keycode;
layer_clear();
return PASS_THRU; // let the event fall through...
}
if(mod_override_layer_state && !record->event.pressed && keycode == mod_override_triggering_key) {
layer_state_set(mod_override_layer_state);
mod_override_layer_state = 0;
mod_override_triggering_key = 0;
return PASS_THRU;
}
if (VIM_START <= keycode && keycode <= VIM_ESC) {
if(keycode == VIM_SHIFT) {
SHIFTED = record->event.pressed;
return false;
}
if (record->event.pressed) {
if(keycode == VIM_START) {
// entry from anywhere
layer_on(_CMD);
vstate = VIM_START;
// reset state
yank_was_lines = false;
SHIFTED = false;
mod_override_layer_state = 0;
mod_override_triggering_key = 0;
return false;
}
switch(vstate) {
case VIM_START:
switch(keycode){
/*****************************
* ground state
*****************************/
case VIM_A:
if(SHIFTED) {
// CMD(KC_RIGHT);
CTRL(KC_E);
} else {
TAP(KC_RIGHT);
}
EDIT;
break;
case VIM_B:
PRESS(KC_LALT);
PRESS(KC_LEFT);
break;
case VIM_C:
if(SHIFTED) {
PRESS(KC_LSHIFT);
CMD(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
} else {
vstate = VIM_C;
}
break;
case VIM_D:
if(SHIFTED) {
TAP(KC_K);
} else {
vstate = VIM_D;
}
break;
case VIM_E:
PRESS(KC_LALT);
PRESS(KC_RIGHT);
break;
case VIM_G:
if(SHIFTED) {
TAP(KC_END);
} else {
vstate = VIM_G;
}
break;
case VIM_H:
PRESS(KC_LEFT);
break;
case VIM_I:
if(SHIFTED){
CTRL(KC_A);
}
EDIT;
break;
case VIM_J:
if(SHIFTED) {
CMD(KC_RIGHT);
TAP(KC_DEL);
} else {
PRESS(KC_DOWN);
}
break;
case VIM_K:
PRESS(KC_UP);
break;
case VIM_L:
PRESS(KC_RIGHT);
break;
case VIM_O:
if(SHIFTED) {
CMD(KC_LEFT);
TAP(KC_ENTER);
TAP(KC_UP);
EDIT;
} else {
CMD(KC_RIGHT);
TAP(KC_ENTER);
EDIT;
}
break;
case VIM_P:
if(SHIFTED) {
CMD(KC_LEFT);
CMD(KC_V);
} else {
if(yank_was_lines) {
CMD(KC_RIGHT);
TAP(KC_RIGHT);
CMD(KC_V);
} else {
CMD(KC_V);
}
}
break;
case VIM_S:
// s for substitute?
if(SHIFTED) {
CMD(KC_LEFT);
PRESS(KC_LSHIFT);
CMD(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
} else {
SHIFT(KC_RIGHT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
}
break;
case VIM_U:
if(SHIFTED) {
PRESS(KC_LSFT);
CMD(KC_Z);
RELEASE(KC_LSHIFT);
} else {
CMD(KC_Z);
}
break;
case VIM_V:
if(SHIFTED) {
CMD(KC_LEFT);
SHIFT(KC_DOWN);
vstate = VIM_VS;
} else {
vstate = VIM_V;
}
break;
case VIM_W:
PRESS(KC_LALT);
TAP(KC_RIGHT);
TAP(KC_RIGHT);
TAP(KC_LEFT);
RELEASE(KC_LALT);
break;
case VIM_X:
// SHIFT(KC_RIGHT);
// CMD(KC_X);
PRESS(KC_DEL);
break;
case VIM_Y:
if(SHIFTED) {
CMD(KC_LEFT);
SHIFT(KC_DOWN);
CMD(KC_C);
TAP(KC_RIGHT);
yank_was_lines = true;
} else {
vstate = VIM_Y;
}
break;
case VIM_COMMA:
if(SHIFTED) {
// indent
CMD(KC_LBRACKET);
} else {
// toggle comment
CMD(KC_SLASH);
}
break;
case VIM_PERIOD:
if(SHIFTED) {
// outdent
CMD(KC_RBRACKET);
}
break;
}
break;
case VIM_C:
/*****************************
* c- ...for change. I never use this...
*****************************/
switch(keycode) {
case VIM_B:
case VIM_E:
case VIM_H:
case VIM_J:
case VIM_K:
case VIM_L:
case VIM_W:
simple_movement(keycode);
CMD(KC_X);
yank_was_lines = false;
EDIT;
break;
case VIM_C:
CMD(KC_LEFT);
PRESS(KC_LSHIFT);
CMD(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
break;
case VIM_I:
vstate = VIM_CI;
break;
default:
vstate = VIM_START;
break;
}
break;
case VIM_CI:
/*****************************
* ci- ...change inner word
*****************************/
switch(keycode) {
case VIM_W:
ALT(KC_LEFT);
PRESS(KC_LSHIFT);
ALT(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
EDIT;
default:
vstate = VIM_START;
break;
}
break;
case VIM_D:
/*****************************
* d- ...delete stuff
*****************************/
switch(keycode) {
case VIM_B:
case VIM_E:
case VIM_H:
case VIM_J:
case VIM_K:
case VIM_L:
case VIM_W:
simple_movement(keycode);
CMD(KC_X);
yank_was_lines = false;
vstate = VIM_START;
break;
case VIM_D:
CMD(KC_LEFT);
SHIFT(KC_DOWN);
CMD(KC_X);
yank_was_lines = true;
vstate = VIM_START;
break;
case VIM_I:
vstate = VIM_DI;
break;
default:
vstate = VIM_START;
break;
}
break;
case VIM_DI:
/*****************************
* ci- ...delete a word... FROM THE INSIDE!
*****************************/
switch(keycode) {
case VIM_W:
ALT(KC_LEFT);
PRESS(KC_LSHIFT);
ALT(KC_RIGHT);
RELEASE(KC_LSHIFT);
CMD(KC_X);
yank_was_lines = false;
vstate = VIM_START;
default:
vstate = VIM_START;
break;
}
break;
case VIM_V:
/*****************************
* visual!
*****************************/
switch(keycode) {
case VIM_D:
case VIM_X:
CMD(KC_X);
yank_was_lines = false;
vstate = VIM_START;
break;
case VIM_B:
PRESS(KC_LALT);
PRESS(KC_LSHIFT);
PRESS(KC_LEFT);
// leave open for key repeat
break;
case VIM_E:
PRESS(KC_LALT);
PRESS(KC_LSHIFT);
PRESS(KC_RIGHT);
// leave open for key repeat
break;
case VIM_H:
PRESS(KC_LSHIFT);
PRESS(KC_LEFT);
break;
case VIM_I:
vstate = VIM_VI;
break;
case VIM_J:
PRESS(KC_LSHIFT);
PRESS(KC_DOWN);
break;
case VIM_K:
PRESS(KC_LSHIFT);
PRESS(KC_UP);
break;
case VIM_L:
PRESS(KC_LSHIFT);
PRESS(KC_RIGHT);
break;
case VIM_W:
PRESS(KC_LALT);
SHIFT(KC_RIGHT); // select to end of this word
SHIFT(KC_RIGHT); // select to end of next word
SHIFT(KC_LEFT); // select to start of next word
RELEASE(KC_LALT);
break;
case VIM_P:
CMD(KC_V);
vstate = VIM_START;
break;
case VIM_Y:
CMD(KC_C);
TAP(KC_RIGHT);
yank_was_lines = false;
vstate = VIM_START;
break;
case VIM_V:
case VIM_ESC:
TAP(KC_RIGHT);
vstate = VIM_START;
break;
default:
// do nothing
break;
}
break;
case VIM_VI:
/*****************************
* vi- ...select a word... FROM THE INSIDE!
*****************************/
switch(keycode) {
case VIM_W:
ALT(KC_LEFT);
PRESS(KC_LSHIFT);
ALT(KC_RIGHT);
RELEASE(KC_LSHIFT);
vstate = VIM_V;
default:
// ignore
vstate = VIM_V;
break;
}
break;
case VIM_VS:
/*****************************
* visual line
*****************************/
switch(keycode) {
case VIM_D:
case VIM_X:
CMD(KC_X);
yank_was_lines = true;
vstate = VIM_START;
break;
case VIM_J:
PRESS(KC_LSHIFT);
PRESS(KC_DOWN);
break;
case VIM_K:
PRESS(KC_LSHIFT);
PRESS(KC_UP);
break;
case VIM_Y:
CMD(KC_C);
yank_was_lines = true;
TAP(KC_RIGHT);
vstate = VIM_START;
break;
case VIM_P:
CMD(KC_V);
vstate = VIM_START;
break;
case VIM_V:
case VIM_ESC:
TAP(KC_RIGHT);
vstate = VIM_START;
break;
default:
// do nothing
break;
}
break;
case VIM_G:
/*****************************
* gg, and a grab-bag of other macros i find useful
*****************************/
switch(keycode) {
case VIM_G:
TAP(KC_HOME);
break;
// codes b
case VIM_H:
CTRL(KC_A);
break;
case VIM_J:
PRESS(KC_PGDN);
break;
case VIM_K:
PRESS(KC_PGUP);
break;
case VIM_L:
CTRL(KC_E);
break;
default:
// do nothing
break;
}
vstate = VIM_START;
break;
case VIM_Y:
/*****************************
* yoink!
*****************************/
switch(keycode) {
case VIM_B:
case VIM_E:
case VIM_H:
case VIM_J:
case VIM_K:
case VIM_L:
case VIM_W:
simple_movement(keycode);
CMD(KC_C);
TAP(KC_RIGHT);
yank_was_lines = false;
break;
case VIM_Y:
CMD(KC_LEFT);
SHIFT(KC_DOWN);
CMD(KC_C);
TAP(KC_RIGHT);
yank_was_lines = true;
break;
default:
// NOTHING
break;
}
vstate = VIM_START;
break;
}
} else {
/************************
* key release events
************************/
clear_keyboard();
}
return false;
} else {
return PASS_THRU;
}
}

@ -0,0 +1,66 @@
/* Copyright 2015-2017 Christon DeWan
*
* 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 USERSPACE
#define USERSPACE
#include QMK_KEYBOARD_H
#include "action_layer.h"
#define X_____X KC_NO
bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record);
enum xtonhasvim_keycodes {
DUMMY = SAFE_RANGE,
VIM_START, // bookend for vim states
VIM_A,
VIM_B,
VIM_C,
VIM_CI,
VIM_D,
VIM_DI,
VIM_E,
VIM_H,
VIM_G,
VIM_I,
VIM_J,
VIM_K,
VIM_L,
VIM_O,
VIM_P,
VIM_S,
VIM_U,
VIM_V,
VIM_VS, // visual-line
VIM_VI,
VIM_W,
VIM_X,
VIM_Y,
VIM_PERIOD, // to support indent/outdent
VIM_COMMA, // and toggle comments
VIM_SHIFT, // avoid side-effect of supporting real shift.
VIM_ESC, // bookend
VIM_SAFE_RANGE // start other keycodes here.
};
enum xtonhasvim_layers {
_EDIT = 12,
_CMD
};
#endif

@ -8,6 +8,7 @@ function export_variables {
export PATH=$PATH:$util_dir/flip/bin
export PATH=$PATH:$util_dir/avr8-gnu-toolchain/bin
export PATH=$PATH:$util_dir/gcc-arm-none-eabi/bin
export PATH=$PATH:/mingw64/bin
}
export_variables

@ -67,7 +67,7 @@ if [ ! -d "$armtools" ]; then
while true; do
echo
echo "The ARM toolchain is not installed."
echo "This is needed for building ARM based keboards."
echo "This is needed for building ARM based keyboards."
read -p "Do you want to install it? (Y/N) " res
case $res in
[Yy]* ) install_arm; break;;

@ -2,9 +2,21 @@
# Script to make a new quantum project
# Jack Humbert 2015
if [ -z "$1" ]; then
echo "Usage: $0 <keyboard_name>"
exit 1
KEYBOARD=$1
KEYBOARD_TYPE=$2
if [ -z "$KEYBOARD" ]; then
echo "Usage: $0 <keyboard_name> <keyboard_type>"
echo "Example: $0 gh60 avr"
echo "Example: $0 bfake ps2avrgb"
exit 1
elif [ -z "$KEYBOARD_TYPE" ]; then
KEYBOARD_TYPE=avr
fi
if [ $KEYBOARD_TYPE != "avr" -a $KEYBOARD_TYPE != "ps2avrgb" ]; then
echo "Invalid keyboard type target"
exit 1
fi
if [ -e "keyboards/$1" ]; then
@ -14,12 +26,14 @@ fi
cd "$(dirname "$0")/.."
KEYBOARD=$1
KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')
KEYBOARD_NAME=$(basename $1)
KEYBOARD_NAME_UPPERCASE=$(echo $KEYBOARD_NAME | awk '{print toupper($0)}')
cp -r quantum/template keyboards/$KEYBOARD
cp -r quantum/template/base keyboards/$KEYBOARD
cp -r quantum/template/$KEYBOARD_TYPE/. keyboards/$KEYBOARD
mv keyboards/${KEYBOARD}/template.c keyboards/${KEYBOARD}/${KEYBOARD_NAME}.c
mv keyboards/${KEYBOARD}/template.h keyboards/${KEYBOARD}/${KEYBOARD_NAME}.h
find keyboards/${KEYBOARD} -type f -exec sed -i '' -e "s;%KEYBOARD%;${KEYBOARD_NAME};g" {} \;

Loading…
Cancel
Save