Skip to content

Commit

Permalink
Merge pull request qmk#14 from sadekbaroudi/fp/rockon_v3
Browse files Browse the repository at this point in the history
rock on v3 firmware support
  • Loading branch information
sadekbaroudi authored Oct 6, 2022
2 parents e0ecd57 + eda041f commit 78f5880
Show file tree
Hide file tree
Showing 18 changed files with 748 additions and 22 deletions.
19 changes: 1 addition & 18 deletions keyboards/fingerpunch/rockon/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MANUFACTURER sadekbaroudi
#define PRODUCT sadekbaroudi rockon

/* key matrix size */
/* Rows are doubled up */
#define MATRIX_ROWS 8
#define MATRIX_COLS 9

// wiring
#define MATRIX_ROW_PINS \
{ B6, F4, B5, B4, B2, B3, B7, D5 }
#define MATRIX_COL_PINS \
{ D2, D4, C6, D7, E6, F5, F6, F7, B1 }

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

Expand All @@ -49,7 +38,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGBLIGHT_HUE_STEP 16
#define RGBLIGHT_SAT_STEP 16
#define RGBLIGHT_VAL_STEP 16
#define RGBLIGHT_LIMIT_VAL 60 /* The maximum brightness level for RGBLIGHT_ENABLE */
#define RGBLIGHT_LIMIT_VAL 120 /* 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
Expand Down Expand Up @@ -110,9 +99,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE

//#define DYNAMIC_KEYMAP_LAYER_COUNT 5

#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#endif
2 changes: 2 additions & 0 deletions keyboards/fingerpunch/rockon/rockon.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# include "v1.h"
#elif defined(KEYBOARD_fingerpunch_rockon_v2)
# include "v2.h"
#elif defined(KEYBOARD_fingerpunch_rockon_v3)
# include "v3.h"
#endif

#include "keyboards/fingerpunch/fp.h"
15 changes: 15 additions & 0 deletions keyboards/fingerpunch/rockon/v1/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once

#define DEVICE_VER 0x0001

/* key matrix size */
/* Rows are doubled up */
#define MATRIX_ROWS 8
#define MATRIX_COLS 9

// wiring
#define MATRIX_ROW_PINS \
{ B6, F4, B5, B4, B2, B3, B7, D5 }
#define MATRIX_COL_PINS \
{ D2, D4, C6, D7, E6, F5, F6, F7, B1 }

#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#endif
16 changes: 16 additions & 0 deletions keyboards/fingerpunch/rockon/v2/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define DEVICE_VER 0x0002

/* key matrix size */
/* Rows are doubled up */
#define MATRIX_ROWS 8
#define MATRIX_COLS 9

// wiring
#define MATRIX_ROW_PINS \
{ B6, F4, B5, B4, B2, B3, B7, D5 }
#define MATRIX_COL_PINS \
{ D2, D4, C6, D7, E6, F5, F6, F7, B1 }


/* encoder config */
#define ENCODERS_PAD_A {F0, C7}
#define ENCODERS_PAD_B {F1, F1}
Expand All @@ -45,3 +57,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#define I2C1_CLOCK_SPEED 400000
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2

#ifdef OLED_ENABLE
#define OLED_DISPLAY_128X64
#endif
83 changes: 83 additions & 0 deletions keyboards/fingerpunch/rockon/v3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
Copyright 2021 Sadek Baroudi <sadekbaroudi@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/>.
*/

#pragma once

#define DEVICE_VER 0x0003


/* 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
#ifdef RGBLED_NUM
#undef RGBLED_NUM
#endif
#define RGBLED_NUM 69
#endif

#ifdef RGB_MATRIX_ENABLE
#ifdef DRIVER_LED_TOTAL
#undef DRIVER_LED_TOTAL
#endif
#define DRIVER_LED_TOTAL 69
#endif

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

/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

#define ENCODERS_PAD_A {C7, D5, F1}
#define ENCODERS_PAD_B {D2, B7, F0}

#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

#define DYNAMIC_KEYMAP_LAYER_COUNT 5
22 changes: 22 additions & 0 deletions keyboards/fingerpunch/rockon/v3/fp_build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"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?"
}
]
30 changes: 30 additions & 0 deletions keyboards/fingerpunch/rockon/v3/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// BEGIN SADEK PWM LED testing
/* 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 <http://www.gnu.org/licenses/>.
*/

/*
* 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_SERIAL TRUE
#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD

#include_next <halconf.h>
107 changes: 107 additions & 0 deletions keyboards/fingerpunch/rockon/v3/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#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_rockon(
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_LBRC, KC_RBRC, 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_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
),


[_COLEMAK] = LAYOUT_rockon(
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_LBRC, KC_RBRC, 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_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
),


[_LOWER] = LAYOUT_rockon(
KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______
),

[_RAISE] = LAYOUT_rockon(
KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______,
_______, KC_PGUP, KC_UP, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______
),

[_ADJUST] = LAYOUT_rockon(
RESET, 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;
}
2 changes: 2 additions & 0 deletions keyboards/fingerpunch/rockon/v3/keymaps/sadekbaroudi/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// #define FP_LAYER_LIGHTING_HUE_0 HSV_YELLOW
// #define FP_LAYER_LIGHTING_HUE_4 HSV_BLUE
Loading

0 comments on commit 78f5880

Please sign in to comment.