佐藤 太郎 / GVD

Dependents:   LPC1114_GVD

Files at this revision

API Documentation at this revision

Comitter:
moneneholic
Date:
Thu Aug 04 00:45:29 2016 +0000
Commit message:
FirstVer

Changed in this revision

GVD.cpp Show annotated file Show diff for this revision Revisions of this file
GVD.hpp Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r a5d388a0355c GVD.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GVD.cpp	Thu Aug 04 00:45:29 2016 +0000
@@ -0,0 +1,33 @@
+#include "GVD.hpp"
+
+GVD::GVD(PinName p0,PinName p1,PinName p2,PinName p3,PinName p4,PinName p5,PinName p6,PinName p7){
+    _dOut[0] = new DigitalOut(p0);
+    _dOut[1] = new DigitalOut(p1);
+    _dOut[2] = new DigitalOut(p2);
+    _dOut[3] = new DigitalOut(p3);    
+    _dOut[4] = new DigitalOut(p4);
+    _dOut[5] = new DigitalOut(p5);
+    _dOut[6] = new DigitalOut(p6);
+    _dOut[7] = new DigitalOut(p7); 
+}
+
+void GVD::write(bool p0State,bool p1State,bool p2State,bool p3State,bool p4State,bool p5State,bool p6State,bool p7State){
+    _dOut[0]->write(p0State);
+    _dOut[1]->write(p1State);
+    _dOut[2]->write(p2State);
+    _dOut[3]->write(p3State);
+    _dOut[4]->write(p4State);
+    _dOut[5]->write(p5State);
+    _dOut[6]->write(p6State);
+    _dOut[7]->write(p7State);
+}
+
+void GVD::off(){
+    _dOut[1]->write(0);
+    _dOut[2]->write(0);
+    _dOut[3]->write(0);
+    _dOut[4]->write(0);
+    _dOut[5]->write(0);
+    _dOut[6]->write(0);
+    _dOut[7]->write(0);      
+}
\ No newline at end of file
diff -r 000000000000 -r a5d388a0355c GVD.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GVD.hpp	Thu Aug 04 00:45:29 2016 +0000
@@ -0,0 +1,14 @@
+#ifndef GVD_HPP
+#define GVD_HPP
+
+#include "mbed.h"
+
+class GVD{
+public:
+    GVD(PinName p0,PinName p1,PinName p2,PinName p3,PinName p4,PinName p5,PinName p6,PinName p7);
+    void write(bool p0State,bool p1State,bool p2State,bool p3State,bool p4State,bool p5State,bool p6State,bool p7State);
+    void off();
+private:
+    DigitalOut* _dOut[8]; 
+};
+#endif //GVD_HPP
\ No newline at end of file