Hello Ali,
i2c_smbus_read_byte_data(data->client, MMA8452_TRANSIENT_SRC);
It is the only function that you can use in UserSpace, with the I2Ctools Utility that can be access as command in UserSpace. So instead of reading the values of the Accelerometer with the
iio_push_event(indio_dev, IIO_MOD_EVENT_CODE(IIO_ACCEL, 0, IIO_MOD_X, IIO_EV_TYPE_MAG, IIO_EV_DIR_RISING), ts);
Just make thei2c_smbus_read_byte_data(data->client, MMA8452_TRANSIENT_SRC);
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------