Merge pull request #6872 from AlienWiiBF/GYRO_GENERIC
Update Gyro driver for generic target
This commit is contained in:
commit
29015af2e2
|
@ -3840,6 +3840,9 @@ const cliResourceValue_t resourceTable[] = {
|
|||
#endif
|
||||
#ifdef USE_RX_SPI
|
||||
DEFS( OWNER_RX_SPI_CS, PG_RX_SPI_CONFIG, rxSpiConfig_t, csnTag ),
|
||||
#endif
|
||||
#ifdef USE_GYRO_EXTI
|
||||
DEFW( OWNER_GYRO_EXTI, PG_GYRO_DEVICE_CONFIG, gyroDeviceConfig_t, extiTag, 2 ),
|
||||
#endif
|
||||
DEFW( OWNER_GYRO_CS, PG_GYRO_DEVICE_CONFIG, gyroDeviceConfig_t, csnTag, 2 ),
|
||||
#ifdef USE_USB_DETECT
|
||||
|
|
|
@ -1177,11 +1177,13 @@ const clivalue_t valueTable[] = {
|
|||
{ "gyro_1_spibus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, SPIDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, spiBus) },
|
||||
{ "gyro_1_i2cBus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2CDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, i2cBus) },
|
||||
{ "gyro_1_i2c_address", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2C_ADDR7_MAX }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, i2cAddress) },
|
||||
{ "gyro_1_sensor_align", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_ALIGNMENT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 0, align) },
|
||||
#ifdef USE_MULTI_GYRO
|
||||
{ "gyro_2_bustype", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_BUS_TYPE }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, bustype) },
|
||||
{ "gyro_2_spibus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, SPIDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, spiBus) },
|
||||
{ "gyro_2_i2cBus", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2CDEV_COUNT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, i2cBus) },
|
||||
{ "gyro_2_i2c_address", VAR_UINT8 | MASTER_VALUE, .config.minmax = { 0, I2C_ADDR7_MAX }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, i2cAddress) },
|
||||
{ "gyro_2_sensor_align", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_ALIGNMENT }, PG_GYRO_DEVICE_CONFIG, PG_ARRAY_ELEMENT_OFFSET(gyroDeviceConfig_t, 1, align) },
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
|
@ -36,8 +36,10 @@ resource SPI_PREINIT_IPU 2 A15 // SDCARD
|
|||
|
||||
# Acc/gyro
|
||||
resource gyro_cs 1 C4
|
||||
resource GYRO_EXTI 1 B15
|
||||
set gyro_1_bustype = SPI
|
||||
set gyro_1_spibus = 1
|
||||
set gyro_1_sensor_align = CW0
|
||||
#set gyro_1_hardware = MPU6500 # Not working (yet ... will it ever?)
|
||||
|
||||
# Timers
|
||||
|
|
|
@ -43,18 +43,6 @@
|
|||
#define USE_GYRO_SPI_MPU6500
|
||||
// Other USE_ACCs and USE_GYROs should follow
|
||||
|
||||
#define GYRO_1_SPI_INSTANCE NULL
|
||||
#define GYRO_1_CS_PIN NONE
|
||||
#define GYRO_1_ALIGN ALIGN_DEFAULT
|
||||
#define ACC_1_ALIGN ALIGN_DEFAULT
|
||||
#define GYRO_1_EXTI_PIN PB15 // XXX Should be gone
|
||||
|
||||
#define GYRO_2_SPI_INSTANCE NULL
|
||||
#define GYRO_2_CS_PIN NONE
|
||||
#define GYRO_2_ALIGN ALIGN_DEFAULT
|
||||
#define ACC_2_ALIGN ALIGN_DEFAULT
|
||||
#define GYRO_2_EXTI_PIN NONE
|
||||
|
||||
#define GYRO_CONFIG_USE_GYRO_DEFAULT GYRO_CONFIG_USE_GYRO_1
|
||||
|
||||
#define USE_MAG
|
||||
|
|
|
@ -246,6 +246,14 @@
|
|||
#define ACC_2_ALIGN ALIGN_DEFAULT
|
||||
#endif
|
||||
|
||||
#if !defined(GYRO_1_SPI_INSTANCE)
|
||||
#define GYRO_1_SPI_INSTANCE NULL
|
||||
#endif
|
||||
|
||||
#if !defined(GYRO_1_CS_PIN)
|
||||
#define GYRO_1_CS_PIN NONE
|
||||
#endif
|
||||
|
||||
#if !defined(GYRO_1_EXTI_PIN)
|
||||
#define GYRO_1_EXTI_PIN NONE
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue