microscope-ring-light-remot.../include/animation.h

36 lines
640 B
C
Raw Normal View History

2022-10-22 00:16:33 +02:00
#ifndef _ANIMATION_H_
#define _ANIMATION_H_
#include <stdint.h>
enum animation_state {
ANI_RED,
ANI_GREEN,
ANI_BLUE,
ANI_RAINBOW,
ANI_FLASH_WHITE,
};
struct animation {
enum animation_state state;
uint32_t step;
uint32_t last_tick;
uint32_t next_interval;
};
/**
* @brief Reset aniamtion to start conditions
*
* @param ani Animation
*/
void animation_reset(struct animation *ani);
/**
* @brief Poll animation
*
* @param ani Animation
* @param dmx_universe Target universe to play animation into. Must be big enough
*/
void animation_process(struct animation *ani, uint8_t *dmx_universe);
#endif /* _ANIMATION_H_ */