microscope-ring-light/firmware/include/ring-light/dmx.h

50 lines
939 B
C

#ifndef _DMX_H_
#define _DMX_H_
#include <stdint.h>
#include <stdbool.h>
#define DMX_UNIVERSE_SIZE (255u)
#define DMX_USED_CHANNEL_COUNT (129u)
/**
* @brief Init DMX reception
*
* DMX data is received from the base channel onwards:
* - R LED1
* - G LED1
* - B LED1
* - W LED1
* - R LED2
* ...
* - W LED32
* - W DISCRETE
*
* In Sum: 129 8 bit channels
*
* @param base_channel Base channel the ring light will listen on
*/
void dmx_init(uint32_t base_channel);
/**
* @brief Returns the array of the 129 DMX channels
* @return
*/
const uint8_t *dmx_get_data(void);
/**
* @brief Check if a break was received. This resets the flag
* @return true if a break was received since the last time calling this function
*/
bool dmx_poll_break_received(void);
/**
* @brief The DMX receiver has received all data for the ring light. It can be read
* @return
*/
bool dmx_enough_data_received(void);
#endif /* _DMX_H_ */