taiyou komazawa / DataPool

Dependencies:   Gamma Beta Alpha

Dependents:   2017_Bteam_I2CTransporter BETA_A ALPHA_A GAMMA_A

Revision:
0:52b800fb3844
Child:
1:47ea89b6364e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GammaPool.cpp	Wed Aug 16 02:02:18 2017 +0000
@@ -0,0 +1,28 @@
+#include "GammaPool.h"
+
+GammaPool::GammaPool()
+:   _master(SDA, SCL)
+{
+}
+
+bool GammaPool::set()
+{
+    bool error = true;
+    /*_master.transport(0, JUSHINKUN_ADDR,  0, ctrl.all_data, 10);
+    _master.transport(APPER_BODY_ADDR, TspMode::send,    r.all_data,    4);
+    _master.transport(APPER_BODY_ADDR, TspMode::reseive, r.all_data,    1);*/
+    
+    error &= ~_master.read(JUSHINKUN_ADDR, ctrl.all_data, 10);
+    error &= ~_master.write(APPER_BODY_ADDR, a.all_data, 4);
+    error &= ~_master.read(JUSHINKUN_ADDR, ar.all_data, 1);
+    
+    return error;
+} 
+    
+void GammaPool::reset(){
+    for(int t = 0; t < 10; t++)
+        ctrl.all_data[t] = 0;
+    for(int t = 0; t < 4; t++)
+        a.all_data[t] = 0;
+    ar.all_data[0] = 0;
+}
\ No newline at end of file