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

Revision:
18:69d65ca92bcc
Parent:
17:c9198630ba05
Child:
19:ae8fd2ba7c53
diff -r c9198630ba05 -r 69d65ca92bcc DMX.h
--- a/DMX.h	Wed Sep 30 13:52:20 2015 +0000
+++ b/DMX.h	Mon Jan 11 06:17:04 2016 +0000
@@ -14,13 +14,14 @@
 #include "mbed.h"
 #include "RawSerial.h"
 
-#define DMX_UART_DIRECT
+//#define DMX_UART_DIRECT
 
-#define DMX_SIZE 512
-#define DMX_TIME_BREAK 100 // 100us (88us-1s)
-#define DMX_TIME_MAB 10 // 10us (8us-1s)
-#define DMX_TIME_BETWEEN 200 // 10us (0-1s)
-#define DMX_START_CODE 0
+#define DMX_SIZE        512
+#define DMX_START_CODE  0
+
+#define DMX_TIME_BREAK  100 // 100us (88us-1s)
+#define DMX_TIME_MAB    12 // 12us (8us-1s)
+#define DMX_TIME_MBB    200 // 10us (0-1s)
 
 enum DMX_MODE {
     DMX_MODE_BEGIN,
@@ -76,10 +77,11 @@
      */
     void clear ();
 
-    int isRecived ();
+    int isReceived ();
     int isSent ();
     unsigned char *getRxBuffer ();
     unsigned char *getTxBuffer ();
+    int setTimingParameters (int breaktime, int mab, int mbb);
 
 protected:
 
@@ -94,7 +96,8 @@
     volatile int addr_tx, addr_rx;
     unsigned char data_tx[DMX_SIZE];
     unsigned char data_rx[DMX_SIZE];
-    int is_recived, is_sent;
+    int is_received, is_sent;
+    int time_break, time_mab, time_mbb;
 
 private:
 #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088)