feat(v16): add gyro support for HelloRadio V16 (#7232)
This commit is contained in:
@@ -147,7 +147,7 @@ elseif (PCB STREQUAL X12S)
|
||||
add_definitions(-DMANUFACTURER_FRSKY)
|
||||
endif()
|
||||
|
||||
# enable GPS support if there is AUX port available unless otherwise disabled
|
||||
# enable GPS support if there is AUX port available unless otherwise disabled
|
||||
if(AUX_SERIAL)
|
||||
option(INTERNAL_GPS "Support for internal GPS" ON)
|
||||
set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
|
||||
@@ -284,6 +284,7 @@ add_library(board OBJECT EXCLUDE_FROM_ALL
|
||||
targets/common/arm/stm32/delays_driver.cpp
|
||||
targets/common/arm/stm32/heartbeat_driver.cpp
|
||||
drivers/lsm6ds.cpp
|
||||
drivers/icm42627.cpp
|
||||
targets/common/arm/stm32/mixer_scheduler_driver.cpp
|
||||
targets/common/arm/stm32/module_timer_driver.cpp
|
||||
targets/common/arm/stm32/sticks_pwm_driver.cpp
|
||||
|
||||
@@ -133,14 +133,23 @@ void audioInit()
|
||||
#endif
|
||||
|
||||
#if defined(HAS_IMU)
|
||||
#include "drivers/lsm6ds.h"
|
||||
#include "gyro.h"
|
||||
#include "stm32_i2c_driver.h"
|
||||
#include "drivers/icm42627.h"
|
||||
#include "drivers/lsm6ds.h"
|
||||
|
||||
static void gyroInit()
|
||||
{
|
||||
#if defined(RADIO_V16)
|
||||
const etx_imu_driver_t *driver = &imu_icm42627_driver;
|
||||
#else
|
||||
const etx_imu_driver_t *driver = &imu_lsm6ds_driver;
|
||||
#endif
|
||||
|
||||
const etx_imu_t candidates[] = {
|
||||
{ &imu_lsm6ds_driver, IMU_I2C_BUS, IMU_I2C_ADDRESS },
|
||||
{ driver, IMU_I2C_BUS, IMU_I2C_ADDRESS },
|
||||
};
|
||||
|
||||
gyroStart(imuDetect(candidates, DIM(candidates)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
#define DEFAULT_6POS_CALIB {3, 12, 21, 30, 38}
|
||||
#define DEFAULT_6POS_IDX 5
|
||||
#endif
|
||||
|
||||
|
||||
// Power
|
||||
#if defined(RADIO_T18)
|
||||
#define PWR_ON_GPIO GPIO_PIN(GPIOJ, 1) // PJ.01
|
||||
@@ -355,7 +355,7 @@
|
||||
#define STORAGE_USE_SDIO // Use SD card for storage with SDIO driver
|
||||
//#define STORAGE_USE_SPI_FLASH // Use SPI flash for storage instead of SD card
|
||||
|
||||
// SPI NOR Flash
|
||||
// SPI NOR Flash
|
||||
#if defined(PCBX12S) && PCBREV >= 13
|
||||
#define FLASH_SPI SPI1
|
||||
#define FLASH_SPI_CS_GPIO GPIO_PIN(GPIOA, 15) // PA.15
|
||||
@@ -374,7 +374,7 @@
|
||||
// #define FLASH_SPI_TX_DMA_IRQHandler DMA2_Stream3_IRQHandler
|
||||
// #define FLASH_SPI_TX_DMA_FLAG_TC DMA_IT_TCIF3
|
||||
// #define FLASH_SPI_TX_DMA_STATUS_REG HISR
|
||||
// SPI1_RX: DMA2 Stream 0 / Stream 2
|
||||
// SPI1_RX: DMA2 Stream 0 / Stream 2
|
||||
// #define FLASH_SPI_RX_DMA_CHANNEL DMA_Channel_3
|
||||
// #define FLASH_SPI_RX_DMA_STREAM DMA2_Stream5
|
||||
// #define FLASH_SPI_RX_DMA_IRQn DMA2_Stream5_IRQn
|
||||
@@ -491,6 +491,9 @@
|
||||
#if defined(PCBX12S)
|
||||
#define IMU_I2C_BUS I2C_Bus_1
|
||||
#define IMU_I2C_ADDRESS 0x6A
|
||||
#elif defined(RADIO_V16)
|
||||
#define IMU_I2C_BUS I2C_Bus_1
|
||||
#define IMU_I2C_ADDRESS 0x69
|
||||
#elif !defined(AUX_SERIAL) && defined(IMU_LSM6DS33)
|
||||
#define IMU_I2C_BUS I2C_Bus_2
|
||||
#define IMU_I2C_ADDRESS 0x6A
|
||||
|
||||
Reference in New Issue
Block a user