|
Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
|
Advanced LP581x LED Controller configuration. More...
Data Structures | |
| struct | lp581x_animation_pattern |
| LED pattern configuration. More... | |
| struct | lp581x_animation_engine_config |
| Configuration of a single engine. More... | |
| struct | lp581x_animation_engines_config |
| Configuration of all engines. More... | |
Macros | |
| #define | LP581X_MAX_LEDS 4 |
| Maximum number of LED channels. | |
| #define | LP581X_PATTERN_PLAY_FOREVER 0xF |
| Repeat the pattern forever. | |
Functions | |
| 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. | |
| int | lp581x_animation_engines_configure (const struct device *dev, const struct lp581x_animation_engines_config *config) |
| Configure LP581X animation engines. | |
| int | lp581x_animation_start (const struct device *dev, uint8_t led_bitmask) |
| Start animations. | |
| int | lp581x_animation_stop (const struct device *dev) |
| Stop animations. | |
Advanced LP581x LED Controller configuration.
| #define LP581X_MAX_LEDS 4 |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Maximum number of LED channels.
| #define LP581X_PATTERN_PLAY_FOREVER 0xF |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Repeat the pattern forever.
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Number of times the animation engine repeats the configured patterns.
| enum lp581x_engine |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
| Enumerator | |
|---|---|
| LP581X_ENGINE_0 | |
| LP581X_ENGINE_1 | |
| LP581X_ENGINE_2 | |
| LP581X_ENGINE_3 | |
| LP581X_NUM_ENGINES | Number of available engines. |
| enum lp581x_pattern |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
| Enumerator | |
|---|---|
| LP581X_PATTERN_0 | |
| LP581X_PATTERN_1 | |
| LP581X_PATTERN_2 | |
| LP581X_PATTERN_3 | |
| LP581X_NUM_PATTERNS | Number of available patterns. |
| LP581X_PATTERN_SKIP | Skip pattern in this step. |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Duration of an pattern phase.
| int lp581x_animation_engines_configure | ( | const struct device * | dev, |
| const struct lp581x_animation_engines_config * | config ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Configure LP581X animation engines.
The LP581X devices have 4 independent programmable animation engines. Each engine has 4 steps, where each step runs a pattern programed by lp581x_animation_pattern_program.
Animation engines must be programmed before starting the animation.
| dev | LP581X device |
| config | Engine configuration |
| 0 | On success |
| -ENOTSUP | Part variant does not support animations |
| -EINVAL | If config has invalid values |
| -EBUSY | If animation engines are already running |
| -errno | On failure |
| int lp581x_animation_pattern_program | ( | const struct device * | dev, |
| uint8_t | pattern_idx, | ||
| const struct lp581x_animation_pattern * | pattern ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Program an animation pattern to the LP581X.
The LP581X devices have 4 programmable patterns, with each pattern being available to any of the animation engines. Any number of animation engines can use each pattern at the same time.
Animation patterns must be programmed before starting the animation.
| dev | LP581X device |
| pattern_idx | Pattern to program, 0 to 3 |
| pattern | Pattern configuration |
| 0 | On success |
| -ENOTSUP | Part variant does not support animations |
| -EINVAL | If pattern_idx or pattern have invalid values |
| -EBUSY | If animation engines are already running |
| -errno | On failure |
| int lp581x_animation_start | ( | const struct device * | dev, |
| uint8_t | led_bitmask ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Start animations.
| dev | LP581X device |
| led_bitmask | Bitmask of LEDs that should be enabled |
| 0 | On success |
| -ENOTSUP | Part variant does not support animations |
| -EINVAL | If led_bitmask has invalid values |
| -EBUSY | If animation engines are already running |
| -errno | On failure |
| int lp581x_animation_stop | ( | const struct device * | dev | ) |
#include </__w/infuse-sdk/infuse-sdk/infuse-sdk/include/infuse/drivers/led/lp581x.h>
Stop animations.
| dev | LP581X device |
| 0 | On success |
| -ENOTSUP | Part variant does not support animations |
| -EAGAIN | Animations are not currently running |
| -errno | On failure |