INSAT Mini Project

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Fork of X_NUCLEO_6180XA1 by ST

Files at this revision

API Documentation at this revision

Comitter:
licio.mapelli@st.com
Date:
Tue Sep 29 15:40:08 2015 +0200
Parent:
8:f943a1fca15f
Child:
10:4954b09b72d8
Commit message:
Fixed i2c wr

Changed in this revision

Components/VL6180X/vl6180x_class.cpp Show annotated file Show diff for this revision Revisions of this file
Components/VL6180X/vl6180x_class.h Show annotated file Show diff for this revision Revisions of this file
--- a/Components/VL6180X/vl6180x_class.cpp	Tue Sep 29 14:50:15 2015 +0200
+++ b/Components/VL6180X/vl6180x_class.cpp	Tue Sep 29 15:40:08 2015 +0200
@@ -382,10 +382,12 @@
     if( status ){
         VL6180x_ErrLog("new i2c addr Wr fail");
     }
+		DevData.I2cAddr = NewAddress;
     LOG_FUNCTION_END(status);
     return status;
 }
 
+
 uint16_t VL6180X::VL6180x_GetUpperLimit(VL6180xDev_t dev) {
     uint16_t limit;
     int scaling;
@@ -2574,7 +2576,7 @@
 		{  	 
         memcpy(tmp+sizeof(RegisterAddr), pBuffer, NumByteToWrite);
     }
-    ret = dev_i2c.write(DeviceAddr, (const char*)tmp, NumByteToWrite+sizeof(RegisterAddr), false);
+    ret = dev_i2c.write(WriteDeviceAddr, (const char*)tmp, NumByteToWrite+sizeof(RegisterAddr), false);
  
     if(ret) return -1;
     return 0;
--- a/Components/VL6180X/vl6180x_class.h	Tue Sep 29 14:50:15 2015 +0200
+++ b/Components/VL6180X/vl6180x_class.h	Tue Sep 29 15:40:08 2015 +0200
@@ -219,7 +219,8 @@
 		int VL6180x_UpdateByte(VL6180xDev_t dev, uint16_t index, uint8_t AndData, uint8_t OrData);
     int VL6180x_I2CWrite(uint8_t DeviceAddr, uint16_t RegisterAddr, uint8_t *pBuffer, uint16_t NumByteToWrite);
     int VL6180x_I2CRead(uint8_t DeviceAddr, uint16_t RegisterAddr, uint8_t *pBuffer, uint16_t NumByteToRead);
-		
+
+		VL6180xDev_t  DevData;
 
 private:
     /*** Instance Variables ***/
@@ -228,7 +229,7 @@
     DigitalOut *gpio0;
     STMPE1600DigiOut *expgpio0;  
 
-		VL6180xDev_t  DevData;
+//		VL6180xDev_t  DevData;
 //    VL6180xDev_t MyDeviceAddress;
 //    unsigned Present;
 //    unsigned Ready;