Modified for compatibility with Rev.E. hardware

Fork of AkmSensor by AKM Development Platform

Revision:
36:aafd15b3291b
Parent:
26:4e436b0cbaf8
Child:
37:c76d2edf3426
diff -r 35ad9dc51b21 -r aafd15b3291b ap1017ctrl.h
--- a/ap1017ctrl.h	Mon May 08 17:37:52 2017 +0000
+++ b/ap1017ctrl.h	Fri May 19 23:13:23 2017 +0000
@@ -50,10 +50,10 @@
     /**
      * Process abstraction for starting sensor operation.
      *
-     * @param sec Number of seconds of operation.
+     * @param freq PWM frequency in Hz (2000 Hz by default).
      * @return Termination status type for debugging purposes.
      */
-    virtual AkmSensor::Status startSensor(const float sec);
+    virtual AkmSensor::Status startSensor(const float freq);
     
     /**
      * Process abstraction for stopping sensor operation.
@@ -88,21 +88,26 @@
      */
     virtual char* getSensorName();
     
-    /**
-     * Interrupt handler occurring at regular intervals.
-     */
-    void timerCallback();
+    // Interrupt Service Routines
+    void pwmPeriod();
+    void pwmOnPulse();
 
 private:
-    bool            event;
+    //bool            event;
     uint8_t         primaryId;
     uint8_t         subId;
     char*           sensorName;
 
+    DigitalOut*     inputA;
+    DigitalOut*     inputB;
+    I2C*            i2cMotor;
+
     AP1017*         ap1017;
-    Ticker          ticker;         // Timer interrupt handler object
+    Ticker          pwm;
+    Ticker          pulse;
+    uint8_t         index;
+    float           freq;
     float           interval;       // Timer interrupt interval
-
 };
 
 #endif
\ No newline at end of file