Configurable SDCARD, and clean up of DMA.
[betaflight.git] / src / main / target / RG_SSD_F3 / target.h
blobb4db6cd6cf9304cabea68745b2a979e5cfd01b94
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 "RGF3" // rgSSD_F3
22 #define LED0_PIN PC1
23 #define LED1_PIN PC0
25 #define BEEPER PA8
26 #define BEEPER_INVERTED
28 #define MPU6000_CS_PIN PB2
29 #define MPU6000_SPI_INSTANCE SPI2
31 #define USE_SPI
32 #define USE_SPI_DEVICE_1
33 #define USE_SPI_DEVICE_2
35 #define SPI1_NSS_PIN PB12
36 #define SPI1_SCK_PIN PB3
37 #define SPI1_MISO_PIN PB4
38 #define SPI1_MOSI_PIN PB5
40 #define SPI2_NSS_PIN PB2
41 #define SPI2_SCK_PIN PB13
42 #define SPI2_MISO_PIN PB14
43 #define SPI2_MOSI_PIN PB15
46 #define USE_GYRO
47 #define USE_GYRO_SPI_MPU6000
48 #define GYRO_MPU6000_ALIGN CW180_DEG
50 #define USE_ACC
51 #define USE_ACC_SPI_MPU6000
52 #define ACC_MPU6000_ALIGN CW180_DEG
53 #define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT
54 #define USE_TARGET_CONFIG
56 #define USE_EXTI
57 #define MPU_INT_EXTI PC13
58 #define USE_MPU_DATA_READY_SIGNAL
59 #define ENSURE_MPU_DATA_READY_IS_LOW
61 #define USE_SDCARD
63 #define SDCARD_DETECT_INVERTED
64 #define SDCARD_DETECT_PIN PC14
66 #define SDCARD_SPI_INSTANCE SPI1
67 #define SDCARD_SPI_CS_GPIO GPIOB
68 #define SDCARD_SPI_CS_PIN SPI1_NSS_PIN
70 // SPI2 is on the APB1 bus whose clock runs at 36MHz. Divide to under 400kHz for init:
71 #define SDCARD_SPI_INITIALIZATION_CLOCK_DIVIDER 128
72 // Divide to under 25MHz for normal operation:
73 #define SDCARD_SPI_FULL_SPEED_CLOCK_DIVIDER 2
75 #define SDCARD_DMA_CHANNEL_TX DMA1_Channel3
76 #define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT
78 #define USE_VCP
79 #define USE_UART1
80 #define USE_UART2
81 #define USE_UART3
82 #define USE_UART4
83 #define USE_UART5
84 #define USE_SOFTSERIAL1
85 #define USE_SOFTSERIAL2
87 #define SERIAL_PORT_COUNT 8
89 #define UART1_TX_PIN PC4
90 #define UART1_RX_PIN PC5
91 #define UART2_TX_PIN PA2
92 #define UART2_RX_PIN PA3
93 #define UART3_TX_PIN PB10
94 #define UART3_RX_PIN PB11
95 #define UART4_TX_PIN PC10
96 #define UART4_RX_PIN PC11
97 #define UART5_TX_PIN PC12
98 #define UART5_RX_PIN PD2
100 #define USE_I2C
101 #define USE_I2C_DEVICE_2
102 #define I2C_DEVICE (I2CDEV_2)
104 #define I2C2_SCL_GPIO GPIOA
105 #define I2C2_SCL_GPIO_AF GPIO_AF_4
106 #define I2C2_SCL_PIN GPIO_Pin_9
107 #define I2C2_SCL_PIN_SOURCE GPIO_PinSource9
108 #define I2C2_SCL_CLK_SOURCE RCC_AHBPeriph_GPIOA
109 #define I2C2_SDA_GPIO GPIOA
110 #define I2C2_SDA_GPIO_AF GPIO_AF_4
111 #define I2C2_SDA_PIN GPIO_Pin_10
112 #define I2C2_SDA_PIN_SOURCE GPIO_PinSource10
113 #define I2C2_SDA_CLK_SOURCE RCC_AHBPeriph_GPIOA
115 #define USE_ADC
116 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
118 #define ADC_INSTANCE ADC2
120 #define VBAT_ADC_PIN PA4
121 #define CURRENT_METER_ADC_PIN PA5
122 #define VBAT_SCALE_DEFAULT 119
124 #define USE_TRANSPONDER
126 #define DEFAULT_RX_FEATURE FEATURE_RX_PPM
128 #define REMAP_TIM16_DMA
129 #define REMAP_TIM17_DMA
130 #define ADC24_DMA_REMAP
132 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
134 // IO - stm32f303rc in 64pin package
135 #define TARGET_IO_PORTA 0xffff
136 #define TARGET_IO_PORTB 0xffff
137 #define TARGET_IO_PORTC 0xffff
138 #define TARGET_IO_PORTD (BIT(2))
139 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
141 #define USED_TIMERS (TIM_N(2) | TIM_N(3) | TIM_N(4) | TIM_N(8) | TIM_N(16) | TIM_N(17))
143 #define USABLE_TIMER_CHANNEL_COUNT 9