lsm9ds0: added constructor option to allow raw i2c bus init

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Mihai Tudor Panu 2016-05-12 14:01:45 -07:00
parent de986764d4
commit 1eafab7932
2 changed files with 6 additions and 3 deletions

View File

@ -33,8 +33,8 @@ using namespace upm;
using namespace std;
LSM9DS0::LSM9DS0(int bus, uint8_t gAddress, uint8_t xmAddress) :
m_i2cG(bus), m_i2cXM(bus), m_gpioG_INT(0), m_gpioG_DRDY(0),
LSM9DS0::LSM9DS0(int bus, bool raw, uint8_t gAddress, uint8_t xmAddress) :
m_i2cG(bus, raw), m_i2cXM(bus, raw), m_gpioG_INT(0), m_gpioG_DRDY(0),
m_gpioXM_GEN1(0), m_gpioXM_GEN2(0)
{
m_gAddr = gAddress;

View File

@ -1058,9 +1058,12 @@ namespace upm {
* lsm9ds0 constructor
*
* @param bus i2c bus to use
* @param raw bypass board definition file, set to true if using Sparkfun
* 9DOF Block on an Intel Edison Arduino board
* @param address the address for this device
*/
LSM9DS0(int bus=LSM9DS0_I2C_BUS,
LSM9DS0(int bus=LSM9DS0_I2C_BUS,
bool raw=false,
uint8_t gAddress=LSM9DS0_DEFAULT_GYRO_ADDR,
uint8_t xmAddress=LSM9DS0_DEFAULT_XM_ADDR);