-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hw/drivers/lis2dh12: Add sensor notifications support to LIS2DH12 driver #1394
Conversation
Some bit fields were privet even though they were needed for functions settings registers with those fields.
This adds lis2dh12_write8 to simplify writes (no variable is needed to write simple valuse). This adds also lis2dh12_read8 for completeness.
- lis2dh12_clear_intX functions now return active interrupts - lis2dh12_enable_intX now value is passed by value not pointer - possible uninitialized variable now initialized
Added functions for click and activity registers.
Simple shell commands based on lis2dw12.
This adds support for sensors notifications with all required configuration to configure supported detection options in accel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the code looks fine, I see two main issues here:
- self test run is not implemented
- X,Y and Z notifications should be broken into X -> X_L and X_H and Y -> Y_L, Y_H and Z -> Z_L, Z_H. Please refer lis2dw12.c for the exact changes. I haven't really tested it but rest looks ok.
@@ -34,6 +34,80 @@ | |||
#include "modlog/modlog.h" | |||
#include "stats/stats.h" | |||
#include <syscfg/syscfg.h> | |||
#include <sensor/sensor.h> | |||
#include <console/console.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include <console/console.h>
should be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it would be helpful for testing if the sensor/creator has some more config options for offboard testing.
This was merged as part of #1520 |
Kudos go to @kasjer - I just made few small fixes in few places and tested this :-)