Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Prime_EXL prototype to 'handwired' #3932

Merged
merged 8 commits into from
Sep 19, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions keyboards/handwired/prime_exl/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
Copyright 2018 Holten Campbell

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 0x4024
#define DEVICE_VER 0x0001
#define MANUFACTURER PrimeKB
#define PRODUCT Prime_EXL
#define DESCRIPTION Ergo

/* key matrix size */
#define MATRIX_ROWS 10
#define MATRIX_COLS 9

/* Keyboard Matrix Assignments */
#define MATRIX_ROW_PINS { B1, E6, D5, D6, B4, D7, D4, F1, F0, B0 }
#define MATRIX_COL_PINS { D0, B3, B2, D1, D2, D3, F7, F6, F5 }
#define UNUSED_PINS

/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
#define DIODE_DIRECTION COL2ROW

#define BACKLIGHT_PIN B7
#define BACKLIGHT_LEVELS 5

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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 magic key command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
12 changes: 12 additions & 0 deletions keyboards/handwired/prime_exl/info.json

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions keyboards/handwired/prime_exl/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2018 Holten Campbell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

// place overrides here
173 changes: 173 additions & 0 deletions keyboards/handwired/prime_exl/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/* Copyright 2018 Holten Campbell
*
* 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

// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
QMKBEST = SAFE_RANGE,
QMKURL
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_F7, TO(2), KC_P0,
KC_F5, KC_P1, KC_P3, KC_LCTL, KC_LBRC, MO(1), KC_SPC, KC_EQL, MO(4),
KC_F3, KC_P4, KC_P6, KC_LSFT, KC_X, KC_V, KC_N, KC_COMM, KC_SLSH,
KC_F1, KC_P7, KC_P9, KC_TAB, KC_S, KC_F, KC_H, KC_K, KC_QUOT,
KC_NLCK, KC_RPRN, KC_PAST, KC_ESC, KC_W, KC_R, KC_Y, KC_I, KC_P,
KC_LPRN, KC_PSLS, KC_BSPC, KC_Q, KC_E, KC_T, KC_U, KC_O, KC_BSPC,
KC_F2, KC_P8, KC_DEL, KC_A, KC_D, KC_G, KC_J, KC_L, KC_ENT,
KC_F4, KC_P5, KC_PMNS, KC_Z, KC_C, KC_B, KC_M, KC_DOT, KC_LSFT,
KC_F6, KC_P2, KC_PPLS, KC_LALT, KC_RBRC, MO(3), KC_MINS, KC_LGUI,
KC_F8, KC_PDOT, KC_PENT
),

[1] = LAYOUT(
BL_TOGG, KC_TRNS, KC_TRNS,
KC_NLCK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS,
KC_SLCK, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_SCLN,
KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_2, KC_4, KC_TRNS, KC_UP, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_3, KC_5, KC_TRNS, KC_TRNS, KC_DEL,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RGHT, KC_BSLS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE,
BL_STEP, KC_TRNS, KC_TRNS
),

[2] = LAYOUT(
KC_LCTL, TO(0), KC_H,
KC_LSFT, KC_X, KC_V, KC_LCTL, KC_LBRC, MO(5), KC_SPC, KC_EQL, MO(4),
KC_TAB, KC_S, KC_F, KC_LSFT, KC_X, KC_V, KC_N, KC_COMM, KC_SLSH,
KC_TAB, KC_W, KC_R, KC_TAB, KC_S, KC_F, KC_H, KC_K, KC_QUOT,
KC_ESC, KC_2, KC_4, KC_ESC, KC_W, KC_R, KC_Y, KC_I, KC_P,
KC_1, KC_3, KC_F9, KC_Q, KC_E, KC_T, KC_U, KC_O, KC_BSPC,
KC_Q, KC_E, KC_T, KC_A, KC_D, KC_G, KC_J, KC_L, KC_ENT,
KC_A, KC_D, KC_G, KC_Z, KC_C, KC_B, KC_M, KC_DOT, KC_LSFT,
KC_Z, KC_C, KC_B, KC_LALT, KC_RBRC, MO(3), KC_MINS, KC_LGUI,
KC_LALT, KC_P, KC_SPC
),

[3] = LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_2, KC_4, KC_6, KC_8, KC_0,
KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_3, KC_5, KC_7, KC_9, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),

[4] = LAYOUT(
KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_F1, KC_F3, KC_F5, KC_F7, KC_F9, KC_F11,
KC_TRNS, KC_TRNS, KC_TRNS, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, KC_F12,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS
),

[5] = LAYOUT(
BL_TOGG, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_SCLN,
KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_2, KC_4, KC_TRNS, KC_UP, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_3, KC_5, KC_TRNS, KC_TRNS, KC_DEL,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RGHT, KC_BSLS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_MUTE,
BL_STEP, KC_TRNS, KC_TRNS
),

};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QMKBEST:
if (record->event.pressed) {
// when keycode QMKBEST is pressed
SEND_STRING("QMK is the best thing ever!");
} else {
// when keycode QMKBEST is released
}
break;
case QMKURL:
if (record->event.pressed) {
// when keycode QMKURL is pressed
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
} else {
// when keycode QMKURL is released
}
break;
}
return true;
}

void matrix_init_user(void) {
// set CapsLock LED to output and low
DDRC |= (1 << 6);
PORTC &= ~(1 << 6);
// set NumLock LED to output and low
DDRB |= (1 << 6);
PORTB &= ~(1 << 6);
// set ScrollLock LED to output and low
DDRB |= (1 << 5);
PORTB &= ~(1 << 5);
}

void matrix_scan_user(void) {

}


void led_set_user(uint8_t usb_led) {
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
PORTB |= (1<<6);
} else {
PORTB &= ~(1<<6);
}
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
PORTB |= (1<<5);
} else {
PORTB &= ~(1<<5);
}
/*
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
PORTC |= (1<<6);
} else {
PORTC &= ~(1<<6);
}
*/
}

//function for layer indicator LED
uint32_t layer_state_set_user(uint32_t state)
{
if (biton32(state) == 2) {
PORTC |= (1<<6);
} else {
PORTC &= ~(1<<6);
}
return state;
}
1 change: 1 addition & 0 deletions keyboards/handwired/prime_exl/keymaps/default/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default keymap for prime_exl
43 changes: 43 additions & 0 deletions keyboards/handwired/prime_exl/prime_exl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Copyright 2018 Holten Campbell
*
* 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 "prime_exl.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);
}
45 changes: 45 additions & 0 deletions keyboards/handwired/prime_exl/prime_exl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Copyright 2018 Holten Campbell
*
* 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 PRIME_EXL_H
#define PRIME_EXL_H

#include "quantum.h"

#define LAYOUT( \
noroadsleft marked this conversation as resolved.
Show resolved Hide resolved
K000, K001, K002, \
K010, K011, K012, K013, K014, K015, K016, K017, K018, \
K020, K021, K022, K023, K024, K025, K026, K027, K028, \
K030, K031, K032, K033, K034, K035, K036, K037, K038, \
K040, K041, K042, K043, K044, K045, K046, K047, K048, \
K050, K051, K052, K053, K054, K055, K056, K057, K058, \
K060, K061, K062, K063, K064, K065, K066, K067, K068, \
K070, K071, K072, K073, K074, K075, K076, K077, K078, \
K080, K081, K082, K083, K084, K085, K086, K087, \
K090, K091, K092 \
) { \
{ K000, K001, K002, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \
{ K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \
{ K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \
{ K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \
{ K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \
{ K060, K061, K062, K063, K064, K065, K066, K067, K068 }, \
{ K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \
{ K080, K081, K082, K083, K084, K085, K086, K087, KC_NO }, \
{ K090, K091, K092, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
}

#endif
16 changes: 16 additions & 0 deletions keyboards/handwired/prime_exl/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Prime_EXL

![Prime_EXL](https://i.imgur.com/3t524g8.jpg)

An ergonomic 45% keyboard with a macro/numpad added to the left side.

Keyboard Maintainer: [Holtenc](https://github.com/holtenc/)
holtenc marked this conversation as resolved.
Show resolved Hide resolved

Hardware Supported: Prime_EXL PCB, ATMega32u4
Hardware Availability: Prototype

Make example for this keyboard (after setting up your build environment):

make handwired/prime_exl:default

See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
Loading