2022-06-21 20:33:23 +02:00
|
|
|
#ifndef _DMX_H_
|
|
|
|
#define _DMX_H_
|
|
|
|
|
2022-06-21 22:04:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
2022-07-07 17:40:25 +02:00
|
|
|
#define DMX_UNIVERSE_SIZE (512u)
|
2022-06-21 22:04:44 +02:00
|
|
|
#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);
|
|
|
|
|
2022-06-24 19:43:00 +02:00
|
|
|
/**
|
|
|
|
* @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);
|
|
|
|
|
2022-06-21 20:33:23 +02:00
|
|
|
#endif /* _DMX_H_ */
|