diff --git a/keyboards/handwired/onekey/rando_stm32f407/board.h b/keyboards/handwired/onekey/rando_stm32f407/board.h new file mode 100644 index 0000000000..e3b0ab419f --- /dev/null +++ b/keyboards/handwired/onekey/rando_stm32f407/board.h @@ -0,0 +1,26 @@ +/* Copyright 2020 Nick Brassel (tzarc) + * + * 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 . + */ +#pragma once + +#include_next + +#undef STM32_HSECLK +#define STM32_HSECLK 8000000U +#undef STM32_LSECLK +#define STM32_LSECLK 32768U + +#undef STM32_HSE_BYPASS +#define BOARD_OTG_NOVBUSSENS diff --git a/keyboards/handwired/onekey/rando_stm32f407/config.h b/keyboards/handwired/onekey/rando_stm32f407/config.h new file mode 100644 index 0000000000..4401623e85 --- /dev/null +++ b/keyboards/handwired/onekey/rando_stm32f407/config.h @@ -0,0 +1,8 @@ +// Copyright 2021 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define ADC_PIN A0 + +#define SOLENOID_PINS { B12, B13, B14, B15 } +#define SOLENOID_PINS_ACTIVE_STATE { high, high, low } diff --git a/keyboards/handwired/onekey/rando_stm32f407/halconf.h b/keyboards/handwired/onekey/rando_stm32f407/halconf.h new file mode 100644 index 0000000000..e3fd1cf6e1 --- /dev/null +++ b/keyboards/handwired/onekey/rando_stm32f407/halconf.h @@ -0,0 +1,10 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#define HAL_USE_ADC TRUE +#define HAL_USE_SPI TRUE +#define HAL_USE_I2C TRUE +#define HAL_USE_PWM TRUE + +#include_next diff --git a/keyboards/handwired/onekey/rando_stm32f407/keyboard.json b/keyboards/handwired/onekey/rando_stm32f407/keyboard.json new file mode 100644 index 0000000000..ea5c0c8602 --- /dev/null +++ b/keyboards/handwired/onekey/rando_stm32f407/keyboard.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "Onekey STM32F407VE", + "processor": "STM32F407", + "bootloader": "stm32-dfu", + "matrix_pins": { + "cols": ["A2"], + "rows": ["A1"] + }, + "backlight": { + "pin": "B8" + }, + "ws2812": { + "pin": "A0" + }, + "apa102": { + "data_pin": "A0", + "clock_pin": "B13" + } +} diff --git a/keyboards/handwired/onekey/rando_stm32f407/mcuconf.h b/keyboards/handwired/onekey/rando_stm32f407/mcuconf.h new file mode 100644 index 0000000000..a0145d41d3 --- /dev/null +++ b/keyboards/handwired/onekey/rando_stm32f407/mcuconf.h @@ -0,0 +1,40 @@ +// Copyright 2023 Nick Brassel (@tzarc) +// SPDX-License-Identifier: GPL-2.0-or-later +#pragma once + +#include_next + +#undef STM32_ADC_USE_ADC1 +#define STM32_ADC_USE_ADC1 TRUE + +#undef STM32_PWM_USE_TIM4 +#define STM32_PWM_USE_TIM4 TRUE + +#undef STM32_I2C_USE_I2C1 +#define STM32_I2C_USE_I2C1 TRUE + +#undef STM32_SPI_USE_SPI1 +#define STM32_SPI_USE_SPI1 TRUE + +#undef STM32_LSE_ENABLED +#define STM32_LSE_ENABLED TRUE + +#undef STM32_PLLM_VALUE +#define STM32_PLLM_VALUE 4 +#undef STM32_PLLN_VALUE +#define STM32_PLLN_VALUE 168 +#undef STM32_PLLP_VALUE +#define STM32_PLLP_VALUE 2 +#undef STM32_PLLQ_VALUE +#define STM32_PLLQ_VALUE 7 + +#undef STM32_RTCSEL +#define STM32_RTCSEL STM32_RTCSEL_LSE + +#undef STM32_MCO1SEL +#define STM32_MCO1SEL STM32_MCO1SEL_HSE + +#undef STM32_HSI_ENABLED +#define STM32_HSI_ENABLED FALSE +#undef STM32_LSI_ENABLED +#define STM32_LSI_ENABLED FALSE