vrahane opened a new pull request #505: [WIP, DO NOT MERGE] MYNEWT-828 
SensorAPI: Sensor OIC notifications/triggers
URL: https://github.com/apache/mynewt-core/pull/505
 
 
   - Add API for setting threshold based on polling mechanism
   - Also allow the API to set thresholds based on interrupts mechanism
   - Design is as follows: 
   i. It adds a list of structures sensor_traits_list to the sensor structure 
which keeps track of per type thresholds, oic resources, algorithm, etc. These 
thresholds are then compared with the readings from the sensor at the specific 
poll rates based on algorithms decided by the developer: 
<SENSOR_THRESH_ALGO_WINDOW> and <SENSOR_THRESH_ALGO_WATERMARK>. 
   <SENSOR_THRESH_ALGO_WINDOW>: Sensor data is compared to thresholds making a 
window.
   <SENSOR_THRESH_ALGO_WATERMARK>: Sensor data is compared to thresholds based 
on watermarks
   Notifications are sent if conditions are satisfied as per the above 
algorithms.
   If a set_thresh callback is specified in the driver, this callback will get 
called which will enable interrupts based notifications for specific sensor 
drivers. An example of this can be seen in 
[hw/drivers/sensors/lis2dh12/src/lis2dh12.c](https://github.com/apache/mynewt-core/compare/master...vrahane:sensor_notif?expand=1#diff-18789c89dd99a5f02122ee67a80b82a1).
   ii. Syscfg <SENSOR_OIC_PERIODIC>: This is a new syscfg which enables or 
disables periodic observation of sensor resources. By default it is enabled in 
the sensors test app.
   iii. There were two fields added to <struct sensor_itf>: <si_low_pin> & 
<si_high_pin> which lets the developer specify the interrupt pins in the bsp 
along with the interface and chip select if any.
   iv. A lot of functions were added to the lis2dh12 driver to support 
interrupt functionality.
   (The current interrupt config for lis2dh12 enables the low thresh interrupts 
and high thresh interrupts but it somehow only generates an interrupt on a 
change in the accelerometer data crossing a threshold instead of generating one 
based on threshold regardless, this needs to be investigated further). 
   Jira Ticket: https://issues.apache.org/jira/browse/MYNEWT-828
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to