MMA7361L interface

Dependents:   MMA7361L_Example ARLISS2012_Hidaka

Files at this revision

API Documentation at this revision

Comitter:
yamaguch
Date:
Mon May 20 05:24:57 2013 +0000
Parent:
1:19444721f19a
Commit message:
rename sleep to nSleep

Changed in this revision

MMA7361L.cpp Show annotated file Show diff for this revision Revisions of this file
MMA7361L.h Show annotated file Show diff for this revision Revisions of this file
--- a/MMA7361L.cpp	Wed Apr 25 10:13:30 2012 +0000
+++ b/MMA7361L.cpp	Mon May 20 05:24:57 2013 +0000
@@ -1,13 +1,13 @@
 #include "MMA7361L.h"
 
 MMA7361L::MMA7361L(PinName xoutPin, PinName youtPin,PinName zoutPin,
-                   PinName zeroGDetectPin, PinName gSelectPin, PinName sleepPin) :
+                   PinName zeroGDetectPin, PinName gSelectPin, PinName nSleepPin) :
         xout(xoutPin), yout(youtPin), zout(zoutPin),
-        zeroGDetect(zeroGDetectPin), gSelect(gSelectPin), sleep(sleepPin),
+        zeroGDetect(zeroGDetectPin), gSelect(gSelectPin), nSleep(nSleepPin),
         flags(-1) {
     zeroGDetectEnabled = zeroGDetectPin != NC;
     gSelectEnabled = gSelectPin != NC;
-    sleepEnabled = sleepPin != NC;
+    sleepEnabled = nSleepPin != NC;
     setSleep(false);
     setScale(SCALE_1_5G);
     for (int i = 0; i < 2; i++) {
@@ -74,7 +74,7 @@
 
 void MMA7361L::setSleep(bool on) {
     if (sleepEnabled)
-        sleep = !on;
+        nSleep = !on;
 }
 
 bool MMA7361L::zeroGDetected() {
@@ -127,7 +127,7 @@
               "sleepEnabled             = %d\n"
               "zeroGDetect(InterruptIn) = %d\n"
               "gSelect(DigitalOut)      = %d\n"
-              "sleep(DigitalOut)        = %d\n"
+              "nSleep(DigitalOut)       = %d\n"
               "scale                    = %d\n"
               "accelX, accelY, accelZ   = %4.3f, %4.3f, %4.3f\n"
               "calib (1.5G)             = %4.3f, %4.3f; %4.3f, %4.3f; %4.3f, %4.3f\n"
@@ -138,7 +138,7 @@
               sleepEnabled,
               zeroGDetectEnabled ? zeroGDetect.read() : -1,
               gSelectEnabled ? gSelect.read() : -1,
-              sleepEnabled ? sleep.read() : -1,
+              sleepEnabled ? nSleep.read() : -1,
               scale,
               accelX, accelY, accelZ,
               calib[0].minX, calib[0].maxX, calib[0].minY, calib[0].maxY, calib[0].minZ, calib[0].maxZ,
--- a/MMA7361L.h	Wed Apr 25 10:13:30 2012 +0000
+++ b/MMA7361L.h	Mon May 20 05:24:57 2013 +0000
@@ -16,7 +16,7 @@
      * @param zoutPin zout pin
      * @param zeroGDetectPin 0G detect pin
      * @param gSelectPin select 1.5G/6G pin
-     * @param sleepPin sleep pin
+     * @param nSleepPin ~sleep pin
      *
      */
     MMA7361L(PinName xoutPin, PinName youtPin, PinName zoutPin, PinName zeroGDetectPin = NC, PinName gSelectPin = NC, PinName sleepPin = NC);
@@ -163,7 +163,7 @@
     AnalogIn xout, yout, zout;
     InterruptIn zeroGDetect;
     DigitalOut gSelect;
-    DigitalOut sleep;
+    DigitalOut nSleep;
     bool zeroGDetectEnabled;
     bool gSelectEnabled;
     bool sleepEnabled;