Written by Ayrton Leyssens DMX library, bitbang method for LPC1768

Dependents:   ArtnetDMX

Committer:
Ayrton_L
Date:
Mon May 23 14:26:06 2016 +0000
Revision:
6:622a294f70ab
Parent:
4:54754f9736f1
latest stable state

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ayrton_L 0:55edcc97ba17 1 #ifndef DMX_H
Ayrton_L 0:55edcc97ba17 2 #define DMX_H
Ayrton_L 6:622a294f70ab 3
Ayrton_L 0:55edcc97ba17 4 #include "mbed.h"
Ayrton_L 6:622a294f70ab 5
Ayrton_L 6:622a294f70ab 6 enum DMX_STATUS {
Ayrton_L 6:622a294f70ab 7 BEGIN,
Ayrton_L 6:622a294f70ab 8 START,
Ayrton_L 6:622a294f70ab 9 BREAK,
Ayrton_L 6:622a294f70ab 10 MAB,
Ayrton_L 6:622a294f70ab 11 DATA,
Ayrton_L 6:622a294f70ab 12 STOP,
Ayrton_L 6:622a294f70ab 13 };
Ayrton_L 6:622a294f70ab 14
Ayrton_L 6:622a294f70ab 15 class DMX
Ayrton_L 0:55edcc97ba17 16 {
Ayrton_L 0:55edcc97ba17 17 public:
Ayrton_L 6:622a294f70ab 18 DMX (PinName p_tx, PinName p_rx);
Ayrton_L 6:622a294f70ab 19 void V_PutData(int addr, int data);
Ayrton_L 0:55edcc97ba17 20
Ayrton_L 6:622a294f70ab 21 void V_Start ();
Ayrton_L 6:622a294f70ab 22 void V_Stop ();
Ayrton_L 6:622a294f70ab 23
Ayrton_L 0:55edcc97ba17 24 private:
Ayrton_L 6:622a294f70ab 25
Ayrton_L 6:622a294f70ab 26 Serial _dmx; //seriele poort / uart voor dmx gebruiken
Ayrton_L 6:622a294f70ab 27 Timeout T_Timer;
Ayrton_L 6:622a294f70ab 28 LPC_UART_TypeDef *_uart; //definitie om uart te kunnen gebruiken als cross fucntie gebruik
Ayrton_L 1:4eb21fcb621a 29
Ayrton_L 6:622a294f70ab 30 void V_InitTimer();
Ayrton_L 6:622a294f70ab 31 void V_InitSend ();
Ayrton_L 6:622a294f70ab 32
Ayrton_L 6:622a294f70ab 33 volatile DMX_STATUS ZendStatus;
Ayrton_L 6:622a294f70ab 34 volatile uint32_t I32_m_Addr;
Ayrton_L 6:622a294f70ab 35 uint8_t I8_Data[512];
Ayrton_L 0:55edcc97ba17 36 };
Ayrton_L 6:622a294f70ab 37
Ayrton_L 0:55edcc97ba17 38 #endif