Lesson 12 - #122
Open
megaparanoik wants to merge 8 commits into
Open
Lesson 12#122megaparanoik wants to merge 8 commits into
megaparanoik wants to merge 8 commits into
Conversation
added 8 commits
January 18, 2019 00:11
As a base we took a driver from lesson 11. Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
In order to have access from user-space we implement a char device interface which allocates /dev/accel device Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Just to inform a user that the device doesn't support a read operation we print a message to use IOCTL instead. Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Since the driver doesn't allow any input parameter we just return EFAULT. Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
To be able to get acces to the device we have implemented a user space application which interacts with the driver via read/write operations an IOCTLs. Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
application Signed-off-by: Aleksandr Androsov <eelleekk.gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There was added a char device interface to the existed mpu6050 driver.
Now the driver allocates the char device file /dev/accel.
There were implemented write and read operation but they are extremely limited.
Essentially, the driver doesn't allow direct read or write thus we just inform a userspace application to use IOCTL instead.
The IOCTLs Implemented allow to get access to the raw accelerometer data, a statistic related to IRQ handling.
Also, these IOCTLs allow writing and reading to/from any register in IC directly.