qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

config.h (2636B)


      1 /* Copyright 2023 David Hoelscher (@customMK)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 2 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15  */
     16 
     17 #pragma once
     18 
     19 // No VBUS sense needed
     20 #define BOARD_OTG_NOVBUSSENS 1
     21 
     22 #define STM32_LSECLK 32768
     23 
     24 #define MATRIX_ROWS 5
     25 #define MATRIX_COLS 16
     26 #define MATRIX_ROW_PINS { A8, A1, A2, B1, A7 }
     27 
     28 // FRAM configuration
     29 #define EEPROM_SPI_MB85RS64V
     30 #define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A0
     31 #define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 4 // 48MHz / 4 = 12MHz; max supported by MB85R64 is 20MHz
     32 
     33 // External flash configuration
     34 #define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B12
     35 #define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 1  // 48MHz; max supported by W25Q128JV is 133MHz
     36 #define EXTERNAL_FLASH_SIZE (16 * 1024 * 1024)  //128Mbit or 16MByte
     37 #define EXTERNAL_FLASH_SPI_TIMEOUT 200000 //datasheet max is 200seconds for flash chip erase
     38 
     39 // SPI Configuration
     40 #define SPI_DRIVER SPID1
     41 #define SPI_SCK_PIN B3
     42 #define SPI_SCK_PAL_MODE 5
     43 #define SPI_MOSI_PIN B5
     44 #define SPI_MOSI_PAL_MODE 5
     45 #define SPI_MISO_PIN B4
     46 #define SPI_MISO_PAL_MODE 5
     47 
     48 
     49 // SPI LCD Configuration
     50 #define LCD_RST_PIN B2
     51 #define LCD_CS_PIN A9
     52 #define LCD_DC_PIN B0
     53 #ifndef LCD_ACTIVITY_TIMEOUT
     54     #define LCD_ACTIVITY_TIMEOUT 30000
     55 #endif
     56 
     57 // I2C OLED Configuration
     58 #define I2C1_SCL_PIN B6
     59 #define I2C1_SDA_PIN B9
     60 
     61 #define I2C1_CLOCK_SPEED 400000
     62 #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2
     63 
     64 #define OLED_DISABLE_TIMEOUT
     65 
     66 #define COL_SHIFT_IN_PIN B14
     67 #define COL_SHIFT_CLK_PIN B15
     68 
     69 #define QUANTUM_PAINTER_SUPPORTS_256_PALETTE TRUE
     70 #define QUANTUM_PAINTER_SUPPORTS_NATIVE_COLORS TRUE
     71 
     72 #define OLED_UPDATE_INTERVAL 66
     73 
     74 #define BACKLIGHT_PWM_DRIVER PWMD3
     75 #define BACKLIGHT_PWM_CHANNEL 1
     76 #define BACKLIGHT_PAL_MODE 2
     77 
     78 #define WS2812_PWM_DRIVER PWMD1
     79 #define WS2812_PWM_CHANNEL 3
     80 #define WS2812_PWM_PAL_MODE 1
     81 #define WS2812_PWM_DMA_STREAM STM32_DMA2_STREAM5
     82 #define WS2812_PWM_DMA_CHANNEL 6
     83 
     84 #define TAP_CODE_DELAY 10
     85 
     86 #define AUDIO_PIN B8
     87 #define AUDIO_PWM_DRIVER PWMD4
     88 #define AUDIO_PWM_CHANNEL 3 
     89 #define AUDIO_PWM_PAL_MODE 2
     90 #define AUDIO_STATE_TIMER GPTD5
     91 #define AUDIO_INIT_DELAY