new defines for messages and brodcats

This commit is contained in:
2024-02-10 01:02:19 +01:00
parent 504d8b206d
commit 5535393c23

View File

@@ -49,12 +49,26 @@ typedef enum {
} CLSChannelStatus;
typedef enum {
CLS_CH_MSG_LIGHT = 0, // 0b000
CLS_CH_MSG_1 = 1, // 0b001
CLS_CH_MSG_2 = 2, // 0b010
CLS_CH_MSG_3 = 3, // 0b011
CLS_CH_MSG_4 = 4, // 0b100
CLS_CH_MSG_5 = 5, // 0b101
CLS_CH_MSG_6 = 6, // 0b110
CLS_CH_MSG_7 = 7 // 0b111
} CLSChannelMessage;
typedef struct {
CLSMessageCode code : 3;
uint8_t device : 5;
CLSChannel channel : 3;
} CLSAddress;
#define GLOBAL_CAST_CLS_ADDRESS 0x11111
#define GENERATE_CLS_ADDRESS(type, device, channel) \
((uint16_t)(((type) << 8) | ((device) << 3) | (channel)) & 0x7ff)