Lesson 11. MPU6050 with IRQ and filter #119
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a sysfs module code based on sysfs module from MPU6050 lesson.
To build the module you should first export the BUILD_KERNEL environment variable, that points to a kernel directory.
The module implements detection, initialization, and handling of MPU6050 chip.
The module creates an interface at /sys/class/mpu6050.
A set of properties allow getting access to:
raw accelerometer data,
/sys/class/mpu6050/accel_x
/sys/class/mpu6050/accel_y
/sys/class/mpu6050/accel_z
raw gyroscope data,
/sys/class/mpu6050/gyro_x
/sys/class/mpu6050/gyro_y
/sys/class/mpu6050/gyro_z
smoothed accelerometer data,
/sys/class/mpu6050/sma_x
/sys/class/mpu6050/sma_y
/sys/class/mpu6050/sma_z
raw temperature data.
/sys/class/mpu6050/temp
Also, the module provides some statistic such as a number of handled irq since the module started and speed of irq handling.
/sys/class/mpu6050/irq_speed
/sys/class/mpu6050/irq_handled