Interface to access to Avago ADNS-9500 laser mouse sensors.

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
aplatanado
Date:
Tue Jul 10 13:29:45 2012 +0000
Parent:
7:1771f1c89df6
Child:
9:8b1e889e94fe
Commit message:
ensure ncs is high if observation test fails during reset

Changed in this revision

adns9500.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/adns9500.cpp	Mon Jun 25 16:33:14 2012 +0000
+++ b/adns9500.cpp	Tue Jul 10 13:29:45 2012 +0000
@@ -88,13 +88,19 @@
         // clear observation register. Only required to deassert shutdown mode.
         spiSend(OBSERVATION, 0x00);
         LONG_WAIT_US(DEFAULT_MAX_FRAME_PERIOD);
-        
+
+        WAIT_TSCLKNCS();
+        ncs_.write(1);
+
         // check observation register bits [5:0]
         int observation = spiReceive(OBSERVATION);
         if (! ADNS9500_IF_OBSERVATION_TEST(observation))
             error("ADNS9500::reset : observation register test failed: 0x%x\n", observation);
 
         // read motion data
+        ncs_.write(0);
+        WAIT_TNCSSCLK();
+
         WAIT_TSRR();
         spiReceive(MOTION);
         WAIT_TSRR();