dali_dt8.hpp
2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright (c) 2015-2016, Arkadiusz Materek (arekmat@poczta.fm)
*
* All right reversed. Usage for commercial on not commercial
* purpose without written permission is not allowed.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#ifndef DALI_DALI_DT8_HPP_
#define DALI_DALI_DT8_HPP_
#include "config_dt8.hpp"
#ifdef DALI_DT8
#include "commands_dt8.hpp"
#include "dali.hpp"
#define DALI_DT8_COLOR_TYPE_XY 0
#define DALI_DT8_COLOR_TYPE_TC 1
#define DALI_DT8_COLOR_TYPE_PRIMARY_N 2
#define DALI_DT8_COLOR_TYPE_RGBWAF 3
#define DALI_DT8_COLOUR_TYPE_FEATURES_XY 0x01
#define DALI_DT8_COLOUR_TYPE_FEATURES_TC 0x02
#define DALI_DT8_COLOUR_TYPE_FEATURES_PRIMARY_N 0x1C
#define DALI_DT8_COLOUR_TYPE_FEATURES_RGBWAF 0xE0
#define DALI_DT8_FEATURES_AUTO_ACTIVATION 0x01
#define DALI_DT8_FEATURES_AUTO_CALIBRATION 0x40
#define DALI_DT8_FEATURES_AUTO_CALIBRATION_RECOVERY 0x80
#define DALI_DT8_STATUS_XY_OUT_OF_RANGE 0x01
#define DALI_DT8_STATUS_TC_OUT_OF_RANGE 0x02
#define DALI_DT8_STATUS_AUTO_CALIBRATION_RUNNING 0x04
#define DALI_DT8_STATUS_AUTO_CALIBRATION_SUCCESSFUL 0x08
#define DALI_DT8_TC_COOLEST 1
#define DALI_DT8_TC_WARMESR 65534
#define DALI_DT8_PRIMARY_TY_MAX 32767
#define DALI_DT8_RGBWAF_MAX 254
#define DALI_DT8_MASK16 65535
#define DALI_DT8_RGBWAF_CONTROL_CHANNEL 0
#define DALI_DT8_RGBWAF_CONTROL_COLOR 1
#define DALI_DT8_RGBWAF_CONTROL_NORMALIZED 2
#define DALI_DT8_RGBWAF_CONTROL_CANNELS_MASK ((1 << DALI_DT8_NUMBER_OF_PRIMARIES) - 1)
namespace dali {
typedef struct {
uint16_t x;
uint16_t y;
} PointXY;
typedef struct {
uint16_t ty;
PointXY xy;
} Primary;
class ILampDT8 : public ILamp {
public:
virtual void setPrimary(const uint16_t primary[], uint8_t size, uint32_t changeTime) = 0;
virtual void getPrimary(uint16_t primary[], uint8_t size) = 0;
virtual bool isColorChanging() = 0;
virtual void abortColorChanging() = 0;
};
typedef struct {
public:
Primary primaryConfig[6];
uint8_t colorType;
#ifdef DALI_DT8_SUPPORT_XY
uint16_t xCoordinate;
uint16_t yCoordinate;
#endif // DALI_DT8_SUPPORT_XY
#ifdef DALI_DT8_SUPPORT_TC
uint16_t tcCoolest;
uint16_t tcWarmest;
uint16_t tc;
#endif // DALI_DT8_SUPPORT_TC
#ifdef DALI_DT8_SUPPORT_PRIMARY_N
uint16_t primary[6];
#endif // DALI_DT8_SUPPORT_PRIMARY_N
} DefaultsDT8;
extern const DefaultsDT8 kDefaultsDT8;
} // namespace dali
#endif // DALI_DT8
#endif // DALI_DALI_DT8_HPP_