mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
Merge pull request #7260 from AlienWiiBF/I2C_GENERIC_CONFIG
Make I2C pullups and overclocking configurable for generic targets
This commit is contained in:
commit
24344405fb
4 changed files with 22 additions and 0 deletions
|
@ -69,6 +69,7 @@
|
|||
#include "pg/adc.h"
|
||||
#include "pg/beeper.h"
|
||||
#include "pg/beeper_dev.h"
|
||||
#include "pg/bus_i2c.h"
|
||||
#include "pg/dashboard.h"
|
||||
#include "pg/flash.h"
|
||||
#include "pg/gyrodev.h"
|
||||
|
@ -1260,6 +1261,24 @@ const clivalue_t valueTable[] = {
|
|||
{ "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
|
||||
#ifdef I2C_FULL_RECONFIGURABILITY
|
||||
#ifdef USE_I2C_DEVICE_1
|
||||
{ "i2c1_pullup", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 0, pullUp) },
|
||||
{ "i2c1_overclock", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 0, overClock) },
|
||||
#endif
|
||||
#ifdef USE_I2C_DEVICE_2
|
||||
{ "i2c2_pullup", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 1, pullUp) },
|
||||
{ "i2c2_overclock", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 1, overClock) },
|
||||
#endif
|
||||
#ifdef USE_I2C_DEVICE_3
|
||||
{ "i2c3_pullup", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 2, pullUp) },
|
||||
{ "i2c3_overclock", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 2, overClock) },
|
||||
#endif
|
||||
#ifdef USE_I2C_DEVICE_4
|
||||
{ "i2c4_pullup", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 3, pullUp) },
|
||||
{ "i2c4_overclock", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_I2C_CONFIG, PG_ARRAY_ELEMENT_OFFSET(i2cConfig_t, 3, overClock) },
|
||||
#endif
|
||||
#endif
|
||||
#ifdef USE_MCO
|
||||
{ "mco2_on_pc9", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, .config.lookup = { TABLE_OFF_ON }, PG_MCO_CONFIG, offsetof(mcoConfig_t, enabled[1]) },
|
||||
#endif
|
||||
|
|
|
@ -13,6 +13,7 @@ set beeper_od = OFF
|
|||
# Buses
|
||||
resource I2C_SCL 1 B06
|
||||
resource I2C_SDA 1 B07
|
||||
set i2c1_pullup = ON
|
||||
|
||||
resource SPI_SCK 1 A05
|
||||
resource SPI_MISO 1 A06
|
||||
|
|
|
@ -13,6 +13,7 @@ set beeper_od = OFF
|
|||
# Buses
|
||||
resource I2C_SCL 1 B06
|
||||
resource I2C_SDA 1 B07
|
||||
set i2c1_pullup = ON
|
||||
|
||||
resource SPI_SCK 1 A05
|
||||
resource SPI_MISO 1 A06
|
||||
|
|
|
@ -13,6 +13,7 @@ set beeper_od = OFF
|
|||
# Buses
|
||||
resource I2C_SCL 1 B06
|
||||
resource I2C_SDA 1 B07
|
||||
set i2c1_pullup = ON
|
||||
|
||||
resource SPI_SCK 1 A05
|
||||
resource SPI_MISO 1 A06
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue