Skip to content

Commit

Permalink
[Keyboard] Iris via support, Rev 3 updates (qmk#4849)
Browse files Browse the repository at this point in the history
* Add encoder support

* Add VIA support to Iris Rev. 3

* Update pinout and disable mouse keys to free up space

* Rollout VIA support to all Iris revisions

* Update default keymap

* Update vendor ID
  • Loading branch information
nooges authored and drashna committed Jan 15, 2019
1 parent 2dcce4c commit c768ffe
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 217 deletions.
1 change: 1 addition & 0 deletions keyboards/iris/iris.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#endif

#include "quantum.h"
#include "../../zeal60/zeal60_keycodes.h"

// Used to create a keymap using only KC_ prefixed keys
#define LAYOUT_kc( \
Expand Down
71 changes: 17 additions & 54 deletions keyboards/iris/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@

extern keymap_config_t keymap_config;

#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
#define _ADJUST 16

enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
ADJUST,
};
#define _MAIN 0
#define _FN1 1
#define _FN2 2
#define _FN3 3

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[_QWERTY] = LAYOUT(
[_MAIN] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
Expand All @@ -26,11 +19,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT
KC_LGUI, FN_MO13, KC_ENT, KC_SPC, FN_MO23, KC_LALT
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
),

[_LOWER] = LAYOUT(
[_FN1] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
Expand All @@ -44,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
),

[_RAISE] = LAYOUT(
[_FN2] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
Expand All @@ -58,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
),

[_ADJUST] = LAYOUT(
[_FN3] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
Expand All @@ -73,42 +66,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};

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 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;
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
}
}
38 changes: 20 additions & 18 deletions keyboards/iris/rev1/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_CONFIG_H

/* USB Device descriptor parameter */
#define VENDOR_ID 0xCEEB
#define VENDOR_ID 0xCB10
#define PRODUCT_ID 0x1256
#define DEVICE_VER 0x0100
#define MANUFACTURER Keebio
Expand Down Expand Up @@ -68,20 +68,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN D3
#define RGBLED_NUM 12 // Number of LEDs

/*
* 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
#define DYNAMIC_KEYMAP_LAYER_COUNT 4

// EEPROM usage

// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x08
#define EEPROM_VERSION_ADDR 34

// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480)
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
14 changes: 0 additions & 14 deletions keyboards/iris/rev1/rev1.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ void led_set_kb(uint8_t usb_led) {
}
#endif

void matrix_init_kb(void) {

// // green led on
// DDRD |= (1<<5);
// PORTD &= ~(1<<5);

// // orange led on
// DDRB |= (1<<0);
// PORTB &= ~(1<<0);

matrix_init_user();
};


#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
Expand Down
38 changes: 20 additions & 18 deletions keyboards/iris/rev1_led/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_CONFIG_H

/* USB Device descriptor parameter */
#define VENDOR_ID 0xCEEB
#define VENDOR_ID 0xCB10
#define PRODUCT_ID 0x1256
#define DEVICE_VER 0x0100
#define MANUFACTURER Keebio
Expand Down Expand Up @@ -68,20 +68,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN D3
#define RGBLED_NUM 12 // Number of LEDs

/*
* 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
#define DYNAMIC_KEYMAP_LAYER_COUNT 4

// EEPROM usage

// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x08
#define EEPROM_VERSION_ADDR 34

// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480)
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
14 changes: 0 additions & 14 deletions keyboards/iris/rev1_led/rev1_led.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ void led_set_kb(uint8_t usb_led) {
}
#endif

void matrix_init_kb(void) {

// // green led on
// DDRD |= (1<<5);
// PORTD &= ~(1<<5);

// // orange led on
// DDRB |= (1<<0);
// PORTB &= ~(1<<0);

matrix_init_user();
};


#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
Expand Down
38 changes: 20 additions & 18 deletions keyboards/iris/rev2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_CONFIG_H

/* USB Device descriptor parameter */
#define VENDOR_ID 0xCEEB
#define VENDOR_ID 0xCB10
#define PRODUCT_ID 0x1256
#define DEVICE_VER 0x0200
#define MANUFACTURER Keebio
Expand Down Expand Up @@ -68,20 +68,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN D3
#define RGBLED_NUM 12 // Number of LEDs

/*
* 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
#define DYNAMIC_KEYMAP_LAYER_COUNT 4

// EEPROM usage

// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x08
#define EEPROM_VERSION_ADDR 34

// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480)
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
14 changes: 0 additions & 14 deletions keyboards/iris/rev2/rev2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,6 @@ void led_set_kb(uint8_t usb_led) {
}
#endif

void matrix_init_kb(void) {

// // green led on
// DDRD |= (1<<5);
// PORTD &= ~(1<<5);

// // orange led on
// DDRB |= (1<<0);
// PORTB &= ~(1<<0);

matrix_init_user();
};


#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
// swap-hands action needs a matrix to define the swap
Expand Down
47 changes: 29 additions & 18 deletions keyboards/iris/rev3/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_CONFIG_H

/* USB Device descriptor parameter */
#define VENDOR_ID 0xCEEB
#define VENDOR_ID 0xCB10
#define PRODUCT_ID 0x1256
#define DEVICE_VER 0x0300
#define MANUFACTURER Keebio
Expand All @@ -35,6 +35,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// wiring of each half
#define MATRIX_ROW_PINS { D2, D3, D5, D7, D6 }
#define MATRIX_COL_PINS { F1, F4, F5, F6, D4, B4 }
#define SPLIT_HAND_PIN F0
#define QMK_ESC_OUTPUT D2
#define QMK_ESC_INPUT F1
#define QMK_LED B0
#define QMK_SPEAKER C6

#define NUMBER_OF_ENCODERS 1
#define ENCODERS_PAD_A { B5 }
#define ENCODERS_PAD_B { B7 }

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
Expand Down Expand Up @@ -68,20 +77,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_DI_PIN F7
#define RGBLED_NUM 12 // Number of LEDs

/*
* 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
#define DYNAMIC_KEYMAP_LAYER_COUNT 4

// EEPROM usage

// TODO: refactor with new user EEPROM code (coming soon)
#define EEPROM_MAGIC 0x451F
#define EEPROM_MAGIC_ADDR 32
// Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x08
#define EEPROM_VERSION_ADDR 34

// Dynamic keymap starts after EEPROM version
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
// Dynamic macro starts after dynamic keymaps (35+(4*10*6*2)) = (35+480)
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 515
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 509 // 1024-DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
Loading

0 comments on commit c768ffe

Please sign in to comment.