summaryrefslogtreecommitdiff
path: root/keyboards/tzarc/ghoul/rev1/rp2040
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-10-03 07:24:22 +1100
committerGitHub <noreply@github.com>2022-10-03 07:24:22 +1100
commit9ecd6eb9b9ddf487ced76bf0b5114674cf61432b (patch)
tree3dec8ebc6f6af5995e8b3a59cedb212cf6c94871 /keyboards/tzarc/ghoul/rev1/rp2040
parent2b3f6d0ec6bf504b0b5794bd4f1f3ed7e792a221 (diff)
Add `tzarc/ghoul`. (#18562)
Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/tzarc/ghoul/rev1/rp2040')
-rw-r--r--keyboards/tzarc/ghoul/rev1/rp2040/config.h39
-rw-r--r--keyboards/tzarc/ghoul/rev1/rp2040/halconf.h8
-rw-r--r--keyboards/tzarc/ghoul/rev1/rp2040/info.json15
-rw-r--r--keyboards/tzarc/ghoul/rev1/rp2040/mcuconf.h13
-rw-r--r--keyboards/tzarc/ghoul/rev1/rp2040/rules.mk1
5 files changed, 76 insertions, 0 deletions
diff --git a/keyboards/tzarc/ghoul/rev1/rp2040/config.h b/keyboards/tzarc/ghoul/rev1/rp2040/config.h
new file mode 100644
index 0000000000..c428b26606
--- /dev/null
+++ b/keyboards/tzarc/ghoul/rev1/rp2040/config.h
@@ -0,0 +1,39 @@
+// Copyright 2018-2022 Nick Brassel (@tzarc)
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+#include "config_common.h"
+
+// Matrix configuration
+#define SPI_MATRIX_CHIP_SELECT_PIN GP21
+#define SPI_MATRIX_DIVISOR 16
+
+// Encoder
+#define ENCODER_PUSHBUTTON_PIN GP7
+
+// SPI Configuration
+#define SPI_DRIVER SPID0
+#define SPI_SCK_PIN GP22
+#define SPI_MOSI_PIN GP23
+#define SPI_MISO_PIN GP20
+
+// EEPROM configuration
+#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8
+#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN GP3
+#define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 8
+#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN GP2
+
+// RGB configuration
+#define RGB_DI_PIN GP13
+#define RGB_ENABLE_PIN GP6
+
+// ADC Configuration
+#define ADC_RESOLUTION ? ? ? // ADC_CFGR1_RES_12BIT // TBD when RP2040 has analog support
+#define ADC_SATURATION ? ? ? // ((1 << 12) - 1) // TBD when RP2040 has analog support
+#define ADC_CURRENT_PIN GP26
+#define ADC_VOLTAGE_PIN GP27
+
+// Display Configuration
+#define OLED_CS_PIN GP16
+#define OLED_DC_PIN GP17
+#define OLED_RST_PIN GP18
diff --git a/keyboards/tzarc/ghoul/rev1/rp2040/halconf.h b/keyboards/tzarc/ghoul/rev1/rp2040/halconf.h
new file mode 100644
index 0000000000..a22be02412
--- /dev/null
+++ b/keyboards/tzarc/ghoul/rev1/rp2040/halconf.h
@@ -0,0 +1,8 @@
+// Copyright 2018-2022 Nick Brassel (@tzarc)
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+//#define HAL_USE_ADC TRUE
+#define HAL_USE_SPI TRUE
+
+#include_next <halconf.h>
diff --git a/keyboards/tzarc/ghoul/rev1/rp2040/info.json b/keyboards/tzarc/ghoul/rev1/rp2040/info.json
new file mode 100644
index 0000000000..57b4cb772f
--- /dev/null
+++ b/keyboards/tzarc/ghoul/rev1/rp2040/info.json
@@ -0,0 +1,15 @@
+{
+ "keyboard_name": "Ghoul_RP2040",
+ "processor": "RP2040",
+ "bootloader": "rp2040",
+ "bootloader_instructions": "Hold the boot switch and tap the reset switch, or hold the top-left key when plugging in the board.",
+ "encoder": {
+ "rotary": [
+ {
+ "pin_a": "GP8",
+ "pin_b": "GP5",
+ "resolution": 2
+ }
+ ]
+ }
+}
diff --git a/keyboards/tzarc/ghoul/rev1/rp2040/mcuconf.h b/keyboards/tzarc/ghoul/rev1/rp2040/mcuconf.h
new file mode 100644
index 0000000000..abd4e19f7c
--- /dev/null
+++ b/keyboards/tzarc/ghoul/rev1/rp2040/mcuconf.h
@@ -0,0 +1,13 @@
+// Copyright 2018-2022 Nick Brassel (@tzarc)
+// SPDX-License-Identifier: GPL-3.0-or-later
+#pragma once
+
+#include_next <mcuconf.h>
+
+// Used for RGB
+//#undef RP_ADC_USE_ADC1
+//#define RP_ADC_USE_ADC1 TRUE
+
+// Used for EEPROM
+#undef RP_SPI_USE_SPI0
+#define RP_SPI_USE_SPI0 TRUE
diff --git a/keyboards/tzarc/ghoul/rev1/rp2040/rules.mk b/keyboards/tzarc/ghoul/rev1/rp2040/rules.mk
new file mode 100644
index 0000000000..997fce7e65
--- /dev/null
+++ b/keyboards/tzarc/ghoul/rev1/rp2040/rules.mk
@@ -0,0 +1 @@
+WS2812_DRIVER = vendor