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:
Thu Jul 12 14:57:09 2012 +0000
Parent:
0:cbff6bf41542
Child:
2:d7677060f8eb
Commit message:
use uart rbr

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	Tue Jun 26 08:29:33 2012 +0000
+++ b/DMX.cpp	Thu Jul 12 14:57:09 2012 +0000
@@ -100,7 +100,7 @@
     // Data
     if (mode_tx == DMX_MODE_DATA) {
         if (addr_tx < DMX_SIZE) {
-#ifdef DMX_DIRECT
+#ifdef DMX_UART_DIRECT
             *uart_thr = (uint8_t)data_tx[addr_tx];
 #else
             dmx.putc(data_tx[addr_tx]);
@@ -119,7 +119,11 @@
     int flg, dat;
 
     flg = *uart_lsr;
+#ifdef DMX_UART_DIRECT
+    dat = *uart_rbr;
+#else
     dat = dmx.getc();
+#endif
 
     if (flg & ((1 << 7)|(1 << 3)|(1 << 4))) {
         // Break Time
--- a/DMX.h	Tue Jun 26 08:29:33 2012 +0000
+++ b/DMX.h	Thu Jul 12 14:57:09 2012 +0000
@@ -13,7 +13,7 @@
 
 #include "mbed.h"
 
-#define DMX_DIRECT
+#define DMX_UART_DIRECT
 
 #define DMX_SIZE 512
 #define DMX_TIME_BREAK 100 // 100us