forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Bonsai C4 as a platform board file (qmk#18901)
* Set up Bonsai C4 as a platform board file * corrections and improvements based on testing and feedback * Added VBUS sensing as default capability for improved split support using Bonsai C4 * Update clock divisor for SPI flash Co-authored-by: Nick Brassel <[email protected]> Co-authored-by: Nick Brassel <[email protected]>
- Loading branch information
1 parent
8927d72
commit 1ab16bc
Showing
14 changed files
with
427 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
keyboards/custommk/bonsai_c4_template/bonsai_c4_template.c
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# List of all the board related files. | ||
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE/board.c | ||
|
||
# Required include directories | ||
BOARDINC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_F411RE | ||
|
||
# Shared variables | ||
ALLCSRC += $(BOARDSRC) | ||
ALLINC += $(BOARDINC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* 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 <https://www.gnu.org/licenses/>. | ||
*/ | ||
#pragma once | ||
|
||
#include_next "board.h" | ||
|
||
#undef STM32_HSE_BYPASS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* Copyright 2022 David Hoelscher, customMK | ||
* | ||
* 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 | ||
|
||
// Bonsai C4 includes Vbus sensing; derived designs that use PA9 for other purposes | ||
// may disable Vbus sensing with #define BOARD_OTG_NOVBUSSENS 1 | ||
|
||
#ifndef EARLY_INIT_PERFORM_BOOTLOADER_JUMP | ||
# define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE | ||
#endif | ||
|
||
// FRAM configuration | ||
#ifndef EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN | ||
# define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN PAL_LINE(GPIOA, 0) | ||
# define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8 // 96MHz / 8 = 12MHz; max supported by MB85R64 is 20MHz | ||
# define EXTERNAL_EEPROM_BYTE_COUNT 8192 | ||
# define EXTERNAL_EEPROM_PAGE_SIZE 64 // does not matter for FRAM, just sets the RAM buffer size in STM32F chip | ||
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 8191 | ||
#endif | ||
|
||
// External flash configuration | ||
#ifndef EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN | ||
# define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN PAL_LINE(GPIOB, 12) | ||
# define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 2 // 48MHz; max supported by W25Q128JV is 133MHz | ||
# define EXTERNAL_FLASH_BYTE_COUNT (16 * 1024 * 1024) //128Mbit or 16MByte | ||
# define EXTERNAL_FLASH_PAGE_SIZE 256 | ||
# define EXTERNAL_FLASH_SPI_TIMEOUT 200000 //datasheet max is 200 seconds for flash chip erase | ||
#endif | ||
|
||
// SPI Configuration (needed for FRAM and FLASH) | ||
#ifndef SPI_DRIVER | ||
# define SPI_DRIVER SPID1 | ||
#endif | ||
#ifndef SPI_SCK_PIN | ||
# define SPI_SCK_PIN PAL_LINE(GPIOB, 3) | ||
#endif | ||
#ifndef SPI_MOSI_PIN | ||
# define SPI_MOSI_PIN PAL_LINE(GPIOB, 5) | ||
#endif | ||
#ifndef SPI_MISO_PIN | ||
# define SPI_MISO_PIN PAL_LINE(GPIOB, 4) | ||
#endif | ||
|
||
|
||
// I2C Configuration | ||
#ifdef CONVERT_TO_BONSAI_C4 | ||
# ifndef I2C1_SCL_PIN | ||
# define I2C1_SCL_PIN PAL_LINE(GPIOB, 6) | ||
# endif | ||
# ifndef I2C1_SDA_PIN | ||
# define I2C1_SDA_PIN PAL_LINE(GPIOB, 9) | ||
# endif | ||
#endif | ||
|
||
// WS2812-style LED control on pin A10 | ||
#ifdef WS2812_DRIVER_PWM | ||
# ifndef RGB_DI_PIN | ||
# define RGB_DI_PIN PAL_LINE(GPIOA, 10) | ||
# endif | ||
# ifndef WS2812_PWM_DRIVER | ||
# define WS2812_PWM_DRIVER PWMD1 | ||
# endif | ||
# ifndef WS2812_PWM_CHANNEL | ||
# define WS2812_PWM_CHANNEL 3 | ||
# endif | ||
# ifndef WS2812_PWM_PAL_MODE | ||
# define WS2812_PWM_PAL_MODE 1 | ||
# endif | ||
# ifndef WS2812_DMA_STREAM | ||
# define WS2812_DMA_STREAM STM32_DMA2_STREAM5 | ||
# endif | ||
# ifndef WS2812_DMA_CHANNEL | ||
# define WS2812_DMA_CHANNEL 6 | ||
# endif | ||
#endif | ||
|
||
#ifndef USB_VBUS_PIN | ||
# define USB_VBUS_PIN PAL_LINE(GPIOA, 9) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* Copyright 2022 David Hoelscher, customMK | ||
* | ||
* 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 | ||
|
||
#ifndef HAL_USE_SPI | ||
# define HAL_USE_SPI TRUE | ||
#endif | ||
|
||
#ifndef HAL_USE_I2C | ||
# define HAL_USE_I2C TRUE | ||
#endif | ||
|
||
#ifdef SPLIT_KEYBOARD | ||
# ifndef HAL_USE_SERIAL | ||
# define HAL_USE_SERIAL TRUE | ||
# endif | ||
# ifndef SERIAL_BUFFERS_SIZE | ||
# define SERIAL_BUFFERS_SIZE 256 | ||
# endif | ||
#endif | ||
|
||
#ifdef WS2812_DRIVER_PWM | ||
# ifndef HAL_USE_PWM | ||
# define HAL_USE_PWM TRUE | ||
# endif | ||
#endif | ||
|
||
#ifndef SPI_SELECT_MODE | ||
# define SPI_SELECT_MODE SPI_SELECT_MODE_PAD | ||
#endif | ||
|
||
#ifndef SPI_USE_WAIT | ||
# define SPI_USE_WAIT TRUE | ||
#endif | ||
|
||
#include_next <halconf.h> |
Oops, something went wrong.