Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
lp581x.h
Go to the documentation of this file.
1
8
9#ifndef INFUSE_SDK_INCLUDE_INFUSE_DRIVERS_LED_LP581X_H_
10#define INFUSE_SDK_INCLUDE_INFUSE_DRIVERS_LED_LP581X_H_
11
12#include <stdint.h>
13
14#include <zephyr/toolchain.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
26
28#define LP581X_MAX_LEDS 4
29
39
51
89
91#define LP581X_PATTERN_PLAY_FOREVER 0xF
92
105 struct {
107 uint8_t pwm;
112 struct {
114 uint8_t play_count;
116 uint8_t pwm[3];
121 struct {
123 uint8_t pwm;
127};
128
148int lp581x_animation_pattern_program(const struct device *dev, uint8_t pattern_idx,
149 const struct lp581x_animation_pattern *pattern);
150
162
170
180
199int lp581x_animation_engines_configure(const struct device *dev,
200 const struct lp581x_animation_engines_config *config);
201
214int lp581x_animation_start(const struct device *dev, uint8_t led_bitmask);
215
226int lp581x_animation_stop(const struct device *dev);
227
231
232#ifdef __cplusplus
233}
234#endif
235
236#endif /* INFUSE_SDK_INCLUDE_INFUSE_DRIVERS_LED_LP581X_H_ */
int lp581x_animation_engines_configure(const struct device *dev, const struct lp581x_animation_engines_config *config)
Configure LP581X animation engines.
int lp581x_animation_stop(const struct device *dev)
Stop animations.
lp581x_pattern
LP581x animation pattern index.
Definition lp581x.h:41
lp581x_animation_engine_repeats
Number of times the animation engine repeats the configured patterns.
Definition lp581x.h:152
int lp581x_animation_start(const struct device *dev, uint8_t led_bitmask)
Start animations.
#define LP581X_MAX_LEDS
Maximum number of LED channels.
Definition lp581x.h:28
lp581x_engine
LP581x animation engine index.
Definition lp581x.h:31
int lp581x_animation_pattern_program(const struct device *dev, uint8_t pattern_idx, const struct lp581x_animation_pattern *pattern)
Program an animation pattern to the LP581X.
lp581x_phase_duration
Duration of an pattern phase.
Definition lp581x.h:53
@ LP581X_PATTERN_0
Definition lp581x.h:42
@ LP581X_PATTERN_3
Definition lp581x.h:45
@ LP581X_PATTERN_2
Definition lp581x.h:44
@ LP581X_PATTERN_SKIP
Skip pattern in this step.
Definition lp581x.h:49
@ LP581X_NUM_PATTERNS
Number of available patterns.
Definition lp581x.h:47
@ LP581X_PATTERN_1
Definition lp581x.h:43
@ LP581X_ENGINE_REPEAT_NONE
Engine does not repeat the configured pattern (one total run)
Definition lp581x.h:154
@ LP581X_ENGINE_REPEAT_TWICE
Engine repeats the configured pattern twice (three total runs)
Definition lp581x.h:158
@ LP581X_ENGINE_REPEAT_FOREVER
Engine repeats the configured pattern forever.
Definition lp581x.h:160
@ LP581X_ENGINE_REPEAT_ONCE
Engine repeats the configured pattern once (two total runs)
Definition lp581x.h:156
@ LP581X_ENGINE_1
Definition lp581x.h:33
@ LP581X_ENGINE_3
Definition lp581x.h:35
@ LP581X_ENGINE_0
Definition lp581x.h:32
@ LP581X_NUM_ENGINES
Number of available engines.
Definition lp581x.h:37
@ LP581X_ENGINE_2
Definition lp581x.h:34
@ LP581X_PHASE_250_MS
250ms duration
Definition lp581x.h:65
@ LP581X_PHASE_300_MS
300ms duration
Definition lp581x.h:67
@ LP581X_PHASE_6000_MS
6000ms duration
Definition lp581x.h:83
@ LP581X_PHASE_8000_MS
8000ms duration
Definition lp581x.h:85
@ LP581X_PHASE_50_MS
50ms duration
Definition lp581x.h:57
@ LP581X_PHASE_350_MS
350ms duration
Definition lp581x.h:69
@ LP581X_PHASE_150_MS
150ms duration
Definition lp581x.h:61
@ LP581X_PHASE_2000_MS
2000ms duration
Definition lp581x.h:79
@ LP581X_PHASE_0_MS
No phase duration.
Definition lp581x.h:55
@ LP581X_PHASE_450_MS
450ms duration
Definition lp581x.h:73
@ LP581X_PHASE_500_MS
500ms duration
Definition lp581x.h:75
@ LP581X_PHASE_4000_MS
4000ms duration
Definition lp581x.h:81
@ LP581X_PHASE_100_MS
100ms duration
Definition lp581x.h:59
@ LP581X_PHASE_400_MS
400ms duration
Definition lp581x.h:71
@ LP581X_PHASE_200_MS
200ms duration
Definition lp581x.h:63
@ LP581X_PHASE_1000_MS
1000ms duration
Definition lp581x.h:77
Configuration of a single engine.
Definition lp581x.h:164
enum lp581x_animation_engine_repeats repeats
Number of times to repeat array of patterns.
Definition lp581x.h:168
enum lp581x_pattern order[4]
Pattern order.
Definition lp581x.h:166
Configuration of all engines.
Definition lp581x.h:172
uint8_t num_engines
Number of animation engines configured by engines.
Definition lp581x.h:176
struct lp581x_animation_engine_config engines[LP581X_NUM_ENGINES]
Configuration of each animation engine.
Definition lp581x.h:178
enum lp581x_engine led_channel_engines[4]
Animation engine that drives each LED channel.
Definition lp581x.h:174
LED pattern configuration.
Definition lp581x.h:103
struct lp581x_animation_pattern::@161203207313071247134300133174253325075063160332 sloper
Sloper configuration steps.
enum lp581x_phase_duration duration
Duration of pre-pause.
Definition lp581x.h:109
uint8_t play_count
Number of times to run, 0 to 14 or LP581X_PATTERN_PLAY_FOREVER.
Definition lp581x.h:114
struct lp581x_animation_pattern::@232053103037062157374316207153302247356126314034 post_pause
Pause after pattern stops running.
uint8_t pwm
LED intensity in pre-pause.
Definition lp581x.h:107
struct lp581x_animation_pattern::@353057327071173232362325154314253221026135333075 pre_pause
Pause before pattern starts running.