Problems working with I2C and the AMS TCS3701 on the nrf52832 DK Zephyr

I was able to write some I2C code to successfully work with the TCS34725 by porting a library from Arduino without fully understanding what was going on.  Now I have to port that code to work with the TCS3701 that also communicates via I2C.  I again found a library (https://github.com/Tvirus/tcs3701_driver) and worked to port that to Zephyr

Now, any call to i2c_read or i2c_write returns -5 which is IOERROR

My previous overlay file for the TCS34725 that was working was this:

&i2c1 {
	compatible = "nordic,nrf-twi";
	status = "okay";
	sda-pin = <30>;
	scl-pin = <31>;
	clock-frequency = <I2C_BITRATE_STANDARD>;

	tsc34725@29 {
		compatible = "adafruit,tcs34725";
		label = "TSC34725";
		reg = <0x29>;

	};
};

I now updated it, based on the tcs3701 driver I found, to this:

&i2c1 {
	compatible = "nordic,nrf-twi";
	status = "okay";
	sda-pin = <30>;
	scl-pin = <31>;
	clock-frequency = <I2C_BITRATE_STANDARD>;

	tsc3701@39 {
		compatible = "ams,tcs3701";
		label = "TSC3701";
		reg = <0x39>;
	};
};

 

My question is about the registry address in the device tree overlay.  In the spec sheet for the TCS3701 (https://ams.com/documents/20143/36005/TCS3701_DS000624_4-00.pdf) it only mentions the number 0x39 when it talks about contact info.  And for the TCS34725 it also only mentions the number 0x29 when it talks about contact info.  What does specifying the registry address in the device tree accomplish?

Parents Reply Children
No Data
Related