Removed excess trailing spaces before new lines on licenses.
[betaflight.git] / src / main / target / TINYFISH / target.h
blob4a1e4a7a12f3fe673f5c71e267cc96cbdbbea624
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
21 #pragma once
23 #define USB_VCP_ENABLED 1
25 #define TARGET_BOARD_IDENTIFIER "TFSH" // http://fishpepper.de/projects/tinyFISH
28 #define LED0_PIN PC14
29 #define LED1_PIN PA13
31 #define USE_BEEPER
32 #define BEEPER_PIN PC15
33 #define BEEPER_INVERTED
36 #define USE_EXTI
37 #define MPU_INT_EXTI PC13
38 #define USE_MPU_DATA_READY_SIGNAL
40 #define MPU6000_SPI_INSTANCE SPI1
41 #define MPU6000_CS_PIN PA4
43 #define USE_GYRO
44 #define USE_GYRO_SPI_MPU6000
45 #define GYRO_MPU6000_ALIGN CW180_DEG_FLIP
47 #define USE_ACC
48 #define USE_ACC_SPI_MPU6000
49 #define ACC_MPU6000_ALIGN CW180_DEG_FLIP
52 #if USB_VCP_ENABLED
53 #define USE_VCP
54 #define USBD_PRODUCT_STRING "tinyFISH"
55 #define SERIAL_PORT_COUNT 6
56 #else
57 #define SERIAL_PORT_COUNT 5
58 #endif
60 #define USE_UART1
61 #define USE_UART2
62 #define USE_UART3
63 #define USE_SOFTSERIAL1
64 #define USE_SOFTSERIAL2
66 #define UART1_TX_PIN PB6
67 #define UART1_RX_PIN PB7
69 #define UART2_TX_PIN PA14
70 #define UART2_RX_PIN PA15
72 #define UART3_TX_PIN PB10
73 #define UART3_RX_PIN PB11
75 #define SBUS_TELEMETRY_UART SERIAL_PORT_USART2
77 #define USE_SPI
78 #define USE_SPI_DEVICE_1
80 #define SPI1_NSS_PIN PA4
81 #define SPI1_SCK_PIN PA5
82 #define SPI1_MISO_PIN PA6
83 #define SPI1_MOSI_PIN PA7
85 #define USE_SPI
86 #define USE_SPI_DEVICE_2
88 #define SPI2_NSS_PIN PB12
89 #define SPI2_SCK_PIN PB13
90 #define SPI2_MISO_PIN PB14
91 #define SPI2_MOSI_PIN PB15
93 #define M25P16_CS_PIN SPI2_NSS_PIN
94 #define M25P16_SPI_INSTANCE SPI2
96 #define USE_FLASHFS
97 #define USE_FLASH_M25P16
98 #define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
100 #define USE_ADC
101 #define DEFAULT_VOLTAGE_METER_SOURCE VOLTAGE_METER_ADC
102 #define DEFAULT_CURRENT_METER_SOURCE CURRENT_METER_ADC
103 #define VBAT_ADC_PIN PB1
104 #define CURRENT_METER_ADC_PIN PB0
105 #define ADC_INSTANCE ADC3
106 #define VBAT_SCALE_DEFAULT 100
108 #define CURRENT_TARGET_CPU_VOLTAGE 3.0
110 // board uses an ina139, RL=0.005, Rs=30000
111 // V/A = (0.005 * 0.001 * 30000) * I
112 // rescale to 1/10th mV / A -> * 1000 * 10
113 // use 3.0V as cpu and adc voltage -> rescale by 3.0/3.3
114 #define CURRENT_METER_SCALE_DEFAULT (0.005 * 0.001 * 30000) * 1000 * 10 * (CURRENT_TARGET_CPU_VOLTAGE / 3.3)
115 #define CURRENT_METER_OFFSET_DEFAULT 0
117 #define WS2811_PIN PA8
118 #define WS2811_TIMER TIM1
119 #define WS2811_DMA_CHANNEL DMA1_Channel2
120 #define WS2811_IRQ DMA1_Channel2_IRQn
121 #define WS2811_DMA_TC_FLAG DMA1_FLAG_TC2
122 #define WS2811_DMA_HANDLER_IDENTIFER DMA1_CH2_HANDLER
124 #define DEFAULT_RX_FEATURE FEATURE_RX_SERIAL
125 #define DEFAULT_FEATURES ( FEATURE_TELEMETRY )
126 #define USE_TARGET_CONFIG
128 #define USE_SERIAL_4WAY_BLHELI_INTERFACE
130 #define TARGET_IO_PORTA 0xffff
131 #define TARGET_IO_PORTB 0xffff
132 #define TARGET_IO_PORTC (BIT(13)|BIT(14)|BIT(15))
133 #define TARGET_IO_PORTF (BIT(0)|BIT(1)|BIT(4))
135 #define USABLE_TIMER_CHANNEL_COUNT 5
136 #define USED_TIMERS (TIM_N(1) | TIM_N(2) | TIM_N(4) | TIM_N(8))