jacobrosenthal commented on issue #948: Sensors: lis2ds12
URL: https://github.com/apache/mynewt-core/pull/948#issuecomment-394074416
 
 
   Im doneish for now.  Im (to my knowledge) fully caught up with changes on 
the lis2dw12 driver.
   Mainly Ive tested single tap and double tap and general reading/polling in 
the shell though not 4d, 6d, freefall, fifo, inactivity sleep, anything on 
interrupt 2, or interrupt mapping as I dont have any code or use cases for 
those myself atm, and requests have gone unanswerd.
   
   for posterity sensors_test is a good test with cli and stats enabled 
something like this
   
   ```
   syscfg.vals:
       I2C_0: 1
       I2C_0_PIN_SCL: 29
       I2C_0_PIN_SDA: 28
       I2C_0_FREQ_KHZ: 100
   
       LIS2DS12_OFB: 1
       LIS2DS12_INT1_PIN_HOST: 4
       LIS2DS12_INT1_PIN_DEVICE: 1
       LIS2DS12_CLI: 1
   
       SHELL_TASK: 1
       STATS_CLI: 1
   ```
   
   ```
   000018 [ts=140616ssb, mod=4 level=0] Command complete: cmd_pkts=1 ogf=0x0 
ocf=0x0
   stat lis2ds12_0
   stat lis2ds12_0
   000684 write_errors: 0
   000684 read_errors: 0
   000684 single_tap_notify: 0
   000684 double_tap_notify: 0
   000684 free_fall_notify: 0
   000684 sleep_notify: 0
   000684 wakeup_notify: 0
   001049 compat> sensor notify lis2ds12_0 on single
   sensor notify lis2ds12_0 on single
   002482 compat> stat lis2ds12_0
   stat lis2ds12_0
   002975 write_errors: 0
   002975 read_errors: 0
   002975 single_tap_notify: 1
   002975 double_tap_notify: 0
   002975 free_fall_notify: 0
   002975 sleep_notify: 0
   002975 wakeup_notify: 0
   003391 compat> sensor notify lis2ds12_0 off single
   sensor notify lis2ds12_0 off single
   005118 compat> sensor notify lis2ds12_0 on double
   sensor notify lis2ds12_0 on double
   006091 compat> stat lis2ds12_0
   stat lis2ds12_0
   006520 write_errors: 0
   006520 read_errors: 0
   006520 single_tap_notify: 1
   006520 double_tap_notify: 1
   006520 free_fall_notify: 0
   006520 sleep_notify: 0
   006520 wakeup_notify: 0
   009668 compat> sensor notify lis2ds12_0 off double
   sensor notify lis2ds12_0 off double
   011408 compat> stat lis2ds12_0
   stat lis2ds12_0
   011702 write_errors: 0
   011702 read_errors: 0
   011702 single_tap_notify: 2
   011702 double_tap_notify: 2
   011702 free_fall_notify: 0
   011702 sleep_notify: 0
   011702 wakeup_notify: 0
   011703 compat> stat lis2ds12_0
   
   
   033331 compat> lis2ds12 chipid
   lis2ds12 chipid
   034110 CHIP_ID:0x43
   034110 compat> 
   
   034110 compat> lis2ds12 test
   lis2ds12 test
   035641 SELF TEST: PASSED
   035641 compat> 
   
   035641 compat> lis2ds12 peek 35
   lis2ds12 peek 35
   037488 reg 0x23(35) = 0x00
   
   037488 compat> lis2ds12 r 5 
   lis2ds12 r 5
   039862 x:9.718390464 y:0.254972912 z:-1.255251168
   039862 x:9.698777216 y:0.254972912 z:-1.255251168
   039863 x:9.738003712 y:0.235359616 z:-1.245444544
   039863 x:9.708583808 y:0.235359616 z:-1.206218000
   039863 x:9.698777216 y:0.235359616 z:-1.255251168
   039863 compat> 
   
   
   005464 compat> sensor list
   sensor list
   005809 sensor dev = lis2ds12_0, configured type = 0x1 
   005809 compat> 
   
   
   000224 compat> sensor read lis2ds12_0 1 -n 5
   sensor read lis2ds12_0 1 -n 5
   000518 ts: [ secs: 4 usecs: 49344 cputime: 132691 ]
   000518 x = 9.708583808 y = 0.215746320 z = -1.245444544
   000518 ts: [ secs: 4 usecs: 51815 cputime: 132772 ]
   000518 x = 9.738003712 y = 0.235359616 z = -1.265057808
   000519 ts: [ secs: 4 usecs: 54317 cputime: 132854 ]
   000519 x = 9.757617024 y = 0.245166256 z = -1.235637904
   000519 ts: [ secs: 4 usecs: 56788 cputime: 132935 ]
   000519 x = 9.698777216 y = 0.215746320 z = -1.294477824
   000519 ts: [ secs: 4 usecs: 59290 cputime: 133017 ]
   000519 x = 9.698777216 y = 0.235359616 z = -1.216024640
   000519 compat> 
   
   
   003423 compat> sensor read lis2ds12_0 1 -i 100 -d 500
   sensor read lis2ds12_0 1 -i 100 -d 500
   004728 ts: [ secs: 36 usecs: 941276 cputime: 1210494 ]
   004728 x = 9.698777216 y = 0.215746320 z = -1.225831264
   004741 ts: [ secs: 37 usecs: 41251 cputime: 1213770 ]
   004741 x = 9.698777216 y = 0.254972912 z = -1.225831264
   004754 ts: [ secs: 37 usecs: 141226 cputime: 1217046 ]
   004754 x = 9.718390464 y = 0.254972912 z = -1.255251168
   004767 ts: [ secs: 37 usecs: 241201 cputime: 1220322 ]
   004767 x = 9.718390464 y = 0.245166256 z = -1.245444544
   004779 ts: [ secs: 37 usecs: 341176 cputime: 1223598 ]
   004779 x = 9.708583808 y = 0.254972912 z = -1.216024640
   004779 Sensor polling done
   004780 compat> 
   ```

----------------------------------------------------------------
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