Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

andrzej-kaczmarek
Copy link
Contributor

Kudos go to @kasjer - I just made few small fixes in few places and tested this :-)

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.
@vrahane vrahane changed the title hw/drivers/lis2dh12: Add seosor notifications support to LIS2DH12 driver hw/drivers/lis2dh12: Add sensor notifications support to LIS2DH12 driver Oct 10, 2018
Copy link
Contributor

@vrahane vrahane left a 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:

  1. self test run is not implemented
  2. 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>
Copy link
Contributor

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

Copy link
Contributor

@vrahane vrahane left a 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.

@vrahane vrahane closed this Nov 15, 2018
@vrahane
Copy link
Contributor

vrahane commented Nov 15, 2018

This was merged as part of #1520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants