Permalink
Browse files

Merge branch 'spracingf3neo'

  • Loading branch information...
2 parents 7206156 + 2f2596b commit 6fbb6f87948a8b650531421d1f9e7c1e8a968d4a @hydra hydra committed Dec 6, 2016
Showing with 1,966 additions and 207 deletions.
  1. +1 −0 .travis.yml
  2. +52 −10 Makefile
  3. +140 −0 docs/Board - SPRacingF3NEO.md
  4. +1 −0 fake_travis_build.sh
  5. +1 −0 src/main/config/parameter_group_ids.h
  6. +1 −1 src/main/drivers/accgyro_l3gd20.c
  7. +2 −0 src/main/drivers/accgyro_mpu6500.h
  8. +5 −5 src/main/drivers/accgyro_spi_mpu6000.c
  9. +2 −2 src/main/drivers/accgyro_spi_mpu6500.c
  10. +0 −2 src/main/drivers/adc_stm32f10x.c
  11. +3 −45 src/main/drivers/bus_spi.c
  12. +57 −4 src/main/drivers/bus_spi.h
  13. +2 −2 src/main/drivers/dma.c
  14. +1 −1 src/main/drivers/dma.h
  15. +1 −1 src/main/drivers/flash_m25p16.c
  16. +1 −0 src/main/drivers/nvic.h
  17. +68 −0 src/main/drivers/pwm_mapping.c
  18. +41 −0 src/main/drivers/timer.c
  19. +73 −28 src/main/drivers/video_max7456.c
  20. +11 −6 src/main/drivers/video_max7456.h
  21. +247 −0 src/main/drivers/vtx_rtc6705.c
  22. +44 −0 src/main/drivers/vtx_rtc6705.h
  23. +53 −1 src/main/fc/boot.c
  24. +50 −1 src/main/fc/cleanflight_fc.c
  25. +17 −0 src/main/fc/config.c
  26. +1 −0 src/main/fc/config.h
  27. +4 −0 src/main/fc/fc_debug.h
  28. +16 −0 src/main/fc/fc_tasks.c
  29. +6 −0 src/main/fc/fc_tasks.h
  30. +130 −4 src/main/fc/msp_server_fc.c
  31. +2 −0 src/main/fc/msp_server_fc.h
  32. +1 −0 src/main/fc/rc_controls.h
  33. +5 −1 src/main/io/serial_cli.c
  34. +203 −0 src/main/io/vtx.c
  35. +58 −0 src/main/io/vtx.h
  36. +92 −0 src/main/io/vtx_rtc6705.c
  37. +2 −2 src/main/msp/msp_protocol.h
  38. +1 −0 src/main/osd/boot.c
  39. +1 −0 src/main/osd/cleanflight_osd.c
  40. +1 −0 src/main/osd/config.c
  41. +0 −4 src/main/osd/config.h
  42. +1 −1 src/main/osd/fc_state.h
  43. +5 −0 src/main/osd/feature.h
  44. +29 −4 src/main/osd/osd.c
  45. +32 −0 src/main/osd/osd_debug.c
  46. +31 −0 src/main/osd/osd_debug.h
  47. +23 −0 src/main/osd/osd_element.c
  48. +5 −0 src/main/osd/osd_element.h
  49. +25 −0 src/main/osd/osd_element_render.c
  50. +3 −0 src/main/osd/osd_element_render.h
  51. +30 −49 src/main/osd/osd_max7456.c
  52. +1 −1 src/main/sensors/initialisation.c
  53. +0 −11 src/main/target/SPRACINGF1OSD/target.h
  54. +0 −3 src/main/target/SPRACINGF3EVO/target.h
  55. +0 −4 src/main/target/SPRACINGF3MINI/target.h
  56. +309 −0 src/main/target/SPRACINGF3NEO/target.h
  57. +0 −11 src/main/target/SPRACINGF3OSD/target.h
  58. +1 −0 src/test/unit/config_eeprom_unittest.cc
  59. +6 −0 src/test/unit/msp_fc_unittest.cc
  60. +60 −0 src/test/unit/osd_screen_unittest.cc
  61. +2 −0 src/test/unit/platform.h
  62. +6 −3 src/test/unit/scheduler_unittest.cc
View
@@ -5,6 +5,7 @@ env:
- PUBLISHDOCS=True
- TARGET=SPRACINGF3MINI
- TARGET=SPRACINGF3EVO
+ - TARGET=SPRACINGF3NEO
- TARGET=SPRACINGF3
- TARGET=SPRACINGF3OSD
- TARGET=SPRACINGF1OSD
View
@@ -38,13 +38,13 @@ FORKNAME = cleanflight
64K_TARGETS = CJMCU
128K_TARGETS = ALIENFLIGHTF1 CC3D NAZE RMDO SPRACINGF1OSD
-256K_TARGETS = ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE IRCFUSIONF3 LUX_RACE MOTOLAB PORT103R RCEXPLORERF3 SPARKY SPRACINGF3 SPRACINGF3EVO SPRACINGF3MINI STM32F3DISCOVERY SPRACINGF3OSD
+256K_TARGETS = ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE IRCFUSIONF3 LUX_RACE MOTOLAB PORT103R RCEXPLORERF3 SPARKY SPRACINGF3 SPRACINGF3EVO SPRACINGF3MINI SPRACINGF3NEO STM32F3DISCOVERY SPRACINGF3OSD
-F3_TARGETS = ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE IRCFUSIONF3 LUX_RACE MOTOLAB RCEXPLORERF3 RMDO SPARKY SPRACINGF3 SPRACINGF3EVO SPRACINGF3MINI STM32F3DISCOVERY SPRACINGF3OSD
+F3_TARGETS = ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE IRCFUSIONF3 LUX_RACE MOTOLAB RCEXPLORERF3 RMDO SPARKY SPRACINGF3 SPRACINGF3EVO SPRACINGF3MINI SPRACINGF3NEO STM32F3DISCOVERY SPRACINGF3OSD
VALID_TARGETS = $(64K_TARGETS) $(128K_TARGETS) $(256K_TARGETS)
-VCP_TARGETS = CC3D ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE LUX_RACE MOTOLAB RCEXPLORERF3 SPARKY SPRACINGF3EVO SPRACINGF3MINI STM32F3DISCOVERY SPRACINGF1OSD SPRACINGF3OSD
+VCP_TARGETS = CC3D ALIENFLIGHTF3 CHEBUZZF3 COLIBRI_RACE LUX_RACE MOTOLAB RCEXPLORERF3 SPARKY SPRACINGF3EVO SPRACINGF3MINI SPRACINGF3NEO STM32F3DISCOVERY SPRACINGF1OSD SPRACINGF3OSD
OSD_TARGETS = SPRACINGF1OSD SPRACINGF3OSD
# Configure default flash sizes for the targets
@@ -231,6 +231,8 @@ endif
# OSDs
ifeq ($(TARGET),$(filter $(TARGET),$(OSD_TARGETS)))
TARGET_FLAGS := $(TARGET_FLAGS) -DOSD
+else
+TARGET_FLAGS := $(TARGET_FLAGS) -DFC
endif
@@ -328,25 +330,29 @@ FC_COMMON_SRC = \
sensors/gyro.c \
sensors/initialisation.c
-OSD_COMMON_SRC = \
+OSD_SYSTEM_SRC = \
config/feature.c \
osd/boot.c \
osd/cleanflight_osd.c \
osd/fc_state.c \
osd/config.c \
- osd/osd.c \
- osd/osd_screen.c \
- osd/osd_element.c \
- osd/osd_element_render.c \
osd/osd_serial.c \
osd/msp_server_osd.c \
osd/msp_client_osd.c \
osd/osd_tasks.c \
+ osd/osd_debug.c \
sensors/battery.c \
sensors/voltage.c \
sensors/amperage.c \
io/beeper.c
+OSD_COMMON_SRC = \
+ osd/fc_state.c \
+ osd/osd.c \
+ osd/osd_screen.c \
+ osd/osd_element.c \
+ osd/osd_element_render.c
+
HIGHEND_SRC = \
flight/gtune.c \
flight/navigation.c \
@@ -719,6 +725,40 @@ SPRACINGF3EVO_SRC = \
$(SYSTEM_SRC) \
$(VCP_SRC)
+SPRACINGF3NEO_SRC = \
+ $(STM32F30x_COMMON_SRC) \
+ $(STM32F30x_FC_COMMON_SRC) \
+ drivers/accgyro_mpu.c \
+ drivers/accgyro_mpu6500.c \
+ drivers/accgyro_spi_mpu6500.c \
+ drivers/barometer_bmp280.c \
+ drivers/barometer_ms5611.c \
+ drivers/compass_ak8975.c \
+ drivers/compass_hmc5883l.c \
+ drivers/display_ug2864hsweg01.h \
+ drivers/light_ws2811strip.c \
+ drivers/light_ws2811strip_stm32f30x.c \
+ drivers/serial_usb_vcp.c \
+ drivers/sdcard.c \
+ drivers/sdcard_standard.c \
+ drivers/transponder_ir.c \
+ drivers/transponder_ir_stm32f30x.c \
+ drivers/video_max7456.c \
+ drivers/vtx_rtc6705.c \
+ io/asyncfatfs/asyncfatfs.c \
+ io/asyncfatfs/fat_standard.c \
+ io/transponder_ir.c \
+ io/flashfs.c \
+ io/vtx_rtc6705.c \
+ io/vtx.c \
+ osd/fonts/font_max7456_12x18.c \
+ osd/osd_max7456.c \
+ $(HIGHEND_SRC) \
+ $(FC_COMMON_SRC) \
+ $(OSD_COMMON_SRC) \
+ $(SYSTEM_SRC) \
+ $(VCP_SRC)
+
MOTOLAB_SRC = \
$(STM32F30x_COMMON_SRC) \
$(STM32F30x_FC_COMMON_SRC) \
@@ -789,8 +829,9 @@ SPRACINGF1OSD_SRC = \
io/flashfs.c \
osd/fonts/font_max7456_12x18.c \
osd/osd_max7456.c \
- $(OSD_COMMON_SRC) \
$(SYSTEM_SRC) \
+ $(OSD_SYSTEM_SRC) \
+ $(OSD_COMMON_SRC) \
$(VCP_SRC)
SPRACINGF3OSD_SRC = \
@@ -806,8 +847,9 @@ SPRACINGF3OSD_SRC = \
io/transponder_ir.c \
osd/fonts/font_max7456_12x18.c \
osd/osd_max7456.c \
- $(OSD_COMMON_SRC) \
$(SYSTEM_SRC) \
+ $(OSD_SYSTEM_SRC) \
+ $(OSD_COMMON_SRC) \
$(VCP_SRC)
# Search path and source files for the ST stdperiph library
@@ -0,0 +1,140 @@
+# Board - Seriously Pro SP Racing F3 NEO
+
+The Seriously Pro Racing F3 NEO board (SPRacingF3NEO) is a full-featured board designed specifically for quadcopters. The NEO FC/PDB features the latest gyro technology and stacks with an OSD/VTX board. The stack makes for an extremely compact and easy to install solution with the minimal of solder connections and external cables required. It's perfect for beginners and experienced pilots. The acc/gyro is an ICM20602, which is newer than you'll find in all other F3 boards and most F4 boards as of December 2016.
+
+Purchasing boards directly from SeriouslyPro / SP Racing and official retailers helps fund Cleanflight development, it's the reason the Seriously Pro boards exist! Official retailers are always listed on the SeriouslyPro.com website.
+
+Full details available on the website, here:
+
+http://seriouslypro.com/spracingf3neo
+
+## Hardware Features
+
+The NEO comprises of two boards.
+
+1. NEO FC/PDB - FC/PDB/AMPERAGE MONITORING/LC FILTER/12V BEC/5V BEC/ETC
+2. NEO OSD/VTX - OSD/VTX/BUTTON/ANTENNA/ETC
+
+The height of the combined stack is just 15mm high.
+
+### NEO FC/PDB board.
+
+* Next-generation STM32 F3 processor with hardware floating point unit for efficient flight calculations and faster ARM-Cortex M4 core.
+* Features the latest accelerometer and gyro technology (ICM20602) via SPI connection.
+* MicroSD-Card socket for black box flight log recorder - optimize your tuning and see the results of your setup without guesswork.
+* Built in amperage/current monitoring sensor, 110A.
+* Telemetry support (FrSky, SmartPort/S.PORT, IBus, etc).
+* 5 Serial ports. e.g Receiver + Telemetry + 3 Spare - None shared with the USB.
+* Built-in LC-Filter for clearer video.
+* Race transponder built in - just turn up at a race and have your lap times recorded.
+* Boot button for easy DFU/USB flashing.
+* Wire up using solder pads for ESC connections and cable or header pins for receiver.
+* 6 PWM output lines for ESCs and Servos. 4 are arranged for easy wiring on each corner of the board. (The 4 main outputs support DSHOT *).
+* Supports direct connection of SBus, SumH, SumD, Spektrum1024/2048, XBus/IBus receivers. No external inverters required (built-in).
+* Supports direct connection of 3.3v Spektrum Satellite receivers via 3 pin through-hole JST-ZH connector.
+* Supports PPM receivers.
+* Micro USB socket.
+* Dedicated output for programmable LEDs - great for orientation, racing and night flying.
+* Dedicated I2C/UART3/UART5 port for connection of OLED display, GPS receivers, external MAG/BARO without needing flight battery.
+* Voltage monitoring for battery, 12v and 5v supplies.
+* Analog RSSI monitoring.
+* Buzzer port for audible warnings and notifications.
+* Developer friendly debugging port (SWD) unbrickable bootloader.
+* Symmetrical design for a super tidy wiring, just 4 wires per corner to each ESC and you're done!
+* JST-SH sockets only for I2C/UART3/UART4 and SWD. UART1 available on through-hole stacking pins and broken out on OSD/VTX board.
+* 12 position connector for stacking the OSD/VTX board. (SPI/CS1/CS2/VSYNC/HSYNC/VTX ENABLE/BUTTON),
+* Through-hole solder pads AND solder-less connections for receiver via PicoBlade connector.
+* Through-hole solder pads for Transponder IR LED.
+* Solder pads for RSSI.
+* Solder pads for LED Strip.
+* Solder pads for ESC power. (2 by each corner)
+* Solder pads for ESC signal and ground. (2 by each corner).
+* Solder pads for 2x additional PWM outputs (e.g. for pan / tilt servos).
+* Direct connection for XT60 socket. (Through hole).
+* Flashing via USB or serial port.
+* Standard 30.5mm mounting holes, board fits in most 36x36x mounting spaces.
+* Board is 45x50mm with corner cutouts to allow frame clearance.
+* LEDs for 3v (Blue), 5v (Green) and 12v (Yellow) supplies.
+* Two status LEDs (Red, White) for easy diagnostics/flight mode indications.
+* Supplied with cable for no-solder connection to FrSky XSR receivers.
+* Supplied with receiver cable for no-solder connection to most other receviers.
+* Supplied with JST-ZH socket for connection to 3.3v spektrum satellite receivers.
+* Cleanflight logo.
+* SPRacing logo.
+
+* Note: DSHOT support is coming to a future Cleanflight release.
+
+### NEO VTX/OSD board.
+
+* OSD with customisable layout.
+* VTX with 25/200mw output.
+* Button for changing VTX channel/band/rf power/power/etc.
+* Configurable via cleanflight configurator, via the NEO USB socket.
+* U.FL socket for antenna connection, gold plated.
+* Display of amperage/current, voltage, RSSI, flight modes, on duration, armed duration, 5v, 12v, callsign, motors, etc.
+* Available without VTX module, so users can use external VTX or alternative compatible VTX modules.
+* VTX can be turned off remotely (e.g via transmitter). Great for team races or in-pit configuration.
+* Solder pads for 5V, 5V switched, 3.3V, 12V, Video IN/OUT, Audio, GND.
+* Breakout 2.54mm pitch though-holes for connecting to UART1 on the NEO - e.g. for Bluetooth/Wifi modules.
+* Picoplade connector for no-solder connection to external VTX, with 12V/VIDEO/AUDIO/5V switched/GND signals.
+* 2.54mm Through hole pads for connecting Buzzer (controlled via NEO).
+* 2.54mm Through hole pads for connecting 12V devices.
+* Though hole pads for JST-ZH sockets (supplied) connecting CAMERA an EXTERNAL VTX boards.
+* Solder pads for PCB side-mount antenna JACK connection (when not using U.FL connector).
+* CAMERA and EXTERNAL VTX sockets power selectable between 5V and 12V.
+* Hole for accessing the boot button (via paperclip) on the NEO below it.
+* Board is 36x36mm with standard 30.5mm mounting holes.
+* 12 position connector for stacking above the NEO.
+* Illuminating white LED.
+* Blue LED for 3v3 power.
+* Cleanflight logos.
+* SPRacing logo.
+
+
+## Pinouts
+
+Full pinout details are available in the manual, here:
+
+http://seriouslypro.com/files/SPRacingF3NEO-Manual-latest.pdf
+
+### Spektrum Satellite
+
+| Pin | Function | Notes |
+| --- | -------------- | -------------------------------------------- |
+| 3 | 3.3V | |
+| 2 | Ground | |
+| 1 | RXD | |
+
+### Receiver
+
+| Pin | Function | Notes |
+| --- | -------------- | -------------------------------------------- |
+| 1 | UART2 RX | Serial RX or PPM |
+| 2 | UART2 TX | FrSky Telemetry |
+| 3 | UART5 TX | SmartPort/S.PORT telemetry |
+| 4 | 5.0v | Voltage as-supplied by BEC or USB, always on |
+| 5 | Ground | |
+
+
+### I2C/UART3/UART4
+
+| Pin | Function | Notes |
+| --- | -------------- | -------------------------------------------- |
+| 1 | Ground | |
+| 2 | 5.0v | Voltage as-supplied by BEC OR USB, always on |
+| 3 | SCL | 3.3V signals only |
+| 4 | SDA | 3.3V signals only |
+| 5 | UART3 RXD | 3.3V signals only |
+| 6 | UART3 TXD | 3.3V signals only |
+| 7 | UART4 RXD | 3.3V or 5V signals OK |
+| 8 | UART4 TXD | 3.3V or 5V signals OK |
+
+### SWD
+
+| Pin | Function | Notes |
+| --- | -------------- | -------------------------------------------- |
+| 1 | Ground | |
+| 2 | NRST | |
+| 3 | SWDIO | |
+| 4 | SWDCLK | |
+
@@ -5,6 +5,7 @@ targets=("PUBLISHMETA=True" \
"TARGET=SPRACINGF3MINI" \
"TARGET=SPRACINGF3" \
"TARGET=SPRACINGF3EVO" \
+ "TARGET=SPRACINGF3NEO" \
"TARGET=NAZE" \
"TARGET=CC3D" \
"TARGET=CJMCU" \
@@ -69,6 +69,7 @@
#define PG_DEBUG_CONFIG 51
#define PG_SERVO_CONFIG 52
#define PG_IBUS_TELEMETRY_CONFIG 53
+#define PG_VTX_CONFIG 54
// Driver configuration
#define PG_DRIVER_PWM_RX_CONFIG 100
@@ -83,7 +83,7 @@ static void l3gd20SpiInit(SPI_TypeDef *SPIx)
GPIO_SetBits(L3GD20_CS_GPIO, L3GD20_CS_PIN);
- spiSetDivisor(L3GD20_SPI, SPI_9MHZ_CLOCK_DIVIDER);
+ spiSetDivisor(L3GD20_SPI, SPI_CLOCK_STANDARD);
}
static void l3gd20GyroInit(gyro_t *gyro, uint8_t lpf)
@@ -17,6 +17,8 @@
#define MPU6500_WHO_AM_I_CONST (0x70)
#define MPU9250_WHO_AM_I_CONST (0x71)
+#define ICM20608G_WHO_AM_I_CONST (0xAF)
+#define ICM20602_WHO_AM_I_CONST (0x12)
#define MPU6500_BIT_RESET (0x80)
@@ -144,7 +144,7 @@ void mpu6000SpiGyroInit(gyro_t *gyro, uint8_t lpf)
mpu6000AccAndGyroInit();
- spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_0_5625MHZ_CLOCK_DIVIDER);
+ spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_CLOCK_SLOW);
// Accel and Gyro DLPF Setting
mpu6000WriteRegister(MPU6000_CONFIG, lpf);
@@ -170,7 +170,7 @@ bool mpu6000SpiDetect(void)
uint8_t in;
uint8_t attemptsRemaining = 5;
- spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_0_5625MHZ_CLOCK_DIVIDER);
+ spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_CLOCK_SLOW);
mpu6000WriteRegister(MPU_RA_PWR_MGMT_1, BIT_H_RESET);
@@ -218,7 +218,7 @@ static void mpu6000AccAndGyroInit(void)
return;
}
- spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_0_5625MHZ_CLOCK_DIVIDER);
+ spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_CLOCK_SLOW);
// Device Reset
mpu6000WriteRegister(MPU_RA_PWR_MGMT_1, BIT_H_RESET);
@@ -248,7 +248,7 @@ static void mpu6000AccAndGyroInit(void)
delayMicroseconds(1);
// Accel +/- 8 G Full Scale
- mpu6000WriteRegister(MPU_RA_ACCEL_CONFIG, INV_FSR_8G << 3);
+ mpu6000WriteRegister(MPU_RA_ACCEL_CONFIG, INV_FSR_16G << 3);
delayMicroseconds(1);
@@ -260,7 +260,7 @@ static void mpu6000AccAndGyroInit(void)
delayMicroseconds(1);
#endif
- spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_18MHZ_CLOCK_DIVIDER); // 18 MHz SPI clock
+ spiSetDivisor(MPU6000_SPI_INSTANCE, SPI_CLOCK_FAST); // 18 MHz SPI clock
mpuSpi6000InitDone = true;
}
@@ -92,7 +92,7 @@ static void mpu6500SpiInit(void)
GPIO_SetBits(MPU6500_CS_GPIO, MPU6500_CS_PIN);
- spiSetDivisor(MPU6500_SPI_INSTANCE, SPI_9MHZ_CLOCK_DIVIDER);
+ spiSetDivisor(MPU6500_SPI_INSTANCE, SPI_CLOCK_STANDARD);
hardwareInitialised = true;
}
@@ -105,7 +105,7 @@ bool mpu6500SpiDetect(void)
mpu6500ReadRegister(MPU_RA_WHO_AM_I, 1, &sig);
- if (sig == MPU6500_WHO_AM_I_CONST || sig == MPU9250_WHO_AM_I_CONST) {
+ if (sig == MPU6500_WHO_AM_I_CONST || sig == MPU9250_WHO_AM_I_CONST || sig == ICM20608G_WHO_AM_I_CONST || sig == ICM20602_WHO_AM_I_CONST) {
return true;
}
@@ -110,8 +110,6 @@ void adcInit(drv_adc_config_t *init)
RCC_AHBPeriphClockCmd(ADC_AHB_PERIPHERAL, ENABLE);
RCC_APB2PeriphClockCmd(ADC_ABP2_PERIPHERAL, ENABLE);
- // FIXME ADC driver assumes all the GPIO was already placed in 'AIN' mode
-
DMA_DeInit(ADC_DMA_CHANNEL);
DMA_InitTypeDef DMA_InitStructure;
DMA_StructInit(&DMA_InitStructure);
Oops, something went wrong.

0 comments on commit 6fbb6f8

Please sign in to comment.