config.h (3352B)
1 /* 2 Copyright 2012 Jun Wako <wakojun@gmail.com> 3 Copyright 2015 Jack Humbert 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 2 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #pragma once 20 21 // #define USB_VBUS_PIN B10 // doesn't seem to work for me on one of my controllers... */ 22 #define USER_BUTTON_PIN A0 23 24 // WS2812 RGB LED strip input and number of LEDs 25 #define WS2812_PWM_DRIVER PWMD2 // default: PWMD2 26 #define WS2812_PWM_CHANNEL 2 // default: 2 27 #define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 28 #define WS2812_EXTERNAL_PULLUP 29 //#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy). 30 #define WS2812_PWM_DMA_STREAM STM32_DMA1_STREAM7 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. 31 #define WS2812_PWM_DMA_CHANNEL 3 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. 32 33 #define DEBUG_LED_PIN C13 34 35 /* Audio config */ 36 #define AUDIO_PIN B1 37 #define AUDIO_PWM_DRIVER PWMD3 38 #define AUDIO_PWM_CHANNEL 4 39 #define AUDIO_PWM_PAL_MODE 2 40 41 /* serial.c configuration for split keyboard */ 42 #define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode. 43 #define SERIAL_USART_TX_PIN A2 44 #define SERIAL_USART_RX_PIN A3 45 #define SERIAL_USART_DRIVER SD2 46 #define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 47 #define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7 48 #define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100 49 #define SERIAL_USART_SPEED 921600 50 51 #define CRC8_USE_TABLE 52 #define CRC8_OPTIMIZE_SPEED 53 54 /* i2c config for oleds */ 55 #define I2C_DRIVER I2CD1 56 #define I2C1_SCL_PIN B8 57 #define I2C1_SDA_PIN B9 58 #define I2C1_SCL_PAL_MODE 4 59 #define I2C1_SDA_PAL_MODE 4 60 #define I2C1_CLOCK_SPEED 400000 61 #define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_16_9 62 63 /* spi config for eeprom and pmw3360 sensor */ 64 #define SPI_DRIVER SPID1 65 #define SPI_SCK_PIN A5 66 #define SPI_SCK_PAL_MODE 5 67 #define SPI_MOSI_PIN A7 68 #define SPI_MOSI_PAL_MODE 5 69 #define SPI_MISO_PIN A6 70 #define SPI_MISO_PAL_MODE 5 71 72 /* eeprom config */ 73 #define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4 74 #define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8 75 76 /* pmw3360 config */ 77 #define PMW33XX_CS_PIN B0 78 #define PMW33XX_SPI_DIVISOR 8