Files
libcls/CLS.h
Oliver Walter 7dc557c9a7 added more device info into hartbeat
fw_version+id+type+postion
slowed down to 1000ms

now depends on libRevision to get the FW version information
2024-04-29 01:06:00 +02:00

61 lines
1.2 KiB
C

#pragma once
#define CLS_HEARTBEAT_INTERVAL_MS 1000
typedef enum CLS_Type {
CLS_TYPE_LIGHT = 0x00,
CLS_TYPE_SWITCH = 0x01,
CLS_TYPE_SWITCHED_LIGHT = 0x02,
CLS_TYPE_SENSOR = 0x03,
CLS_TYPE_DISPLAY = 0x04,
CLS_TYPE_MASTER = 0x0F,
}CLS_Type_t;
typedef enum CLS_Position_Type {
CLS_POSITION_TOP = 0x00,
CLS_POSITION_BOTTOM = 0x01,
CLS_POSITION_LEFT = 0x02,
CLS_POSITION_RIGHT = 0x03,
CLS_POSITION_CENTER = 0x04,
CLS_POSITION_FRONT = 0x05,
CLS_POSITION_REAR = 0x06,
CLS_POSITION_BACK = 0x07,
CLS_POSITION_FLOOR = 0x08,
CLS_POSITION_CEILING = 0x09,
CLS_POSITION_ENGINE = 0x0A,
CLS_POSITION_TRUNK = 0x0B,
// more TBD
CLS_POSITION_INSIDE = 0x0E,
CLS_POSITION_OUTSIDE = 0x0F,
} CLS_Position_Type_t;
typedef struct CLS_Position {
CLS_Position_Type_t p0:4;
CLS_Position_Type_t p1:4;
} CLS_Position_t;
#pragma pack(1) // 1 byte alignment
typedef struct CLS_HeatbeatData
{
struct
{
uint8_t major;
uint8_t minor;
uint8_t patch;
uint8_t count;
}firmware_version;
CLS_Type_t type;
uint8_t id;
uint8_t counter;
CLS_Position_t position;
} CLS_HeatbeatData_t;
extern uint8_t gCLS_DEVICE_ADDRESS;
void CLS_Init(void);