Skip to content

Commit

Permalink
xivik v0.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sadekbaroudi committed May 12, 2024
1 parent c6ac077 commit 92f84ab
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 8 deletions.
25 changes: 19 additions & 6 deletions keyboards/fingerpunch/vulpes_minora/xivik/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef FP_XIVIK_V01
#define MATRIX_ROW_PINS { GP1, GP24, GP9, GP8 }
#define MATRIX_COL_PINS { GP2, GP3, GP4, GP5, GP6 }
#else
#elif defined(FP_XIVIK_V02)
#define MATRIX_ROW_PINS { GP1, GP23, GP20, GP22 }
#define MATRIX_COL_PINS { GP2, GP3, GP5, GP6, GP4 }
#else // If we're here, it's v03
#define MATRIX_ROW_PINS { GP1, GP23, GP20, GP22 }
#define MATRIX_COL_PINS { GP2, GP3, GP6, GP7, GP4 }
#endif

// VIK pin config
Expand All @@ -41,12 +44,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef FP_XIVIK_V01
#define VIK_I2C_SDA_PIN GP22
#define VIK_I2C_SCL_PIN GP23
#else
#else // v0.2 or v0.3
#define VIK_I2C_SDA_PIN GP8
#define VIK_I2C_SCL_PIN GP9
#endif
#if defined(FP_XIVIK_V01) || defined(FP_XIVIK_V02)
#define VIK_GPIO_1 GP18
#define VIK_GPIO_2 GP10
#else // If we're here, it's v03
#define VIK_GPIO_1 GP26
#define VIK_GPIO_2 GP27
#endif
#define VIK_WS2812_DI_PIN GP16

// Used only if you have a weact st7735 display, set to unused pin
Expand All @@ -56,17 +64,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SERIAL_PIO_USE_PIO1
#ifdef FP_XIVIK_V01
#define SERIAL_USART_TX_PIN GP7
#else
#else // v0.2 or v0.3
// USART TX pin
#define SERIAL_USART_TX_PIN GP21
#endif

#define WS2812_DI_PIN GP0

// For VIK modules with encoders
#ifdef ENCODER_ENABLE
// In case there is a VIK module that has an encode
#define ENCODERS_PAD_A { GP18 }
#define ENCODERS_PAD_B { GP10 }
#if defined(FP_XIVIK_V01) || defined(FP_XIVIK_V02)
#define ENCODERS_PAD_A { GP18 }
#define ENCODERS_PAD_B { GP10 }
#else // If we're here, it's v03
#define ENCODERS_PAD_A { GP26 }
#define ENCODERS_PAD_B { GP27 }
#endif
#endif

#ifdef CIRQUE_ENABLE
Expand Down
8 changes: 8 additions & 0 deletions keyboards/fingerpunch/vulpes_minora/xivik/fp_build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"type" : "one-of",
"names" : [
"FP_XIVIK_V01",
"FP_XIVIK_V02"
],
"user_input": "Which version of xivik are you running? Latest v0.3 (0), v0.1 (1), or v0.2 (2)"
},
{
"type" : "one-of",
"names" : [
Expand Down
4 changes: 4 additions & 0 deletions keyboards/fingerpunch/vulpes_minora/xivik/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ SERIAL_DRIVER = vendor

ifeq ($(strip $(FP_XIVIK_V01)), yes)
OPT_DEFS += -DFP_XIVIK_V01
endif

ifeq ($(strip $(FP_XIVIK_V02)), yes)
OPT_DEFS += -DFP_XIVIK_V02
endif
17 changes: 15 additions & 2 deletions keyboards/fingerpunch/xivik/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef FP_XIVIK_V01
#define VIK_I2C_SDA_PIN GP22
#define VIK_I2C_SCL_PIN GP23
#else
#else // v0.2 or v0.3
#define VIK_I2C_SDA_PIN GP8
#define VIK_I2C_SCL_PIN GP9
#endif
#if defined(FP_XIVIK_V01) || defined(FP_XIVIK_V02)
#define VIK_GPIO_1 GP18
#define VIK_GPIO_2 GP10
#else // If we're here, it's v03
#define VIK_GPIO_1 GP26
#define VIK_GPIO_2 GP27
#endif
#define VIK_WS2812_DI_PIN GP16

// Used only if you have a weact st7735 display, set to unused pin
Expand All @@ -63,18 +68,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef FP_XIVIK_V01
#define MATRIX_ROW_PINS { GP24, GP9, GP8, GP7 }
#define MATRIX_COL_PINS { GP0, GP1, GP2, GP3, GP4, GP5, GP6 }
#else
#elif defined(FP_XIVIK_V02)
#define MATRIX_ROW_PINS { GP23, GP20, GP22, GP21 }
#define MATRIX_COL_PINS { GP0, GP1, GP2, GP3, GP5, GP6, GP4 }
#else // If we're here, it's v03
#define MATRIX_ROW_PINS { GP23, GP20, GP22, GP21 }
#define MATRIX_COL_PINS { GP0, GP1, GP2, GP3, GP6, GP7, GP4 }
#endif

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

// For VIK modules with encoders
#ifdef ENCODER_ENABLE
#if defined(FP_XIVIK_V01) || defined(FP_XIVIK_V02)
#define ENCODERS_PAD_A { GP18 }
#define ENCODERS_PAD_B { GP10 }
#else // If we're here, it's v03
#define ENCODERS_PAD_A { GP26 }
#define ENCODERS_PAD_B { GP27 }
#endif
#endif

#ifdef CIRQUE_ENABLE
Expand Down
8 changes: 8 additions & 0 deletions keyboards/fingerpunch/xivik/fp_build.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"type" : "one-of",
"names" : [
"FP_XIVIK_V01",
"FP_XIVIK_V02"
],
"user_input": "Which version of xivik are you running? Latest v0.3 (0), v0.1 (1), or v0.2 (2)"
},
{
"type" : "one-of",
"names" : [
Expand Down
4 changes: 4 additions & 0 deletions keyboards/fingerpunch/xivik/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ ifeq ($(strip $(FP_XIVIK_V01)), yes)
OPT_DEFS += -DFP_XIVIK_V01
endif

ifeq ($(strip $(FP_XIVIK_V02)), yes)
OPT_DEFS += -DFP_XIVIK_V02
endif

include keyboards/fingerpunch/src/rules.mk

0 comments on commit 92f84ab

Please sign in to comment.