There is a updated driver code that is inherited from Toradex linux kernel.
Updated driver code: bmi160.
New kernel driver module is qt60248 QMatrix touch sensor.
- insert of_match_table into driver structure. code
- config irq reading of_node "INT1" or "INT2". code
- set DRDY bit in interrupt enable register.
- set data ready trigger.
- Fast offset compensation
- Add new sysfs attributes for fast offset compensation:
-
gyro_offset_enable:
Enable offset compensation for gyroscope code -
accel_offset_enable:
Enable offset compensation for accelerometer code -
gyro_calib_config:
Enable fast offset calibration for gyroscope code -
accel_x_calib_config, accel_y_calib_config, accel_x_calib_config:
Set compensation target value for x, y ,z axis of the accelerometer:
disabled, +1g, -1g or 0g code -
Fast offset compensation start code
-
- Add low pass filter for the accelerometer sensor data
- There are 3 kind of iio trigger are registered: code
And set state of trigger: code-
bmi160-dev trigger based on data ready interrupt
Data ready interrupt can be mapped to the appropriate pin (INT1 or INT2). When DRDY interrupt is mapped, other interrupt should not be mapped to the same pin. code -
bmi160-any-motion-dev trigger based on any motion interrupt Any motion interrupt can be mapped to the appropriate pin (INT1 or INT2) only when DRDY interrupt is not set and mapped. code
-
bmi160-no-motion-dev trigger based on no motion interrupt No motion interrupt can be mapped to the appropriate pin (INT1 or INT2) only when DRDY interrupt is not set and mapped. code
-
- Add IIO Event management.
-
Any motion event is associated with iio event called in_roc_rising. code
There are two attributes: Rate of change threshold, and period. -
No motion event is associated with iio event called in_roc_falling. code
There are two attributes: Rate of change threshold, and period. (read event) (write event)
-
- Allocate an interrupt line for iio device code
-
bmi160_irq_handler: Function to be called when the IRQ occur. code
This funclion calls iio_trigger_poll with all triggers that are enabled.
Function bmi160_trigger_handler is called if there is a enabled trigger. code -
bmi160_irq_thread_handler: Function to be called in a threaded interrupt context. code
-