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
25
27#define LP581X_MAX_LEDS 4
28
37
48
86
88#define LP581X_PATTERN_PLAY_FOREVER 0xF
89
102 struct {
104 uint8_t pwm;
109 struct {
111 uint8_t play_count;
113 uint8_t pwm[3];
118 struct {
120 uint8_t pwm;
124};
125
145int lp581x_animation_pattern_program(const struct device *dev, uint8_t pattern_idx,
146 const struct lp581x_animation_pattern *pattern);
147
159
167
177
196int lp581x_animation_engines_configure(const struct device *dev,
197 const struct lp581x_animation_engines_config *config);
198
211int lp581x_animation_start(const struct device *dev, uint8_t led_bitmask);
212
223int lp581x_animation_stop(const struct device *dev);
224
228
229#ifdef __cplusplus
230}
231#endif
232
233#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
Definition lp581x.h:38
lp581x_animation_engine_repeats
Number of times the animation engine repeats the configured patterns.
Definition lp581x.h:149
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:27
lp581x_engine
Definition lp581x.h:29
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:50
@ LP581X_PATTERN_0
Definition lp581x.h:39
@ LP581X_PATTERN_3
Definition lp581x.h:42
@ LP581X_PATTERN_2
Definition lp581x.h:41
@ LP581X_PATTERN_SKIP
Skip pattern in this step.
Definition lp581x.h:46
@ LP581X_NUM_PATTERNS
Number of available patterns.
Definition lp581x.h:44
@ LP581X_PATTERN_1
Definition lp581x.h:40
@ LP581X_ENGINE_REPEAT_NONE
Engine does not repeat the configured pattern (one total run)
Definition lp581x.h:151
@ LP581X_ENGINE_REPEAT_TWICE
Engine repeats the configured pattern twice (three total runs)
Definition lp581x.h:155
@ LP581X_ENGINE_REPEAT_FOREVER
Engine repeats the configured pattern forever.
Definition lp581x.h:157
@ LP581X_ENGINE_REPEAT_ONCE
Engine repeats the configured pattern once (two total runs)
Definition lp581x.h:153
@ LP581X_ENGINE_1
Definition lp581x.h:31
@ LP581X_ENGINE_3
Definition lp581x.h:33
@ LP581X_ENGINE_0
Definition lp581x.h:30
@ LP581X_NUM_ENGINES
Number of available engines.
Definition lp581x.h:35
@ LP581X_ENGINE_2
Definition lp581x.h:32
@ LP581X_PHASE_250_MS
250ms duration
Definition lp581x.h:62
@ LP581X_PHASE_300_MS
300ms duration
Definition lp581x.h:64
@ LP581X_PHASE_6000_MS
6000ms duration
Definition lp581x.h:80
@ LP581X_PHASE_8000_MS
8000ms duration
Definition lp581x.h:82
@ LP581X_PHASE_50_MS
50ms duration
Definition lp581x.h:54
@ LP581X_PHASE_350_MS
350ms duration
Definition lp581x.h:66
@ LP581X_PHASE_150_MS
150ms duration
Definition lp581x.h:58
@ LP581X_PHASE_2000_MS
2000ms duration
Definition lp581x.h:76
@ LP581X_PHASE_0_MS
No phase duration.
Definition lp581x.h:52
@ LP581X_PHASE_450_MS
450ms duration
Definition lp581x.h:70
@ LP581X_PHASE_500_MS
500ms duration
Definition lp581x.h:72
@ LP581X_PHASE_4000_MS
4000ms duration
Definition lp581x.h:78
@ LP581X_PHASE_100_MS
100ms duration
Definition lp581x.h:56
@ LP581X_PHASE_400_MS
400ms duration
Definition lp581x.h:68
@ LP581X_PHASE_200_MS
200ms duration
Definition lp581x.h:60
@ LP581X_PHASE_1000_MS
1000ms duration
Definition lp581x.h:74
Configuration of a single engine.
Definition lp581x.h:161
enum lp581x_animation_engine_repeats repeats
Number of times to repeat array of patterns.
Definition lp581x.h:165
enum lp581x_pattern order[4]
Pattern order.
Definition lp581x.h:163
Configuration of all engines.
Definition lp581x.h:169
uint8_t num_engines
Number of animation engines configured by engines.
Definition lp581x.h:173
struct lp581x_animation_engine_config engines[LP581X_NUM_ENGINES]
Configuration of each animation engine.
Definition lp581x.h:175
enum lp581x_engine led_channel_engines[4]
Animation engine that drives each LED channel.
Definition lp581x.h:171
LED pattern configuration.
Definition lp581x.h:100
struct lp581x_animation_pattern::@161203207313071247134300133174253325075063160332 sloper
Sloper configuration steps.
enum lp581x_phase_duration duration
Duration of pre-pause.
Definition lp581x.h:106
uint8_t play_count
Number of times to run, 0 to 14 or LP581X_PATTERN_PLAY_FOREVER.
Definition lp581x.h:111
struct lp581x_animation_pattern::@232053103037062157374316207153302247356126314034 post_pause
Pause after pattern stops running.
uint8_t pwm
LED intensity in pre-pause.
Definition lp581x.h:104
struct lp581x_animation_pattern::@353057327071173232362325154314253221026135333075 pre_pause
Pause before pattern starts running.