Skip to content

Commit

Permalink
convert keyball61 to sea picro
Browse files Browse the repository at this point in the history
  • Loading branch information
idank committed May 1, 2024
1 parent 13e0bd9 commit ef9a3dc
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 23 deletions.
Empty file removed keyboards/keyball/keyball61/.noci
Empty file.
27 changes: 17 additions & 10 deletions keyboards/keyball/keyball61/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Key matrix parameters (Keyball61 is duplex matrix)
#define MATRIX_ROWS (5 * 2) // split keyboard
#define MATRIX_COLS (4 * 2) // duplex matrix
#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
#define MATRIX_COL_PINS { F4, F5, F6, F7 }
#define MATRIX_ROW_PINS { GP4, GP5, GP6, GP7, GP8 }
#define MATRIX_COL_PINS { GP29, GP28, GP27, GP26 }
#define MATRIX_MASKED
#define DEBOUNCE 5

// Split parameters
#define SOFT_SERIAL_PIN D2
#define SPLIT_HAND_MATRIX_GRID F7, D7
#define SPLIT_USB_DETECT
#define SPLIT_USB_TIMEOUT 500
#define SERIAL_USART_TX_PIN GP1
#define SPLIT_HAND_MATRIX_GRID GP26, GP6
#define SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT
// #define SPLIT_USB_DETECT
// #define SPLIT_USB_TIMEOUT 500

#define SPLIT_TRANSACTION_IDS_KB KEYBALL_GET_INFO, KEYBALL_GET_MOTION, KEYBALL_SET_CPI

// RGB LED settings
#define WS2812_DI_PIN D3
#define WS2812_DI_PIN GP0
#ifdef RGBLIGHT_ENABLE
# define RGBLED_NUM 74
# define RGBLIGHT_LED_COUNT 74
# define RGBLED_SPLIT { 37, 37 }
# ifndef RGBLIGHT_LIMIT_VAL
# define RGBLIGHT_LIMIT_VAL 120 // limitated for power consumption
Expand All @@ -51,6 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# ifndef RGBLIGHT_SAT_STEP
# define RGBLIGHT_SAT_STEP 17
# endif
# define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL
#endif
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_SPLIT { 37, 37 }
Expand All @@ -64,6 +66,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define LAYER_STATE_8BIT
#endif

#define SPI_DRIVER SPID0
#define SPI_SCK_PIN GP22
#define SPI_MISO_PIN GP20
#define SPI_MOSI_PIN GP23

// To squeeze firmware size
#undef LOCKING_SUPPORT_ENABLE
#undef LOCKING_RESYNC_ENABLE
// #undef LOCKING_SUPPORT_ENABLE
// #undef LOCKING_RESYNC_ENABLE
25 changes: 25 additions & 0 deletions keyboards/keyball/keyball61/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_I2C TRUE
#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD

#include_next <halconf.h>
8 changes: 8 additions & 0 deletions keyboards/keyball/keyball61/info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"processor": "RP2040",
"bootloader": "rp2040",
"usb": {
"vid": "0x5957",
"pid": "0x0100",
Expand All @@ -9,6 +11,12 @@
"rgblight": {
"driver": "ws2812"
},
"ws2812": {
"driver": "vendor"
},
"split": {
"enabled": true
},
"layouts": {
"LAYOUT_no_ball": {
"layout": [
Expand Down
4 changes: 2 additions & 2 deletions keyboards/keyball/keyball61/keymaps/test/rules.mk
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
RGBLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = no

OLED_ENABLE = yes
OLED_ENABLE = no
23 changes: 23 additions & 0 deletions keyboards/keyball/keyball61/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* 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

#include_next <mcuconf.h>

#undef RP_SPI_USE_SPI0
#define RP_SPI_USE_SPI0 TRUE
13 changes: 2 additions & 11 deletions keyboards/keyball/keyball61/rules.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = caterina

# Link Time Optimization required for size.
LTO_ENABLE = yes

# Build Options
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
EXTRAKEY_ENABLE = no # Audio control and System control
Expand All @@ -21,7 +12,7 @@ CUSTOM_MATRIX = lite
SRC += lib/duplexmatrix/duplexmatrix.c

# Split keyboard.
SPLIT_KEYBOARD = yes
SERIAL_DRIVER = vendor

# Optical sensor driver for trackball.
POINTING_DEVICE_ENABLE = yes
Expand All @@ -30,7 +21,7 @@ SRC += drivers/pmw3360/pmw3360.c
QUANTUM_LIB_SRC += spi_master.c # Optical sensor use SPI to communicate

# This is unnecessary for processing KC_MS_BTN*.
MOUSEKEY_ENABLE = no
MOUSEKEY_ENABLE = yes

# Enabled only one of RGBLIGHT and RGB_MATRIX if necessary.
RGBLIGHT_ENABLE = no # Enable RGBLIGHT
Expand Down

0 comments on commit ef9a3dc

Please sign in to comment.