LightHub
4.6.0
Open-source smart home controller firmware
Toggle main menu visibility
Loading...
Searching...
No Matches
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
*/
29
#define D_UPDATED1 1
30
#define D_UPDATED2 2
31
#define D_UPDATED3 4
32
#define D_UPDATED4 8
33
#define D_CHECKT 300
34
35
//#define MAX_CHANNELS 60
36
//define MAX_IN_CHANNELS 16
37
38
//#define DMX_OUT_PIN 3
39
40
#include "
options.h
"
41
42
#if defined(_dmxout)
43
44
#if defined DMX_SMOOTH
45
46
#if defined(ARDUINO_ARCH_AVR)
47
#include <DmxSimple.h>
48
#define DmxWrite DmxSimple.write
49
//#define DmxWrite DmxWriteBuf
50
#endif
51
52
#if defined(ESP8266)
53
#include <ESPDMX.h>
54
extern
DMXESPSerial dmxout;
55
#define DmxWrite dmxout.write
56
//#define DmxWrite DmxWriteBuf
57
#endif
58
59
#if defined(ARDUINO_ARCH_ESP32)
60
#include <ESPDMX.h>
61
extern
DMXESPSerial dmxout;
62
#define DmxWrite dmxout.write
63
//#define DmxWrite DmxWriteBuf
64
#endif
65
66
#if defined(__SAM3X8E__)
67
#include <DmxDue.h>
68
#define DmxWrite2 dmxout.write
69
#define DmxWrite DmxWriteBuf
70
#endif
71
72
#else
73
#if defined(ARDUINO_ARCH_AVR)
74
#include <DmxSimple.h>
75
#define DmxWrite DmxSimple.write
76
#endif
77
78
#if defined(ESP8266)
79
#include <ESPDMX.h>
80
extern
DMXESPSerial dmxout;
81
#define DmxWrite dmxout.write
82
#endif
83
84
#if defined(ARDUINO_ARCH_ESP32)
85
#include <ESPDMX.h>
86
extern
DMXESPSerial dmxout;
87
#define DmxWrite dmxout.write
88
#endif
89
90
#if defined(__SAM3X8E__)
91
#include <DmxDue.h>
92
#define DmxWrite dmxout.write
93
#endif
94
95
#endif
96
#endif
97
98
#ifdef _artnet
99
#include <Artnet.h>
100
extern
Artnet *artnet;
101
#endif
102
103
#ifdef _dmxin
104
#if defined(ARDUINO_ARCH_AVR)
105
#include <DMXSerial.h>
106
#endif
107
#endif
108
109
#include "aJSON.h"
110
112
extern
aJsonObject *
dmxArr
;
113
122
void
DMXput
(
void
);
127
void
DMXinSetup
(
int
channels);
132
void
DMXoutSetup
(
int
channels);
136
void
artnetSetup
();
142
void
artnetSetChans
(uint8_t minCh, uint8_t maxCh);
147
void
DMXCheck
(
void
);
157
int
itemCtrl2
(
char
* name,
int
r,
int
g,
int
b
,
int
w);
163
void
DmxWriteBuf
(uint16_t chan,uint8_t val);
167
void
DMXOUT_propagate
();
dmxArr
aJsonObject * dmxArr
Definition
main.cpp:131
DMXCheck
void DMXCheck(void)
DMX housekeeping called from the main loop: propagates changes and services pending DMX-in updates.
Definition
dmx.cpp:256
artnetSetup
void artnetSetup()
Initializes the Art-Net receiver and wires its frame callback.
Definition
dmx.cpp:402
DmxWriteBuf
void DmxWriteBuf(uint16_t chan, uint8_t val)
Writes a value into the intermediate (smoothing) DMX output buffer.
Definition
dmx.cpp:423
DMXinSetup
void DMXinSetup(int channels)
Sets up the DMX input for the given number of channels.
Definition
dmx.cpp:295
DMXOUT_propagate
void DMXOUT_propagate()
Smoothly ramps the actual DMX output toward the buffered target.
Definition
dmx.cpp:365
DMXput
void DMXput(void)
Propagates received DMX input frames to the mapped items.
Definition
dmx.cpp:206
itemCtrl2
int itemCtrl2(char *name, int r, int g, int b, int w)
Drives a named DMX/LED item with an RGB(W) value.
Definition
dmx.cpp:120
artnetSetChans
void artnetSetChans(uint8_t minCh, uint8_t maxCh)
Restricts the Art-Net channel range that is forwarded.
Definition
dmx.cpp:415
DMXoutSetup
void DMXoutSetup(int channels)
Sets up the DMX output for the given number of channels.
Definition
dmx.cpp:327
b
#define b
Definition
item.cpp:2411
options.h
lighthub
dmx.h
Generated by
1.18.0