[Keyboard] Add micromod stuff
This commit is contained in:
parent
329380b2e5
commit
e8c54b669f
14 changed files with 274 additions and 0 deletions
48
keyboards/handwired/onekey/micromod/rp2040/config.h
Normal file
48
keyboards/handwired/onekey/micromod/rp2040/config.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
// Copyright 2022 Stefan Kerkmann
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define QMK_WAITING_TEST_BUSY_PIN GP25
|
||||||
|
// #define QMK_WAITING_TEST_YIELD_PIN GP9
|
||||||
|
|
||||||
|
#define I2C_DRIVER I2CD0
|
||||||
|
#define I2C1_SDA_PIN GP4
|
||||||
|
#define I2C1_SCL_PIN GP5
|
||||||
|
#define I2C1_CLOCK_SPEED 400000
|
||||||
|
|
||||||
|
#define BACKLIGHT_PWM_DRIVER PWMD4
|
||||||
|
#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_A
|
||||||
|
|
||||||
|
#define AUDIO_PIN GP13
|
||||||
|
#define AUDIO_PWM_DRIVER PWMD6
|
||||||
|
#define AUDIO_PWM_CHANNEL RP2040_PWM_CHANNEL_B
|
||||||
|
#define AUDIO_SHUTDOWN_PIN GP26
|
||||||
|
#define AUDIO_INIT_DELAY
|
||||||
|
|
||||||
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
|
||||||
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25
|
||||||
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 750U
|
||||||
|
|
||||||
|
#define ENCODERS_PAD_A { GP6 }
|
||||||
|
#define ENCODERS_PAD_B { GP7 }
|
||||||
|
|
||||||
|
|
||||||
|
#define SPI_DRIVER SPID0
|
||||||
|
#define SPI_SCK_PIN GP22
|
||||||
|
#define SPI_MOSI_PIN GP23
|
||||||
|
#define SPI_MISO_PIN GP20
|
||||||
|
|
||||||
|
/* OLED SPI Pins */
|
||||||
|
#define OLED_DC_PIN GP7 // D1
|
||||||
|
#define OLED_RST_PIN GP6 // D0
|
||||||
|
#define OLED_CS_PIN GP21 // SPI_CS
|
||||||
|
|
||||||
|
#define DISPLAY_DC_PIN GP6 // D0
|
||||||
|
#define DISPLAY_RST_PIN GP7 // D1
|
||||||
|
#define DISPLAY_CS_PIN GP21
|
||||||
|
#define DISPLAY_SPI_DIVIDER 16
|
||||||
|
|
||||||
|
/* Divisor for OLED */
|
||||||
|
#define OLED_SPI_DIVISOR 4
|
||||||
|
#define OLED_UPDATE_INTERVAL 1
|
11
keyboards/handwired/onekey/micromod/rp2040/halconf.h
Normal file
11
keyboards/handwired/onekey/micromod/rp2040/halconf.h
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright 2022 Stefan Kerkmann
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define HAL_USE_I2C TRUE
|
||||||
|
#define HAL_USE_PWM TRUE
|
||||||
|
#define HAL_USE_ADC TRUE
|
||||||
|
#define HAL_USE_SPI TRUE
|
||||||
|
|
||||||
|
#include_next <halconf.h>
|
15
keyboards/handwired/onekey/micromod/rp2040/info.json
Normal file
15
keyboards/handwired/onekey/micromod/rp2040/info.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"keyboard_name": "ATP MicroMod RP2040",
|
||||||
|
"processor": "RP2040",
|
||||||
|
"bootloader": "rp2040",
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["GP18"],
|
||||||
|
"rows": ["GP20"]
|
||||||
|
},
|
||||||
|
"backlight": {
|
||||||
|
"pin": "GP13"
|
||||||
|
},
|
||||||
|
"ws2812": {
|
||||||
|
"pin": "GP24"
|
||||||
|
}
|
||||||
|
}
|
20
keyboards/handwired/onekey/micromod/rp2040/mcuconf.h
Normal file
20
keyboards/handwired/onekey/micromod/rp2040/mcuconf.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
// Copyright 2022 Stefan Kerkmann
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include_next <mcuconf.h>
|
||||||
|
|
||||||
|
#undef RP_PWM_USE_PWM4
|
||||||
|
#define RP_PWM_USE_PWM4 TRUE
|
||||||
|
|
||||||
|
#undef RP_PWM_USE_PWM6
|
||||||
|
#define RP_PWM_USE_PWM6 TRUE
|
||||||
|
|
||||||
|
#undef RP_I2C_USE_I2C0
|
||||||
|
#define RP_I2C_USE_I2C0 TRUE
|
||||||
|
|
||||||
|
#define RP_IRQ_RTC_PRIORITY 3
|
||||||
|
|
||||||
|
#undef RP_SPI_USE_SPI0
|
||||||
|
#define RP_SPI_USE_SPI0 TRUE
|
12
keyboards/handwired/onekey/micromod/rp2040/readme.md
Normal file
12
keyboards/handwired/onekey/micromod/rp2040/readme.md
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Raspberry Pi 2040 onekey
|
||||||
|
|
||||||
|
To trigger keypress, short together pins *GP4* and *GP5*.
|
||||||
|
|
||||||
|
Double-tap reset to enter bootloader mode. Copy the built uf2 file to the device by dragging the file to the new USB disk.
|
||||||
|
|
||||||
|
## Supported Hardware
|
||||||
|
|
||||||
|
* Raspberry Pi Pico
|
||||||
|
* SparkFun Pro Micro - RP2040
|
||||||
|
* Adafruit KB2040 - RP2040 Kee Boar
|
||||||
|
* ...and many more RP2040 based development boards
|
8
keyboards/handwired/onekey/micromod/rp2040/rp2040.c
Normal file
8
keyboards/handwired/onekey/micromod/rp2040/rp2040.c
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
void keyboard_pre_init_kb(void) {
|
||||||
|
setPinOutput(GP25);
|
||||||
|
writePinLow(GP25);
|
||||||
|
|
||||||
|
keyboard_pre_init_user();
|
||||||
|
}
|
2
keyboards/handwired/onekey/micromod/rp2040/rules.mk
Normal file
2
keyboards/handwired/onekey/micromod/rp2040/rules.mk
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
AUDIO_ENABLE = yes
|
||||||
|
AUDIO_DRIVER = pwm_hardware
|
48
keyboards/handwired/onekey/micromod/stm32f405/config.h
Normal file
48
keyboards/handwired/onekey/micromod/stm32f405/config.h
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
// Copyright 2022 Stefan Kerkmann
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define QMK_WAITING_TEST_BUSY_PIN A15
|
||||||
|
// #define QMK_WAITING_TEST_YIELD_PIN GP9
|
||||||
|
|
||||||
|
#define I2C_DRIVER I2CD2
|
||||||
|
#define I2C1_SDA_PIN B11
|
||||||
|
#define I2C1_SCL_PIN B10
|
||||||
|
|
||||||
|
#define I2C1_CLOCK_SPEED 400000
|
||||||
|
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_16_9
|
||||||
|
|
||||||
|
#define BACKLIGHT_PWM_DRIVER PWMD8
|
||||||
|
#define BACKLIGHT_PWM_CHANNEL 2
|
||||||
|
#define BACKLIGHT_PAL_MODE 3
|
||||||
|
|
||||||
|
#define AUDIO_PIN C6
|
||||||
|
|
||||||
|
#define AUDIO_PWM_DRIVER PWMD8
|
||||||
|
#define AUDIO_PWM_CHANNEL 1
|
||||||
|
#define AUDIO_PWM_PAL_MODE 3
|
||||||
|
#define AUDIO_SHUTDOWN_PIN C5
|
||||||
|
#define AUDIO_INIT_DELAY
|
||||||
|
|
||||||
|
#define ENCODERS_PAD_A { C0 }
|
||||||
|
#define ENCODERS_PAD_B { C1 }
|
||||||
|
|
||||||
|
#define SPI_DRIVER SPID1
|
||||||
|
#define SPI_SCK_PIN A5
|
||||||
|
#define SPI_MOSI_PIN A7
|
||||||
|
#define SPI_MISO_PIN A6
|
||||||
|
|
||||||
|
/* OLED SPI Pins */
|
||||||
|
#define OLED_DC_PIN C1
|
||||||
|
#define OLED_RST_PIN C0
|
||||||
|
#define OLED_CS_PIN C4
|
||||||
|
|
||||||
|
#define DISPLAY_CS_PIN C4 // SPI CS
|
||||||
|
#define DISPLAY_DC_PIN C0 // D0
|
||||||
|
#define DISPLAY_RST_PIN C1 // D1
|
||||||
|
#define DISPLAY_SPI_DIVIDER 16
|
||||||
|
|
||||||
|
/* Divisor for OLED */
|
||||||
|
#define OLED_SPI_DIVISOR 4
|
||||||
|
#define OLED_UPDATE_INTERVAL 1
|
25
keyboards/handwired/onekey/micromod/stm32f405/halconf.h
Normal file
25
keyboards/handwired/onekey/micromod/stm32f405/halconf.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/* Copyright 2021 QMK
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#ifdef AUDIO_DRIVER_DAC
|
||||||
|
#define HAL_USE_GPT TRUE
|
||||||
|
#define HAL_USE_DAC TRUE
|
||||||
|
#endif
|
||||||
|
#define HAL_USE_PWM TRUE
|
||||||
|
|
||||||
|
#include_next <halconf.h>
|
15
keyboards/handwired/onekey/micromod/stm32f405/info.json
Normal file
15
keyboards/handwired/onekey/micromod/stm32f405/info.json
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"keyboard_name": "ATP MicroMod STM32F405",
|
||||||
|
"processor": "STM32F405",
|
||||||
|
"bootloader": "stm32-dfu",
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["A0"],
|
||||||
|
"rows": ["C9"]
|
||||||
|
},
|
||||||
|
"backlight": {
|
||||||
|
"pin": "C7"
|
||||||
|
},
|
||||||
|
"ws2812": {
|
||||||
|
"pin": "C7"
|
||||||
|
}
|
||||||
|
}
|
54
keyboards/handwired/onekey/micromod/stm32f405/mcuconf.h
Normal file
54
keyboards/handwired/onekey/micromod/stm32f405/mcuconf.h
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
/* Copyright 2021 QMK
|
||||||
|
*
|
||||||
|
* 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 3 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 <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include_next <mcuconf.h>
|
||||||
|
|
||||||
|
#if HAL_USE_ADC==TRUE
|
||||||
|
#undef STM32_ADC_USE_ADC1
|
||||||
|
#define STM32_ADC_USE_ADC1 TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAL_USE_I2C==TRUE
|
||||||
|
#undef STM32_I2C_USE_I2C2
|
||||||
|
#define STM32_I2C_USE_I2C2 TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAL_USE_SPI==TRUE
|
||||||
|
#undef STM32_SPI_USE_SPI1
|
||||||
|
#define STM32_SPI_USE_SPI1 TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WS2812_PWM
|
||||||
|
#undef STM32_PWM_USE_TIM3
|
||||||
|
#define STM32_PWM_USE_TIM3 TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef BACKLIGHT_PWM
|
||||||
|
#undef STM32_PWM_USE_TIM8
|
||||||
|
#define STM32_PWM_USE_TIM8 TRUE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIO_DRIVER_DAC
|
||||||
|
#undef STM32_DAC_USE_DAC1_CH1
|
||||||
|
#define STM32_DAC_USE_DAC1_CH1 TRUE
|
||||||
|
#undef STM32_DAC_USE_DAC1_CH2
|
||||||
|
#define STM32_DAC_USE_DAC1_CH2 TRUE
|
||||||
|
|
||||||
|
#undef STM32_GPT_USE_TIM6
|
||||||
|
#define STM32_GPT_USE_TIM6 TRUE
|
||||||
|
#endif
|
7
keyboards/handwired/onekey/micromod/stm32f405/readme.md
Normal file
7
keyboards/handwired/onekey/micromod/stm32f405/readme.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Adafruit Feather STM32F405 Express onekey
|
||||||
|
|
||||||
|
* Supported Hardware: [Adafruit Feather STM32F405 Express](https://www.adafruit.com/product/4382)
|
||||||
|
|
||||||
|
To trigger keypress, short together pins *GPIO 12 / PC2* and *GPIO 11 / PC3*.
|
||||||
|
|
||||||
|
https://learn.adafruit.com/adafruit-stm32f405-feather-express/dfu-bootloader-details#enabling-dfu-bootloader-mode-3045622-2
|
1
keyboards/handwired/onekey/micromod/stm32f405/rules.mk
Normal file
1
keyboards/handwired/onekey/micromod/stm32f405/rules.mk
Normal file
|
@ -0,0 +1 @@
|
||||||
|
AUDIO_DRIVER = pwm_hardware
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
void keyboard_pre_init_kb(void) {
|
||||||
|
setPinOutput(A15);
|
||||||
|
writePinLow(A15);
|
||||||
|
|
||||||
|
keyboard_pre_init_user();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue