Untung Haryono / ShiftOut

Fork of ShiftOut by Ollie Milton

Files at this revision

API Documentation at this revision

Comitter:
untung
Date:
Thu Aug 03 07:57:28 2017 +0000
Parent:
4:7333dc6fca5c
Commit message:
export for Marten

Changed in this revision

ShiftOut.h Show annotated file Show diff for this revision Revisions of this file
--- a/ShiftOut.h	Tue Jul 14 07:33:26 2015 +0000
+++ b/ShiftOut.h	Thu Aug 03 07:57:28 2017 +0000
@@ -40,6 +40,16 @@
             }
             *latchout = 1;
         }
+        
+        void write(uint64_t data) {
+            *latchout = 0;
+            for (int i = registerCount - 1; i >=  0; i--) {
+                *clkout = 0;
+                *dataout = (data & (1 << i)) != 0;
+                *clkout = 1;
+            }
+            *latchout = 1;
+        }
          
     private :
         DigitalOut *clkout;