mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-07-06 06:08:22 +00:00
Fix some bugs from merging and add second dmx interface
This commit is contained in:
parent
50c37dc80a
commit
e53f897aac
5 changed files with 150 additions and 121 deletions
15
src/ESPDMX.h
15
src/ESPDMX.h
|
@ -1,4 +1,5 @@
|
|||
#include <inttypes.h>
|
||||
#include <HardwareSerial.h>
|
||||
|
||||
#ifndef ESPDMX_h
|
||||
#define ESPDMX_h
|
||||
|
@ -7,7 +8,9 @@
|
|||
#define DMXFORMAT SERIAL_8N2
|
||||
#define BREAKSPEED 83333
|
||||
#define BREAKFORMAT SERIAL_8N1
|
||||
#define SERIALPORT Serial0
|
||||
#define DMX_DEFAULT_PORT Serial0
|
||||
#define DMX_DEFAULT_TX 21
|
||||
#define DMX_DEFAULT_RX 33
|
||||
#define DMXCHANNELS 512
|
||||
|
||||
class DMXESPSerial
|
||||
|
@ -15,14 +18,20 @@ class DMXESPSerial
|
|||
public:
|
||||
int sendPin;
|
||||
int recvPin;
|
||||
HardwareSerial *port;
|
||||
bool dmxStarted;
|
||||
uint8_t dmxDataStore[DMXCHANNELS + 1];
|
||||
|
||||
void init(int pinSend, int pinRecv);
|
||||
uint8_t read(int Channel);
|
||||
void init(int pinSend, int pinRecv, HardwareSerial& port);
|
||||
uint8_t read(int channel);
|
||||
uint8_t* readAll();
|
||||
void write(int channel, uint8_t value);
|
||||
void update();
|
||||
void end();
|
||||
|
||||
private:
|
||||
// Member variables
|
||||
HardwareSerial* _Serial;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue