23#ifndef PROTOCORE_DMX_H
24#define PROTOCORE_DMX_H
28#if PROTOCORE_ENABLE_DMX
36#define DMX_MAX_CHANNELS 512u
38#define DMX_SC_DIMMER 0x00u
42#define RDM_SUB_SC 0x01u
44#define RDM_OVERHEAD 26u
46#define RDM_CC_DISCOVERY 0x10u
48#define RDM_CC_DISCOVERY_RESPONSE 0x11u
50#define RDM_CC_GET 0x20u
52#define RDM_CC_GET_RESPONSE 0x21u
54#define RDM_CC_SET 0x30u
56#define RDM_CC_SET_RESPONSE 0x31u
58#define RDM_RESPONSE_ACK 0x00u
60#define RDM_RESPONSE_ACK_TIMER 0x01u
62#define RDM_RESPONSE_NACK_REASON 0x02u
64#define RDM_RESPONSE_ACK_OVERFLOW 0x03u
66#define RDM_PID_DISC_UNIQUE_BRANCH 0x0001u
68#define RDM_PID_DISC_MUTE 0x0002u
70#define RDM_PID_DISC_UN_MUTE 0x0003u
72#define RDM_PID_SUPPORTED_PARAMETERS 0x0050u
74#define RDM_PID_DEVICE_INFO 0x0060u
76#define RDM_PID_DMX_START_ADDRESS 0x00F0u
78#define RDM_PID_IDENTIFY_DEVICE 0x1000u
80#define PROTOCORE_RDM_DEVICE_INFO_PDL 19
103 uint16_t device_model_id;
104 uint16_t product_category;
105 uint32_t software_version_id;
106 uint16_t dmx_footprint;
107 uint8_t current_personality;
108 uint8_t personality_count;
109 uint16_t dmx_start_address;
110 uint16_t sub_device_count;
111 uint8_t sensor_count;
120 const uint8_t *channels;
135 uint16_t manufacturer;
152 const uint8_t *pdata;
171} DmxRdmDecodeDiscResponseArgs;
179 uint8_t preamble_len;
180} DmxRdmBuildDiscResponseArgs;
187 const RdmDeviceInfo *info;
188} DmxRdmBuildDeviceInfoArgs;
193 const uint8_t *pdata;
196} DmxRdmParseDeviceInfoArgs;
245 DmxBuildArgs build_args;
246 DmxGetChannelArgs get_channel_args;
247 DmxRdmUidArgs rdm_uid_args;
248 DmxRdmChecksumArgs rdm_checksum_args;
249 DmxRdmBuildArgs rdm_build_args;
250 DmxRdmParseArgs rdm_parse_args;
251 DmxRdmDecodeDiscResponseArgs rdm_decode_disc_response_args;
252 DmxRdmBuildDiscResponseArgs rdm_build_disc_response_args;
253 DmxRdmBuildDeviceInfoArgs rdm_build_device_info_args;
254 DmxRdmParseDeviceInfoArgs rdm_parse_device_info_args;
268 void (*
const build)(uint8_t *work);
269 void (*
const get_channel)(uint8_t *work);
270 void (*
const rdm_uid)(uint8_t *work);
271 void (*
const rdm_checksum)(uint8_t *work);
272 void (*
const rdm_build)(uint8_t *work);
273 void (*
const rdm_parse)(uint8_t *work);
274 void (*
const rdm_decode_disc_response)(uint8_t *work);
275 void (*
const rdm_build_disc_response)(uint8_t *work);
276 void (*
const rdm_build_device_info)(uint8_t *work);
277 void (*
const rdm_parse_device_info)(uint8_t *work);
282void protocore_dmx_build(uint8_t *work);
283void protocore_dmx_get_channel(uint8_t *work);
284void protocore_dmx_rdm_uid(uint8_t *work);
285void protocore_dmx_rdm_checksum(uint8_t *work);
286void protocore_dmx_rdm_build(uint8_t *work);
287void protocore_dmx_rdm_parse(uint8_t *work);
288void protocore_dmx_rdm_decode_disc_response(uint8_t *work);
289void protocore_dmx_rdm_build_disc_response(uint8_t *work);
290void protocore_dmx_rdm_build_device_info(uint8_t *work);
291void protocore_dmx_rdm_parse_device_info(uint8_t *work);
297static const DmxNs Dmx __attribute__((unused)) = {
298 .build = protocore_dmx_build,
299 .get_channel = protocore_dmx_get_channel,
300 .rdm_uid = protocore_dmx_rdm_uid,
301 .rdm_checksum = protocore_dmx_rdm_checksum,
302 .rdm_build = protocore_dmx_rdm_build,
303 .rdm_parse = protocore_dmx_rdm_parse,
304 .rdm_decode_disc_response = protocore_dmx_rdm_decode_disc_response,
305 .rdm_build_disc_response = protocore_dmx_rdm_build_disc_response,
306 .rdm_build_device_info = protocore_dmx_rdm_build_device_info,
307 .rdm_parse_device_info = protocore_dmx_rdm_parse_device_info,
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS