| LightHub v4.0.0 Smarthome controller firmware

dmx.h
Go to the documentation of this file.
1 /* Copyright © 2017-2018 Andrey Klimov. All rights reserved.
2
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 Homepage: http://lazyhome.ru
16 GIT: https://github.com/anklimov/lighthub
17 e-mail anklimov@gmail.com
18
19 */
20 #define D_UPDATED1 1
21 #define D_UPDATED2 2
22 #define D_UPDATED3 4
23 #define D_UPDATED4 8
24 #define D_CHECKT 300
25
26 //#define MAX_CHANNELS 60
27 //define MAX_IN_CHANNELS 16
28
29 //#define DMX_OUT_PIN 3
30
31 #include "options.h"
32
33 #if defined(_dmxout)
34
35 #if defined DMX_SMOOTH
36
37 #if defined(ARDUINO_ARCH_AVR)
38 #include <DmxSimple.h>
39 #define DmxWrite DmxSimple.write
40 //#define DmxWrite DmxWriteBuf
41 #endif
42
43 #if defined(ESP8266)
44 #include <ESPDMX.h>
45 extern DMXESPSerial dmxout;
46 #define DmxWrite dmxout.write
47 //#define DmxWrite DmxWriteBuf
48 #endif
49
50 #if defined(ARDUINO_ARCH_ESP32)
51 #include <ESPDMX.h>
52 extern DMXESPSerial dmxout;
53 #define DmxWrite dmxout.write
54 //#define DmxWrite DmxWriteBuf
55 #endif
56
57 #if defined(__SAM3X8E__)
58 #include <DmxDue.h>
59 #define DmxWrite2 dmxout.write
60 #define DmxWrite DmxWriteBuf
61 #endif
62
63 #else
64 #if defined(ARDUINO_ARCH_AVR)
65 #include <DmxSimple.h>
66 #define DmxWrite DmxSimple.write
67 #endif
68
69 #if defined(ESP8266)
70 #include <ESPDMX.h>
71 extern DMXESPSerial dmxout;
72 #define DmxWrite dmxout.write
73 #endif
74
75 #if defined(ARDUINO_ARCH_ESP32)
76 #include <ESPDMX.h>
77 extern DMXESPSerial dmxout;
78 #define DmxWrite dmxout.write
79 #endif
80
81 #if defined(__SAM3X8E__)
82 #include <DmxDue.h>
83 #define DmxWrite dmxout.write
84 #endif
85
86 #endif
87 #endif
88
89 #ifdef _artnet
90 #include <Artnet.h>
91 extern Artnet *artnet;
92 #endif
93
94 #ifdef _dmxin
95 #if defined(ARDUINO_ARCH_AVR)
96 #include <DMXSerial.h>
97 #endif
98 #endif
99
100 #include "aJSON.h"
101
102 extern aJsonObject *dmxArr;
103
104
105 void DMXput(void);
106 void DMXinSetup(int channels);
107 void DMXoutSetup(int channels);
108 void artnetSetup();
109 void artnetSetChans(uint8_t minCh, uint8_t maxCh);
110 void DMXCheck(void);
111 int itemCtrl2(char* name,int r,int g, int b, int w);
112 void DmxWriteBuf(uint16_t chan,uint8_t val);
113 void DMXOUT_propagate();
DMXCheck
void DMXCheck(void)
Definition: dmx.cpp:186
DmxWriteBuf
void DmxWriteBuf(uint16_t chan, uint8_t val)
Definition: dmx.cpp:358
artnetSetup
void artnetSetup()
Definition: dmx.cpp:337
DMXinSetup
void DMXinSetup(int channels)
Definition: dmx.cpp:233
options.h
artnetSetChans
void artnetSetChans(uint8_t minCh, uint8_t maxCh)
Definition: dmx.cpp:350
b
#define b
Definition: item.cpp:1735
dmxArr
aJsonObject * dmxArr
Definition: main.cpp:103
DMXput
void DMXput(void)
Definition: dmx.cpp:127
itemCtrl2
int itemCtrl2(char *name, int r, int g, int b, int w)
Definition: dmx.cpp:64
DMXOUT_propagate
void DMXOUT_propagate()
Definition: dmx.cpp:300
DMXoutSetup
void DMXoutSetup(int channels)
Definition: dmx.cpp:262