we are using P2020 Processor with the linux platform, I2C interface with LIS331DLH Accelerometer sensor
Actually i am writing the application in the user level to read Accelerometer LIS331DLH sensor data X-axis, Y-axis,Z-axis Value
here i am facing issue, i want write the data in particular address to Enable (EN_X_Y_Z); //CTRL_REG1 register enable X-axis, Y-axis,Z-axis in normal mode , how we read the data from specific register address? kindly guide me.
CTRL_REG1= 0x20; // Register address
EN_X_Y_Z= 0x27; // Data
how can i write 0x27 data in the CTRL Register1 address location 0x20 ,please tell me
unsigned char reg_buf;
buf= 0x30; // write address
buf=0x20; // register address
buf=0x27; // data
write(fd, reg_buf, sizeof(buf)); // for your reference i have attached my program
how we write, read I2C register's Data using system call, kindly help me i am hanging here i am not able to read Accelerometer sensor registers from particular location data , please send sample program.