diff --git a/keyboards/fingerpunch/fpm101/config.h b/keyboards/fingerpunch/fpm101/config.h new file mode 100644 index 0000000000..4cadf569fe --- /dev/null +++ b/keyboards/fingerpunch/fpm101/config.h @@ -0,0 +1,179 @@ +/* +Copyright 2021 Sadek Baroudi + +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 + + +#pragma once +#include "config_common.h" + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +/* key matrix size */ +/* Rows are doubled up */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 8 + +// SHIFT REGISTER +// Only needed for matrix_74hc595_spi.c +#define SHIFTREG_MATRIX_COL_CS B6 +#define SHIFTREG_DIVISOR 8 // needs to be the same as the PMW33XX_CS_DIVISOR below +#define MATRIX_ROW_PINS_SR { D4, C6, D7, E6, B4, F4, F5, F6, F7 } + +#define RGB_DI_PIN D3 +#ifdef RGBLIGHT_ENABLE + #define RGBLED_NUM 65 + #define RGBLIGHT_HUE_STEP 16 + #define RGBLIGHT_SAT_STEP 16 + #define RGBLIGHT_VAL_STEP 16 + #define RGBLIGHT_LIMIT_VAL 150 /* The maximum brightness level for RGBLIGHT_ENABLE */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ + #define RGBLIGHT_EFFECT_ALTERNATING + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_TWINKLE +#endif + +#ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_LED_COUNT 65 + #define RGB_MATRIX_CENTER {100, 32} + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 /* The maximum brightness level for RGB_MATRIX */ + #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Sets the default brightness value, if none has been set + #define RGB_MATRIX_KEYPRESSES + #define RGB_MATRIX_FRAMEBUFFER_EFFECTS + #define RGB_MATRIX_KEYREACTIVE_ENABLED + #define ENABLE_RGB_MATRIX_ALPHAS_MODS + #define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN + #define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT + #define ENABLE_RGB_MATRIX_BREATHING + #define ENABLE_RGB_MATRIX_BAND_SAT + #define ENABLE_RGB_MATRIX_BAND_VAL + #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT + #define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL + #define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT + #define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL + #define ENABLE_RGB_MATRIX_CYCLE_ALL + #define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT + #define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN + #define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON + #define ENABLE_RGB_MATRIX_DUAL_BEACON + #define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL + #define ENABLE_RGB_MATRIX_CYCLE_SPIRAL + #define ENABLE_RGB_MATRIX_RAINBOW_BEACON + #define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS + #define ENABLE_RGB_MATRIX_RAINDROPS + #define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS + #define ENABLE_RGB_MATRIX_DIGITAL_RAIN + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS + #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + #define ENABLE_RGB_MATRIX_SPLASH + #define ENABLE_RGB_MATRIX_MULTISPLASH + #define ENABLE_RGB_MATRIX_SOLID_SPLASH + #define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif + +/* 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 + +// SPI config for shift register (and trackball if enabled) +#define SPI_DRIVER SPID1 +#define SPI_SCK_PIN B1 +#define SPI_SCK_PAL_MODE 5 +#define SPI_MOSI_PIN B2 +#define SPI_MOSI_PAL_MODE 5 +#define SPI_MISO_PIN B3 +#define SPI_MISO_PAL_MODE 5 + +// If we have audio enabled, that means we're not using the left encoder, as they share a pin on the controller +// Note that you need to solder the jumper on the pcb to use the audio buzzer on the pcb if you are not using the left encoder +#ifdef AUDIO_ENABLE + #define ENCODERS_PAD_A {F1, B7} + #define ENCODERS_PAD_B {F0, D5} +#else + #define ENCODERS_PAD_A {C7, F1, B7} + #define ENCODERS_PAD_B {D2, F0, D5} +#endif + +#ifdef AUDIO_ENABLE + #define AUDIO_VOICES + #define AUDIO_PIN F1 + #define AUDIO_PWM_DRIVER PWMD2 + #define AUDIO_PWM_CHANNEL 1 + #define AUDIO_STATE_TIMER GPTD4 + #define AUDIO_VOICES + // #define AUDIO_PWM_PAL_MODE 42 // only if using AUDIO_DRIVER = pwm_hardware + // #define NO_MUSIC_MODE + #define AUDIO_ENABLE_TONE_MULTIPLEXING + #define AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT 10 + #define FP_AUDIO_MOUSE_BUTTONS + #define FP_AUDIO_CUT_COPY_PASTE + #define FP_AUDIO_SAVE + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define DEFAULT_LAYER_SONGS \ + { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND) } +#endif + +#ifdef HAPTIC_ENABLE + #define FB_ERM_LRA 1 + #define FB_BRAKEFACTOR 3 // For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 + #define FB_LOOPGAIN 1 // For Low:0, Medium:1, High:2, Very High:3 + #define RATED_VOLTAGE 2 + #define V_PEAK 2.8 + #define V_RMS 2.0 + #define F_LRA 150 // resonance freq + #define DRV_GREETING alert_750ms + #define FP_HAPTIC_MOUSE_BUTTONS + #define FP_HAPTIC_CUT_COPY_PASTE + #define FP_HAPTIC_SAVE +#endif + +#ifdef CIRQUE_ENABLE + // cirque trackpad config + #define CIRQUE_PINNACLE_ADDR 0x2A + #define POINTING_DEVICE_ROTATION_90 + #define CIRQUE_PINNACLE_TAP_ENABLE + #define POINTING_DEVICE_TASK_THROTTLE_MS 5 + #define I2C1_CLOCK_SPEED 400000 + #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2 +#endif + +#ifdef FP_TRACKBALL_ENABLE + // Trackball config + #define FP_POINTING_DEFAULT_DPI 800 + #define PMW33XX_CS_PIN B5 + #define PMW33XX_CPI FP_POINTING_DEFAULT_DPI + #define PMW33XX_CS_DIVISOR 8 // needs to be the same as the SHIFTREG_DIVISOR above + #define POINTING_DEVICE_INVERT_Y +#endif + diff --git a/keyboards/fingerpunch/fpm101/fp_build.json b/keyboards/fingerpunch/fpm101/fp_build.json new file mode 100644 index 0000000000..9beb1a7065 --- /dev/null +++ b/keyboards/fingerpunch/fpm101/fp_build.json @@ -0,0 +1,36 @@ +[ + { + "type" : "convert-to", + "name" : "stemcell" + }, + { + "type" : "single", + "name" : "CIRQUE_ENABLE", + "user_input": "Do you have a cirque?" + }, + { + "type" : "single", + "name" : "FP_TRACKBALL_ENABLE", + "user_input": "Do you have a trackball?" + }, + { + "type" : "one-of", + "names" : [ "RGBLIGHT_ENABLE", "RGB_MATRIX_ENABLE" ], + "user_input": "No RGB, RGB light, RGB matrix?" + }, + { + "type" : "single", + "name" : "ENCODER_ENABLE", + "user_input": "Do you have one or more rotary encoders?" + }, + { + "type" : "single", + "name" : "AUDIO_ENABLE", + "user_input": "Do you have an audio buzzer?" + }, + { + "type" : "single", + "name" : "HAPTIC_ENABLE", + "user_input": "Do you have haptic feedback?" + } +] diff --git a/keyboards/fingerpunch/fpm101/fpm101.c b/keyboards/fingerpunch/fpm101/fpm101.c new file mode 100644 index 0000000000..f7b81e8097 --- /dev/null +++ b/keyboards/fingerpunch/fpm101/fpm101.c @@ -0,0 +1,65 @@ +/* Copyright 2021 Sadek Baroudi + * + * 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 . + */ +#include "fpm101.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + { 65, 3, 5, 63, 64, 4, 2, 1 }, + { 58, 10, 8, 60, 59, 9, 11, 12 }, + { 51, 17, 19, 49, 50, 18, 16, 15 }, + { 44, 24, 22, 46, 45, 23, 25, 26 }, + { 38, 30, 32, 36, 37, 31, 29, 28 }, + { 42, 47, 34, 56, 53, 67, 21, 0 }, + { 54, 6, 35, 62, 48, 20, 33, 13 }, + { 41, 7, NO_LED, 61, NO_LED, NO_LED, 27, 14 }, + { 55, 52, 39, 40, 68, 43, 57, 66 } +}, { + {7,1}, {21,1}, {36,2}, {51,1}, {65,5}, {79,10}, {93,14}, + {90,21}, {76,20}, {62,16}, {48,12}, {33,12}, {19,12}, {4,10}, + {2,20}, {16,22}, {31,23}, {46,23}, {60,27}, {74,31}, {88,35}, + {87,50}, {71,42}, {57,38}, {43,33}, {28,34}, {14,33}, {0,31}, + {25,46}, {40,48}, {56,51}, {70,56}, {84,63}, + {99,64}, {112,64}, {125,64}, + {138,63}, {152,56}, {166,51}, {182,48}, {197,46}, {223,31}, {209,33}, + {200,34}, {179,33}, {165,38}, {151,42}, {135,50}, {134,35}, {148,31}, + {162,27}, {176,23}, {191,23}, {206,22}, {220,20}, {218,9}, {203,12}, + {189,12}, {174,12}, {160,16}, {146,20}, {132,24}, {129,14}, {143,10}, + {157,5}, {171,1}, {186,2}, {201,1}, {215,0} +}, { + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 1, 1, 1, 1, + 1, 1, 1, + 1, 1, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1, + 1, 4, 4, 4, 4, 4, 1 +} }; +#endif + +#ifdef AUDIO_ENABLE +// TODO: This is incorrect, see https://github.com/qmk/qmk_firmware/blob/master/docs/feature_audio.md#music-map +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_fpm101( + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 +); +#endif diff --git a/keyboards/fingerpunch/fpm101/fpm101.h b/keyboards/fingerpunch/fpm101/fpm101.h new file mode 100644 index 0000000000..ac747caddc --- /dev/null +++ b/keyboards/fingerpunch/fpm101/fpm101.h @@ -0,0 +1,63 @@ +/* Copyright 2021 Sadek Baroudi + * + * 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 + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +#define ___ KC_NO + +#define LAYOUT_fpm101( \ + K50, K00, K01, K02, K03, K04, K72, K75, K05, K06, K07, K80, K53, K86, \ + K60, K10, K11, K12, K13, K14, K15, K16, K17, K81, K55, K87, \ + K70, K20, K21, K22, K23, K24, K63, K66, K25, K26, K27, K82, K56, K67, \ + K71, K30, K31, K32, K33, K34, K51, K52, K35, K36, K37, K83, K57, K77, \ + K40, K41, K42, K43, K44, K61, K54, K74, K45, K46, K47, K84, K85 \ +) \ +{ \ + { K07, K02, K04, K05, K06, K03, K01, K00 }, \ + { K17, K12, K14, K15, K16, K13, K11, K10 }, \ + { K27, K22, K24, K25, K26, K23, K21, K20 }, \ + { K37, K32, K34, K35, K36, K33, K31, K30 }, \ + { K47, K42, K44, K45, K46, K43, K41, K40 }, \ + { K57, K52, K54, K55, K56, K53, K51, K50 }, \ + { K67, ___, ___, ___, K66, K63, K61, K60 }, \ + { K77, K72, K74, K75, ___, ___, K71, K70 }, \ + { K87, K82, K84, K85, K86, K83, K81, K80 } \ +} +/* +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, ___, K63, ___, ___, K66, K67 }, \ + { K70, K71, K72, ___, K74, K75, ___, K77 }, \ + { K80, K81, K82, K83, K84, K85, K86, K87 } \ +} +*/ + +#include "keyboards/fingerpunch/fp.h" \ No newline at end of file diff --git a/keyboards/fingerpunch/fpm101/halconf.h b/keyboards/fingerpunch/fpm101/halconf.h new file mode 100644 index 0000000000..36e9a5ca3e --- /dev/null +++ b/keyboards/fingerpunch/fpm101/halconf.h @@ -0,0 +1,31 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confupdate -i keyboards/tkw/grandiceps/halconf.h -r platforms/chibios/BLACKPILL_STM32_F411/configs/halconf.h` + */ + +#pragma once + +#define HAL_USE_PWM TRUE +#define HAL_USE_GPT TRUE +#define HAL_USE_SERIAL TRUE +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next diff --git a/keyboards/fingerpunch/fpm101/info.json b/keyboards/fingerpunch/fpm101/info.json new file mode 100644 index 0000000000..25f891ba07 --- /dev/null +++ b/keyboards/fingerpunch/fpm101/info.json @@ -0,0 +1,11 @@ +{ + "manufacturer": "sadekbaroudi", + "keyboard_name": "fpm101", + "url": "https://fingerpunch.xyz/product/fpm101/", + "maintainer": "Sadek Baroudi ", + "usb": { + "vid": "0xFEFE", + "pid": "0xF177", + "device_version": "1.0.0" + } +} diff --git a/keyboards/fingerpunch/fpm101/keymaps/default/keymap.c b/keyboards/fingerpunch/fpm101/keymaps/default/keymap.c new file mode 100644 index 0000000000..7177c7084f --- /dev/null +++ b/keyboards/fingerpunch/fpm101/keymaps/default/keymap.c @@ -0,0 +1,102 @@ +#include QMK_KEYBOARD_H + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +// All the KC_MUTE keycodes below represent the encoders. If you aren't using encoders, you can ignore these: +// --> KC_MUTE, KC_LCTL, KC_LGUI, LOWER, KC_SPC, KC_LALT, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_RALT, KC_SPC, RAISE, KC_RGUI, KC_RCTL, KC_MUTE, <-- +// --> KC_MUTE <-- +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_fpm101( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LPRN, KC_RPRN, 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_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LCBR, KC_RCBR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, ADJUST, ADJUST, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_MUTE, KC_LGUI, LOWER, KC_SPC, KC_LALT, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_RALT, KC_SPC, RAISE, KC_RGUI, KC_MUTE +), + + +[_COLEMAK] = LAYOUT_fpm101( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LPRN, KC_RPRN, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_G, KC_LCBR, KC_RCBR, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, ADJUST, ADJUST, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_MUTE, KC_LGUI, LOWER, KC_SPC, KC_LALT, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, KC_RALT, KC_SPC, RAISE, KC_RGUI, KC_MUTE +), + + +[_LOWER] = LAYOUT_fpm101( + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_RAISE] = LAYOUT_fpm101( + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, + _______, KC_PGUP, KC_UP, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, + KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT_fpm101( + QK_BOOT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, RGB_TOG, RGB_RMOD, RGB_MOD, _______, TG(_QWERTY), _______, _______, _______, KC_F11, KC_F12, _______, + _______, RGB_SPI, RGB_HUI, RGB_SAI, RGB_VAI, TG(_COLEMAK), _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_SPD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + 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; + default: + break; + } + + return true; +} diff --git a/keyboards/fingerpunch/fpm101/keymaps/sadekbaroudi/config.h b/keyboards/fingerpunch/fpm101/keymaps/sadekbaroudi/config.h new file mode 100644 index 0000000000..88f6e06237 --- /dev/null +++ b/keyboards/fingerpunch/fpm101/keymaps/sadekbaroudi/config.h @@ -0,0 +1,2 @@ +// #define FP_LAYER_LIGHTING_HUE_0 HSV_YELLOW +// #define FP_LAYER_LIGHTING_HUE_4 HSV_BLUE diff --git a/keyboards/fingerpunch/fpm101/keymaps/sadekbaroudi/keymap.c b/keyboards/fingerpunch/fpm101/keymaps/sadekbaroudi/keymap.c new file mode 100644 index 0000000000..fb0828e4db --- /dev/null +++ b/keyboards/fingerpunch/fpm101/keymaps/sadekbaroudi/keymap.c @@ -0,0 +1,113 @@ +/* Copyright 2021 Sadek Baroudi + * + * 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 . + */ + +#include "sadekbaroudi.h" +#include QMK_KEYBOARD_H + +// Uncomment to set up WPM +//char wpm_as_str[8]; + +/* + * The `LAYOUT_fpm101_base` macro is a template to allow the use of identical + * modifiers for the default layouts (eg ALPHA_ALT, Alpha, Dvorak, etc), so + * that there is no need to set them up for each layout, and modify all of + * them if I want to change them. This helps to keep consistency and ease + * of use. K## is a placeholder to pass through the individual keycodes + */ + +// clang-format off +#define LAYOUT_fpm101_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + K33, K34, K35, K36, K37, K38 \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, M_KI_R_ANGLE, M_KI_R_FREE, KC_3, KC_4, KC_5, FP_SCROLL_TOG, TO(_GAME), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + M_KI_SEL_TR, K01, K02, K03, LT(_FUNCTION, K04), K05, K06, LT(_FUNCTION, K07), K08, K09, K0A, KC_BSLS, \ + M_KI_MV, LCTL_T(K11), LGUI_T(K12), LALT_T(K13), LSFT_T(K14), K15, KC_MS_BTN1, TO(_NAVIGATION), LT(_MOUSE, K16), RSFT_T(K17), RALT_T(K18), RGUI_T(K19), RCTL_T(K1A), KC_QUOT, \ + M_KI_MVREL, K21, K22, K23, K24, K25, FP_SNIPE_TOG, TO(_ALPHA), K26, K27, K28, K29, K2A, KC_ENT, \ + KC_MUTE, K33, LT(_NAVIGATION,K34), LT(_FUNCTION,K35), KC_LGUI, KC_MS_BTN3, KC_MS_BTN1, KC_MS_BTN2, KC_RGUI, LT(_MEDIA,K36), LT(_SYMBOLS,K37), K38, KC_RCTL \ + ) + +/* Re-pass though to allow templates to be used */ +#define LAYOUT_fpm101_base_wrapper(...) LAYOUT_fpm101_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_ALPHA_ALT] = LAYOUT_fpm101_base_wrapper( + _________________ALPHA_ALT_L1_________________, _________________ALPHA_ALT_R1_________________, + _________________ALPHA_ALT_L2_________________, _________________ALPHA_ALT_R2_________________, + _________________ALPHA_ALT_L3_________________, _________________ALPHA_ALT_R3_________________, + __ALPHA_ALT_THUMBS_6__ + ), + + [_ALPHA] = LAYOUT_fpm101_base_wrapper( + __________________ALPHA_L1____________________, __________________ALPHA_R1____________________, + __________________ALPHA_L2____________________, __________________ALPHA_R2____________________, + __________________ALPHA_L3____________________, __________________ALPHA_R3____________________, + __ALPHA_THUMBS_6__ + ), + + [_NAVIGATION] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, TO(_ALPHA), _______, _______, _______, _______, _______, _______, + _______, ________________NAVIGATION_1_______________, _________________NUMPAD_1__________________, _______, + _______, ________________NAVIGATION_2_______________, _______, TO(_SYMBOLS), _________________NUMPAD_2__________________, _______, + _______, ________________NAVIGATION_3_______________, _______, _______, _________________NUMPAD_3__________________, _______, + _______, _______, _______, KC_TAB, _______, _______, _______, _______, _______, KC_BSPC, KC_SPACE, KC_DOT, _______ + ), + + [_SYMBOLS] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, TO(_NAVIGATION), _______, _______, _______, _______, _______, _______, + _______, ________________SYMBOLS_L1_________________, ________________SYMBOLS_R1_________________, _______, + _______, ________________SYMBOLS_L2_________________, _______, TO(_FUNCTION), ________________SYMBOLS_R2_________________, _______, + _______, ________________SYMBOLS_L3_________________, _______, _______, ________________SYMBOLS_R3_________________, _______, + _______, _______, KC_ENT, KC_DEL, _______, _______, _______, _______, _______, KC_BSPC, _______, _______, _______ + ), + + [_FUNCTION] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, TO(_SYMBOLS), _______, _______, _______, _______, _______, _______, + _______, ________________SHIFTNAV_1_________________, ________________FUNCTION_1_________________, _______, + _______, ________________SHIFTNAV_2_________________, _______, TO(_MEDIA), ________________FUNCTION_2_________________, _______, + _______, ________________SHIFTNAV_3_________________, _______, _______, ________________FUNCTION_3_________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, N_DEL_LINE, KC_SPACE, _______, _______ + ), + + [_MEDIA] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, TO(_FUNCTION), _______, _______, _______, _______, _______, _______, + _______, ___________________RGB_1___________________, _________________MACROS_1__________________, _______, + _______, ___________________RGB_2___________________, _______, TO(_GAME), _________________MACROS_2__________________, _______, + _______, ___________________RGB_3___________________, _______, _______, _________________MACROS_3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_MOUSE] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______, _______, _______, _______, + _______, _______________AUTO_MOUSE_1________________, ___________________BLANK___________________, _______, + _______, _______________AUTO_MOUSE_2________________, _______, KC_NO, ___________________BLANK___________________, _______, + _______, _______________AUTO_MOUSE_3________________, _______, _______, ___________________BLANK___________________, _______, + _______, _______, KC_MS_BTN1, KC_MS_BTN3, _______, _______, _______, _______, _______, KC_MS_BTN3, KC_MS_BTN2, _______, _______ + ), + + [_GAME] = LAYOUT_wrapper( + __GAMES_R0_L__, ___________________GAMES_0_________________, __GAMES_R0_R__, TO(_MEDIA), _______, _______, _______, _______, _______, _______, + __GAMES_R1_L__, ___________________GAMES_1_________________, ___________________BLANK___________________, _______, + __GAMES_R2_L__, ___________________GAMES_2_________________, __GAMES_R2_R__, TO(_ALPHA), ___________________BLANK___________________, _______, + __GAMES_R3_L__, ___________________GAMES_3_________________, __GAMES_R3_R__, _______, ___________________BLANK___________________, _______, + __GAMES_R4_1__, __GAMES_TH_L__, __GAMES_TH_C__, __GAMES_TH_R__, __GAMES_R4_3__, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + diff --git a/keyboards/fingerpunch/fpm101/mcuconf.h b/keyboards/fingerpunch/fpm101/mcuconf.h new file mode 100644 index 0000000000..165cdddbe5 --- /dev/null +++ b/keyboards/fingerpunch/fpm101/mcuconf.h @@ -0,0 +1,52 @@ +/* Copyright 2020 QMK + * + * 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 . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confupdate -i keyboards/tkw/grandiceps/mcuconf.h -r platforms/chibios/BLACKPILL_STM32_F411/configs/mcuconf.h` + */ + +#pragma once + +#include_next "mcuconf.h" + +#undef STM32_SPI_USE_SPI0 +#define STM32_SPI_USE_SPI0 TRUE + +// Added because of this error at compile time +/* +Compiling: keyboards/fingerpunch/ffkb_byomcu/v3/matrix_74hc595_spi.c In file included from ./lib/chibios/os/hal/include/hal_spi_v2.h:146:0, + from ./lib/chibios/os/hal/include/hal_spi.h:31, + from ./lib/chibios/os/hal/include/hal.h:315, + from platforms/chibios/platform_deps.h:18, + from quantum/quantum.h:18, + from keyboards/fingerpunch/ffkb_byomcu/v3/matrix_74hc595_spi.c:3: +./lib/chibios/os/hal/ports/STM32/LLD/SPIv1/hal_spi_v2_lld.h:282:2: error: #error "SPI driver activated but no SPI peripheral assigned" + #error "SPI driver activated but no SPI peripheral assigned" + ^~~~~ + [ERRORS] +*/ +#undef STM32_SPI_USE_SPI1 +#define STM32_SPI_USE_SPI1 TRUE + +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 5 + +#undef STM32_GPT_USE_TIM4 +#define STM32_GPT_USE_TIM4 TRUE + +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE diff --git a/keyboards/fingerpunch/fpm101/readme.md b/keyboards/fingerpunch/fpm101/readme.md new file mode 100644 index 0000000000..fb6a2b1da5 --- /dev/null +++ b/keyboards/fingerpunch/fpm101/readme.md @@ -0,0 +1,30 @@ +# fpm101 + +An ergonomic 70% keyboard + +* Keyboard Maintainer: [sadekbaroudi](https://github.com/sadekbaroudi) + +To build the firmware for this keyboard (after setting up your build environment), select from one of the following, depending on what features you have on your board: +``` + make fingerpunch/fpm101:default RGBLIGHT_ENABLE=yes ENCODER_ENABLE=yes CIRQUE_ENABLE=yes +``` + +Don't forget to add ```CONVERT_TO=stemcell``` if using a stemcell controller. + +Options are: +``` + CIRQUE_ENABLE=yes + FP_TRACKBALL_ENABLE=yes + RGBLIGHT_ENABLE=yes + RGB_MATRIX_ENABLE=yes + ENCODER_ENABLE=yes + AUDIO_ENABLE=yes + HAPTIC_ENABLE=yes +``` + +Example of flashing this keyboard: +``` + make fingerpunch/fpm101:default:flash RGBLIGHT_ENABLE=yes ENCODER_ENABLE=yes CIRQUE_ENABLE=yes +``` + +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). diff --git a/keyboards/fingerpunch/fpm101/rules.mk b/keyboards/fingerpunch/fpm101/rules.mk new file mode 100644 index 0000000000..01407c878b --- /dev/null +++ b/keyboards/fingerpunch/fpm101/rules.mk @@ -0,0 +1,74 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MOUSEKEY_ENABLE = yes + +# Either do RGBLIGHT_ENABLE or RGB_MATRIX_ENABLE and RGB_MATRIX_DRIVER +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = no +RGB_MATRIX_DRIVER = WS2812 + +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +ENCODER_ENABLE = no +# EXTRAFLAGS += -flto # macros disabled, if you need the extra space +MOUSEKEY_ENABLE = no + +SRC += keyboards/fingerpunch/fp_matrix_74hc595_spi.c +QUANTUM_LIB_SRC += spi_master.c +CUSTOM_MATRIX = lite + +AUDIO_ENABLE ?= no +AUDIO_DRIVER = pwm_software + +HAPTIC_ENABLE ?= no +HAPTIC_DRIVER = DRV2605L + +ifeq ($(strip $(CIRQUE_ENABLE)), yes) + MOUSEKEY_ENABLE := yes # not required, but enabling for mouse button keys + POINTING_DEVICE_ENABLE := yes + POINTING_DEVICE_DRIVER := cirque_pinnacle_i2c + OPT_DEFS += -DCIRQUE_ENABLE +endif + +ifeq ($(strip $(FP_TRACKBALL_ENABLE)), yes) + MOUSEKEY_ENABLE := yes # not required, but enabling for mouse button keys + POINTING_DEVICE_ENABLE := yes + POINTING_DEVICE_DRIVER := pmw3360 + QUANTUM_LIB_SRC += spi_master.c + OPT_DEFS += -DFP_TRACKBALL_ENABLE +endif + +DEFERRED_EXEC_ENABLE = yes +SRC += keyboards/fingerpunch/fp.c \ + keyboards/fingerpunch/fp_haptic.c \ + keyboards/fingerpunch/fp_audio.c \ + keyboards/fingerpunch/fp_keyhandler.c \ + keyboards/fingerpunch/fp_pointing.c \ + keyboards/fingerpunch/fp_rgb_common.c \ + keyboards/fingerpunch/fp_rgblight.c \ + keyboards/fingerpunch/fp_rgb_matrix.c diff --git a/users/sadekbaroudi/process_records.h b/users/sadekbaroudi/process_records.h index 351212d1e0..f49d362e34 100755 --- a/users/sadekbaroudi/process_records.h +++ b/users/sadekbaroudi/process_records.h @@ -13,6 +13,7 @@ || defined(KEYBOARD_fingerpunch_ffkb_byomcu_v2) \ || defined(KEYBOARD_fingerpunch_ffkb_byomcu_v3) \ || defined(KEYBOARD_fingerpunch_fflx) \ + || defined(KEYBOARD_fingerpunch_fpm101) \ || defined(KEYBOARD_fingerpunch_luakeeb) \ || defined(KEYBOARD_fingerpunch_pinkiesout_v1) \ || defined(KEYBOARD_fingerpunch_pinkiesout_v2) \ diff --git a/users/sadekbaroudi/wrappers.h b/users/sadekbaroudi/wrappers.h index 07f1c52358..7a3c29b960 100755 --- a/users/sadekbaroudi/wrappers.h +++ b/users/sadekbaroudi/wrappers.h @@ -131,16 +131,20 @@ expanded before being used as arguments to the LAYOUT_xxx macro. # define LAYOUT LAYOUT_badwings #endif -// Since badwings uses the name LAYOUT_badwings instead of LAYOUT +// Since fflx uses the name LAYOUT_fflx instead of LAYOUT #if (!defined(LAYOUT) && defined(LAYOUT_fflx)) # define LAYOUT LAYOUT_fflx #endif -// Since KLOR uses the name LAYOUT_polydactyl instead of LAYOUT +// Since KLOR uses the name LAYOUT_saegewerk instead of LAYOUT #if (!defined(LAYOUT) && defined(LAYOUT_saegewerk)) # define LAYOUT LAYOUT_saegewerk #endif +// Since fpm101 uses the name LAYOUT_fpm101 instead of LAYOUT +#if (!defined(LAYOUT) && defined(LAYOUT_fpm101)) +# define LAYOUT LAYOUT_fpm101 +#endif // clang-format off #define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)