Skip to content

Commit

Permalink
added icm20608 support and updated bluejayf4 target
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFastEnuf committed Jul 22, 2020
1 parent 1577a5e commit 8588ec6
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 42 deletions.
70 changes: 35 additions & 35 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@
</resource>
</language>
</provider>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1315978123255115236" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1116006768254785745" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down Expand Up @@ -698,16 +698,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="Libraries/cbor/src">
Expand Down Expand Up @@ -747,16 +747,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main">
Expand Down Expand Up @@ -796,16 +796,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main/config">
Expand Down Expand Up @@ -845,16 +845,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/util">
Expand Down Expand Up @@ -894,16 +894,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main/usb">
Expand Down Expand Up @@ -943,16 +943,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/drivers">
Expand Down Expand Up @@ -992,16 +992,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/system/stm32f405">
Expand Down Expand Up @@ -1041,16 +1041,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/main/rx">
Expand Down Expand Up @@ -1090,16 +1090,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/drivers/usb">
Expand Down Expand Up @@ -1139,16 +1139,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
<resource project-relative-path="src/system/stm32f411">
Expand Down Expand Up @@ -1305,16 +1305,16 @@
<entry kind="includePath" name="/${ProjName}/Libraries/STM32F4xx_StdPeriph_Driver/inc">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/src/targets/pyrodrone_f4">
<entry kind="includePath" name="/${ProjName}/src/targets/bluejayf4">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="includePath" name="/${ProjName}/Libraries/cbor/src">
<flag value="VALUE_WORKSPACE_PATH"/>
</entry>
<entry kind="macro" name="GIT_VERSION" value="0c6f61398f5017d6a14697aae527ef013648985f"/>
<entry kind="macro" name="GIT_VERSION" value="1577a5e6f6a02722ce826e411905295851e3b0b6"/>
<entry kind="macro" name="STM32F40XX" value="1"/>
<entry kind="macro" name="STM32F4XX" value="1"/>
<entry kind="macro" name="TARGET" value="pyrodrone_f4"/>
<entry kind="macro" name="TARGET" value="bluejayf4"/>
<entry kind="macro" name="USE_STDPERIPH_DRIVER" value="1"/>
</resource>
</language>
Expand Down Expand Up @@ -1370,7 +1370,7 @@
</resource>
</language>
</provider>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1315978123255115236" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1116006768254785745" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
12 changes: 12 additions & 0 deletions script/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,17 @@
}
}
]
},
{
"name": "bluejayf4",
"configurations": [
{
"name": "brushless.serial",
"defines": {
"BRUSHLESS_TARGET": "",
"RX_UNIFIED_SERIAL": ""
}
}
]
}
]
12 changes: 10 additions & 2 deletions src/drivers/drv_spi_mpu6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
#endif
#endif

#if defined(ICM20608_SPI_PORT) && defined(ICM20608_NSS)
#define MPU6XXX_SPI_PORT ICM20608_SPI_PORT
#define MPU6XXX_NSS ICM20608_NSS
#ifdef ICM20608_INT
#define MPU6XXX_INT ICM20608_INT
#endif
#endif

#define PORT spi_port_defs[MPU6XXX_SPI_PORT]
#define SCLK_PIN gpio_pin_defs[PORT.sck]
#define MISO_PIN gpio_pin_defs[PORT.miso]
Expand Down Expand Up @@ -129,7 +137,7 @@ void spi_MPU6XXX_reinit_slow(void) {
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
#if defined(ICM20601_SPI_PORT) //5.25mhz SPI
#if defined(ICM20601_SPI_PORT) || defined(ICM20608_SPI_PORT) //5.25mhz SPI
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8;
#else
#if defined(ICM20602_SPI_PORT) //10mhz SPI
Expand Down Expand Up @@ -157,7 +165,7 @@ void spi_MPU6XXX_reinit_fast(void) {
SPI_InitStructure.SPI_CPOL = SPI_CPOL_High;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_2Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
#if defined(ICM20601_SPI_PORT) //5.25mhz SPI
#if defined(ICM20601_SPI_PORT) || defined(ICM20608_SPI_PORT) //5.25mhz SPI
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8;
#else
#if defined(ICM20602_SPI_PORT) //10mhz SPI
Expand Down
10 changes: 5 additions & 5 deletions src/targets/bluejayf4/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@
#define FPV_PORT GPIOA

//GYRO
#define MPU6XXX_SPI_PORT SPI_PORT1
#define MPU6XXX_NSS PIN_C4
#define MPU6XXX_INT PIN_C5
#define ICM20608_SPI_PORT SPI_PORT1
#define ICM20608_NSS PIN_C4
#define ICM20608_INT PIN_C5
#define USE_DUMMY_I2C
#define GYRO_ID_1 0x68
#define GYRO_ID_1 0xAF
#define GYRO_ID_2 0x73
#define GYRO_ID_3 0x78
#define GYRO_ID_4 0x71
#define SENSOR_ROTATE_90_CCW
#define SENSOR_ROTATE_90_CW

//RADIO
#define USART6_INVERTER_PIN PIN_B15
Expand Down

0 comments on commit 8588ec6

Please sign in to comment.