DMX512, RDM send/recv library http://mbed.org/users/okini3939/notebook/dmx512

Dependents:   dmx_test ArtNodeLED SPK-DVIMXR SPK-DMXer ... more

DMX512 send/recv library

DMX512 is protocol for lighting.

調光プロトコル DMX512 を送受信するライブラリです。

see: http://mbed.org/users/okini3939/notebook/dmx512/

LPC1114 support is thanks to Stanly Chen

Files at this revision

API Documentation at this revision

Comitter:
okini3939
Date:
Mon Sep 23 09:15:57 2013 +0000
Parent:
11:cb132e066057
Child:
13:9841af9ac344
Commit message:
add clear()

Changed in this revision

DMX.cpp Show annotated file Show diff for this revision Revisions of this file
DMX.h Show annotated file Show diff for this revision Revisions of this file
--- a/DMX.cpp	Fri Sep 20 01:52:31 2013 +0000
+++ b/DMX.cpp	Mon Sep 23 09:15:57 2013 +0000
@@ -12,12 +12,8 @@
 #include "DMX.h"
 
 DMX::DMX (PinName p_tx, PinName p_rx) : _dmx(p_tx, p_rx) {
-    int i;
 
-    for (i = 0; i < DMX_SIZE; i ++) {
-        data_tx[i] = 0;
-        data_rx[i] = 0;
-    }
+    clear();
 //    mode_tx = DMX_MODE_BEGIN;
     mode_tx = DMX_MODE_STOP;
     mode_rx = DMX_MODE_BEGIN;
@@ -193,3 +189,12 @@
     timeout01.detach();
     mode_tx = DMX_MODE_STOP;
 }
+
+void DMX::clear () {
+    int i;
+
+    for (i = 0; i < DMX_SIZE; i ++) {
+        data_tx[i] = 0;
+        data_rx[i] = 0;
+    }
+}
--- a/DMX.h	Fri Sep 20 01:52:31 2013 +0000
+++ b/DMX.h	Mon Sep 23 09:15:57 2013 +0000
@@ -71,6 +71,9 @@
     /** Stop DMX send operation
      */
     void stop ();
+    /** Clear DMX data
+     */
+    void clear ();
 
     volatile int is_recived, is_sent;