File syn_dmx512.c¶
FileList > proto > syn_dmx512.c
Go to the source code of this file
USITT DMX512-A Stage Lighting Protocol implementation.
#include "../util/syn_assert.h"#include "syn_dmx512.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| size_t | syn_dmx512_master_build_frame (const SYN_DMX512_Master * master, uint8_t * out_buf, size_t max_len) Build DMX packet payload (Start Code + Channel Slots). |
| uint8_t | syn_dmx512_master_get_channel (const SYN_DMX512_Master * master, uint16_t channel) Get channel value (1-indexed channel, 1..512). |
| void | syn_dmx512_master_init (SYN_DMX512_Master * master, uint16_t num_channels) Initialize DMX512 Master engine. |
| SYN_Status | syn_dmx512_master_set_channel (SYN_DMX512_Master * master, uint16_t channel, uint8_t value) Set channel value (1-indexed channel, 1..512). |
| uint8_t | syn_dmx512_slave_get_channel (const SYN_DMX512_Slave * slave, uint16_t offset) Read channel value from local slave footprint (0-indexed offset). |
| void | syn_dmx512_slave_init (SYN_DMX512_Slave * slave, uint16_t start_address, uint16_t footprint) Initialize DMX512 Slave engine. |
| bool | syn_dmx512_slave_is_updated (SYN_DMX512_Slave * slave) Check if a complete DMX packet was received since last query. |
| void | syn_dmx512_slave_rx_break (SYN_DMX512_Slave * slave) Signal line Break event to Slave engine (e.g. from UART framing error interrupt). |
| void | syn_dmx512_slave_rx_byte (SYN_DMX512_Slave * slave, uint8_t byte) Ingest incoming byte stream into Slave engine. |
Public Functions Documentation¶
function syn_dmx512_master_build_frame¶
Build DMX packet payload (Start Code + Channel Slots).
size_t syn_dmx512_master_build_frame (
const SYN_DMX512_Master * master,
uint8_t * out_buf,
size_t max_len
)
Parameters:
masterMaster handle.out_bufOutput buffer for frame payload.max_lenMaximum capacity of out_buf.
Returns:
Number of payload bytes written (1 + num_channels).
function syn_dmx512_master_get_channel¶
Get channel value (1-indexed channel, 1..512).
Parameters:
masterMaster handle.channelChannel index (1..512).
Returns:
8-bit slot value.
function syn_dmx512_master_init¶
Initialize DMX512 Master engine.
Parameters:
masterMaster handle.num_channelsActive universe length (1..512, default 512).
function syn_dmx512_master_set_channel¶
Set channel value (1-indexed channel, 1..512).
SYN_Status syn_dmx512_master_set_channel (
SYN_DMX512_Master * master,
uint16_t channel,
uint8_t value
)
Parameters:
masterMaster handle.channelChannel index (1..512).value8-bit slot value (0..255).
Returns:
SYN_OK on success, error code on invalid channel.
function syn_dmx512_slave_get_channel¶
Read channel value from local slave footprint (0-indexed offset).
Parameters:
slaveSlave handle.offsetFootprint channel offset (0 .. footprint - 1).
Returns:
Channel value byte.
function syn_dmx512_slave_init¶
Initialize DMX512 Slave engine.
Parameters:
slaveSlave handle.start_addressStart channel address (1..512).footprintChannel footprint length (e.g. 4 for 4-channel fixture).
function syn_dmx512_slave_is_updated¶
Check if a complete DMX packet was received since last query.
Parameters:
slaveSlave handle.
Returns:
true if updated, false otherwise.
function syn_dmx512_slave_rx_break¶
Signal line Break event to Slave engine (e.g. from UART framing error interrupt).
Parameters:
slaveSlave handle.
function syn_dmx512_slave_rx_byte¶
Ingest incoming byte stream into Slave engine.
Parameters:
slaveSlave handle.byteIncoming byte from UART rx.
The documentation for this class was generated from the following file src/syntropic/proto/syn_dmx512.c