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 17:c9198630ba05, committed 2015-09-30
- Comitter:
- okini3939
- Date:
- Wed Sep 30 13:52:20 2015 +0000
- Parent:
- 16:4eeb749806e5
- Child:
- 18:69d65ca92bcc
- Commit message:
- fix isRecieved()
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 Thu Aug 20 09:21:28 2015 +0000 +++ b/DMX.cpp Wed Sep 30 13:52:20 2015 +0000 @@ -221,3 +221,23 @@ data_rx[i] = 0; } } + +int DMX::isRecived (){ + int r = is_recived; + is_recived = 0; + return r; +} + +int DMX::isSent () { + int r = is_sent; + is_sent = 0; + return r; +} + +unsigned char *DMX::getRxBuffer () { + return data_rx; +} + +unsigned char *DMX::getTxBuffer () { + return data_tx; +}
--- a/DMX.h Thu Aug 20 09:21:28 2015 +0000 +++ b/DMX.h Wed Sep 30 13:52:20 2015 +0000 @@ -76,7 +76,10 @@ */ void clear (); - volatile int is_recived, is_sent; + int isRecived (); + int isSent (); + unsigned char *getRxBuffer (); + unsigned char *getTxBuffer (); protected: @@ -91,6 +94,7 @@ volatile int addr_tx, addr_rx; unsigned char data_tx[DMX_SIZE]; unsigned char data_rx[DMX_SIZE]; + int is_recived, is_sent; private: #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) || defined(TARGET_LPC4088)