Skip to content

Linux kernel driver There are driver code that are updated or introduced add new feature to bmi160: iio event and more iio trigger qt60248 QMatrix key controller

Notifications You must be signed in to change notification settings

crz21/linux-driver-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Linux kernel driver

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.

BMI160 - Bosch IMU (accel, gyro plus external magnetometer)

Upgrade from mainline

  • 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.

Add new features

  • 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
    • Get available 3dB cutoff frequencies that depend on the sampling rate.

    • Read and write raw value of IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY line 893 line 927
      Set IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY bit in info_mask_shared_by_type of iio_chan_spec structure code

  • 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

About

Linux kernel driver There are driver code that are updated or introduced add new feature to bmi160: iio event and more iio trigger qt60248 QMatrix key controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 99.6%
  • Makefile 0.4%