Hi Stefan,
Thank you! Trying to implement your suggestion:
unsigned char read_sensor_xcvu125(unsigned char *value, unsigned short i2c_addr){
// Command is 4 bytes as DPR Read command is 32-bit (p.62 Figure 3-10)
// [31:30] = xx (set to 00)
// [29:26] = CMD [3:0]=0001 for DPR Read (p.63 Table 3-11)
// [25:16] = DPR Address [9:0] = 0 for Temperature register
// [15:0] = DPR Data [15:0] - N/A for Read command, set to 0
// 00_0001_0000000000_0000000000000000 > 0000_0100_0000_0000 > 0x04000000
unsigned int reg = 0x04000000;
// Data Buffer
unsigned char dataBuff[2]; // 2 bytes as DPR Data is 16-bit
// char i2c_dev_read_4bytesReg(unsigned short addr, unsigned int reg, unsigned char *pdata, unsigned char size)
char i2c_dev_read_4bytesReg(i2c_addr, reg, dataBuff, 2);
// Temperature register [15:0], temperature data 10-bit → Bit15=MSB Bit6=LSB
// 8 MSB from dataBuff[1]=Data[15:8]
*value = dataBuff[1];
return 0x00; //return non-zero value in case of reading error (sensor not updated)
}
However, got the error:
→ Compile IPMC source code
make: Entering directory ‘/tmp/comp-4j5EU7HJQ1’
ipmc-sensors/sensor_xcvu125.c: In function ‘read_sensor_xcvu125’:
ipmc-sensors/sensor_xcvu125.c:106: error: expected ‘)’ before numeric constant
ipmc-sensors/sensor_xcvu125.c:100: warning: unused variable ‘reg’
make: *** [ipmc-core/NR-RULES:104: ipmc-core/.objs/ipmc-sensors/sensor_xcvu125.o] Error 1
make: Leaving directory ‘/tmp/comp-4j5EU7HJQ1’
Error: IPMC configuration failed. This issue has been automatically reported
→ Compilation error
Cheers,
Yuri