summaryrefslogtreecommitdiff
path: root/keyboards/handwired/tractyl_manuform/5x6_right/f303/config.h
blob: f9a44587b09dfcd986c546940671fc38d6bedf4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert

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

#define PRODUCT Tractyl Manuform(5x6) Proton C

// wiring of each half
#define MATRIX_COL_PINS \
    { B0, B1, B2, B3, B4, B5 }
#define MATRIX_ROW_PINS \
    { B10, B11, B12, A14, A13, A15 }

#define UNUSED_PINS \
    { A0, A2, A7, A8 }
// B2 used for BOOT1, has internal pull down?
// A9 has internal pull-down
// A11 and A12 are used for USB sense.  DO NOT USE.

#define DIODE_DIRECTION     COL2ROW

// #define USB_VBUS_PIN        B10
#define SPLIT_HAND_PIN      C14  // high = left, low = right

// WS2812 RGB LED strip input and number of LEDs
#define RGB_DI_PIN          A6
#define WS2812_PWM_DRIVER   PWMD3  // default: PWMD2
#define WS2812_PWM_CHANNEL  1      // default: 2
#define WS2812_PWM_PAL_MODE 2      // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
//#define WS2812_PWM_COMPLEMENTARY_OUTPUT // Define for a complementary timer output (TIMx_CHyN); omit for a normal timer output (TIMx_CHy).
// #define WS2812_DMA_STREAM   STM32_DMA1_STREAM3  // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define WS2812_DMA_CHANNEL  3  // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.

#define RGBLED_NUM          20
#define RGBLIGHT_SPLIT
#define RGBLED_SPLIT \
    { 10, 10 }

#define DEBUG_LED_PIN C13

/* Audio config */
#define AUDIO_PIN     A5
#define AUDIO_PIN_ALT A4
#define AUDIO_PIN_ALT_AS_NEGATIVE

/* serial.c configuration for split keyboard */
#define SERIAL_USART_FULL_DUPLEX  // Enable full duplex operation mode.
#define SERIAL_USART_TX_PIN      A9
#define SERIAL_USART_RX_PIN      A10
#define SERIAL_USART_DRIVER      SD1
#define SERIAL_USART_TX_PAL_MODE 7    // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_RX_PAL_MODE 7    // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
#define SERIAL_USART_TIMEOUT     100  // USART driver timeout. default 100

/* i2c config for oleds */
#define I2C_DRIVER               I2CD1
#define I2C1_SCL_PIN             B6
#define I2C1_SDA_PIN             B7
#define I2C1_SCL_PAL_MODE        4
#define I2C1_SDA_PAL_MODE        4
#define I2C1_CLOCK_SPEED         400000

/* encoder config */
#define ENCODERS_PAD_A \
    { A7 }
#define ENCODERS_PAD_B \
    { A8 }

/* spi config for eeprom and pmw3360 sensor */
#define SPI_DRIVER                           SPID2
#define SPI_SCK_PIN                          B13
#define SPI_SCK_PAL_MODE                     5
#define SPI_MOSI_PIN                         B15
#define SPI_MOSI_PAL_MODE                    5
#define SPI_MISO_PIN                         B14
#define SPI_MISO_PAL_MODE                    5

/* eeprom config */
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN B8
#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR    8
// #define EXTERNAL_EEPROM_BYTE_COUNT           8196
// #define EXTERNAL_EEPROM_PAGE_SIZE            32
// #define EXTERNAL_EEPROM_ADDRESS_SIZE         2
// #define DEBUG_EEPROM_OUTPUT

/* pmw3360 config  */
#define PMW3360_CS_PIN                       B9
#define PMW3360_SPI_MODE                     3
#define PMW3360_SPI_DIVISOR                  8