diff --git a/keyboards/bastardkb/dilemma/assembled/assembled.c b/keyboards/bastardkb/dilemma/assembled/assembled.c new file mode 100644 index 000000000000..fa00085ce569 --- /dev/null +++ b/keyboards/bastardkb/dilemma/assembled/assembled.c @@ -0,0 +1,32 @@ +/** + * Copyright 2022 Charly Delay (@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 . + */ + +#include "quantum.h" + +// Forward declare RP2040 SDK declaration. +void gpio_init(uint gpio); + +void keyboard_pre_init_user(void) { + // Ensures that GP26 through GP29 are initialized as digital inputs (as + // opposed to analog inputs). These GPIOs are shared with A0 through A3, + // respectively. On RP2040-B2 and later, the digital inputs are disabled by + // default (see RP2040-E6). + gpio_init(GP26); + gpio_init(GP27); + gpio_init(GP28); + gpio_init(GP29); +} diff --git a/keyboards/bastardkb/dilemma/assembled/config.h b/keyboards/bastardkb/dilemma/assembled/config.h new file mode 100644 index 000000000000..f16b876e2028 --- /dev/null +++ b/keyboards/bastardkb/dilemma/assembled/config.h @@ -0,0 +1,46 @@ +/** + * Copyright 2022 Charly Delay (@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 . + */ + +#pragma once + +/* Key matrix configuration. */ +#define MATRIX_ROW_PINS \ + { GP4, GP5, GP28, GP26 } +#define MATRIX_COL_PINS \ + { GP8, GP9, GP7, GP6, GP27 } + +/* Handedness. */ +#define SPLIT_HAND_PIN GP29 +#define SPLIT_HAND_PIN_LOW_IS_LEFT // High -> right, Low -> left. + +/* serial.c configuration (for split keyboard). */ +#define SOFT_SERIAL_PIN GP1 + +/* CRC. */ +#define CRC8_USE_TABLE +#define CRC8_OPTIMIZE_SPEED + +/* Cirque trackpad. */ +#define SPI_SCK_PIN GP22 +#define SPI_MOSI_PIN GP23 +#define SPI_MISO_PIN GP20 +#define CIRQUE_PINNACLE_SPI_CS_PIN GP21 + +/* Reset. */ +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17 +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U diff --git a/keyboards/bastardkb/dilemma/assembled/halconf.h b/keyboards/bastardkb/dilemma/assembled/halconf.h new file mode 100644 index 000000000000..7a79bec953f6 --- /dev/null +++ b/keyboards/bastardkb/dilemma/assembled/halconf.h @@ -0,0 +1,22 @@ +/** + * Copyright 2022 Charly Delay (@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 . + */ + +#pragma once + +#define HAL_USE_SPI TRUE + +#include_next "halconf.h" diff --git a/keyboards/bastardkb/dilemma/assembled/info.json b/keyboards/bastardkb/dilemma/assembled/info.json new file mode 100644 index 000000000000..26db604554ea --- /dev/null +++ b/keyboards/bastardkb/dilemma/assembled/info.json @@ -0,0 +1,7 @@ +{ + "keyboard_name": "Dilemma Assembled", + "usb": { + "device_version": "1.0.0", + }, +} + diff --git a/keyboards/bastardkb/dilemma/assembled/mcuconf.h b/keyboards/bastardkb/dilemma/assembled/mcuconf.h new file mode 100644 index 000000000000..b54d705b5426 --- /dev/null +++ b/keyboards/bastardkb/dilemma/assembled/mcuconf.h @@ -0,0 +1,23 @@ +/** + * Copyright 2022 Charly Delay (@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 . + */ + +#pragma once + +#include_next "mcuconf.h" + +#undef RP_SPI_USE_SPI1 +#define RP_SPI_USE_SPI1 TRUE diff --git a/keyboards/bastardkb/dilemma/assembled/rules.mk b/keyboards/bastardkb/dilemma/assembled/rules.mk new file mode 100644 index 000000000000..53f09be34a9b --- /dev/null +++ b/keyboards/bastardkb/dilemma/assembled/rules.mk @@ -0,0 +1,12 @@ +# MCU name +MCU = RP2040 + +# Bootloader selection +BOOTLOADER = rp2040 + +# RP2040-specific options +PICO_INTRINSICS_ENABLED = no # ATM Unsupported by ChibiOS. +SERIAL_DRIVER = vendor + +# Assembled version uses SPI instead of I2C. +POINTING_DEVICE_DRIVER = cirque_pinnacle_spi diff --git a/keyboards/bastardkb/dilemma/splinky/config.h b/keyboards/bastardkb/dilemma/splinky/config.h index 80c9e4222486..4ac28ed1f90a 100644 --- a/keyboards/bastardkb/dilemma/splinky/config.h +++ b/keyboards/bastardkb/dilemma/splinky/config.h @@ -1,4 +1,4 @@ -/* +/** * Copyright 2022 Charly Delay (@0xcharly) * * This program is free software: you can redistribute it and/or modify