Apologies for not being clear !!
Let me try to explain again.
Our objective is to read the inbuilt temperature sensor data from IMX219 camera.
Register to measure temperature value : 0x0140
Now as per the data sheet of IMX219, we can read the temperature register after streaming of camera.
Once the streaming is started, we have to enable the temperature register to measurement mode & then read the value from it.
For validation, we have used gstreamer command to stream the imx219 camera in one terminal & in another terminal we used “i2ctransfer” commands to enable & read temperature register.
Commands are :
sudo i2ctransfer -f -y 6 w3@0x10 0x01 0x40 0x80 → To enable temperature measurement mode
sudo i2ctransfer -f -y 6 w2@0x10 0x01 0x40 r1 → Reads the temperature value. For. eg: 0x32 and so on.
Now, instead of using i2ctransfer command, we want to do the same from imx219 driver. So, we are using imx219_write_reg() & imx219_read_reg() to write/read the temperature register.
Followed the same process to first enable the temperature measurement by writing “0x80” to temperature register & then read back from it.
err = imx219_write_reg(s_data, IMX219_TEMP, 0x80);
if(err)
printk("error writing temp. reg\n");
imx219_read_reg(s_data, IMX219_TEMP, &dev_temp_val);
return sprintf(buf, "%d\n", dev_temp_val);
Reading the register here, should give us some temperature value , whereas it only gives us what we have written to it.
I have attached the snapshot of temperature register from IMX219 datasheet.
