Library for TI's DRV2667

Files at this revision

API Documentation at this revision

Comitter:
takuhachisu
Date:
Mon Feb 19 00:43:53 2018 +0000
Parent:
2:101901b3f05e
Commit message:
Add a function "isPlaying"

Changed in this revision

DRV2667.cpp Show annotated file Show diff for this revision Revisions of this file
DRV2667.h Show annotated file Show diff for this revision Revisions of this file
diff -r 101901b3f05e -r 870dc06a0e8a DRV2667.cpp
--- a/DRV2667.cpp	Thu Feb 08 07:38:17 2018 +0000
+++ b/DRV2667.cpp	Mon Feb 19 00:43:53 2018 +0000
@@ -51,6 +51,11 @@
     i2cWriteByte(0x02, i2cReadByte(0x02) & ~1);
 }
 
+bool DRV2667::isPlaying()
+{
+    return i2cReadByte(0x02) & 1;
+}
+
 void DRV2667::setWaveform(char* id, char setNum)
 {
     for(int i = 0; i < setNum && i < 8; i++)
diff -r 101901b3f05e -r 870dc06a0e8a DRV2667.h
--- a/DRV2667.h	Thu Feb 08 07:38:17 2018 +0000
+++ b/DRV2667.h	Mon Feb 19 00:43:53 2018 +0000
@@ -87,6 +87,11 @@
     void stop();
     
     /**
+    * Get state of playing
+    */
+    bool isPlaying();
+    
+    /**
     * Set sequencer to play waveform
     *   
     * @param id array of waveform ID in RAM