ist8310:Expand suported busses to External I2C 1-4

This commit is contained in:
David Sidrane 2017-08-24 15:16:52 -10:00
parent a3b39394b8
commit 24522ca885
1 changed files with 15 additions and 3 deletions

View File

@ -175,8 +175,11 @@ static const int16_t IST8310_MIN_VAL_Z = -IST8310_MAX_VAL_Z;
enum IST8310_BUS {
IST8310_BUS_ALL = 0,
IST8310_BUS_I2C_EXTERNAL = 1,
IST8310_BUS_I2C_INTERNAL = 2,
IST8310_BUS_I2C_EXTERNAL = 1,
IST8310_BUS_I2C_EXTERNAL1 = 2,
IST8310_BUS_I2C_EXTERNAL2 = 3,
IST8310_BUS_I2C_EXTERNAL3 = 4,
IST8310_BUS_I2C_INTERNAL = 5,
};
#ifndef CONFIG_SCHED_WORKQUEUE
@ -1277,6 +1280,15 @@ struct ist8310_bus_option {
IST8310 *dev;
} bus_options[] = {
{ IST8310_BUS_I2C_EXTERNAL, "/dev/ist8310_ext", PX4_I2C_BUS_EXPANSION, NULL },
#ifdef PX4_I2C_BUS_EXPANSION1
{ IST8310_BUS_I2C_EXTERNAL1, "/dev/ist8311_int", PX4_I2C_BUS_EXPANSION1, NULL },
#endif
#ifdef PX4_I2C_BUS_EXPANSION2
{ IST8310_BUS_I2C_EXTERNAL2, "/dev/ist8312_int", PX4_I2C_BUS_EXPANSION2, NULL },
#endif
#ifdef PX4_I2C_BUS_EXPANSION3
{ IST8310_BUS_I2C_EXTERNAL3, "/dev/ist8313_int", PX4_I2C_BUS_EXPANSION3, NULL },
#endif
#ifdef PX4_I2C_BUS_ONBOARD
{ IST8310_BUS_I2C_INTERNAL, "/dev/ist8310_int", PX4_I2C_BUS_ONBOARD, NULL },
#endif
@ -1548,7 +1560,7 @@ usage()
PX4_INFO(" -R rotation");
PX4_INFO(" -C calibrate on start");
PX4_INFO(" -a 12C Address (0x%02x)", IST8310_BUS_I2C_ADDR);
PX4_INFO(" -b 12C bus (%d|%d)", IST8310_BUS_I2C_EXTERNAL, IST8310_BUS_I2C_INTERNAL);
PX4_INFO(" -b 12C bus (%d-%d)", IST8310_BUS_I2C_EXTERNAL, IST8310_BUS_I2C_INTERNAL);
}
} // namespace