Skip to content

Commit

Permalink
Added layout based on miryoku
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Bancroft committed Jan 27, 2022
1 parent 91e5020 commit 5996322
Show file tree
Hide file tree
Showing 10 changed files with 1,142 additions and 0 deletions.
31 changes: 31 additions & 0 deletions keyboards/chimera_ergo_42/chimera_ergo_42.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include "chimera_ergo_42.h"

void uart_init(void) {
SERIAL_UART_INIT();
}

void led_init(void) {
DDRD |= (1<<1);
PORTD |= (1<<1);
DDRF |= (1<<4) | (1<<5);
PORTF |= (1<<4) | (1<<5);
}


void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
uart_init();
led_init();
}

void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}

void led_set_kb(uint8_t usb_led) {

}
81 changes: 81 additions & 0 deletions keyboards/chimera_ergo_42/chimera_ergo_42.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#ifndef CHIMERA_ERGO_42_H
#define CHIMERA_ERGO_42_H

#include "quantum.h"
#include "matrix.h"
//#include "backlight.h"
#include <stddef.h>

#define red_led_off PORTF |= (1 << 5)
#define red_led_on PORTF &= ~(1 << 5)
#define blu_led_off PORTF |= (1 << 4)
#define blu_led_on PORTF &= ~(1 << 4)
#define grn_led_off PORTD |= (1 << 1)
#define grn_led_on PORTD &= ~(1 << 1)

#define set_led_off \
red_led_off; \
grn_led_off; \
blu_led_off
#define set_led_red \
red_led_on; \
grn_led_off; \
blu_led_off
#define set_led_blue \
red_led_off; \
grn_led_off; \
blu_led_on
#define set_led_green \
red_led_off; \
grn_led_on; \
blu_led_off
#define set_led_yellow \
red_led_on; \
grn_led_on; \
blu_led_off
#define set_led_magenta \
red_led_on; \
grn_led_off; \
blu_led_on
#define set_led_cyan \
red_led_off; \
grn_led_on; \
blu_led_on
#define set_led_white \
red_led_on; \
grn_led_on; \
blu_led_on

/*
#define LED_B 5
#define LED_R 6
#define LED_G 7
#define all_leds_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
#define red_led_on PORTF |= (1<<LED_R)
#define red_led_off PORTF &= ~(1<<LED_R)
#define grn_led_on PORTF |= (1<<LED_G)
#define grn_led_off PORTF &= ~(1<<LED_G)
#define blu_led_on PORTF |= (1<<LED_B)
#define blu_led_off PORTF &= ~(1<<LED_B)
#define set_led_off PORTF &= ~(1<<LED_B) & ~(1<<LED_R) & ~(1<<LED_G)
#define set_led_red PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_G) | (1<<LED_R)
#define set_led_blue PORTF = PORTF & ~(1<<LED_G) & ~(1<<LED_R) | (1<<LED_B)
#define set_led_green PORTF = PORTF & ~(1<<LED_B) & ~(1<<LED_R) | (1<<LED_G)
#define set_led_yellow PORTF = PORTF & ~(1<<LED_B) | (1<<LED_R) | (1<<LED_G)
#define set_led_magenta PORTF = PORTF & ~(1<<LED_G) | (1<<LED_R) | (1<<LED_B)
#define set_led_cyan PORTF = PORTF & ~(1<<LED_R) | (1<<LED_B) | (1<<LED_G)
#define set_led_white PORTF |= (1<<LED_B) | (1<<LED_R) | (1<<LED_G)
*/

// This a shortcut to help you visually see your layout.
// The first section contains all of the arguements
// The second converts the arguments into a two-dimensional array
#define KC_KEYMAP(k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41) \
{ {KC_NO, KC_##k28, KC_##k14, KC_##k03, KC_##k16, KC_NO, KC_##k39, KC_##k19, KC_##k08, KC_##k21, KC_NO, KC_NO}, {KC_NO, KC_##k25, KC_##k02, KC_##k15, KC_##k04, KC_##k24, KC_##k35, KC_##k07, KC_##k20, KC_##k09, KC_##k34, KC_NO}, {KC_##k00, KC_##k13, KC_NO, KC_##k27, KC_##k17, KC_##k37, KC_##k40, KC_##k18, KC_##k32, KC_NO, KC_##k22, KC_##k11}, {KC_##k12, KC_##k01, KC_##k26, KC_NO, KC_##k05, KC_##k36, KC_##k41, KC_##k06, KC_NO, KC_##k33, KC_##k10, KC_##k23}, {KC_##k29, KC_##k38, KC_NO, KC_##k28, KC_##k25, KC_NO, KC_##k30, KC_##k31, KC_NO, KC_NO, KC_##k34, KC_NO}, }

#define KEYMAP(k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41) \
{ {KC_NO, k28, k14, k03, k16, KC_NO, k39, k19, k08, k21, KC_NO, KC_NO}, {KC_NO, k25, k02, k15, k04, k24, k35, k07, k20, k09, k34, KC_NO}, {k00, k13, KC_NO, k27, k17, k37, k40, k18, k32, KC_NO, k22, k11}, {k12, k01, k26, KC_NO, k05, k36, k41, k06, KC_NO, k33, k10, k23}, {k29, k38, KC_NO, k28, k25, KC_NO, k30, k31, KC_NO, KC_NO, k34, KC_NO}, }
#endif
87 changes: 87 additions & 0 deletions keyboards/chimera_ergo_42/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#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 unknown
#define PRODUCT Chimera Ergo fortytwo
#define DESCRIPTION q.m.k. keyboard firmware for Chimera Ergo fortytwo

/* key matrix size */
#define MATRIX_ROWS 6
#define MATRIX_COLS 12

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* number of backlight levels */
//#define BACKLIGHT_LEVELS 3

#define ONESHOT_TIMEOUT 500


/* key combination for 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.
*/

#define PREVENT_STUCK_MODIFIERS

/* 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

//UART settings for communication with the RF microcontroller
#define SERIAL_UART_BAUD 1000000
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
#define SERIAL_UART_INIT() do { \
/* baud rate */ \
UBRR1L = SERIAL_UART_UBRR; \
/* baud rate */ \
UBRR1H = SERIAL_UART_UBRR >> 8; \
/* enable TX and RX */ \
UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
/* 8-bit data */ \
UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
} while(0)

#endif
67 changes: 67 additions & 0 deletions keyboards/chimera_ergo_42/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"keyboard_name": "Chimera Ergo",
"url": "",
"maintainer": "qmk",
"layouts": {
"LAYOUT": {
"layout": [
{ "label": "k00", "x": 0, "y": 1 },
{ "label": "k01", "x": 1, "y": 0.75 },
{ "label": "k02", "x": 2, "y": 0.25 },
{ "label": "k03", "x": 3, "y": 0 },
{ "label": "k04", "x": 4, "y": 0.25 },
{ "label": "k05", "x": 5, "y": 0.5 },
{ "label": "k06", "x": 9, "y": 0.5 },
{ "label": "k07", "x": 10, "y": 0.25 },
{ "label": "k08", "x": 11, "y": 0 },
{ "label": "k09", "x": 12, "y": 0.25 },
{ "label": "k10", "x": 13, "y": 0.75 },
{ "label": "k11", "x": 14, "y": 1 },
{ "label": "k12", "x": 0, "y": 2 },
{ "label": "k13", "x": 1, "y": 1.75 },
{ "label": "k14", "x": 2, "y": 1.25 },
{ "label": "k15", "x": 3, "y": 1 },
{ "label": "k16", "x": 4, "y": 1.25 },
{ "label": "k17", "x": 5, "y": 1.5 },
{ "label": "k18", "x": 9, "y": 1.5 },
{ "label": "k19", "x": 10, "y": 1.25 },
{ "label": "k20", "x": 11, "y": 1 },
{ "label": "k21", "x": 12, "y": 1.25 },
{ "label": "k22", "x": 13, "y": 1.75 },
{ "label": "k23", "x": 14, "y": 2 },
{ "label": "k24", "x": 0, "y": 3 },
{ "label": "k25", "x": 1, "y": 2.75 },
{ "label": "k26", "x": 2, "y": 2.25 },
{ "label": "k27", "x": 3, "y": 2 },
{ "label": "k28", "x": 4, "y": 2.25 },
{ "label": "k29", "x": 5, "y": 2.5 },
{ "label": "k30", "x": 9, "y": 2.5 },
{ "label": "k31", "x": 10, "y": 2.25 },
{ "label": "k32", "x": 11, "y": 2 },
{ "label": "k33", "x": 12, "y": 2.25 },
{ "label": "k34", "x": 13, "y": 2.75 },
{ "label": "k35", "x": 14, "y": 3 },
{ "label": "k36", "x": 0, "y": 4 },
{ "label": "k37", "x": 1, "y": 3.75 },
{ "label": "k38", "x": 2, "y": 3.25 },
{ "label": "k39", "x": 3, "y": 3 },
{ "label": "k40", "x": 4, "y": 3.25 },
{ "label": "k41", "x": 5, "y": 3.5 },
{ "label": "k42", "x": 9, "y": 3.5 },
{ "label": "k43", "x": 10, "y": 3.25 },
{ "label": "k44", "x": 11, "y": 3 },
{ "label": "k45", "x": 12, "y": 3.25 },
{ "label": "k46", "x": 13, "y": 3.75 },
{ "label": "k47", "x": 14, "y": 4 },

{ "label": "k48", "x": 4, "y": 4.75 },
{ "label": "k49", "x": 5, "y": 5 },
{ "label": "k49", "x": 6, "y": 5.25 },

{ "label": "k49", "x": 8, "y": 5.25 },
{ "label": "k50", "x": 9, "y": 5 },
{ "label": "k51", "x": 10, "y": 4.75 }
]
}
}
}
45 changes: 45 additions & 0 deletions keyboards/chimera_ergo_42/keymaps/cbancroft/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#pragma once

//** Config Options

// this makes it possible to do rolling combos (zx) with keys that
// convert to other keys on hold (z becomes ctrl when you hold it,
// and when this option isn't enabled, z rapidly followed by x
// actually sends Ctrl-x. That's bad.)
#define IGNORE_MOD_TAP_INTERRUPT
#undef PERMISSIVE_HOLD
#define PREVENT_STUCK_MODIFIERS
#define TAPPING_TERM_PER_KEY
// #define TAPPING_FORCE_HOLD
//#define RETRO_TAPPING

#define FORCE_NKRO

#ifdef TAPPING_TERM
# undef TAPPING_TERM
#endif // TAPPING_TERM
#define TAPPING_TERM 190

/* Use I2C or Serial, not both */

/* Mouse Control Settings */
#define MOUSEKEY_INTERVAL 20
#define MOUSEKEY_DELAY 0
#define MOUSEKEY_TIME_TO_MAX 60
#define MOUSEKEY_MAX_SPEED 7

#define MOUSEKEY_WHEEL_DELAY 0
#define MOUSEKEY_WHEEL_MAX_SPEED 8
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40

// Disable action_get_macro and fn_actions, since we don't use these
// and it saves on space in the firmware.
#ifndef NO_DEBUG
# define NO_DEBUG
#endif // !NO_DEBUG

#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE)
# define NO_PRINT
#endif // !NO_PRINT

#define MACRO_TIMER 5
Loading

0 comments on commit 5996322

Please sign in to comment.