Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
light_scheduler.h File Reference

basic LED scheduler based on WS2812 RGB led driver More...

#include "std.h"
+ Include dependency graph for light_scheduler.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LIGHT_SCHEDULER_MODE_RAINBOW   0
 Light modes.
 
#define LIGHT_SCHEDULER_MODE_COLOR   1
 
#define LIGHT_SCHEDULER_MODE_OFF   2
 
#define LIGHT_SCHEDULER_MODE_SPARKLE   3
 
#define LIGHT_SCHEDULER_COLOR_FLAG_FIRST   LIGHT_SCHEDULER_COLOR_FLAG_ITALY
 

Enumerations

enum  light_scheduler_color_t {
  LIGHT_SCHEDULER_COLOR_CUSTOM , LIGHT_SCHEDULER_COLOR_RED , LIGHT_SCHEDULER_COLOR_GREEN , LIGHT_SCHEDULER_COLOR_BLUE ,
  LIGHT_SCHEDULER_COLOR_WHITE , LIGHT_SCHEDULER_COLOR_YELLOW , LIGHT_SCHEDULER_COLOR_ORANGE , LIGHT_SCHEDULER_COLOR_CYAN ,
  LIGHT_SCHEDULER_COLOR_MAGENTA , LIGHT_SCHEDULER_COLOR_PURPLE , LIGHT_SCHEDULER_COLOR_FLAG_ITALY , LIGHT_SCHEDULER_COLOR_FLAG_NETHERLANDS ,
  LIGHT_SCHEDULER_COLOR_FLAG_FRANCE , LIGHT_SCHEDULER_COLOR_NB
}
 Color presets and flags, order must match the values of the color setting Flags are shown as three equal bands along each strip. More...
 

Functions

void light_scheduler_init (void)
 
void light_scheduler_periodic (void)
 
void light_scheduler_set_color (uint8_t color)
 Settings handler: apply a color preset to red/green/blue (or select a flag) and switch to color mode.
 

Variables

uint8_t light_scheduler_mode
 one of LIGHT_SCHEDULER_MODE_*
 
uint8_t light_scheduler_red
 red value in color mode
 
uint8_t light_scheduler_green
 green value in color mode
 
uint8_t light_scheduler_blue
 blue value in color mode
 
uint8_t light_scheduler_brightness
 brightness scaling (255 = full)
 
uint8_t light_scheduler_color
 selected preset (light_scheduler_color_t)
 

Detailed Description

basic LED scheduler based on WS2812 RGB led driver

Author
Xavier Paris @maintainer Gautier Hattenberger gauti.nosp@m.er.h.nosp@m.atten.nosp@m.berg.nosp@m.er@en.nosp@m.ac.f.nosp@m.r

Definition in file light_scheduler.h.

Macro Definition Documentation

◆ LIGHT_SCHEDULER_COLOR_FLAG_FIRST

#define LIGHT_SCHEDULER_COLOR_FLAG_FIRST   LIGHT_SCHEDULER_COLOR_FLAG_ITALY

Definition at line 67 of file light_scheduler.h.

◆ LIGHT_SCHEDULER_MODE_COLOR

#define LIGHT_SCHEDULER_MODE_COLOR   1

Definition at line 37 of file light_scheduler.h.

◆ LIGHT_SCHEDULER_MODE_OFF

#define LIGHT_SCHEDULER_MODE_OFF   2

Definition at line 38 of file light_scheduler.h.

◆ LIGHT_SCHEDULER_MODE_RAINBOW

#define LIGHT_SCHEDULER_MODE_RAINBOW   0

Light modes.

Definition at line 36 of file light_scheduler.h.

◆ LIGHT_SCHEDULER_MODE_SPARKLE

#define LIGHT_SCHEDULER_MODE_SPARKLE   3

Definition at line 39 of file light_scheduler.h.

Enumeration Type Documentation

◆ light_scheduler_color_t

Color presets and flags, order must match the values of the color setting Flags are shown as three equal bands along each strip.

Enumerator
LIGHT_SCHEDULER_COLOR_CUSTOM 
LIGHT_SCHEDULER_COLOR_RED 
LIGHT_SCHEDULER_COLOR_GREEN 
LIGHT_SCHEDULER_COLOR_BLUE 
LIGHT_SCHEDULER_COLOR_WHITE 
LIGHT_SCHEDULER_COLOR_YELLOW 
LIGHT_SCHEDULER_COLOR_ORANGE 
LIGHT_SCHEDULER_COLOR_CYAN 
LIGHT_SCHEDULER_COLOR_MAGENTA 
LIGHT_SCHEDULER_COLOR_PURPLE 
LIGHT_SCHEDULER_COLOR_FLAG_ITALY 

first flag, red | white | green

LIGHT_SCHEDULER_COLOR_FLAG_NETHERLANDS 

red | white | blue

LIGHT_SCHEDULER_COLOR_FLAG_FRANCE 

blue | white | red

LIGHT_SCHEDULER_COLOR_NB 

Definition at line 50 of file light_scheduler.h.

Function Documentation

◆ light_scheduler_init()

void light_scheduler_init ( void  )
extern

Definition at line 156 of file light_scheduler.c.

References light_scheduler_color, LIGHT_SCHEDULER_COLOR_CUSTOM, light_scheduler_mode, light_scheduler_set_color(), light_ws2812_arch_init(), and mode.

+ Here is the call graph for this function:

◆ light_scheduler_periodic()

◆ light_scheduler_set_color()

void light_scheduler_set_color ( uint8_t  color)
extern

Settings handler: apply a color preset to red/green/blue (or select a flag) and switch to color mode.

Definition at line 143 of file light_scheduler.c.

References foo, light_scheduler_blue, light_scheduler_color, LIGHT_SCHEDULER_COLOR_CUSTOM, LIGHT_SCHEDULER_COLOR_FLAG_FIRST, LIGHT_SCHEDULER_COLOR_NB, light_scheduler_green, light_scheduler_mode, LIGHT_SCHEDULER_MODE_COLOR, light_scheduler_presets, and light_scheduler_red.

Referenced by light_scheduler_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ light_scheduler_blue

uint8_t light_scheduler_blue
extern

blue value in color mode

Definition at line 77 of file light_scheduler.c.

Referenced by light_scheduler_periodic(), and light_scheduler_set_color().

◆ light_scheduler_brightness

uint8_t light_scheduler_brightness
extern

brightness scaling (255 = full)

Definition at line 78 of file light_scheduler.c.

Referenced by light_scheduler_set().

◆ light_scheduler_color

uint8_t light_scheduler_color
extern

selected preset (light_scheduler_color_t)

Definition at line 79 of file light_scheduler.c.

Referenced by light_scheduler_init(), light_scheduler_periodic(), and light_scheduler_set_color().

◆ light_scheduler_green

uint8_t light_scheduler_green
extern

green value in color mode

Definition at line 76 of file light_scheduler.c.

Referenced by light_scheduler_periodic(), and light_scheduler_set_color().

◆ light_scheduler_mode

uint8_t light_scheduler_mode
extern

one of LIGHT_SCHEDULER_MODE_*

Definition at line 74 of file light_scheduler.c.

Referenced by light_scheduler_init(), light_scheduler_periodic(), and light_scheduler_set_color().

◆ light_scheduler_red

uint8_t light_scheduler_red
extern

red value in color mode

Definition at line 75 of file light_scheduler.c.

Referenced by light_scheduler_periodic(), and light_scheduler_set_color().