Skip to content

Commit

Permalink
ximi v2 firmware added, and v1 moved into its own subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
sadekbaroudi committed Apr 13, 2024
1 parent 0ec94ff commit ca35e3a
Show file tree
Hide file tree
Showing 35 changed files with 926 additions and 174 deletions.
3 changes: 2 additions & 1 deletion keyboards/fingerpunch/src/vik/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ ifeq ($(strip $(VIK_TRACKPOINT)), yes)
# The only thing that's left is busywait, which is not recommended by QMK, and also requires PAL_MODE_OUTPUT_OPENDRAIN
# https://github.com/qmk/qmk_firmware/blob/master/docs/feature_ps2_mouse.md#busywait-version-idbusywait-version

# So, our only option is to use two consecutive pins, which means we can't even use the VIK connector...
# So, our only option is to use two consecutive pins, which means we can't even use the VIK connector unless GPIO AD1 and AD2
# are consecutive, as defined by the RP2040 vendor driver, check QMK docs

# Options are:
# 1) hand wire from VIK module to a PCB with consecutive GPIO available (assuming RP2040), or hand wire to any two GPIO for non-RP2040 controllers. This also requires a bodge for 3.3v (untested) or a logic level conversion between 3.3v and 5v if using a 3.3v controller
Expand Down
19 changes: 5 additions & 14 deletions keyboards/fingerpunch/ximi/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 8
#define MATRIX_COLS 8

// For shift register (and optionally trackball)
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

// For General SPI pins and VIK on v2
#define SPI_DRIVER SPID0
#define SPI_SCK_PIN GP22
#define SPI_MOSI_PIN GP23
#define SPI_MISO_PIN GP20

// wiring of each half
#define MATRIX_ROW_PINS { GP29, GP28, GP27, GP24 }
#define MATRIX_COL_PINS { GP10, GP11, GP26, GP12, GP13, GP14, GP15, GP16 }

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

#define ENCODERS_PAD_A { GP7 }
#define ENCODERS_PAD_B { GP8 }

Expand Down Expand Up @@ -179,12 +176,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PMW33XX_CS_PIN GP9
#define PMW33XX_CPI 1000
#define PMW33XX_CS_DIVISOR 8

/* SPI config for pmw3360 sensor. */
#define SPI_DRIVER SPID0
// #define SPI_SCK_PAL_MODE 5 // already defined in chibios
// #define SPI_MOSI_PAL_MODE 5 // already defined in chibios
// #define SPI_MISO_PAL_MODE 5 // already defined in chibios
#endif

// All the possible configurations of pointing devices
Expand Down
7 changes: 4 additions & 3 deletions keyboards/fingerpunch/ximi/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ ifeq ($(strip $(FP_SPLIT_RIGHT)), yes)
OPT_DEFS += -DFP_SPLIT_RIGHT
endif

# include here so that if VIK enables the PMW3360, the OPT_DEFS get set appropriately for ximi
include keyboards/fingerpunch/src/rules.mk

ifeq ($(strip $(CIRQUE_ENABLE)), yes)
POINTING_DEVICE_ENABLE := yes
POINTING_DEVICE_DRIVER := cirque_pinnacle_spi
Expand All @@ -134,6 +137,4 @@ ifeq ($(strip $(PMW3360_ENABLE)), yes)
POINTING_DEVICE_DRIVER := pmw3360
QUANTUM_LIB_SRC += spi_master.c
OPT_DEFS += -DFP_TRACKBALL_ENABLE
endif

include keyboards/fingerpunch/src/rules.mk
endif
23 changes: 23 additions & 0 deletions keyboards/fingerpunch/ximi/v1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Copyright 2012 Jun Wako <wakojun@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

// wiring of each half
#define MATRIX_ROW_PINS { GP29, GP28, GP27, GP24 }
#define MATRIX_COL_PINS { GP10, GP11, GP26, GP12, GP13, GP14, GP15, GP16 }

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manufacturer": "sadekbaroudi",
"keyboard_name": "ximi",
"keyboard_name": "ximi v1",
"url": "https://fingerpunch.xyz/product/ximi/",
"maintainer": "Sadek Baroudi <sadekbaroudi@gmail.com>",
"usb": {
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
152 changes: 152 additions & 0 deletions keyboards/fingerpunch/ximi/v1/v1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/* 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/>.
*/
#include "v1.h"

#ifdef RGB_MATRIX_ENABLE

// Layout
//
//┌────────────────────────┐ ┌────────────────────────┐
//│ 18 17 12 11 06 05 │ │ 26 27 32 33 38 39 │
//│────────────────────────┤ ├────────────────────────│
//│ 19 16 13 10 07 04 │ │ 25 28 31 34 37 40 │
//├────────────────────────┤ ├────────────────────────┤
//│ 20 15 14 09 08 03 │ │ 24 29 30 35 36 41 │
//└───────────────────┬────┴───────┐ ┌───────┴────┬───────────────────┘
// │ 02 01 00 │ │ 21 22 23 │
// └────────────┘ └────────────┘
//
//

// use this matrix if you use the 6 column layout ----------------------------------------------

led_config_t g_led_config = { {
//COL 00 01 02 03 04 05 06 ROW
{ 18, 17, 12, 11, 6, 5, 2 },//00
{ 19, 16, 13, 10, 7, 4, 1 },//01
{ 20, 15, 14, 9, 8, 3, 0 },//02
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },//03
{ 39, 38, 33, 32, 27, 26, 23 },//00
{ 40, 37, 34, 31, 28, 25, 22 },//01
{ 41, 36, 35, 30, 29, 24, 21 },//02
{ NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED },//03
}, {
// Left
{93 , 63}, // Thumb reachy
{77 , 55}, // Thumb homing
{61 , 50}, // Thumb tucky
{81 , 38}, // C5 R3
{85 , 25}, // C5 R2
{89 , 12}, // C5 R1
{74 , 6}, // C4 R1
{70 , 20}, // C4 R2
{66 , 33}, // C4 R3
{52 , 26}, // C3 R3
{56 , 12}, // C3 R2
{60 , 0}, // C3 R1
{43 , 0}, // C2 R1
{39 , 12}, // C2 R2
{35 , 26}, // C2 R3
{17 , 31}, // C1 R3
{21 , 18}, // C1 R2
{25 , 4}, // C1 R1
{7 , 5}, // C0 R1
{3 , 19}, // C0 R2
{0 , 32}, // C0 R3
// Right
{129, 63}, // Thumb reachy
{145, 55}, // Thumb homing
{161, 50}, // Thumb tucky
{141, 38}, // C6 R3 (or C5)
{137, 25}, // C6 R2 (or C5)
{133, 12}, // C6 R1 (or C5)
{148, 6}, // C7 R1 (or C4)
{152, 20}, // C7 R2 (or C4)
{156, 33}, // C7 R3 (or C4)
{170, 26}, // C8 R3 (or C3)
{166, 12}, // C8 R2 (or C3)
{162, 0}, // C8 R1 (or C3)
{179, 0}, // C9 R1 (or C2)
{183, 12}, // C9 R2 (or C2)
{187, 26}, // C9 R3 (or C2)
{205, 31}, // C10 R3 (or C1)
{201, 18}, // C10 R2 (or C1)
{197, 4}, // C10 R1 (or C1)
{215, 5}, // C11 R1 (or C0)
{219, 19}, // C11 R2 (or C0)
{223, 32} // C11 R3 (or C0)
}, {
//LEFT
1, 1, 1, // 1, 9, 1, // change to this if you want the thumb home key to be highlighted as a home row key color
4, 4, 4,
4, 12, 4,
4, 12, 4,
4, 12, 4,
4, 12, 4,
1, 1, 1,
//RIGHT
1, 1, 1, // 1, 9, 1, // change to this if you want the thumb home key to be highlighted as a home row key color
4, 4, 4,
4, 12, 4,
4, 12, 4,
4, 12, 4,
4, 12, 4,
1, 1, 1
} };

// -----------------------------------------------------------------------------------------------


// use this matrix if you use the 5 column layout ──────────────────────────────────────────┐
/*
led_config_t g_led_config = { {
//COL 00 01 02 03 04 05 ROW
{ NO_LED, 17, 12, 11, 5, 4 },//00
{ NO_LED, 16, 13, 10, 6, 3 },//01
{ NO_LED, 15, 14, 9, 7, 2 },//02
{ NO_LED, 8, 1, 0, NO_LED, NO_LED },//03
{ NO_LED, 35, 30, 29, 23, 22 },//00
{ NO_LED, 34, 31, 28, 24, 21 },//01
{ NO_LED, 33, 32, 27, 25, 20 },//02
{ NO_LED, 26, 19, 18, NO_LED, NO_LED } //03
}, {
//LEFT
//thumb1 ▼ thumb2 ▼ thumb3 ▼ C0 R3 ▼ C0 R2 ▼ C0 R1 ▼ C1 R1 ▼
{ 89, 54 }, { 74, 49 }, { 75, 34 }, { 75, 21 }, { 75, 8 }, { 60, 6 },
//C1 R2 ▼ C1 R3 ▼ thumb4 ▼ C2 R3 ▼ C2 R2 ▼ C2 R1 ▼ C3 R1 ▼
{ 60, 19 }, { 60, 32 }, { 58, 48 }, { 46, 25 }, { 46, 12 }, { 46, 0 }, { 29, 7 },
//C3 R2 ▼ C3 R3 ▼ C4 R3 ▼ C4 R2 ▼ C4 R1 ▼ C5 R2 ▼ C5 R3 ▼
{ 30, 20 }, { 31, 33 }, { 17, 42 }, { 15, 30 }, { 13, 17 },
//RIGHT
//thumb1 ▼ thumb2 ▼ thumb3 ▼ C0 R3 ▼ C0 R2 ▼ C0 R1 ▼ C1 R1 ▼
{ 135, 54 }, { 150, 49 }, { 149, 34 }, { 149, 21 }, { 149, 8 }, { 163, 6 },
//C1 R2 ▼ C1 R3 ▼ thumb4 ▼ C2 R3 ▼ C2 R2 ▼ C2 R1 ▼ C3 R1 ▼
{ 163, 19 }, { 163, 32 }, { 166, 48 }, { 178, 25 }, { 178, 12 }, { 178, 0 }, { 195, 7 },
//C3 R2 ▼ C3 R3 ▼ C4 R3 ▼ C4 R2 ▼ C4 R1 ▼ C5 R2 ▼ C5 R3 ▼
{ 194, 20 }, { 193, 33 }, { 206, 42 }, { 209, 30 }, { 211, 17 }
}, {
//LEFT
1, 1, 4, 4, 4, 4,
4, 4, 1, 4, 4, 4, 4,
4, 4, 4, 4, 4,
//RIGHT
1, 1, 4, 4, 4, 4,
4, 4, 1, 4, 4, 4, 4,
4, 4, 4, 4, 4
} };
*/
// ────────────────────────────────────────────────────────────────────────────────────────────────────┘
#endif
22 changes: 22 additions & 0 deletions keyboards/fingerpunch/ximi/v1/v1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once
#include "quantum.h"

#define ___ KC_NO

#define LAYOUT_ximi( \
K00, K01, K02, K03, K04, K05, K35, K34, K33, K32, K31, K30, \
K10, K11, K12, K13, K14, K15, K45, K44, K43, K42, K41, K40, \
K20, K21, K22, K23, K24, K25, K55, K54, K53, K52, K51, K50, \
K98, K06, K16, K26, K56, K46, K36, K99, \
K07, K17, K27, K57, K47, K37 \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
{ ___, ___, K98, ___, ___, ___, ___, ___ }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ ___, ___, K99, ___, ___, ___, ___, ___ } \
}
39 changes: 39 additions & 0 deletions keyboards/fingerpunch/ximi/v2/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
Copyright 2012 Jun Wako <wakojun@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

// wiring of each half
#define MATRIX_ROW_PINS { GP29, GP4, GP5, GP24 }
#define MATRIX_COL_PINS { GP10, GP11, GP6, GP12, GP13, GP14, GP15, GP16 }

// VIK pin config
#define VIK_SPI_DRIVER SPID0
#define VIK_SPI_SCK_PIN GP22
#define VIK_SPI_MOSI_PIN GP23
#define VIK_SPI_MISO_PIN GP20
#define VIK_SPI_CS GP9
#define VIK_I2C_DRIVER I2CD1
#define VIK_I2C_SDA_PIN GP2
#define VIK_I2C_SCL_PIN GP3
#define VIK_GPIO_1 GP27
#define VIK_GPIO_2 GP26
#define VIK_WS2812_DI_PIN GP25

// Used only if you have a weact st7735 display, set to unused pin
#define VIK_ST7735_UNUSED_PIN GP15
#define FP_QP_ROTATION QP_ROTATION_270
44 changes: 44 additions & 0 deletions keyboards/fingerpunch/ximi/v2/fp_build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"type" : "one-of",
"names" : [
"FP_TRACKBALL_BOTH",
"FP_CIRQUE_BOTH",
"FP_TRACKBALL_LEFT_ONLY",
"FP_TRACKBALL_RIGHT_ONLY",
"FP_CIRQUE_LEFT_ONLY",
"FP_CIRQUE_RIGHT_ONLY",
"FP_TRACKBALL_LEFT_CIRQUE_RIGHT",
"FP_CIRQUE_LEFT_TRACKBALL_RIGHT"
],
"user_input": "What config would you like to use? (NONE, FP_TRACKBALL_BOTH, FP_CIRQUE_BOTH, FP_TRACKBALL_LEFT_ONLY, FP_TRACKBALL_RIGHT_ONLY, FP_CIRQUE_LEFT_ONLY, FP_CIRQUE_RIGHT_ONLY, FP_TRACKBALL_LEFT_CIRQUE_RIGHT, FP_CIRQUE_LEFT_TRACKBALL_RIGHT):"
},
{
"type" : "one-of",
"names" : [
"FP_SPLIT_LEFT",
"FP_SPLIT_RIGHT"
],
"user_input": "This is only applicable if you are doing mixed pointing devices. 0 if not applicable, 1 to build left firmware, 2 to build right firmware:"
},
{
"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?"
}
]
25 changes: 25 additions & 0 deletions keyboards/fingerpunch/ximi/v2/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
*
* 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 HAL_USE_SPI TRUE
#define HAL_USE_I2C TRUE
#define HAL_USE_PWM TRUE
#define HAL_USE_PAL TRUE

#include_next "halconf.h"
11 changes: 11 additions & 0 deletions keyboards/fingerpunch/ximi/v2/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"manufacturer": "sadekbaroudi",
"keyboard_name": "ximi v2",
"url": "https://fingerpunch.xyz/product/ximi-v2/",
"maintainer": "Sadek Baroudi <sadekbaroudi@gmail.com>",
"usb": {
"vid": "0xFEFE",
"pid": "0xB171",
"device_version": "2.0.0"
}
}
Loading

0 comments on commit ca35e3a

Please sign in to comment.