RP2040 controller support for ffkb v3

This commit is contained in:
Sadek Baroudi 2024-06-06 11:46:58 -07:00
parent 4a88c101ec
commit ed999aef97
5 changed files with 43 additions and 17 deletions

View File

@ -29,13 +29,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROW_PINS_SR { D2, F4, F5, F6, F7, D4 }
// 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
#if defined(CONVERT_TO_ELITE_PI) || defined(CONVERT_TO_RP2040_CE) || defined(CONVERT_TO_HELIOS) || defined(CONVERT_TO_LIATRIS) || defined(CONVERT_TO_KB2040) || defined(CONVERT_TO_PROMICRO_RP2040)
#define SPI_DRIVER SPID0
#endif // CONVERT_TO_(any_rp2040)
#ifdef CONVERT_TO_STEMCELL
#define SPI_DRIVER SPID1
#define SPI_SCK_PAL_MODE 5
#define SPI_MOSI_PAL_MODE 5
#define SPI_MISO_PAL_MODE 5
#endif
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW

View File

@ -17,9 +17,18 @@
#pragma once
#if defined(CONVERT_TO_ELITE_PI) || defined(CONVERT_TO_RP2040_CE) || defined(CONVERT_TO_HELIOS) || defined(CONVERT_TO_LIATRIS) || defined(CONVERT_TO_KB2040) || defined(CONVERT_TO_PROMICRO_RP2040)
#define HAL_USE_PWM TRUE
#define HAL_USE_I2C TRUE
#define HAL_USE_PAL TRUE
#define HAL_USE_SPI TRUE
#endif // CONVERT_TO_(any_rp2040)
#ifdef CONVERT_TO_STEMCELL
#define HAL_USE_SERIAL TRUE
#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
#endif
#include_next "halconf.h"

View File

@ -5,3 +5,8 @@
// Read here for details: https://github.com/sadekbaroudi/qmk_firmware/tree/master/keyboards/fingerpunch#layer-lighting
//#define FP_LAYER_LIGHTING_AUTO_MOUSE_ENABLE
// Sadek: If you are using a white splinky provided by fingerpunch, please uncomment the line below, or even better, add to your personal
// keymap's config.h
// https://github.com/qmk/qmk_firmware/blob/master/docs/platformdev_rp2040.md#rp2040-second-stage-bootloader-selection
// #define RP2040_FLASH_GENERIC_03H

View File

@ -2,24 +2,27 @@
#include_next "mcuconf.h"
#if defined(CONVERT_TO_ELITE_PI) || defined(CONVERT_TO_RP2040_CE) || defined(CONVERT_TO_HELIOS) || defined(CONVERT_TO_LIATRIS) || defined(CONVERT_TO_PROMICRO_RP2040)
#undef RP_I2C_USE_I2C1
#define RP_I2C_USE_I2C1 TRUE
#undef RP_PWM_USE_PWM7
#define RP_PWM_USE_PWM7 TRUE
#undef RP_PWM_USE_TIM1
#define RP_PWM_USE_TIM1 TRUE
#undef RP_SPI_USE_SPI0
#define RP_SPI_USE_SPI0 TRUE
#endif // CONVERT_TO_(any_rp2040)
#ifdef CONVERT_TO_STEMCELL
#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
#define STM32_ST_USE_TIMER 5
#endif // CONVERT_TO_STEMCELL

View File

@ -11,6 +11,8 @@ MCU = atmega32u4
# ATmega328P USBasp
BOOTLOADER = atmel-dfu
PIN_COMPATIBLE=promicro
# Build Options
# change yes to no to disable
#