Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87dc2efda8 | ||
|
|
ed99581161 | ||
|
|
83d33caf63 | ||
|
|
6834febece | ||
|
|
8def9bc642 | ||
|
|
3fc5a05d66 | ||
|
|
1147fc24ad | ||
|
|
d4056a11d3 | ||
|
|
1572375bfb | ||
|
|
0284431ad9 | ||
|
|
8e86e22187 | ||
|
|
9c4b9bbccc | ||
|
|
0537a59920 | ||
|
|
d21b287e7d | ||
|
|
c50e80e13b | ||
|
|
738a9fc16c | ||
|
|
b89cec9ebc | ||
|
|
38299ff2ef | ||
|
|
61c53ad75e | ||
|
|
9234f9c964 | ||
|
|
2869d51ba8 | ||
|
|
bc7fe1223d | ||
|
|
f804bd3d2d | ||
|
|
72fd49b146 | ||
|
|
7e9a7af672 | ||
|
|
11773a5546 | ||
|
|
b2175e1849 | ||
|
|
ffc2ae057b |
No files matched your search
+59
-59
@@ -15,15 +15,15 @@
|
|||||||
void i2c_init(void)
|
void i2c_init(void)
|
||||||
{
|
{
|
||||||
TWSR = 0; /* no prescaler */
|
TWSR = 0; /* no prescaler */
|
||||||
TWBR = (uint8_t)TWBR_val;
|
TWBR = (uint8_t)TWBR_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
||||||
{
|
{
|
||||||
// reset TWI control register
|
// reset TWI control register
|
||||||
TWCR = 0;
|
TWCR = 0;
|
||||||
// transmit START condition
|
// transmit START condition
|
||||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -32,13 +32,13 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the start condition was successfully transmitted
|
// check if the start condition was successfully transmitted
|
||||||
if(((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)){ return I2C_STATUS_ERROR; }
|
if(((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)){ return I2C_STATUS_ERROR; }
|
||||||
|
|
||||||
// load slave address into data register
|
// load slave address into data register
|
||||||
TWDR = address;
|
TWDR = address;
|
||||||
// start transmission of address
|
// start transmission of address
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
timeout_timer = timer_read();
|
timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -47,19 +47,19 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the device has acknowledged the READ / WRITE mode
|
// check if the device has acknowledged the READ / WRITE mode
|
||||||
uint8_t twst = TW_STATUS & 0xF8;
|
uint8_t twst = TW_STATUS & 0xF8;
|
||||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return I2C_STATUS_ERROR;
|
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return I2C_STATUS_ERROR;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
||||||
{
|
{
|
||||||
// load data into data register
|
// load data into data register
|
||||||
TWDR = data;
|
TWDR = data;
|
||||||
// start transmission of data
|
// start transmission of data
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -68,16 +68,16 @@ i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (TW_STATUS & 0xF8) != TW_MT_DATA_ACK ){ return I2C_STATUS_ERROR; }
|
if( (TW_STATUS & 0xF8) != TW_MT_DATA_ACK ){ return I2C_STATUS_ERROR; }
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t i2c_read_ack(uint16_t timeout)
|
int16_t i2c_read_ack(uint16_t timeout)
|
||||||
{
|
{
|
||||||
|
|
||||||
// start TWI module and acknowledge data after reception
|
// start TWI module and acknowledge data after reception
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -86,15 +86,15 @@ int16_t i2c_read_ack(uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return received data from TWDR
|
// return received data from TWDR
|
||||||
return TWDR;
|
return TWDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t i2c_read_nack(uint16_t timeout)
|
int16_t i2c_read_nack(uint16_t timeout)
|
||||||
{
|
{
|
||||||
|
|
||||||
// start receiving without acknowledging reception
|
// start receiving without acknowledging reception
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -103,39 +103,39 @@ int16_t i2c_read_nack(uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return received data from TWDR
|
// return received data from TWDR
|
||||||
return TWDR;
|
return TWDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
||||||
if (status) return status;
|
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
|
||||||
status = i2c_write(data[i], timeout);
|
|
||||||
if (status) return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = i2c_stop(timeout);
|
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
|
status = i2c_write(data[i], timeout);
|
||||||
|
if (status) return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = i2c_stop(timeout);
|
||||||
|
if (status) return status;
|
||||||
|
|
||||||
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(address | I2C_READ, timeout);
|
i2c_status_t status = i2c_start(address | I2C_READ, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < (length-1); i++) {
|
for (uint16_t i = 0; i < (length-1); i++) {
|
||||||
status = i2c_read_ack(timeout);
|
status = i2c_read_ack(timeout);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
} else {
|
} else {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = i2c_read_nack(timeout);
|
status = i2c_read_nack(timeout);
|
||||||
if (status >= 0 ) {
|
if (status >= 0 ) {
|
||||||
@@ -147,47 +147,47 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
|||||||
status = i2c_stop(timeout);
|
status = i2c_stop(timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
||||||
if (status) return status;
|
|
||||||
|
|
||||||
status = i2c_write(regaddr, timeout);
|
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
status = i2c_write(regaddr, timeout);
|
||||||
|
if (status) return status;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = i2c_write(data[i], timeout);
|
status = i2c_write(data[i], timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = i2c_stop(timeout);
|
status = i2c_stop(timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(devaddr, timeout);
|
i2c_status_t status = i2c_start(devaddr, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
status = i2c_write(regaddr, timeout);
|
status = i2c_write(regaddr, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
status = i2c_start(devaddr | 0x01, timeout);
|
status = i2c_start(devaddr | 0x01, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < (length-1); i++) {
|
for (uint16_t i = 0; i < (length-1); i++) {
|
||||||
status = i2c_read_ack(timeout);
|
status = i2c_read_ack(timeout);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
} else {
|
} else {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = i2c_read_nack(timeout);
|
status = i2c_read_nack(timeout);
|
||||||
if (status >= 0 ) {
|
if (status >= 0 ) {
|
||||||
@@ -199,13 +199,13 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16
|
|||||||
status = i2c_stop(timeout);
|
status = i2c_stop(timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_stop(uint16_t timeout)
|
i2c_status_t i2c_stop(uint16_t timeout)
|
||||||
{
|
{
|
||||||
// transmit STOP condition
|
// transmit STOP condition
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while(TWCR & (1<<TWSTO)) {
|
while(TWCR & (1<<TWSTO)) {
|
||||||
@@ -215,4 +215,4 @@ i2c_status_t i2c_stop(uint16_t timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -28,4 +28,4 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint1
|
|||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
i2c_status_t i2c_stop(uint16_t timeout);
|
i2c_status_t i2c_stop(uint16_t timeout);
|
||||||
|
|
||||||
#endif // I2C_MASTER_H
|
#endif // I2C_MASTER_H
|
||||||
+51
-83
@@ -5,96 +5,64 @@
|
|||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <util/twi.h>
|
#include <util/twi.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "i2c_slave.h"
|
#include "i2c_slave.h"
|
||||||
|
|
||||||
void i2c_init(uint8_t address){
|
void i2c_init(uint8_t address){
|
||||||
// load address into TWI address register
|
// load address into TWI address register
|
||||||
TWAR = (address << 1);
|
TWAR = (address << 1);
|
||||||
// set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
|
// set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
|
||||||
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
TWCR = (1 << TWIE) | (1 << TWEA) | (1 << TWINT) | (1 << TWEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void i2c_stop(void){
|
void i2c_stop(void){
|
||||||
// clear acknowledge and enable bits
|
// clear acknowledge and enable bits
|
||||||
TWCR &= ~( (1<<TWEA) | (1<<TWEN) );
|
TWCR &= ~((1 << TWEA) | (1 << TWEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
ISR(TWI_vect){
|
ISR(TWI_vect){
|
||||||
|
uint8_t ack = 1;
|
||||||
// temporary stores the received data
|
// temporary stores the received data
|
||||||
uint8_t data;
|
//uint8_t data;
|
||||||
|
|
||||||
// own address has been acknowledged
|
switch(TW_STATUS){
|
||||||
if( (TWSR & 0xF8) == TW_SR_SLA_ACK ){
|
case TW_SR_SLA_ACK:
|
||||||
buffer_address = 0xFF;
|
// The device is now a slave receiver
|
||||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
slave_has_register_set = false;
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
break;
|
||||||
}
|
|
||||||
else if( (TWSR & 0xF8) == TW_SR_DATA_ACK ){ // data has been received in slave receiver mode
|
case TW_SR_DATA_ACK:
|
||||||
|
// This device is a slave receiver and has received data
|
||||||
// save the received byte inside data
|
// First byte is the location then the bytes will be writen in buffer with auto-incriment
|
||||||
data = TWDR;
|
if(!slave_has_register_set){
|
||||||
|
buffer_address = TWDR;
|
||||||
// check wether an address has already been transmitted or not
|
|
||||||
if(buffer_address == 0xFF){
|
if (buffer_address >= RX_BUFFER_SIZE){ // address out of bounds dont ack
|
||||||
|
ack = 0;
|
||||||
buffer_address = data;
|
buffer_address = 0;
|
||||||
|
}
|
||||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
slave_has_register_set = true; // address has been receaved now fill in buffer
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
} else {
|
||||||
}
|
rxbuffer[buffer_address] = TWDR;
|
||||||
else{ // if a databyte has already been received
|
buffer_address++;
|
||||||
|
}
|
||||||
// store the data at the current address
|
break;
|
||||||
rxbuffer[buffer_address] = data;
|
|
||||||
|
case TW_ST_SLA_ACK:
|
||||||
// increment the buffer address
|
case TW_ST_DATA_ACK:
|
||||||
buffer_address++;
|
// This device is a slave transmitter and master has requested data
|
||||||
|
TWDR = txbuffer[buffer_address];
|
||||||
// if there is still enough space inside the buffer
|
buffer_address++;
|
||||||
if(buffer_address < 0xFF){
|
break;
|
||||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
case TW_BUS_ERROR:
|
||||||
}
|
// We got an error, reset i2c
|
||||||
else{
|
TWCR = 0;
|
||||||
// Don't acknowledge
|
default:
|
||||||
TWCR &= ~(1<<TWEA);
|
break;
|
||||||
// clear TWI interrupt flag, prepare to receive last byte.
|
}
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEN);
|
|
||||||
}
|
// Reset i2c state mahcine to be ready for next interrupt
|
||||||
}
|
TWCR |= (1 << TWIE) | (1 << TWINT) | (ack << TWEA) | (1 << TWEN);
|
||||||
}
|
}
|
||||||
else if( (TWSR & 0xF8) == TW_ST_DATA_ACK ){ // device has been addressed to be a transmitter
|
|
||||||
|
|
||||||
// copy data from TWDR to the temporary memory
|
|
||||||
data = TWDR;
|
|
||||||
|
|
||||||
// if no buffer read address has been sent yet
|
|
||||||
if( buffer_address == 0xFF ){
|
|
||||||
buffer_address = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy the specified buffer address into the TWDR register for transmission
|
|
||||||
TWDR = txbuffer[buffer_address];
|
|
||||||
// increment buffer read address
|
|
||||||
buffer_address++;
|
|
||||||
|
|
||||||
// if there is another buffer address that can be sent
|
|
||||||
if(buffer_address < 0xFF){
|
|
||||||
// clear TWI interrupt flag, prepare to send next byte and receive acknowledge
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// Don't acknowledge
|
|
||||||
TWCR &= ~(1<<TWEA);
|
|
||||||
// clear TWI interrupt flag, prepare to receive last byte.
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// if none of the above apply prepare TWI to be addressed again
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWEA) | (1<<TWEN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,12 +8,16 @@
|
|||||||
#ifndef I2C_SLAVE_H
|
#ifndef I2C_SLAVE_H
|
||||||
#define I2C_SLAVE_H
|
#define I2C_SLAVE_H
|
||||||
|
|
||||||
|
#define TX_BUFFER_SIZE 30
|
||||||
|
#define RX_BUFFER_SIZE 30
|
||||||
|
|
||||||
volatile uint8_t buffer_address;
|
volatile uint8_t buffer_address;
|
||||||
volatile uint8_t txbuffer[0xFF];
|
static volatile bool slave_has_register_set = false;
|
||||||
volatile uint8_t rxbuffer[0xFF];
|
volatile uint8_t txbuffer[TX_BUFFER_SIZE];
|
||||||
|
volatile uint8_t rxbuffer[RX_BUFFER_SIZE];
|
||||||
|
|
||||||
void i2c_init(uint8_t address);
|
void i2c_init(uint8_t address);
|
||||||
void i2c_stop(void);
|
void i2c_stop(void);
|
||||||
ISR(TWI_vect);
|
ISR(TWI_vect);
|
||||||
|
|
||||||
#endif // I2C_SLAVE_H
|
#endif // I2C_SLAVE_H
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
* @details Frequency of the system timer that drives the system ticks. This
|
* @details Frequency of the system timer that drives the system ticks. This
|
||||||
* setting also defines the system tick time unit.
|
* setting also defines the system tick time unit.
|
||||||
*/
|
*/
|
||||||
#define CH_CFG_ST_FREQUENCY 10000
|
#define CH_CFG_ST_FREQUENCY 100000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Time delta constant for the tick-less mode.
|
* @brief Time delta constant for the tick-less mode.
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#include "../config.h"
|
|
||||||
|
|
||||||
#define TAPPING_TERM 600 // ms
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "arrow.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef ARROW_H
|
||||||
|
#define ARROW_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_all( \
|
||||||
|
K00, K01, K02, \
|
||||||
|
K10, K11, K12, \
|
||||||
|
\
|
||||||
|
K31, \
|
||||||
|
K40, K41, K42 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02 }, \
|
||||||
|
{ K10, K11, K12 }, \
|
||||||
|
{ XXX, XXX, XXX }, \
|
||||||
|
{ XXX, K31, XXX }, \
|
||||||
|
{ K40, K41, K42 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1012
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Arrow
|
||||||
|
#define DESCRIPTION Arrow cluster of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B0, C7, C6, B6, B4 }
|
||||||
|
#define MATRIX_COL_PINS { F0, B7, D2 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Arrow Cluster",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 3,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_all": {
|
||||||
|
"layout": [{"label":"Insert", "x":0, "y":0}, {"label":"Home", "x":1, "y":0}, {"label":"PgUp", "x":2, "y":0}, {"label":"Delete", "x":0, "y":1}, {"label":"End", "x":1, "y":1}, {"label":"PgDn", "x":2, "y":1}, {"label":"\u2191", "x":1, "y":3}, {"label":"\u2190", "x":0, "y":4}, {"label":"\u2193", "x":1, "y":4}, {"label":"\u2192", "x":2, "y":4}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* 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 QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_all( /* Base */
|
||||||
|
KC_INS, KC_HOME, KC_PGUP, \
|
||||||
|
KC_DEL, KC_END, KC_PGDN, \
|
||||||
|
\
|
||||||
|
KC_UP, \
|
||||||
|
KC_LEFT, KC_DOWN, KC_RIGHT \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default ANSI keymap for DC01 Arrow cluster
|
||||||
|
|
||||||
|
When using the arrow module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 Danny Nguyen <danny@keeb.io>
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,33 +15,26 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* scan matrix
|
|
||||||
*/
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
|
||||||
#include "pro_micro.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "i2c_slave.h"
|
||||||
|
#include "lufa.h"
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
#define SLAVE_I2C_ADDRESS 0x23
|
||||||
#include "backlight.h"
|
|
||||||
extern backlight_config_t backlight_config;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
/* Set 0 if debouncing isn't needed */
|
||||||
# include "i2c.h"
|
|
||||||
#else // USE_SERIAL
|
|
||||||
# include "serial.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DEBOUNCING_DELAY
|
#ifndef DEBOUNCING_DELAY
|
||||||
# define DEBOUNCING_DELAY 5
|
# define DEBOUNCING_DELAY 5
|
||||||
@@ -56,26 +50,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||||
# define ROW_SHIFTER ((uint8_t)1)
|
# define ROW_SHIFTER ((uint8_t)1)
|
||||||
#else
|
#elif (MATRIX_COLS <= 16)
|
||||||
# error "Currently only supports 8 COLS"
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
#endif
|
#endif
|
||||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
|
||||||
|
|
||||||
#define ERROR_DISCONNECT_COUNT 5
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
#define SERIAL_LED_ADDR 0x00
|
#endif
|
||||||
|
|
||||||
#define ROWS_PER_HAND (MATRIX_ROWS/2)
|
|
||||||
|
|
||||||
static uint8_t error_count = 0;
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* matrix state(1:on, 0:off) */
|
/* matrix state(1:on, 0:off) */
|
||||||
static matrix_row_t matrix[MATRIX_ROWS];
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
|
||||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||||
|
|
||||||
|
|
||||||
#if (DIODE_DIRECTION == COL2ROW)
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
static void init_cols(void);
|
static void init_cols(void);
|
||||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
@@ -90,6 +91,16 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
|||||||
static void select_col(uint8_t col);
|
static void select_col(uint8_t col);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_quantum(void) {
|
||||||
|
matrix_init_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_quantum(void) {
|
||||||
|
matrix_scan_kb();
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
@@ -109,27 +120,25 @@ void matrix_scan_user(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
uint8_t matrix_rows(void)
|
uint8_t matrix_rows(void) {
|
||||||
{
|
|
||||||
return MATRIX_ROWS;
|
return MATRIX_ROWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
uint8_t matrix_cols(void)
|
uint8_t matrix_cols(void) {
|
||||||
{
|
|
||||||
return MATRIX_COLS;
|
return MATRIX_COLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_init(void)
|
void matrix_init(void) {
|
||||||
{
|
|
||||||
debug_enable = true;
|
|
||||||
debug_matrix = true;
|
|
||||||
debug_mouse = true;
|
|
||||||
// initialize row and col
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
TX_RX_LED_INIT;
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -138,17 +147,16 @@ void matrix_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
matrix_init_quantum();
|
matrix_init_quantum();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t _matrix_scan(void)
|
uint8_t matrix_scan(void)
|
||||||
{
|
{
|
||||||
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
|
|
||||||
#if (DIODE_DIRECTION == COL2ROW)
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
// Set row, read cols
|
// Set row, read cols
|
||||||
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
# if (DEBOUNCING_DELAY > 0)
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
if (matrix_changed) {
|
if (matrix_changed) {
|
||||||
debouncing = true;
|
debouncing = true;
|
||||||
@@ -156,181 +164,82 @@ uint8_t _matrix_scan(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
read_cols_on_row(matrix+offset, current_row);
|
read_cols_on_row(matrix, current_row);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif (DIODE_DIRECTION == ROW2COL)
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
// Set col, read rows
|
// Set col, read rows
|
||||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||||
# if (DEBOUNCING_DELAY > 0)
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
|
bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
|
||||||
if (matrix_changed) {
|
if (matrix_changed) {
|
||||||
debouncing = true;
|
debouncing = true;
|
||||||
debouncing_time = timer_read();
|
debouncing_time = timer_read();
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
read_rows_on_col(matrix+offset, current_col);
|
read_rows_on_col(matrix, current_col);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# if (DEBOUNCING_DELAY > 0)
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
matrix[i+offset] = matrix_debouncing[i+offset];
|
matrix[i] = matrix_debouncing[i];
|
||||||
}
|
}
|
||||||
debouncing = false;
|
debouncing = false;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
return 1;
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
}
|
txbuffer[1] = 0x55;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++){
|
||||||
#ifdef USE_I2C
|
txbuffer[i+2] = matrix[i]; //send matrix over 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;
|
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Write backlight level for slave to read
|
|
||||||
err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0);
|
|
||||||
#else
|
|
||||||
// Write zero, so our byte index is the same
|
|
||||||
err = i2c_master_write(0x00);
|
|
||||||
#endif
|
|
||||||
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];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Write backlight level for slave to read
|
|
||||||
serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0;
|
|
||||||
#endif
|
|
||||||
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();
|
matrix_scan_quantum();
|
||||||
return ret;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
void matrix_slave_scan(void) {
|
|
||||||
_matrix_scan();
|
|
||||||
|
|
||||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Read backlight level sent from master and update level on slave
|
|
||||||
backlight_set(i2c_slave_buffer[0]);
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
i2c_slave_buffer[i+1] = matrix[offset+i];
|
|
||||||
}
|
|
||||||
#else // USE_SERIAL
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
serial_slave_buffer[i] = matrix[offset+i];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Read backlight level sent from master and update level on slave
|
|
||||||
backlight_set(serial_master_buffer[SERIAL_LED_ADDR]);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool matrix_is_modified(void)
|
bool matrix_is_modified(void)
|
||||||
{
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
if (debouncing) return false;
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||||
{
|
{
|
||||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
return (matrix[row] & ((matrix_row_t)1<col));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
matrix_row_t matrix_get_row(uint8_t row)
|
matrix_row_t matrix_get_row(uint8_t row)
|
||||||
{
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
return matrix[row];
|
return matrix[row];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_print(void)
|
void matrix_print(void)
|
||||||
{
|
{
|
||||||
print("\nr/c 0123456789ABCDEF\n");
|
print_matrix_header();
|
||||||
|
|
||||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
phex(row); print(": ");
|
phex(row); print(": ");
|
||||||
pbin_reverse16(matrix_get_row(row));
|
print_matrix_row(row);
|
||||||
print("\n");
|
print("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -339,11 +248,13 @@ uint8_t matrix_key_count(void)
|
|||||||
{
|
{
|
||||||
uint8_t count = 0;
|
uint8_t count = 0;
|
||||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
count += bitpop16(matrix[i]);
|
count += matrix_bitpop(i);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (DIODE_DIRECTION == COL2ROW)
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
static void init_cols(void)
|
static void init_cols(void)
|
||||||
@@ -400,7 +311,7 @@ static void unselect_row(uint8_t row)
|
|||||||
|
|
||||||
static void unselect_rows(void)
|
static void unselect_rows(void)
|
||||||
{
|
{
|
||||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
uint8_t pin = row_pins[x];
|
uint8_t pin = row_pins[x];
|
||||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
@@ -411,7 +322,7 @@ static void unselect_rows(void)
|
|||||||
|
|
||||||
static void init_rows(void)
|
static void init_rows(void)
|
||||||
{
|
{
|
||||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
uint8_t pin = row_pins[x];
|
uint8_t pin = row_pins[x];
|
||||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
@@ -427,7 +338,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||||||
wait_us(30);
|
wait_us(30);
|
||||||
|
|
||||||
// For each row...
|
// For each row...
|
||||||
for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++)
|
for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Store last value of row prior to reading
|
// Store last value of row prior to reading
|
||||||
@@ -482,3 +393,12 @@ static void unselect_cols(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
|
||||||
|
sei(); //enable interupts
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Arrow Cluster
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the arrow cluster.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/arrow: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,74 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_slave.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = 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
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1010
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Left
|
||||||
|
#define DESCRIPTION Left half of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 21
|
||||||
|
#define MATRIX_COLS_SCANNED 6
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B6, B5, B4, D7, D6 }
|
||||||
|
#define MATRIX_COL_PINS { F4, F1, F0, F7, F6, F5 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
|
|
||||||
// Limits the amount of we wait for any one i2c transaction.
|
// Limits the amount of we wait for any one i2c transaction.
|
||||||
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
|
// 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.
|
// 9 bits, a single transaction will take around 90μs to complete.
|
||||||
@@ -159,4 +157,3 @@ ISR(TWI_vect) {
|
|||||||
// Reset everything, so we are ready for the next TWI interrupt
|
// Reset everything, so we are ready for the next TWI interrupt
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef I2C_H
|
||||||
|
#define I2C_H
|
||||||
|
|
||||||
|
#include <stdint.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);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Left Half",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 22.5,
|
||||||
|
"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":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Home", "x":16.25, "y":0}, {"label":"PgUp", "x":17.25, "y":0}, {"label":"Num Lock", "x":18.5, "y":0}, {"label":"/", "x":19.5, "y":0}, {"label":"*", "x":20.5, "y":0}, {"label":"-", "x":21.5, "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":"Delete", "x":15.25, "y":1}, {"label":"End", "x":16.25, "y":1}, {"label":"PgDn", "x":17.25, "y":1}, {"label":"7", "x":18.5, "y":1}, {"label":"8", "x":19.5, "y":1}, {"label":"9", "x":20.5, "y":1}, {"label":"+", "x":21.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":18.5, "y":2}, {"label":"5", "x":19.5, "y":2}, {"label":"6", "x":20.5, "y":2}, {"label":"KC_NO", "x":21.5, "y":2}, {"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":"\u2191", "x":16.25, "y":3}, {"label":"1", "x":18.5, "y":3}, {"label":"2", "x":19.5, "y":3}, {"label":"3", "x":20.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "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.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "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}, {"label":"\u2190", "x":15.25, "y":4}, {"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}, {"label":"0", "x":18.5, "y":4}, {"label":"KC_NO", "x":19.5, "y":4}, {"label":".", "x":20.5, "y":4}, {"label":"Enter", "x":21.5, "y":3, "h":2}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ansi( /* Base */
|
||||||
|
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_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
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_P7, KC_P8, KC_P9, KC_PPLS, \
|
||||||
|
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_P4, KC_P5, KC_P6, KC_NO, \
|
||||||
|
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_P1, KC_P2, KC_P3, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_NO, KC_PDOT, KC_PENT \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# The default ANSI keymap for DC01 Left
|
||||||
|
|
||||||
|
The keymap looks like a full layout keymap.
|
||||||
|
|
||||||
|
This is because the left part of the keyboard acts as the masterm coordinating all four part.
|
||||||
|
|
||||||
|
When using the keyboard to connect the other three parts, this keymap overwrites the individual keymaps of the single modules.
|
||||||
|
|
||||||
|
When using a module individually, the keymap of that module will take effect.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "left.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef LEFT_H
|
||||||
|
#define LEFT_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_ansi( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K45, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2H, K2J, K2K, K2L, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, K3F, K3H, K3J, K3K, \
|
||||||
|
K40, K41, K42, K43, K46, K47, K48, K49, K4A, K4B, K4E, K4F, K4G, K4H, K4J, K4K, K4L \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, XXX, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, XXX, XXX, K2H, K2J, K2K, K2L }, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, XXX, K3D, XXX, K3F, XXX, K3H, K3J, K3K, XXX }, \
|
||||||
|
{ K40, K41, K42, K43, XXX, K45, K46, K47, K48, K49, K4A, K4B, XXX, XXX, K4E, K4F, K4G, K4H, K4J, K4K, K4L } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,479 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "i2c_master.h"
|
||||||
|
|
||||||
|
#define SLAVE_I2C_ADDRESS_RIGHT 0x19
|
||||||
|
#define SLAVE_I2C_ADDRESS_NUMPAD 0x21
|
||||||
|
#define SLAVE_I2C_ADDRESS_ARROW 0x23
|
||||||
|
|
||||||
|
#define ERROR_DISCONNECT_COUNT 5
|
||||||
|
static uint8_t error_count_right = 0;
|
||||||
|
static uint8_t error_count_numpad = 0;
|
||||||
|
static uint8_t error_count_arrow = 0;
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
|
||||||
|
#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)
|
||||||
|
#elif (MATRIX_COLS <= 16)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const uint8_t col_pins[MATRIX_COLS_SCANNED] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset);
|
||||||
|
//uint8_t i2c_transaction_numpad(void);
|
||||||
|
//uint8_t i2c_transaction_arrow(void);
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
i2c_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
|
||||||
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
unselect_rows();
|
||||||
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
matrix_debouncing[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
read_cols_on_row(matrix, 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, current_col);
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
read_rows_on_col(matrix, current_col);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (i2c_transaction(SLAVE_I2C_ADDRESS_RIGHT, 0x3F, 0)){ //error has occured for main right half
|
||||||
|
error_count_right++;
|
||||||
|
if (error_count_right > ERROR_DISCONNECT_COUNT){ //disconnect half
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS ; i++) {
|
||||||
|
matrix[i] &= 0x3F; //mask bits to keep
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{ //no error
|
||||||
|
error_count_right = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i2c_transaction(SLAVE_I2C_ADDRESS_ARROW, 0X3FFF, 8)){ //error has occured for arrow cluster
|
||||||
|
error_count_arrow++;
|
||||||
|
if (error_count_arrow > ERROR_DISCONNECT_COUNT){ //disconnect arrow cluster
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS ; i++) {
|
||||||
|
matrix[i] &= 0x3FFF; //mask bits to keep
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{ //no error
|
||||||
|
error_count_arrow = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i2c_transaction(SLAVE_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)){ //error has occured for numpad
|
||||||
|
error_count_numpad++;
|
||||||
|
if (error_count_numpad > ERROR_DISCONNECT_COUNT){ //disconnect numpad
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS ; i++) {
|
||||||
|
matrix[i] &= 0x1FFFF; //mask bits to keep
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{ //no error
|
||||||
|
error_count_numpad = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_is_modified(void)
|
||||||
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void)
|
||||||
|
{
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_key_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
count += matrix_bitpop(i);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
static void init_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS_SCANNED; 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_SCANNED; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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_SCANNED; 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
|
||||||
|
|
||||||
|
// Complete rows from other modules over i2c
|
||||||
|
i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) {
|
||||||
|
i2c_status_t err = i2c_start((address << 1) | I2C_WRITE, 10);
|
||||||
|
if (err) return err;
|
||||||
|
i2c_write(0x01, 10);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
i2c_start((address << 1) | I2C_READ, 10);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
err = i2c_read_ack(10);
|
||||||
|
if (err == 0x55) { //synchronization byte
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble slave matrix in main matrix
|
||||||
|
matrix[i] &= mask; //mask bits to keep
|
||||||
|
err = i2c_read_ack(10);
|
||||||
|
if (err >= 0) {
|
||||||
|
matrix[i] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end
|
||||||
|
} else {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//last read request must be followed by a NACK
|
||||||
|
matrix[MATRIX_ROWS - 1] &= mask; //mask bits to keep
|
||||||
|
err = i2c_read_nack(10);
|
||||||
|
if (err >= 0) {
|
||||||
|
matrix[MATRIX_ROWS - 1] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end
|
||||||
|
} else {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
i2c_stop(10);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_stop(10);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Left Half
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the left part that also acts as the master.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/left: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,73 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_master.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = 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
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1013
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Numpad
|
||||||
|
#define DESCRIPTION Numpad of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 4
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B0, E6, D6, D7, B4 }
|
||||||
|
#define MATRIX_COL_PINS { F0, B7, D2, D3 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Numpad",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 4,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_numpad_5x4": {
|
||||||
|
"layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":3, "h":2}]
|
||||||
|
},
|
||||||
|
"LAYOUT_ortho_5x4": {
|
||||||
|
"layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"Enter", "x":3, "y":3}, {"label":"0", "x":0, "y":4}, {"label":"00", "x":1, "y":4}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_numpad_5x4(
|
||||||
|
TG(1), KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
KC_P7, KC_P8, KC_P9, \
|
||||||
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
|
KC_P1, KC_P2, KC_P3, \
|
||||||
|
KC_P0, KC_PDOT, KC_PENT \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_numpad_5x4(
|
||||||
|
_______, _______, _______, _______, \
|
||||||
|
KC_HOME, KC_UP, KC_PGUP, \
|
||||||
|
KC_LEFT, XXXXXXX, KC_RGHT, _______, \
|
||||||
|
KC_END, KC_DOWN, KC_PGDN, \
|
||||||
|
KC_INS, KC_DEL, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default keymap for DC01 Numpad
|
||||||
|
|
||||||
|
When using the numpad module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
KC_P00 = SAFE_RANGE
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ortho_5x4(
|
||||||
|
TG(1), KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
KC_P7, KC_P8, KC_P9, KC_PPLS, \
|
||||||
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
|
KC_P1, KC_P2, KC_P3, KC_PENT, \
|
||||||
|
KC_P0, KC_P00, KC_PDOT, KC_PENT \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_ortho_5x4(
|
||||||
|
_______, _______, _______, _______, \
|
||||||
|
KC_HOME, KC_UP, KC_PGUP, _______, \
|
||||||
|
KC_LEFT, XXXXXXX, KC_RGHT, _______, \
|
||||||
|
KC_END, KC_DOWN, KC_PGDN, _______, \
|
||||||
|
KC_INS, XXXXXXX, KC_DEL, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch(keycode) {
|
||||||
|
case KC_P00:
|
||||||
|
// types Numpad 0 twice
|
||||||
|
SEND_STRING(SS_TAP(X_KP_0) SS_TAP(X_KP_0));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The orthopad keymap for DC01 Numpad
|
||||||
|
|
||||||
|
When using the numpad module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,404 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "i2c_slave.h"
|
||||||
|
#include "lufa.h"
|
||||||
|
|
||||||
|
#define SLAVE_I2C_ADDRESS 0x21
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
|
||||||
|
#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)
|
||||||
|
#elif (MATRIX_COLS <= 16)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
|
||||||
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
unselect_rows();
|
||||||
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
matrix_debouncing[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void)
|
||||||
|
{
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
read_cols_on_row(matrix, 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, current_col);
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
read_rows_on_col(matrix, current_col);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
txbuffer[1] = 0x55;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++){
|
||||||
|
txbuffer[i+2] = matrix[i]; //send matrix over i2c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_is_modified(void)
|
||||||
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void)
|
||||||
|
{
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_key_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
count += matrix_bitpop(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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
|
||||||
|
sei(); //enable interupts
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* 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 "numpad.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef NUMPAD_H
|
||||||
|
#define NUMPAD_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_numpad_5x4( \
|
||||||
|
K00, K01, K02, K03, \
|
||||||
|
K10, K11, K12, \
|
||||||
|
K20, K21, K22, K13, \
|
||||||
|
K30, K31, K32, \
|
||||||
|
K40, K42, K43 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03 }, \
|
||||||
|
{ K10, K11, K12, K13 }, \
|
||||||
|
{ K20, K21, K22, XXX }, \
|
||||||
|
{ K30, K31, K32, XXX }, \
|
||||||
|
{ K40, XXX, K42, K43 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_ortho_5x4( \
|
||||||
|
K00, K01, K02, K03, \
|
||||||
|
K10, K11, K12, K13, \
|
||||||
|
K20, K21, K22, K23, \
|
||||||
|
K30, K31, K32, K33, \
|
||||||
|
K40, K41, K42, K43 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03 }, \
|
||||||
|
{ K10, K11, K12, K13 }, \
|
||||||
|
{ K20, K21, K22, K23 }, \
|
||||||
|
{ K30, K31, K32, K33 }, \
|
||||||
|
{ K40, K41, K42, K43 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Numpad
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the numpad.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/numpad: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,77 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_slave.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = 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
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
|
|
||||||
|
# Community layouts supported
|
||||||
|
LAYOUTS = numpad_5x4 ortho_5x4
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1011
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Right
|
||||||
|
#define DESCRIPTION Right half of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 8
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 }
|
||||||
|
#define MATRIX_COL_PINS { F1, E6, F6, F5, F4, D4, D6, D7 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Right Half",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 8.5,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_ansi": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0, "w":2}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"|", "x":7, "y":1, "w":1.5}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"\"", "x":5.25, "y":2}, {"label":"Enter", "x":6.25, "y":2, "w":2.25}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"Alt", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
|
"LAYOUT_iso": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0, "w":2}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"@", "x":5.25, "y":2}, {"label":"~", "x":6.25, "y":2}, {"label":"Enter", "x":7.25, "y":1, "w":1.25, "h":2}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"AltGr", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
|
"LAYOUT_hhkb_ansi": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0}, {"label":"~", "x":7.5, "y":0}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"|", "x":7, "y":1, "w":1.5}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"\"", "x":5.25, "y":2}, {"label":"Enter", "x":6.25, "y":2, "w":2.25}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":1.75}, {"label":"Fn", "x":7.5, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"Alt", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
|
"LAYOUT_hhkb_iso": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"|", "x":6.5, "y":0}, {"label":"Backspace", "x":7.5, "y":0}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"@", "x":5.25, "y":2}, {"label":"~", "x":6.25, "y":2}, {"label":"Enter", "x":7.25, "y":1, "w":1.25, "h":2}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":1.75}, {"label":"Fn", "x":7.5, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"AltGr", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ansi( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default ANSI keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_hhkb_ansi( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(1), \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_hhkb_ansi(
|
||||||
|
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||||
|
KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \
|
||||||
|
KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
|
||||||
|
KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, 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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default HHKB ANSI keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_hhkb_iso( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(1), \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_hhkb_iso(
|
||||||
|
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||||
|
KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, \
|
||||||
|
KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_PENT, \
|
||||||
|
KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, 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) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default HHKB ISO keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_iso( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default ISO keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,404 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "i2c_slave.h"
|
||||||
|
#include "lufa.h"
|
||||||
|
|
||||||
|
#define SLAVE_I2C_ADDRESS 0x19
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
|
||||||
|
#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)
|
||||||
|
#elif (MATRIX_COLS <= 16)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
|
||||||
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
unselect_rows();
|
||||||
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
matrix_debouncing[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void)
|
||||||
|
{
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
read_cols_on_row(matrix, 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, current_col);
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
read_rows_on_col(matrix, current_col);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
txbuffer[1] = 0x55;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++){
|
||||||
|
txbuffer[i+2] = matrix[i]; //send matrix over i2c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_is_modified(void)
|
||||||
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void)
|
||||||
|
{
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_key_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
count += matrix_bitpop(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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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 < MATRIX_ROWS; 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
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
|
||||||
|
sei(); //enable interupts
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Right Half
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the right part.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/right: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,43 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "right.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef RIGHT_H
|
||||||
|
#define RIGHT_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_ansi( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ XXX, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, XXX, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, XXX, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_iso( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ XXX, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, XXX }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, XXX, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_hhkb_ansi( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, K00, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K36, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, XXX, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, K36, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_hhkb_iso( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, K00, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K36, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, XXX }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, K36, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_slave.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = 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
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
This is the c configuration file for the keymap
|
||||||
|
|
||||||
|
Copyright 2012 Jun Wako <[email protected]>
|
||||||
|
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
|
||||||
|
|
||||||
|
// Underglow
|
||||||
|
#undef RGBLED_NUM
|
||||||
|
#define RGBLED_NUM 14 // Number of LEDs
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLIGHT_SLEEP
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
#define BASE 0
|
||||||
|
#define META 1
|
||||||
|
#define SYMB 2
|
||||||
|
#define GAME 3
|
||||||
|
#define RGB 4
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
//Following line allows macro to read current RGB settings
|
||||||
|
extern rgblight_config_t rgblight_config;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
RGB_RST = SAFE_RANGE,
|
||||||
|
TAP_ANIM
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* BASE
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | ESC | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Del | RCtrl| A | S | D | F | G | | H | J | K | L | ; | ] | Enter|
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | RGB | LSft | Z | X | C | V | B | | N | M | , | . | / | UP | RSft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT|
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[BASE] = LAYOUT( \
|
||||||
|
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_BSPC, \
|
||||||
|
KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \
|
||||||
|
MO(RGB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \
|
||||||
|
MO(META), KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* META
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | Reset| 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Del | F1 | |Muhen | Henk | | | | Left | Down | Up |Right | | | Enter|
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | RGB | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[META] = LAYOUT( \
|
||||||
|
RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
|
||||||
|
_______, KC_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, _______, \
|
||||||
|
_______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, S(KC_LBRC), S(KC_RBRC), KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* SYMB
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | ESC | ! | @ | # | $ | % | [ | | ] | ^ | & | * | ( | ) | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Del | | | | | | ( | | ) | | | | | | Enter|
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | RGB | | | | | | { | | } | | | | | UP | Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT|
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[SYMB] = LAYOUT( \
|
||||||
|
_______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), KC_LBRC, KC_RBRC, S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), _______, \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_9), S(KC_0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_LBRC), S(KC_RBRC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* RGB
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | TOG | HUI | SAI | VAI |HUANIM| |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | MOD | HUD | SAD | VAD |RESET | |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | | |=>RGB | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[RGB] = LAYOUT( \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, TAP_ANIM,XXXXXXX, \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUI, RGB_SAD, RGB_VAD, RGB_RST, XXXXXXX, \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
bool isTapAnim = false;
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case RGB_MOD:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
isTapAnim = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RGB_RST:
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
if (record->event.pressed) {
|
||||||
|
eeconfig_update_rgblight_default();
|
||||||
|
rgblight_enable();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case TAP_ANIM:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
isTapAnim = !isTapAnim;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isTapAnim) {
|
||||||
|
rgblight_mode_noeeprom(1);
|
||||||
|
uint16_t hue = (rgblight_config.hue + 5) % 360;
|
||||||
|
rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
Executable
+58
@@ -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 KeyPCB
|
||||||
|
#define PRODUCT Fractal
|
||||||
|
#define DESCRIPTION Keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 12
|
||||||
|
|
||||||
|
/* key matrix pins */
|
||||||
|
#define MATRIX_ROW_PINS { B1, F7, F6, F5, F4 }
|
||||||
|
#define MATRIX_COL_PINS { B3, B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
#ifdef BACKLIGHT_PIN
|
||||||
|
#define BACKLIGHT_LEVELS 0
|
||||||
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 0
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
#include "fractal.h"
|
||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef FRACTAL_H
|
||||||
|
#define FRACTAL_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT_ortho_5x12( \
|
||||||
|
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
|
||||||
|
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
|
||||||
|
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \
|
||||||
|
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 \
|
||||||
|
) { \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \
|
||||||
|
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
|
||||||
|
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \
|
||||||
|
{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_preonic_mit( \
|
||||||
|
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
|
||||||
|
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
|
||||||
|
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \
|
||||||
|
K400, K401, K402, K403, K404, K406, K407, K408, K409, K410, K411 \
|
||||||
|
) { \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \
|
||||||
|
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
|
||||||
|
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \
|
||||||
|
{ K400, K401, K402, K403, K404, KC_NO, K406, K407, K408, K409, K410, K411 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define KEYMAP LAYOUT_preonic_mit
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Fractal",
|
||||||
|
"url": "https://keypcb.bigcartel.com/product/fractal-keyboard-group-buy",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 12,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_ortho_5x12": {
|
||||||
|
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "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":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "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, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}]
|
||||||
|
},
|
||||||
|
"LAYOUT_preonic_mit": {
|
||||||
|
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "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":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "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, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4, "w":2}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
|
#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
|
||||||
|
|
||||||
@@ -0,0 +1,225 @@
|
|||||||
|
/* Copyright 2015-2017 Jack Humbert
|
||||||
|
* Modified by KeyPCB for the Fractal keyboard
|
||||||
|
* Backlight isn't on the Fractal, so I've removed the keycode from the keymaps
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
enum preonic_layers {
|
||||||
|
_QWERTY,
|
||||||
|
_COLEMAK,
|
||||||
|
_DVORAK,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_ADJUST
|
||||||
|
};
|
||||||
|
|
||||||
|
enum preonic_keycodes {
|
||||||
|
QWERTY = SAFE_RANGE,
|
||||||
|
COLEMAK,
|
||||||
|
DVORAK,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
BACKLIT
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | Alt | GUI |Lower | Bksp | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_QWERTY] = LAYOUT_ortho_5x12( \
|
||||||
|
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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \
|
||||||
|
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, \
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Colemak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_COLEMAK] = LAYOUT_ortho_5x12( \
|
||||||
|
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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \
|
||||||
|
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, \
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Dvorak
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_DVORAK] = LAYOUT_ortho_5x12( \
|
||||||
|
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_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \
|
||||||
|
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, \
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Lower
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = LAYOUT_ortho_5x12( \
|
||||||
|
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_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),KC_HOME, KC_END, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Raise
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | ` | 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 / | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = LAYOUT_ortho_5x12( \
|
||||||
|
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_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, KC_PGUP, KC_PGDN, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Adjust (Lower + Raise)
|
||||||
|
* ,-----------------------------------------------------------------------------------.
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | Reset| | | | | | | | | | Del |
|
||||||
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||||
|
* | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||||
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||||
|
* | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
|
||||||
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* `-----------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = LAYOUT_ortho_5x12( \
|
||||||
|
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
|
||||||
|
_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \
|
||||||
|
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
||||||
|
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_QWERTY);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case COLEMAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_COLEMAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case DVORAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_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 BACKLIT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
register_code(KC_RSFT);
|
||||||
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
backlight_step();
|
||||||
|
#endif
|
||||||
|
PORTE &= ~(1<<6);
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_RSFT);
|
||||||
|
PORTE |= (1<<6);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# The Default Fractal Layout
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
Fractal
|
||||||
|
===
|
||||||
|
|
||||||
|
The Fractal keyboard has a layout inspired by keyboards such as Preonic and JJ50. It aims to deliver a good quality but affordable keyboard. It supports Alps and MX switches and uses a Pro Micro as the controller.
|
||||||
|
|
||||||
|
Keyboard Maintainer: The QMK Community
|
||||||
|
Hardware Supported: Fractal
|
||||||
|
Hardware Availability: [KeyPCB](https://keypcb.bigcartel.com/product/fractal-keyboard-group-buy)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make fractal: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.
|
||||||
Executable
+61
@@ -0,0 +1,61 @@
|
|||||||
|
# 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 = caterina
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
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
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI controls
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
|
||||||
|
LAYOUTS = preonic_mit ortho_5x12
|
||||||
|
LAYOUTS_HAS_RGB = no
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_KEYMAP_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_KEYMAP_H
|
||||||
|
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#define RGB_DI_PIN F6
|
#define RGB_DI_PIN F6
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
void matrix_init_keymap(void) {
|
void matrix_init_user(void) {
|
||||||
// Set LED's to max
|
// Set LED's to max
|
||||||
_delay_us(300);
|
_delay_us(300);
|
||||||
backlight_config.level = 2;
|
backlight_config.level = 2;
|
||||||
|
|||||||
@@ -2,13 +2,16 @@ ifndef QUANTUM_DIR
|
|||||||
include ../../../../Makefile
|
include ../../../../Makefile
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
USER_NAME := bbaserdem-nouserspace
|
||||||
|
|
||||||
STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER
|
STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER
|
||||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||||
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
|
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
|
||||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
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
|
|
||||||
AUDIO_ENABLE = no # Enable audio output from keyboard
|
AUDIO_ENABLE = no # Enable audio output from keyboard
|
||||||
|
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
RGBLIGHT_ENABLE = yes # Enable RBG light strips
|
RGBLIGHT_ENABLE = yes # Enable RBG light strips
|
||||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
#ifndef I2C_H
|
|
||||||
#define I2C_H
|
|
||||||
|
|
||||||
#include <stdint.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 100000L
|
|
||||||
|
|
||||||
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,39 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Danny Nguyen <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Add layout to the product identifier
|
||||||
|
#undef PRODUCT
|
||||||
|
#define PRODUCT Iris Keyboard (fabian)
|
||||||
|
|
||||||
|
/* Use I2C or Serial, not both */
|
||||||
|
// #define USE_SERIAL
|
||||||
|
#define USE_I2C
|
||||||
|
|
||||||
|
/* Select hand configuration */
|
||||||
|
#define MASTER_LEFT
|
||||||
|
// #define MASTER_RIGHT
|
||||||
|
// #define EE_HANDS
|
||||||
|
|
||||||
|
// RGB configuration
|
||||||
|
#undef RGBLED_NUM
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 12
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
enum custom_layers {
|
||||||
|
_COLEMAK,
|
||||||
|
_QWERTY,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_MOUSECURSOR,
|
||||||
|
_ADJUST,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
COLEMAK = SAFE_RANGE,
|
||||||
|
QWERTY,
|
||||||
|
LOWER,
|
||||||
|
RAISE,
|
||||||
|
MOUSECURSOR,
|
||||||
|
ADJUST,
|
||||||
|
DYNAMIC_MACRO_RANGE,
|
||||||
|
};
|
||||||
|
|
||||||
|
#include "dynamic_macro.h"
|
||||||
|
|
||||||
|
#define KC_ KC_TRNS
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
|
||||||
|
#define KC_COLE COLEMAK
|
||||||
|
#define KC_LOWR LOWER
|
||||||
|
#define KC_QWER QWERTY
|
||||||
|
#define KC_RASE RAISE
|
||||||
|
#define KC_RECB DYN_REC_START1
|
||||||
|
#define KC_RECE DYN_REC_STOP
|
||||||
|
#define KC_RECP DYN_MACRO_PLAY1
|
||||||
|
#define KC_RSET RESET
|
||||||
|
|
||||||
|
#define KC_CTLE CTL_T(KC_ESC) // Tap for Escape, hold for Control
|
||||||
|
#define KC_HTAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift)
|
||||||
|
#define KC_SBSP SFT_T(KC_BSPC) // Tap for Backspace, hold for Shift
|
||||||
|
#define KC_SENT KC_SFTENT // Tap for Enter, hold for Shift
|
||||||
|
#define KC_TGMC TG(_MOUSECURSOR) // Toggle MOUSECURSOR layer
|
||||||
|
#define KC_SPMC LT(_MOUSECURSOR, KC_SPC) // Tap for Space, hold for MOUSECURSOR layer
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[_QWERTY] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
HTAB, Q , W , E , R , T , Y , U , I , O , P ,BSPC,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
CTLE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
SBSP, Z , X , C , V , B ,LALT, RALT, N , M ,COMM,DOT ,SLSH,SENT,
|
||||||
|
//`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
LGUI,LOWR,SPMC, HTAB,RASE,RGUI
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_COLEMAK] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
MEH , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,TGMC,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
HTAB, Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
CTLE, A , R , S , T , D , H , N , E , I , O ,QUOT,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
SBSP, Z , X , C , V , B ,LALT, RALT, K , M ,COMM,DOT ,SLSH,SENT,
|
||||||
|
//`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
LGUI,LOWR,SPMC, HTAB,RASE,RGUI
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_LOWER] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
, F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
GRV , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
, F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,MS_L,MS_D,MS_U,MS_R,BTN1,
|
||||||
|
//`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
, , , , ,
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_RAISE] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
, , , , , , , , , , , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
TILD, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
GRV , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
, F7 , F8 , F9 ,F10 ,F11 , , ,F12 ,LEFT,DOWN, UP ,RGHT,BTN2,
|
||||||
|
//`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
, , , , ,
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_MOUSECURSOR] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
, , , , , , , , , , , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
, , , UP , , , WH_D,WH_R,MS_U,ACL0,ACL1,ACL2,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
, ,LEFT,DOWN,RGHT, , WH_L,MS_L,MS_D,MS_R,BTN1,BTN2,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
, , , , , , , ,WH_U,LEFT,DOWN, UP ,RGHT,BTN3,
|
||||||
|
//`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
, , , , ,
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_ADJUST] = LAYOUT_kc(
|
||||||
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
|
, , , , , , , , , , , ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
,RSET, , , , , , , , ,RSET, ,
|
||||||
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
, , , , , , ,QWER,COLE, , , ,
|
||||||
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
, , , , , , , , , ,RECB,RECE,RECP,CAPS,
|
||||||
|
//`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----'
|
||||||
|
, , , , ,
|
||||||
|
// `----+----+----' `----+----+----'
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
if (!process_record_dynamic_macro(keycode, record)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (keycode) {
|
||||||
|
case COLEMAK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_COLEMAK);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case QWERTY:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_QWERTY);
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
@@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
[_DVORAK] = LAYOUT_kc (
|
[_DVORAK] = LAYOUT_kc (
|
||||||
LBRC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,RBRC,
|
GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSLS,
|
||||||
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,
|
TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH,
|
||||||
ESC , A , O , E , U , I , D , H , T , N , S ,MINS,
|
ESC , A , O , E , U , I , D , H , T , N , S ,MINS,
|
||||||
LSFT,SCLN, Q , J , K , X ,LOWR, RASE, B , M , W , V , Z ,RSFT,
|
LSFT,SCLN, Q , J , K , X ,LOWR, RASE, B , M , W , V , Z ,RSFT,
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
SRC += matrix.c \
|
|
||||||
i2c.c \
|
|
||||||
split_util.c \
|
|
||||||
serial.c
|
|
||||||
|
|
||||||
# MCU name
|
# MCU name
|
||||||
#MCU = at90usb1287
|
#MCU = at90usb1287
|
||||||
MCU = atmega32u4
|
MCU = atmega32u4
|
||||||
@@ -69,6 +64,6 @@ USE_I2C = yes
|
|||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
|
||||||
CUSTOM_MATRIX = yes
|
SPLIT_KEYBOARD = yes
|
||||||
|
|
||||||
DEFAULT_FOLDER = iris/rev2
|
DEFAULT_FOLDER = iris/rev2
|
||||||
@@ -1,228 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
#ifndef MY_SERIAL_H
|
|
||||||
#define MY_SERIAL_H
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
#include <stdbool.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
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "split_util.h"
|
|
||||||
#include "progmem.h"
|
|
||||||
#include "print.h"
|
|
||||||
#include "rgblight.h"
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
# include "i2c.h"
|
|
||||||
#else // USE_SERIAL
|
|
||||||
# include "serial.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
rgblight_config_t rgblight_config;
|
|
||||||
|
|
||||||
void rgblight_slave_update(void) {
|
|
||||||
//rgblight_effect_christmas();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void rgblight_set(void) {
|
|
||||||
if (rgblight_config.enable) {
|
|
||||||
#ifdef RGBW
|
|
||||||
ws2812_setleds_rgbw(led, RGBLED_NUM);
|
|
||||||
#else
|
|
||||||
ws2812_setleds(led, RGBLED_NUM);
|
|
||||||
#endif
|
|
||||||
} else {
|
|
||||||
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
|
|
||||||
led[i].r = 0;
|
|
||||||
led[i].g = 0;
|
|
||||||
led[i].b = 0;
|
|
||||||
}
|
|
||||||
#ifdef RGBW
|
|
||||||
ws2812_setleds_rgbw(led, RGBLED_NUM);
|
|
||||||
#else
|
|
||||||
ws2812_setleds(led, RGBLED_NUM);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#ifndef SPLIT_RGB_H
|
|
||||||
#define SPLIT_RGB_H
|
|
||||||
|
|
||||||
void rgblight_slave_update(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
#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"
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
# include "i2c.h"
|
|
||||||
#else
|
|
||||||
# include "serial.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
volatile bool isLeftHand = true;
|
|
||||||
|
|
||||||
static void setup_handedness(void) {
|
|
||||||
#ifdef EE_HANDS
|
|
||||||
isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
|
|
||||||
#else
|
|
||||||
// I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c
|
|
||||||
#if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT)
|
|
||||||
isLeftHand = !has_usb();
|
|
||||||
#else
|
|
||||||
isLeftHand = has_usb();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void keyboard_master_setup(void) {
|
|
||||||
#ifdef USE_I2C
|
|
||||||
i2c_master_init();
|
|
||||||
#ifdef SSD1306OLED
|
|
||||||
matrix_master_OLED_init ();
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
serial_master_init();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void keyboard_slave_setup(void) {
|
|
||||||
timer_init();
|
|
||||||
#ifdef USE_I2C
|
|
||||||
i2c_slave_init(SLAVE_I2C_ADDRESS);
|
|
||||||
#else
|
|
||||||
serial_slave_init();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
bool has_usb(void) {
|
|
||||||
USBCON |= (1 << OTGPADE); //enables VBUS pad
|
|
||||||
_delay_us(5);
|
|
||||||
return (USBSTA & (1<<VBUS)); //checks state of VBUS
|
|
||||||
}
|
|
||||||
|
|
||||||
void split_keyboard_setup(void) {
|
|
||||||
setup_handedness();
|
|
||||||
|
|
||||||
if (has_usb()) {
|
|
||||||
keyboard_master_setup();
|
|
||||||
} else {
|
|
||||||
keyboard_slave_setup();
|
|
||||||
}
|
|
||||||
sei();
|
|
||||||
}
|
|
||||||
|
|
||||||
void keyboard_slave_loop(void) {
|
|
||||||
matrix_init();
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
matrix_slave_scan();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// this code runs before the usb and keyboard is initialized
|
|
||||||
void matrix_setup(void) {
|
|
||||||
split_keyboard_setup();
|
|
||||||
|
|
||||||
if (!has_usb()) {
|
|
||||||
keyboard_slave_loop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#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;
|
|
||||||
|
|
||||||
// slave version of matix scan, defined in matrix.c
|
|
||||||
void matrix_slave_scan(void);
|
|
||||||
|
|
||||||
void split_keyboard_setup(void);
|
|
||||||
bool has_usb(void);
|
|
||||||
void keyboard_slave_loop(void);
|
|
||||||
|
|
||||||
void matrix_master_OLED_init (void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
+16
-13
@@ -18,6 +18,9 @@
|
|||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// readability
|
||||||
|
#define ___ KC_NO
|
||||||
|
|
||||||
inline void kc60se_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
inline void kc60se_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
||||||
inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
||||||
|
|
||||||
@@ -25,19 +28,19 @@ inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
|||||||
* K2C, K31 and K3C are keys for ISO
|
* K2C, K31 and K3C are keys for ISO
|
||||||
* This is the row/column wiring, which different from the physical layout.
|
* This is the row/column wiring, which different from the physical layout.
|
||||||
*/
|
*/
|
||||||
// All pads defined in logical layout. The KC_NO in this section are padless.
|
// All pads defined in logical layout. The ___ in this section are padless.
|
||||||
#define LAYOUT( \
|
#define LAYOUT( \
|
||||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
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, \
|
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, \
|
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, \
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \
|
||||||
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
|
K40, K41, K42, K45, K4A, K4B, K4C, K4D \
|
||||||
) { \
|
) { \
|
||||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
{ 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 }, \
|
{ 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 }, \
|
{ 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 }, \
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
|
||||||
{ K40, K41, K42, KC_NO,KC_NO,K45,KC_NO,KC_NO,KC_NO,KC_NO,K4A,K4B,K4C,K4D } \
|
{ K40, K41, K42, ___, ___, K45, ___, ___, ___, K49, K4A, K4B, K4C, K4D } \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ANSI */
|
/* ANSI */
|
||||||
@@ -50,18 +53,18 @@ inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
|||||||
) { \
|
) { \
|
||||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
{ 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 }, \
|
{ 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 }, \
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D }, \
|
||||||
{ K30,KC_NO,K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B,KC_NO,K3D }, \
|
{ K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, ___, K3D }, \
|
||||||
{ K40, K41, K42, KC_NO,KC_NO,K45, KC_NO,KC_NO,KC_NO,K4A, K4B,K4C, K4D } \
|
{ K40, K41, K42, ___, ___, K45, ___, ___, ___, ___, K4A, K4B, K4C, K4D } \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* HHKB
|
/* HHKB
|
||||||
* K2C & K31 are represented as KC_NO, otherwise this is
|
* K2C & K31 are represented as ___, otherwise this is
|
||||||
* the best representation of the physical layout, (K49 on top right).
|
* the best representation of the physical layout, (K49 on top right).
|
||||||
* The KC_NOs on the space row do not have pads
|
* The ___s on the space row do not have pads
|
||||||
*/
|
*/
|
||||||
#define LAYOUT_60_ansi_split_bs_rshift( \
|
#define LAYOUT_60_ansi_split_bs_rshift( \
|
||||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K49,\
|
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, \
|
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, \
|
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, K3C, \
|
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3C, \
|
||||||
@@ -69,9 +72,9 @@ inline void kc60se_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
|||||||
) { \
|
) { \
|
||||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
{ 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 }, \
|
{ 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 }, \
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, ___, K2D }, \
|
||||||
{ K30,KC_NO,K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
|
{ K30, ___, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \
|
||||||
{ K40, K41,K42,KC_NO,KC_NO,K45,KC_NO,KC_NO,KC_NO,K49,K4A,K4B, K4C, K4D } \
|
{ K40, K41, K42, ___, ___, K45, ___, ___, ___, K49, K4A, K4B, K4C, K4D } \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_KEYMAP_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_KEYMAP_H
|
||||||
|
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
|
|
||||||
|
|||||||
@@ -20,18 +20,17 @@ uint32_t layer_state_set_keymap(uint32_t state) {
|
|||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
// Main Dvorak layer
|
// Main Dvorak layer
|
||||||
[_DV] = DVORAK,
|
[_DV] = LAYOUT_letssplit_wrapper(DVORAK),
|
||||||
// Turkish and special character overlay
|
// Turkish and special character overlay
|
||||||
[_AL] = ALTCHAR,
|
[_AL] = LAYOUT_letssplit_wrapper(ALTCHAR),
|
||||||
// Gaming layer
|
// Gaming layer
|
||||||
[_GA] = GAME,
|
[_GA] = LAYOUT_letssplit_wrapper(GAME),
|
||||||
// Numbers layer
|
// Numbers layer
|
||||||
[_NU] = NUMBERS,
|
[_NU] = LAYOUT_letssplit_wrapper(NUMBERS),
|
||||||
// Settings layer
|
// Settings layer
|
||||||
[_SE] = SETTINGS,
|
[_SE] = LAYOUT_letssplit_wrapper(SETTINGS),
|
||||||
// Mouse emulation layer
|
// Mouse emulation layer
|
||||||
[_MO] = MOUSE,
|
[_MO] = LAYOUT_letssplit_wrapper(MOUSE),
|
||||||
#ifdef AUDIO_ENABLE
|
// Music layer
|
||||||
[_MU] = MUSIC,
|
[_MU] = LAYOUT_letssplit_wrapper(MUSIC),
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_USER_H
|
#ifndef CONFIG_KEYMAP_H
|
||||||
#define CONFIG_USER_H
|
#define CONFIG_KEYMAP_H
|
||||||
|
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* `-----------------------' `-----------------------'
|
* `-----------------------' `-----------------------'
|
||||||
*/
|
*/
|
||||||
// Main Dvorak layer
|
// Main Dvorak layer
|
||||||
[0] = LAYOUT(
|
[0] = LAYOUT_ortho_4x12(
|
||||||
LCTL(LALT(KC_DEL)), LGUI(KC_GRV), LGUI(KC_Q), LGUI(KC_LALT), LGUI(KC_L), LGUI(KC_RGHT), KC_RPRN, KC_PMNS, KC_PPLS, KC_PEQL, KC_PENT, KC_BSPC,
|
LCTL(LALT(KC_DEL)), LGUI(KC_GRV), LGUI(KC_Q), LGUI(KC_LALT), LGUI(KC_L), LGUI(KC_RGHT), KC_RPRN, KC_PMNS, KC_PPLS, KC_PEQL, KC_PENT, KC_BSPC, \
|
||||||
LGUI(KC_F3), LGUI(KC_M), LGUI(KC_ENT), LGUI(KC_LCTL), LGUI(KC_K), LGUI(KC_UP), KC_LPRN, KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT,
|
LGUI(KC_F3), LGUI(KC_M), LGUI(KC_ENT), LGUI(KC_LCTL), LGUI(KC_K), LGUI(KC_UP), KC_LPRN, KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, \
|
||||||
LGUI(KC_F2), LGUI(KC_T), LGUI(KC_SPC), LGUI(KC_LSFT), LGUI(KC_J), LGUI(KC_DOWN), KC_PERC, KC_PSLS, KC_P8, KC_P5, KC_P2, KC_PCMM,
|
LGUI(KC_F2), LGUI(KC_T), LGUI(KC_SPC), LGUI(KC_LSFT), LGUI(KC_J), LGUI(KC_DOWN), KC_PERC, KC_PSLS, KC_P8, KC_P5, KC_P2, KC_PCMM, \
|
||||||
LGUI(KC_F1), LGUI(KC_F), LGUI(KC_P), LGUI(KC_TAB), LGUI(KC_H), LGUI(KC_LEFT), KC_NLCK, KC_TAB, KC_P7, KC_P4, KC_P1, KC_P0
|
LGUI(KC_F1), LGUI(KC_F), LGUI(KC_P), LGUI(KC_TAB), LGUI(KC_H), LGUI(KC_LEFT), KC_NLCK, KC_TAB, KC_P7, KC_P4, KC_P1, KC_P0 \
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# Build options
|
# Build options
|
||||||
|
|
||||||
|
USER_NAME := bbaserdem-without-userspace
|
||||||
|
|
||||||
BACKLIGHT_ENABLE = no # Switch LEDs
|
BACKLIGHT_ENABLE = no # Switch LEDs
|
||||||
MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses
|
MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses
|
||||||
RGBLIGHT_ENABLE = no # LED strips
|
RGBLIGHT_ENABLE = no # LED strips
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Lets Split Eh Layout
|
||||||
|
|
||||||
|
Check out [user readme](../../../../users/bbaserdem/README.md) for more info.
|
||||||
|
|
||||||
|
# Usage
|
||||||
|
|
||||||
|
Fill in after flashing
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#ifndef CONFIG_KEYMAP_H
|
||||||
|
#define CONFIG_KEYMAP_H
|
||||||
|
#include "../../config.h"
|
||||||
|
#endif
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#include "lets_split_eh.h"
|
||||||
|
#include "bbaserdem.h"
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_keymap (void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t layer_state_set_keymap(uint32_t state) {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
// Main Dvorak layer
|
||||||
|
[_DV] = LAYOUT_letssplit_wrapper(DVORAK),
|
||||||
|
// Turkish and special character overlay
|
||||||
|
[_AL] = LAYOUT_letssplit_wrapper(ALTCHAR),
|
||||||
|
// Gaming layer
|
||||||
|
[_GA] = LAYOUT_letssplit_wrapper(GAME),
|
||||||
|
// Numbers layer
|
||||||
|
[_NU] = LAYOUT_letssplit_wrapper(NUMBERS),
|
||||||
|
// Settings layer
|
||||||
|
[_SE] = LAYOUT_letssplit_wrapper(SETTINGS),
|
||||||
|
// Mouse emulation layer
|
||||||
|
[_MO] = LAYOUT_letssplit_wrapper(MOUSE),
|
||||||
|
// Music layer
|
||||||
|
[_MU] = LAYOUT_letssplit_wrapper(MUSIC),
|
||||||
|
};
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
# Build options
|
||||||
|
|
||||||
|
BACKLIGHT_ENABLE = no # Switch LEDs
|
||||||
|
MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses
|
||||||
|
RGBLIGHT_ENABLE = yes # LED strips
|
||||||
|
TAP_DANCE_ENABLE = no # Use multi-tap features
|
||||||
|
AUDIO_ENABLE = no # Audio stuff
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6064
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER LFKeyboards
|
||||||
|
#define PRODUCT LFK65_HS
|
||||||
|
#define DESCRIPTION QMK keyboard firmware for LFK65_HS
|
||||||
|
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 16
|
||||||
|
#define MATRIX_ROW_PINS {B0, B3, B2, B1, F5}
|
||||||
|
#define MATRIX_COL_PINS {E6, F4, B7, D5, D3, D2, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4}
|
||||||
|
#define UNUSED_PINS {}
|
||||||
|
#define RGBLED_NUM 20 // Number of LEDs
|
||||||
|
|
||||||
|
#define QMK_ESC_OUTPUT E6 // usually COL
|
||||||
|
#define QMK_ESC_INPUT B0 // usually ROW
|
||||||
|
#define QMK_LED F1
|
||||||
|
// #define QMK_SPEAKER C6
|
||||||
|
|
||||||
|
#define BACKLIGHT_LEVELS 8
|
||||||
|
#define BACKLIGHT_PWM_MAP {8, 16, 40, 55, 70, 128, 200, 255}
|
||||||
|
|
||||||
|
#define RGB_DI_PIN C7 // Have to set it to something to get the ws2812 code to compile
|
||||||
|
#define RGBLED_NUM 20 // Number of LEDs
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLIGHT_HUE_STEP 10
|
||||||
|
#define RGBLIGHT_SAT_STEP 17
|
||||||
|
#define RGBLIGHT_VAL_STEP 17
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* control how magic key switches layers */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP1 H
|
||||||
|
//#define MAGIC_KEY_HELP2 SLASH
|
||||||
|
//#define MAGIC_KEY_DEBUG D
|
||||||
|
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||||
|
//#define MAGIC_KEY_DEBUG_KBD K
|
||||||
|
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||||
|
//#define MAGIC_KEY_VERSION V
|
||||||
|
//#define MAGIC_KEY_STATUS S
|
||||||
|
//#define MAGIC_KEY_CONSOLE C
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#define MAGIC_KEY_LAYER1 1
|
||||||
|
//#define MAGIC_KEY_LAYER2 2
|
||||||
|
//#define MAGIC_KEY_LAYER3 3
|
||||||
|
//#define MAGIC_KEY_LAYER4 4
|
||||||
|
//#define MAGIC_KEY_LAYER5 5
|
||||||
|
//#define MAGIC_KEY_LAYER6 6
|
||||||
|
//#define MAGIC_KEY_LAYER7 7
|
||||||
|
//#define MAGIC_KEY_LAYER8 8
|
||||||
|
//#define MAGIC_KEY_LAYER9 9
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "LFK65-HS",
|
||||||
|
"url": "https://github.com/lfkeyboards",
|
||||||
|
"maintainer": "LFKeyboards",
|
||||||
|
"width": 16,
|
||||||
|
"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},{"label": "","x": 13,"y": 0,"w": 1},{"label": "","x": 14,"y": 0,"w": 1},{"label": "Home","x": 15,"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": "Page Up","x": 15,"y": 1},{"label": "Caps Lock","x": 0,"y": 2,"w": 1.75},{"label": "A","x": 1.75,"y": 2},{"label": "S","x": 2.75,"y": 2},{"label": "D","x": 3.75,"y": 2},{"label": "F","x": 4.75,"y": 2},{"label": "G","x": 5.75,"y": 2},{"label": "H","x": 6.75,"y": 2},{"label": "J","x": 7.75,"y": 2},{"label": "K","x": 8.75,"y": 2},{"label": "L","x": 9.75,"y": 2},{"label": ":","x": 10.75,"y": 2},{"label": "\"","x": 11.75,"y": 2},{"label": "","x": 12.75,"y": 2},{"label": "Enter","x": 13.75,"y": 2,"w": 1.25},{"label": "Page Down","x": 15,"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": 1.75},{"label": "↑","x": 14,"y": 3},{"label": "End","x": 15,"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": "Fn","x": 11,"y": 4},{"label": "Ctrl","x": 12,"y": 4},{"label": "←","x": 13,"y": 4},{"label": "↓","x": 14,"y": 4},{"label": "→","x": 15,"y": 4}]},
|
||||||
|
"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": "Backspace","x": 13,"y": 0,"w": 2},{"label": "Home","x": 15,"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": "Page Up","x": 15,"y": 1},{"label": "Caps Lock","x": 0,"y": 2,"w": 1.75},{"label": "A","x": 1.75,"y": 2},{"label": "S","x": 2.75,"y": 2},{"label": "D","x": 3.75,"y": 2},{"label": "F","x": 4.75,"y": 2},{"label": "G","x": 5.75,"y": 2},{"label": "H","x": 6.75,"y": 2},{"label": "J","x": 7.75,"y": 2},{"label": "K","x": 8.75,"y": 2},{"label": "L","x": 9.75,"y": 2},{"label": ":","x": 10.75,"y": 2},{"label": "\"","x": 11.75,"y": 2},{"label": "Enter","x": 12.75,"y": 2,"w": 2.25},{"label": "Page Down","x": 15,"y": 2},{"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": "↑","x": 14,"y": 3},{"label": "End","x": 15,"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": "Fn","x": 11,"y": 4},{"label": "Ctrl","x": 12,"y": 4},{"label": "←","x": 13,"y": 4},{"label": "↓","x": 14,"y": 4},{"label": "→","x": 15,"y": 4}]}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
//Define a shorter 'transparent' key code to make the keymaps more compact
|
||||||
|
#define KC_TR KC_TRNS
|
||||||
|
|
||||||
|
enum keymap_layout {
|
||||||
|
BASE = 0,
|
||||||
|
FUNC,
|
||||||
|
};
|
||||||
|
|
||||||
|
// #define uint16_t int
|
||||||
|
// #define uint8_t int
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[BASE] = LAYOUT_ansi(
|
||||||
|
/* Keymap VANILLA: (Base Layer) Default Layer
|
||||||
|
* ,------------------------------------------------------------.----.
|
||||||
|
* |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins|
|
||||||
|
* |------------------------------------------------------------|----|
|
||||||
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| Del|
|
||||||
|
* |------------------------------------------------------------|----|
|
||||||
|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp|
|
||||||
|
* |------------------------------------------------------------|----|
|
||||||
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn|
|
||||||
|
* |-----------------------------------------------------------------|
|
||||||
|
* |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig |
|
||||||
|
* `-----------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
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_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_BSLS, KC_DEL,
|
||||||
|
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_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||||
|
|
||||||
|
[FUNC] = LAYOUT_ansi(
|
||||||
|
/*Keymap VANILLA: Function Layer
|
||||||
|
* ,------------------------------------------------------------.----.
|
||||||
|
* |Esc~| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backspa| Ins|
|
||||||
|
* |------------------------------------------------------------|----|
|
||||||
|
* |MuMode | | | |E| R| T| Y| U| I| O| P| [| ]| \| Del|
|
||||||
|
* |------------------------------------------------------------|----|
|
||||||
|
* |AudTgl|Hz+|MS+| | D| F| G| H| J| K| L| ;| '|Return |PgUp|
|
||||||
|
* |------------------------------------------------------------|----|
|
||||||
|
* |ClickTgl|Hz-|MS-|| C| V| B| N|MuTgl| ,| .| /|Shift |Up |PgDn|
|
||||||
|
* |-----------------------------------------------------------------|
|
||||||
|
* |Ctrl|Win |Alt | Space |Alt |Ctrl|Func|Lft| Dn |Rig |
|
||||||
|
* `-----------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
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_F13, KC_F14,
|
||||||
|
MU_MOD, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_TOG,
|
||||||
|
AU_TOG, KC_FN1,KC_FN3, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RESET, RGB_MOD,
|
||||||
|
KC_FN5, KC_FN2,KC_FN4, KC_TR, KC_TR, KC_TR, KC_TR, MU_TOG, RGB_VAD, RGB_VAI, KC_TR, KC_TR, RGB_HUI, KC_TR,
|
||||||
|
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI),
|
||||||
|
};
|
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
|
{
|
||||||
|
// MACRODOWN only works in this function
|
||||||
|
switch(id) {
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
Whitespace-only changes.
@@ -0,0 +1,34 @@
|
|||||||
|
#include <avr/sfr_defs.h>
|
||||||
|
#include <avr/timer_avr.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include "lfk65_hs.h"
|
||||||
|
#include "keymap.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void)
|
||||||
|
{
|
||||||
|
matrix_init_user();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void)
|
||||||
|
{
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t* record)
|
||||||
|
{
|
||||||
|
if (keycode == RESET) {
|
||||||
|
reset_keyboard_kb();
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void reset_keyboard_kb(){
|
||||||
|
#ifdef WATCHDOG_ENABLE
|
||||||
|
MCUSR = 0;
|
||||||
|
wdt_disable();
|
||||||
|
wdt_reset();
|
||||||
|
#endif
|
||||||
|
reset_keyboard();
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
#ifndef LFK65_HS_H
|
||||||
|
#define LFK65_HS_H
|
||||||
|
|
||||||
|
/* if the kb.h file exists (because we're running from qmkbuilder) include it */
|
||||||
|
#ifdef __has_include
|
||||||
|
#if __has_include("kb.h")
|
||||||
|
#include "kb.h"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include <avr/sfr_defs.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef cbi
|
||||||
|
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef sbi
|
||||||
|
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void reset_keyboard_kb(void);
|
||||||
|
|
||||||
|
/* All Keymap - contains every possible switch
|
||||||
|
* ,-------------------------------------------------------------------------------.
|
||||||
|
* | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1F | 1G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 21 | 22 |23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | 2C | 2D | 2F | 2G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 3A | 3B | 3C | 3F | 3G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 41 | 42 | 43 | 45 | 46 | 47 | 48 | 49 | 4A | 4B | 4C | 4D | 4F | 4G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 51 | 52 | 53 | 57 | 5A | 5B | 5C | 5D | 5E | 3E | 4E |
|
||||||
|
* `-------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
// The first section contains all of the arguements
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_all( \
|
||||||
|
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \
|
||||||
|
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \
|
||||||
|
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, K3D, k3F, k3G, \
|
||||||
|
k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \
|
||||||
|
k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \
|
||||||
|
) { \
|
||||||
|
{k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G}, \
|
||||||
|
{k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \
|
||||||
|
{k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, k3F, k3G}, \
|
||||||
|
{k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \
|
||||||
|
{k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ANSI Keymap
|
||||||
|
* ,-------------------------------------------------------------------------------.
|
||||||
|
* | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 21 | 22 |23 | 24 | 25 | 26 | 27 | 28 | 29 | 2A | 2B | 2C | 2D | 2F | 2G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 31 | 32 |33 | 34 | 35 | 36 | 37 | 38 | 39 | 3A | 3B | 3C | 3F | 3G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 41 | 42 |43 | 45 | 46 | 47 | 48 | 49 | 4A | 4B | 4C | 4D | 4F | 4G |
|
||||||
|
* |-------------------------------------------------------------------------------|
|
||||||
|
* | 51 | 52 | 53 | 57 | 5A | 5B | 5C | 5D | 5E | 3E | 4E |
|
||||||
|
* `-------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
#define LAYOUT_ansi( \
|
||||||
|
k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, k1G, \
|
||||||
|
k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \
|
||||||
|
k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3F, k3G, \
|
||||||
|
k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \
|
||||||
|
k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \
|
||||||
|
) { \
|
||||||
|
{k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F, k1G}, \
|
||||||
|
{k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \
|
||||||
|
{k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G}, \
|
||||||
|
{k41, KC_NO, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \
|
||||||
|
{k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //LFK65_HS_H
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
LFK65-HS
|
||||||
|
===
|
||||||
|
|
||||||
|
65% layout based with hotswap support.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [LFKeyboards](https://github.com/lfkeyboards)
|
||||||
|
Hardware Supported: LFK65-HS
|
||||||
|
Hardware Availability: [LFKeyboards.com](https://www.lfkeyboards.com/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make lfkeyboards/lfk65_hs: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,20 @@
|
|||||||
|
MCU = atmega32u4
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
FLASH_SIZE_KB = 32
|
||||||
|
BOOT_SECTION_SIZE_KB = 4
|
||||||
|
BOOT_LOADER = BootloaderHID
|
||||||
|
|
||||||
|
# Extra source files for IS3731 lighting
|
||||||
|
SRC = TWIlib.c issi.c lighting.c
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "LFK87/SMK87",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 18.25,
|
||||||
|
"height": 6.5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_tkl_ansi": {
|
||||||
|
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}]
|
||||||
|
},
|
||||||
|
"LAYOUT_tkl_iso": {
|
||||||
|
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"\u00ac", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"\"", "x":2, "y":1.5}, {"label":"\u00a3", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"@", "x":11.75, "y":3.5}, {"label":"~", "x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,8 @@
|
|||||||
#include "lfk87.h"
|
#include QMK_KEYBOARD_H
|
||||||
#include "issi.h"
|
|
||||||
#include "lighting.h"
|
|
||||||
#include "action_layer.h"
|
|
||||||
#include "process_tap_dance.h"
|
|
||||||
|
|
||||||
//Define a shorter 'transparent' key code to make the keymaps more compact
|
// readability
|
||||||
#define KC_TR KC_TRNS
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
enum keymap_layout {
|
enum keymap_layout {
|
||||||
VANILLA = 0, // matches MF68 layout
|
VANILLA = 0, // matches MF68 layout
|
||||||
@@ -34,80 +31,86 @@ const Layer_Info layer_info[] = {
|
|||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[VANILLA] = LAYOUT(
|
/* Keymap VANILLA: (Base Layer) Default Layer
|
||||||
/* Keymap VANILLA: (Base Layer) Default Layer
|
* ,-----------------------------------------------------------------------------.
|
||||||
* ,-----------------------------------------------------------------------------.
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
||||||
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
||||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
* |-----------------------------------------------------------| `--------------'
|
||||||
* |-----------------------------------------------------------| `--------------'
|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||||
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
* |-----------------------------------------------------------| ,----.
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
||||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
* |-----------------------------------------------------------| ,-------------.
|
||||||
* |-----------------------------------------------------------| ,-------------.
|
* |Ctrl|Gui |Alt | Space |ALT |GUI |CTRL |Func| |Lft| Dn |Rig |
|
||||||
* |Ctrl|Gui |Alt | Space |ALT |GUI |CTRL |Func| |Lft| Dn |Rig |
|
* `-----------------------------------------------------------' `-------------'
|
||||||
* `-----------------------------------------------------------' `-------------'
|
*/
|
||||||
*/
|
[VANILLA] = LAYOUT_tkl_ansi(
|
||||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, \
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, \
|
||||||
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_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_DELETE, KC_END, KC_PGDN, \
|
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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
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_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT),
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
/* Keymap DEFAULT_TKL: (Base Layer) Default Layer
|
),
|
||||||
* ,-----------------------------------------------------------------------------.
|
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
|
||||||
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
|
||||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
|
||||||
* |-----------------------------------------------------------| `--------------'
|
|
||||||
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
|
||||||
* |-----------------------------------------------------------| ,----.
|
|
||||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
|
||||||
* |-----------------------------------------------------------| ,-------------.
|
|
||||||
* |Ctrl| |Alt | Space |ALT | |CTRL |Func| |Lft| Dn |Rig |
|
|
||||||
* `-----------------------------------------------------------' `-------------'
|
|
||||||
*/
|
|
||||||
[DEFAULT_WKL] = 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_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_DELETE, 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_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_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT),
|
|
||||||
|
|
||||||
/* Keymap DEFAULT_OSX: (Base Layer) Default Layer
|
/* Keymap DEFAULT_TKL: (Base Layer) Default Layer
|
||||||
* ,-----------------------------------------------------------------------------.
|
* ,-----------------------------------------------------------------------------.
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
||||||
* |-----------------------------------------------------------| `--------------'
|
* |-----------------------------------------------------------| `--------------'
|
||||||
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |-----------------------------------------------------------| ,----.
|
||||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
||||||
* |-----------------------------------------------------------| ,-------------.
|
* |-----------------------------------------------------------| ,-------------.
|
||||||
* |Ctrl| Opt |Cmd | Space |Cmd |Opt |CTRL |Func| |Lft| Dn |Rig |
|
* |Ctrl| |Alt | Space |ALT | |CTRL |Func| |Lft| Dn |Rig |
|
||||||
* `-----------------------------------------------------------' `-------------'
|
* `-----------------------------------------------------------' `-------------'
|
||||||
*/
|
*/
|
||||||
[DEFAULT_OSX] = LAYOUT(
|
[DEFAULT_WKL] = 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_SLCK, KC_PAUS, LALT(KC_F5), \
|
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_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_DELETE, KC_END, KC_PGDN, \
|
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, \
|
||||||
TD(TD_ESC_FUNC), 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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
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_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC),MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT),
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, MO(FUNC), KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
[CS_GO] = LAYOUT(
|
),
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \
|
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_FN0, KC_TR, KC_TR, \
|
/* Keymap DEFAULT_OSX: (Base Layer) Default Layer
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \
|
* ,-----------------------------------------------------------------------------.
|
||||||
KC_LCTL, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, \
|
* |-----------------------------------------------------------| |--------------|
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR),
|
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
||||||
|
* |-----------------------------------------------------------| |--------------|
|
||||||
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
||||||
|
* |-----------------------------------------------------------| `--------------'
|
||||||
|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||||
|
* |-----------------------------------------------------------| ,----.
|
||||||
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
||||||
|
* |-----------------------------------------------------------| ,-------------.
|
||||||
|
* |Ctrl| Opt |Cmd | Space |Cmd |Opt |CTRL |Func| |Lft| Dn |Rig |
|
||||||
|
* `-----------------------------------------------------------' `-------------'
|
||||||
|
*/
|
||||||
|
[DEFAULT_OSX] = 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_SLCK, KC_PAUS, LALT(KC_F5), \
|
||||||
|
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, \
|
||||||
|
TD(TD_ESC_FUNC), 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_UP, \
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, MO(FUNC), MO(SETTINGS), KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
[CS_GO] = LAYOUT_tkl_ansi(
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_FN0, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
/* Keymap FUNCTION: Function Layer
|
/* Keymap FUNCTION: Function Layer
|
||||||
* ,-------------------------------------------------------------. ,--------------.
|
* ,-------------------------------------------------------------. ,--------------.
|
||||||
@@ -124,36 +127,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig |
|
* |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig |
|
||||||
* `------------------------------------------------------' `-------------'
|
* `------------------------------------------------------' `-------------'
|
||||||
*/
|
*/
|
||||||
[FUNC] = LAYOUT(
|
[FUNC] = LAYOUT_tkl_ansi(
|
||||||
KC_ESC, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \
|
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, TO(CS_GO), KC_TR, KC_TR, \
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, TO(CS_GO), _______, _______, \
|
||||||
KC_NO,KC_PGUP, KC_UP, KC_PGDN, KC_HOME, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \
|
XXXXXXX, KC_PGUP, KC_UP, KC_PGDN, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \
|
||||||
KC_TR, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \
|
_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \
|
_______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \
|
||||||
KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR),
|
_______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
/* Keymap SETTINGS: Settings Layer
|
/* Keymap SETTINGS: Settings Layer
|
||||||
* ,-----------------------------------------------------------. ,-------------.
|
* ,-----------------------------------------------------------. ,-------------.
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
* |-------------------------------------------------------------| |--------------|
|
||||||
* |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+|
|
* |LayClr| | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+|
|
||||||
* |-----------------------------------------------------------| |-------------|
|
* |-----------------------------------------------------------| |-------------|
|
||||||
* |Debug| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-|
|
* |Debug| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-|
|
||||||
* |-----------------------------------------------------------| `-------------'
|
* |-----------------------------------------------------------| `-------------'
|
||||||
* |AU_TOG |Hz+|MS+| | | | | | | | | | RST |
|
* |AU_TOG |Hz+|MS+| | | | | | | | | | RST |
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |-----------------------------------------------------------| ,----.
|
||||||
* |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+|
|
* |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+|
|
||||||
* |------------------------------------------------------------------------.
|
* |------------------------------------------------------------------------.
|
||||||
* | | | | Print Debug | | | | |Sat-|Hue-|Sat+|
|
* | | | | Print Debug | | | | |Sat-|Hue-|Sat+|
|
||||||
* `------------------------------------------------------' `--------------'
|
* `------------------------------------------------------' `--------------'
|
||||||
*/
|
*/
|
||||||
[SETTINGS] = LAYOUT(
|
[SETTINGS] = LAYOUT_tkl_ansi(
|
||||||
KC_FN13, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO,
|
KC_FN13, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
KC_FN0,KC_FN3,KC_FN4,KC_FN5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO,
|
KC_FN0, KC_FN3, KC_FN4, KC_FN5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \
|
||||||
MU_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, KC_FN2, RGB_MOD, RGB_VAD, KC_NO,
|
MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \
|
||||||
AU_TOG, KC_FN6,KC_FN8, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET,
|
AU_TOG, KC_FN6, KC_FN8, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \
|
||||||
KC_FN10, KC_FN7,KC_FN9, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_FN0, RGB_HUI,
|
KC_FN10, KC_FN7, KC_FN9, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN0, RGB_HUI, \
|
||||||
KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI),
|
XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) {
|
void tap_esc_func_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
#include "lfk87.h"
|
#include QMK_KEYBOARD_H
|
||||||
#include "issi.h"
|
|
||||||
#include "lighting.h"
|
|
||||||
#include "action_layer.h"
|
|
||||||
|
|
||||||
//Define a shorter 'transparent' key code to make the keymaps more compact
|
// readability
|
||||||
#define KC_TR KC_TRNS
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
enum keymap_layout {
|
enum keymap_layout {
|
||||||
VANILLA = 0, // matches MF68 layout
|
VANILLA = 0, // matches MF68 layout
|
||||||
@@ -24,73 +22,77 @@ const Layer_Info layer_info[] = {
|
|||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[VANILLA] = LAYOUT(
|
/* Keymap VANILLA: (Base Layer) Default Layer
|
||||||
/* Keymap VANILLA: (Base Layer) Default Layer
|
* ,-----------------------------------------------------------------------------.
|
||||||
* ,-----------------------------------------------------------------------------.
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
||||||
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
||||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
* |-----------------------------------------------------------| `--------------'
|
||||||
* |-----------------------------------------------------------| `--------------'
|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||||
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
* |-----------------------------------------------------------| ,----.
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
||||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
* |-----------------------------------------------------------| ,-------------.
|
||||||
* |-----------------------------------------------------------| ,-------------.
|
* |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig |
|
||||||
* |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig |
|
* `-----------------------------------------------------------' `-------------'
|
||||||
* `-----------------------------------------------------------' `-------------'
|
*/
|
||||||
*/
|
[VANILLA] = 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_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_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_DELETE, KC_END, KC_PGDN, \
|
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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
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_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
/* Keymap FUNCTION: Function Layer
|
),
|
||||||
* ,-------------------------------------------------------------. ,--------------.
|
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
|
||||||
* | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | |
|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
|
||||||
* |Tab | |PgU| | | | | | Up| | | | | | | | | |
|
|
||||||
* |-------------------------------------------------------------| `--------------'
|
|
||||||
* |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | |
|
|
||||||
* |-------------------------------------------------------------| ,----.
|
|
||||||
* |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up |
|
|
||||||
* |-------------------------------------------------------------' ,-------------.
|
|
||||||
* |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig |
|
|
||||||
* `------------------------------------------------------' `-------------'
|
|
||||||
*/
|
|
||||||
[FUNC] = LAYOUT(
|
|
||||||
KC_ESC, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \
|
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, KC_TR, KC_TR, KC_TR, \
|
|
||||||
KC_NO,KC_NO, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \
|
|
||||||
KC_TR, KC_HOME, KC_PGDN, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \
|
|
||||||
KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \
|
|
||||||
KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR),
|
|
||||||
|
|
||||||
/* Keymap SETTINGS: Settings Layer
|
/* Keymap FUNCTION: Function Layer
|
||||||
* ,-----------------------------------------------------------. ,-------------.
|
* ,-------------------------------------------------------------. ,--------------.
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
* |-------------------------------------------------------------| |--------------|
|
||||||
* |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+|
|
* | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | |
|
||||||
* |-----------------------------------------------------------| |-------------|
|
* |-------------------------------------------------------------| |--------------|
|
||||||
* |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-|
|
* |Tab | |PgU| | | | | | Up| | | | | | | | | |
|
||||||
* |-----------------------------------------------------------| `-------------'
|
* |-------------------------------------------------------------| `--------------'
|
||||||
* |AudTgl |Hz+|MS+| | | | | | | | | | RST |
|
* |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | |
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |-------------------------------------------------------------| ,----.
|
||||||
* |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+|
|
* |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up |
|
||||||
* |--------------------------------------------------------------------------.
|
* |-------------------------------------------------------------' ,-------------.
|
||||||
* | | | | | | | | | |Sat-|Hue-|Sat+|
|
* |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig |
|
||||||
* `----------------------------------------------------------------------------'
|
* `------------------------------------------------------' `-------------'
|
||||||
*/
|
*/
|
||||||
[SETTINGS] = LAYOUT(
|
[FUNC] = LAYOUT_tkl_ansi(
|
||||||
KC_FN0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO,
|
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \
|
||||||
KC_FN0,KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, \
|
||||||
MU_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, KC_FN2, RGB_MOD, RGB_VAD, KC_NO,
|
XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \
|
||||||
AU_TOG, KC_F1,KC_FN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET,
|
_______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
KC_FN5, KC_FN2,KC_FN4, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI,
|
_______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \
|
||||||
KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI),
|
_______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Keymap SETTINGS: Settings Layer
|
||||||
|
* ,------------------------------------------------------------. ,-------------.
|
||||||
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
||||||
|
* |------------------------------------------------------------| |--------------|
|
||||||
|
* |FN0 | | | | | | | | | | |BL-|BL+|BL Togl | |RGB Tog |Val+|
|
||||||
|
* |------------------------------------------------------------| |-------------|
|
||||||
|
* |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-|
|
||||||
|
* |------------------------------------------------------------| `-------------'
|
||||||
|
* |AudTgl |Hz+|MS+| | | | | | | | | | RST |
|
||||||
|
* |------------------------------------------------------------| ,----.
|
||||||
|
* |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+|
|
||||||
|
* |------------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | |Sat-|Hue-|Sat+|
|
||||||
|
* `------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[SETTINGS] = LAYOUT_tkl_ansi(
|
||||||
|
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
|
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \
|
||||||
|
MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \
|
||||||
|
AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \
|
||||||
|
KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
@@ -100,7 +102,7 @@ const uint16_t PROGMEM fn_actions[] = {
|
|||||||
ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click
|
ACTION_FUNCTION(LFK_CLICK_TIME_LONGER), // FN3 - Increase length of audio click
|
||||||
ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click
|
ACTION_FUNCTION(LFK_CLICK_TIME_SHORTER), // FN4 - Decrease length of audio click
|
||||||
ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click
|
ACTION_FUNCTION(LFK_CLICK_TOGGLE), // FN5 - Toggle audio click
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
#include "lfk87.h"
|
#include QMK_KEYBOARD_H
|
||||||
#include "issi.h"
|
|
||||||
#include "lighting.h"
|
|
||||||
#include "action_layer.h"
|
|
||||||
|
|
||||||
//Define a shorter 'transparent' key code to make the keymaps more compact
|
// readability
|
||||||
#define KC_TR KC_TRNS
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
enum keymap_layout {
|
enum keymap_layout {
|
||||||
VANILLA = 0, // matches MF68 layout
|
VANILLA = 0, // matches MF68 layout
|
||||||
@@ -24,73 +22,77 @@ const Layer_Info layer_info[] = {
|
|||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[VANILLA] = LAYOUT(
|
/* Keymap VANILLA: (Base Layer) Default Layer
|
||||||
/* Keymap VANILLA: (Base Layer) Default Layer
|
* ,-----------------------------------------------------------------------------.
|
||||||
* ,-----------------------------------------------------------------------------.
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12| |Prnt|ScLk|Paus|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
||||||
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0| - | = |Backsp | | Ins|Home|PgUp|
|
* |-----------------------------------------------------------| |--------------|
|
||||||
* |-----------------------------------------------------------| |--------------|
|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
||||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| | Del| End|PgDn|
|
* |-----------------------------------------------------------| `--------------'
|
||||||
* |-----------------------------------------------------------| `--------------'
|
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
||||||
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
* |-----------------------------------------------------------| ,----.
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
||||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up |
|
* |-----------------------------------------------------------| ,-------------.
|
||||||
* |-----------------------------------------------------------| ,-------------.
|
* |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig |
|
||||||
* |Ctrl|Gui |Alt | Space |ALT |GUI |Func|CTRL | |Lft| Dn |Rig |
|
* `-----------------------------------------------------------' `-------------'
|
||||||
* `-----------------------------------------------------------' `-------------'
|
*/
|
||||||
*/
|
[VANILLA] = LAYOUT_tkl_ansi(
|
||||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, LGUI(KC_D), KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_SLCK, KC_PAUS, \
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, LGUI(KC_D), KC_F6, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, 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_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_DELETE, KC_END, KC_PGDN, \
|
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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
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_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(FUNC), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
/* Keymap FUNCTION: Function Layer
|
),
|
||||||
* ,-------------------------------------------------------------. ,--------------.
|
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
|
||||||
* | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | |
|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
|
||||||
* |Tab | |PgU| | | | | | Up| | | | | | | | | |
|
|
||||||
* |-------------------------------------------------------------| `--------------'
|
|
||||||
* |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | |
|
|
||||||
* |-------------------------------------------------------------| ,----.
|
|
||||||
* |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up |
|
|
||||||
* |-------------------------------------------------------------' ,-------------.
|
|
||||||
* |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig |
|
|
||||||
* `------------------------------------------------------' `-------------'
|
|
||||||
*/
|
|
||||||
[FUNC] = LAYOUT(
|
|
||||||
KC_ESC, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_PSCR, KC_SLCK, KC_PAUS, \
|
|
||||||
KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_DEL, KC_TR, KC_TR, KC_TR, \
|
|
||||||
KC_NO,KC_NO, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TR, KC_TR, KC_TR, \
|
|
||||||
KC_TR, KC_HOME, KC_PGDN, KC_END, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, \
|
|
||||||
KC_TR, KC_NO, KC_DEL, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, TG(SETTINGS), KC_TR, \
|
|
||||||
KC_TR, KC_TR, KC_TR, KC_PGDN, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR, KC_TR),
|
|
||||||
|
|
||||||
/* Keymap SETTINGS: Settings Layer
|
/* Keymap FUNCTION: Function Layer
|
||||||
* ,-----------------------------------------------------------. ,-------------.
|
* ,-------------------------------------------------------------. ,--------------.
|
||||||
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
||||||
* |-------------------------------------------------------------| |--------------|
|
* |-------------------------------------------------------------| |--------------|
|
||||||
* |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+|
|
* | ` |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | | | | |
|
||||||
* |-----------------------------------------------------------| |-------------|
|
* |-------------------------------------------------------------| |--------------|
|
||||||
* |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-|
|
* |Tab | |PgU| | | | | | Up| | | | | | | | | |
|
||||||
* |-----------------------------------------------------------| `-------------'
|
* |-------------------------------------------------------------| `--------------'
|
||||||
* |AudTgl |Hz+|MS+| | | | | | | | | | RST |
|
* |Control|Hme|PgD|End| | | |Lft|Dwn|Rgt| | | |
|
||||||
* |-----------------------------------------------------------| ,----.
|
* |-------------------------------------------------------------| ,----.
|
||||||
* |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+|
|
* |Shift | |Del| | | | |Mute|V- |V+ | |TG(SETTINGS)| | Up |
|
||||||
* |--------------------------------------------------------------------------.
|
* |-------------------------------------------------------------' ,-------------.
|
||||||
* | | | | | | | | | |Sat-|Hue-|Sat+|
|
* |Func|Win |Alt | PgD |Alt |Ctrl |Func | |Lft| Dn |Rig |
|
||||||
* `----------------------------------------------------------------------------'
|
* `------------------------------------------------------' `-------------'
|
||||||
*/
|
*/
|
||||||
[SETTINGS] = LAYOUT(
|
[FUNC] = LAYOUT_tkl_ansi(
|
||||||
KC_FN0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, KC_NO, KC_NO, KC_NO,
|
KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \
|
||||||
KC_FN0,KC_NO,KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, KC_NO,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, \
|
||||||
MU_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, KC_FN2, RGB_MOD, RGB_VAD, KC_NO,
|
XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, \
|
||||||
AU_TOG, KC_F1,KC_FN3, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET,
|
_______, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
KC_FN5, KC_FN2,KC_FN4, KC_NO, KC_NO, KC_NO, KC_NO, MU_TOG, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI,
|
_______, XXXXXXX, KC_DEL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, TG(SETTINGS), _______, \
|
||||||
KC_NO, KC_NO, KC_NO, KC_FN12, KC_NO, KC_NO, KC_NO, KC_TR, RGB_SAD, RGB_HUD, RGB_SAI),
|
_______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Keymap SETTINGS: Settings Layer
|
||||||
|
* ,-----------------------------------------------------------. ,-------------.
|
||||||
|
* |Esc |f1| f2| f3| f4| | f5| f6| f7| f8| | f9|f10|f11|f12 | |Prnt|ScLk|Paus|
|
||||||
|
* |-------------------------------------------------------------| |--------------|
|
||||||
|
* |FN0 | | | | | | | | | | |BL-|BL+|BL Togl| |RGB Tog |Val+|
|
||||||
|
* |-----------------------------------------------------------| |-------------|
|
||||||
|
* |MuMode| | | | | | | | | | | | |LEDTst| |RGB Mode|Val-|
|
||||||
|
* |-----------------------------------------------------------| `-------------'
|
||||||
|
* |AudTgl |Hz+|MS+| | | | | | | | | | RST |
|
||||||
|
* |-----------------------------------------------------------| ,----.
|
||||||
|
* |ClickTgl|Hz-|MS-| | | | | | | | |Layer Clr | |Hue+|
|
||||||
|
* |--------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | |Sat-|Hue-|Sat+|
|
||||||
|
* `----------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[SETTINGS] = LAYOUT_tkl_ansi(
|
||||||
|
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
|
KC_FN0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_INC, BL_TOGG, RGB_TOG, RGB_VAI, XXXXXXX, \
|
||||||
|
MU_MOD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_FN2, RGB_MOD, RGB_VAD, XXXXXXX, \
|
||||||
|
AU_TOG, KC_F1, KC_FN3, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, \
|
||||||
|
KC_FN5, KC_FN2, KC_FN4, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_HUI, \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, KC_FN12, XXXXXXX, XXXXXXX, XXXXXXX, _______, RGB_SAD, RGB_HUD, RGB_SAI \
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
|||||||
Loaded 100 of 191 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user