Infuse-IoT SDK API 0.0.1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
lp581x.h File Reference
#include <stdint.h>
#include <zephyr/toolchain.h>

Go to the source code of this file.

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.

Enumerations

enum  lp581x_engine {
  LP581X_ENGINE_0 = 0 , LP581X_ENGINE_1 = 1 , LP581X_ENGINE_2 = 2 , LP581X_ENGINE_3 = 3 ,
  LP581X_NUM_ENGINES
}
enum  lp581x_pattern {
  LP581X_PATTERN_0 = 0 , LP581X_PATTERN_1 = 1 , LP581X_PATTERN_2 = 2 , LP581X_PATTERN_3 = 3 ,
  LP581X_NUM_PATTERNS , LP581X_PATTERN_SKIP = LP581X_NUM_PATTERNS
}
enum  lp581x_phase_duration {
  LP581X_PHASE_0_MS = 0x0 , LP581X_PHASE_50_MS = 0x1 , LP581X_PHASE_100_MS = 0x2 , LP581X_PHASE_150_MS = 0x3 ,
  LP581X_PHASE_200_MS = 0x4 , LP581X_PHASE_250_MS = 0x5 , LP581X_PHASE_300_MS = 0x6 , LP581X_PHASE_350_MS = 0x7 ,
  LP581X_PHASE_400_MS = 0x8 , LP581X_PHASE_450_MS = 0x9 , LP581X_PHASE_500_MS = 0xA , LP581X_PHASE_1000_MS = 0xB ,
  LP581X_PHASE_2000_MS = 0xC , LP581X_PHASE_4000_MS = 0xD , LP581X_PHASE_6000_MS = 0xE , LP581X_PHASE_8000_MS = 0xF ,
  _LP581X_PHASE_END
}
 Duration of an pattern phase. More...
enum  lp581x_animation_engine_repeats { LP581X_ENGINE_REPEAT_NONE = 0 , LP581X_ENGINE_REPEAT_ONCE = 1 , LP581X_ENGINE_REPEAT_TWICE = 2 , LP581X_ENGINE_REPEAT_FOREVER = 3 }
 Number of times the animation engine repeats the configured patterns. More...

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.

Detailed Description

Author
Jordan Yates jorda.nosp@m.n@em.nosp@m.beint.nosp@m..com

SPDX-License-Identifier: Apache-2.0