Ultra-compact high-performance eCompass module: ultra-low power 3D accelerometer and 3D magnetometer.
Dependencies: X_NUCLEO_COMMON ST_INTERFACES
Dependents: HelloWorld_ST_Sensors MOTENV_Mbed mbed-os-mqtt-client LSM303AGR_JS ... more
Diff: LSM303AGRMagSensor.cpp
- Revision:
- 1:86d530a7f949
- Parent:
- 0:ec6e59cc6f40
- Child:
- 2:e37be5550633
diff -r ec6e59cc6f40 -r 86d530a7f949 LSM303AGRMagSensor.cpp --- a/LSM303AGRMagSensor.cpp Mon Sep 04 16:08:24 2017 +0000 +++ b/LSM303AGRMagSensor.cpp Wed Sep 27 16:49:51 2017 +0200 @@ -47,18 +47,10 @@ * @param i2c object of an helper class which handles the I2C peripheral * @param address the address of the component's instance */ -LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C &i2c) : _dev_i2c(i2c) +LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C *i2c, uint8_t address, PinName intmag_pin) : + _dev_i2c(i2c), _address(address), _cs_pin(NC), _intmag_pin(intmag_pin) { - _address = LSM303AGR_MAG_I2C_ADDRESS; -}; - -/** Constructor - * @param i2c object of an helper class which handles the I2C peripheral - * @param address the address of the component's instance - */ -LSM303AGRMagSensor::LSM303AGRMagSensor(DevI2C &i2c, uint8_t address) : _dev_i2c(i2c), _address(address) -{ - + assert (i2c); }; /**