ims: Updated IMS sensor addressing

The IMS library will now change its I2C address after resetting the HW to a new
address.  It will attempt to close the mraa context and re-init each
time.

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck
2017-05-31 14:15:33 -07:00
parent 2b70bea44f
commit da18bac925
4 changed files with 73 additions and 32 deletions

View File

@@ -51,6 +51,8 @@ extern "C" {
typedef struct {
/* mraa i2c context */
mraa_i2c_context _i2c_context;
/* Save the I2C bus (used when changing the device address) */
int16_t _i2c_bus;
} ims_context;
/**
@@ -136,7 +138,7 @@ upm_result_t ims_reset(const ims_context* dev);
* @param address_new New I2C for device
* @return Function result code
*/
upm_result_t ims_reset_i2c_address(const ims_context* dev, uint8_t address_new);
upm_result_t ims_reset_i2c_address(ims_context* dev, uint8_t address_new);
/**
* Put device into low-power mode. Device wakes on any I2C command.