From 39eb4c9df6a314e7a9983c22483366023aa84c98 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 16 Nov 2021 22:44:30 +0100 Subject: [PATCH] Feat: first commit --- README.md | 9 ++++ config.h | 21 +++++++++ keymap.c | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ rules.mk | 20 ++++++++ 4 files changed, 188 insertions(+) create mode 100644 README.md create mode 100644 config.h create mode 100644 keymap.c create mode 100644 rules.mk diff --git a/README.md b/README.md new file mode 100644 index 0000000..de10ead --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# My iris + +In azerty + +## flashing + + qmk compile ... + sudo dfu-programmer atmega32u4 erase --force + sudo dfu-programmer atmega32u4 flash keebio_iris_rev4_spazz.hex --force diff --git a/config.h b/config.h new file mode 100644 index 0000000..149a54b --- /dev/null +++ b/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#pragma once + +// #define USE_I2C +#define EE_HANDS diff --git a/keymap.c b/keymap.c new file mode 100644 index 0000000..8e7e7c5 --- /dev/null +++ b/keymap.c @@ -0,0 +1,138 @@ +#include QMK_KEYBOARD_H +#include "keymap_french.h" + +#define _QWERTY 0 +#define _LOWER 1 +#define _SHEET 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + SHEET, + + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, FR_RPRN, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ +LT(_LOWER, FR_CIRC),KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_DLR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ +CTL_T(FR_ASTR), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, FR_UGRV, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ +LSFT_T(FR_LABK), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TAB, TG(_SHEET), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(FR_EQL), + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, KC_ENT, KC_ESC, KC_BSPC, KC_SPC, KC_RALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + A(KC_LCTRL), _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, A(KC_TAB), KC_SLEP, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, KC_DEL, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + + [_SHEET] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PAST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + LCTL(FR_S), XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, XXXXXXX, KC_P0, KC_PDOT, _______, KC_PPLS, KC_BSPC, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + XXXXXXX, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +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, _SHEET, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _SHEET, _ADJUST); + } + return false; + break; + case SHEET: + if (record->event.pressed) { + layer_on(_SHEET); + update_tri_layer(_LOWER, _SHEET, _ADJUST); + } else { + layer_off(_SHEET); + update_tri_layer(_LOWER, _SHEET, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_scan_user(void) { + static bool has_run; + if (!has_run) { + has_run = true; + rgblight_disable(); + } +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _SHEET: + rgblight_enable(); + rgblight_sethsv_noeeprom(HSV_WHITE); + break; + default: // for any other layers, or the default layer + rgblight_disable(); + break; + } + return state; +} + diff --git a/rules.mk b/rules.mk new file mode 100644 index 0000000..019c9d7 --- /dev/null +++ b/rules.mk @@ -0,0 +1,20 @@ +MCU = atmega32u4 +BOOTLOADER = qmk-dfu + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +MOUSEKEY_ENABLE = no # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes +ENCODER_ENABLE = no