112#define LOR_HEARTBEAT_BYTES ((unsigned char[]){0, 0xFF, 0x81, 0x56, 0})
116#define LOR_HEARTBEAT_SIZE 5
120#define LOR_HEARTBEAT_DELAY_MS 500
124#define LOR_HEARTBEAT_DELAY_NS 500000000
Represents a grouping of 16 channels, as a bit set, aligned to a 16-channel boundary (via a multiplie...
Definition tinylor.h:33
unsigned short cbits
The 16-bit bitset of channels to apply the effect to relative to the offset.
Definition tinylor.h:43
unsigned char offset
The offset of the first channel in the set.
Definition tinylor.h:36
Represents a request to apply an effect to a set of channels on a specific unit. The effect may requi...
Definition tinylor.h:132
lor_effect effect
The effect type to apply.
Definition tinylor.h:134
lor_effect_args_u args
The effect data, if required by the effect type, otherwise zero.
Definition tinylor.h:136
lor_unit unit
The unit to apply the effect to.
Definition tinylor.h:140
lor_channel_set cset
The channel set to apply the effect to, may be a single channel.
Definition tinylor.h:138
lor_effect
Represents the various effects that may be applied to a set of channels on a specific unit....
Definition tinylor.h:53
@ LOR_SHIMMER
Shimmer the lights using hardware controls.
Definition tinylor.h:60
@ LOR_PULSE
Cycle the lights between two intensities.
Definition tinylor.h:58
@ LOR_SET_OFF
Turn the lights off.
Definition tinylor.h:55
@ LOR_SET_INTENSITY
Set the lights to a specific intensity.
Definition tinylor.h:56
@ LOR_SET_LIGHTS
Set the lights to full intensity.
Definition tinylor.h:54
@ LOR_SET_DMX_INTENSITY
Write raw DMX protocol data.
Definition tinylor.h:61
@ LOR_FADE
Fade between two intensities over time.
Definition tinylor.h:57
@ LOR_TWINKLE
Twinkle the lights using hardware controls.
Definition tinylor.h:59
struct lor_channel_set lor_channel_set
void lor_set_channels(lor_req_s *req, lor_channel first, unsigned short cbits)
Configures the request to use a channel set, in the form of a 16-bit bitset of channels,...
Definition tinylor.c:14
unsigned char lor_unit
Represents a unit number, which is a unique identifier for a piece of LOR hardware....
Definition tinylor.h:24
union lor_effect_data lor_effect_args_u
void lor_set_unit(lor_req_s *req, lor_unit u)
Configures the request to be sent to the specified unit. A unit is required for all requests....
Definition tinylor.c:22
void lor_set_channel(lor_req_s *req, lor_channel c)
Configures the request to use a single, absolute channel.
Definition tinylor.c:7
void lor_set_fade(lor_req_s *req, lor_intensity start, lor_intensity end, lor_decisec ds)
Configures the request to fade from one intensity to another over a specified duration in deciseconds...
Definition tinylor.c:46
size_t lor_write(unsigned char *b, size_t bs, const lor_req_s *r, size_t rs)
Encodes and writes up to rs requests to the provided buffer b as binary data. Requests are first enco...
Definition tinylor.c:139
unsigned char lor_intensity
Represents a scaled intensity value used by the LOR protocol.
Definition tinylor.h:18
lor_intensity lor_get_intensity(unsigned char b)
Encodes a [0,0xFF] value into a roughly equivalent LOR intensity value (precision is lossy) that is c...
Definition tinylor.c:159
void lor_set_intensity(lor_req_s *req, lor_intensity i)
Configures the request to set the intensity of the lights to the provided value.
Definition tinylor.c:41
unsigned short lor_decisec
Represents a duration in deciseconds, which is 1/10th of a second.
Definition tinylor.h:28
unsigned short lor_channel
Represents a channel number, which is a unique identifier for a specific light or group of lights....
Definition tinylor.h:12
lor_intensity(* lor_intensity_fn)(unsigned char b)
Represents a function that converts an arbitrary byte value to a a scaled intensity value used by the...
Definition tinylor.h:215
int lor_set_effect(lor_req_s *req, lor_effect e, const lor_effect_args_u *args)
Configures the request to apply the specified effect. The effect may require additional arguments,...
Definition tinylor.c:24
lor_channel_format
Represents the various formats that a channel set may be encoded in for the LOR protocol....
Definition tinylor.h:70
@ LOR_FMT_16
16-bit bitset of channels.
Definition tinylor.h:72
@ LOR_FMT_UNIT
Unit number, no channels.
Definition tinylor.h:75
@ LOR_FMT_MULTIPART
Multi-part channel set.
Definition tinylor.h:76
@ LOR_FMT_8H
8-bit bitset of channels, high byte.
Definition tinylor.h:74
@ LOR_FMT_8L
8-bit bitset of channels, low byte.
Definition tinylor.h:73
@ LOR_FMT_SINGLE
Single channel.
Definition tinylor.h:71
Union of effect argument structures that may be required by assorted effect types: LOR_SET_LIGHTS,...
Definition tinylor.h:83
lor_intensity intensity
The intensity to set the lights to.
Definition tinylor.h:87
struct lor_effect_data::@1 fade
Required effect arguments for LOR_FADE.
struct lor_effect_data::@3 set_dmx_intensity
Required effect arguments for LOR_SET_DMX_INTENSITY.
lor_intensity start_intensity
The starting intensity.
Definition tinylor.h:92
struct lor_effect_data::@0 set_intensity
Required effect arguments for LOR_SET_LIGHTS.
lor_intensity end_intensity
The ending intensity.
Definition tinylor.h:94
unsigned char output
The output value to set the DMX channel to (likely brightness).
Definition tinylor.h:106
lor_decisec deciseconds
The duration of the fade in deciseconds.
Definition tinylor.h:96
struct lor_effect_data::@2 pulse
Required effect arguments for LOR_PULSE.