Configurable SDCARD, and clean up of DMA.
[betaflight.git] / src / main / target / KROOZX / target.h
blobd089d7e376cbe6531a10394237eb7e24cba43d83
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #pragma once
20 #define TARGET_BOARD_IDENTIFIER "KROOZX"
22 #define CONFIG_START_FLASH_ADDRESS (0x08080000) //0x08080000 to 0x080A0000 (FLASH_Sector_8)
23 #define TARGET_XTAL_MHZ 16
25 #define USBD_PRODUCT_STRING "KroozX"
27 #define USE_TARGET_CONFIG
28 #define TARGET_PREINIT
30 #define LED0_PIN PA14 // Red LED
31 #define LED1_PIN PA13 // Green LED
33 #define BEEPER PC1
35 #define INVERTER_PIN_UART1 PB13
36 #define INVERTER_PIN_UART6 PB12
38 #define MPU6000_CS_PIN PB2
39 #define MPU6000_SPI_INSTANCE SPI1
41 // MPU6000 interrupts
42 #define USE_EXTI
43 #define USE_MPU_DATA_READY_SIGNAL
44 #define MPU_INT_EXTI PA4
46 #define USE_GYRO
47 #define USE_GYRO_SPI_MPU6000
48 #define GYRO_MPU6000_ALIGN CW90_DEG
50 #define USE_ACC
51 #define USE_ACC_SPI_MPU6000
52 #define ACC_MPU6000_ALIGN CW270_DEG
54 #define USE_MAG
55 #define USE_MAG_HMC5883
56 #define MAG_HMC5883_ALIGN CW180_DEG
57 #define MAG_I2C_INSTANCE I2CDEV_1
59 #define USE_BARO
60 #define USE_BARO_MS5611
62 #define USE_SDCARD
63 #define SDCARD_DETECT_INVERTED
64 #define SDCARD_DETECT_PIN PC13
65 #define SDCARD_SPI_INSTANCE SPI3
66 #define SDCARD_SPI_CS_PIN PA15
67 #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 256 // 328kHz
68 #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 4 // 21MHz
70 #define SDCARD_DMA_CHANNEL_TX DMA1_Stream5
71 #define SDCARD_DMA_CHANNEL 0
73 #define USE_OSD
74 #ifdef USE_MSP_DISPLAYPORT
75 #undef USE_MSP_DISPLAYPORT
76 #endif
77 #define USE_MAX7456
78 #define MAX7456_SPI_INSTANCE SPI1
79 #define MAX7456_SPI_CS_PIN PC4
80 #define MAX7456_SPI_CLK (SPI_CLOCK_STANDARD) // 10MHz
81 #define MAX7456_RESTORE_CLK (SPI_CLOCK_FAST)
83 #define OSD_CH_SWITCH PC5
85 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
86 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
87 #define USE_ADC
88 #define ADC_INSTANCE ADC1
89 #define VBAT_ADC_PIN PC3
90 #define CURRENT_METER_ADC_PIN PC2
91 #define RSSI_ADC_PIN PC0
93 #define CURRENT_METER_SCALE_DEFAULT 1000
94 #define CURRENT_METER_OFFSET_DEFAULT 0
96 #define USE_VCP
97 //#define VBUS_SENSING_PIN PA9
99 #define USE_UART1
100 #define UART1_RX_PIN PA10
101 #define UART1_TX_PIN PA9
103 #define USE_UART3
104 #define UART3_RX_PIN PB11
105 #define UART3_TX_PIN PB10
107 #define USE_UART4
108 #define UART4_RX_PIN PC11
109 #define UART4_TX_PIN PC10
111 #define USE_UART5
112 #define UART5_RX_PIN PD2
113 #define UART5_TX_PIN PC12
115 #define USE_UART6
116 #define UART6_RX_PIN PC7
117 #define UART6_TX_PIN PC6
119 #define SERIAL_PORT_COUNT 6
121 #define USE_I2C
122 #define I2C_DEVICE (I2CDEV_3)
124 #define USE_I2C_DEVICE_1
125 #define I2C1_SCL PB6
126 #define I2C1_SDA PB7
128 #define USE_I2C_DEVICE_3
129 #define I2C3_SCL PA8
130 #define I2C3_SDA PC9
132 #define USE_SPI
133 #define USE_SPI_DEVICE_1
134 #define SPI1_NSS_PIN PC4
135 #define SPI1_SCK_PIN PA5
136 #define SPI1_MISO_PIN PA6
137 #define SPI1_MOSI_PIN PA7
139 #define USE_SPI_DEVICE_3
140 #define SPI3_SCK_PIN PB3
141 #define SPI3_MISO_PIN PB4
142 #define SPI3_MOSI_PIN PB5
144 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
146 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
147 #define RX_CHANNELS_TAER
148 #define DEFAULT_FEATURES (FEATURE_OSD)
150 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
152 #define TARGET_IO_PORTA 0xffff
153 #define TARGET_IO_PORTB 0xffff
154 #define TARGET_IO_PORTC 0xffff
155 #define TARGET_IO_PORTD (BIT(2))
157 #define USABLE_TIMER_CHANNEL_COUNT 10
158 #define USED_TIMERS (TIM_N(3) | TIM_N(4) | TIM_N(5) | TIM_N(8))