A collection of Analog Devices drivers for the mbed platform
For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all
Diff: examples/drvdiag/main.cpp
- Revision:
- 21:a8023e5e97be
- Parent:
- 19:fb92949e59c9
- Child:
- 26:1b988c505139
- Child:
- 33:c3ec596a29c2
--- a/examples/drvdiag/main.cpp Tue May 17 15:15:19 2016 +0300 +++ b/examples/drvdiag/main.cpp Tue May 17 18:15:28 2016 +0300 @@ -55,12 +55,6 @@ Serial pc(SERIAL_TX, SERIAL_RX); vector<string> cmdbuffer; -static const uint16_t INACT_VAL = 50; -static const uint16_t INACT_TIMER = 25 * 10; -static const uint16_t ACT_VAL = 50; -static const uint8_t ACT_TIMER = 100; -static const uint16_t SCAN_SENSOR_TIME = 500; - class commands { public: @@ -164,36 +158,8 @@ {"xlfset", 2, [](){adxl362diag.fifo_setup(); }}, {"xlfr16", 0, [](){adxl362diag.fifo_read_u16(); }}, {"xlfrs", 0, [](){adxl362diag.fifo_scan(); }}, - {"xlintinit",0,[](){ - adxl362.reset(); - pc.printf("adxl362 reset\r\n"); - wait_ms(500); - adxl362.set_activity_threshold(ACT_VAL); - adxl362.set_activity_time(ACT_TIMER / 10); - - adxl362.set_inactivity_threshold(INACT_VAL); - adxl362.set_inactivity_time(INACT_TIMER); - adxl362.set_act_inact_ctl_reg(0x3f); - - pc.printf("adxl362 set activity/inactivity\r\n"); - - adxl362.disable_interrupt2(); - adxl362.set_interrupt2_pin(D2,0x40,&rising_adxl362,&falling_adxl362); - extern bool awake; - awake = true; - - pc.printf("adxl362 set interrupt\r\n"); - adxl362.enable_interrupt2(); - adxl362.set_mode(ADXL362::MEASUREMENT); - pc.printf("adxl362 measurement started\r\n"); - - }}, - { - "xlawake",0,[](){ - extern bool awake; - if(awake) pc.printf("awaken"); - else pc.printf("asleep"); - } + {"xlintinit",0,[](){adxl362diag.intinit();}}, + {"xlawake",0,[](){adxl362diag.checkawake();} },