2014-07-18 02:15:30 +00:00
|
|
|
#ifndef SOFTPWM_LED_H
|
|
|
|
#define SOFTPWM_LED_H
|
|
|
|
|
2014-08-02 01:15:57 +00:00
|
|
|
#include "stdint.h"
|
|
|
|
#include "led.h"
|
|
|
|
|
|
|
|
|
2014-07-18 02:15:30 +00:00
|
|
|
#ifdef SOFTPWM_LED_ENABLE
|
|
|
|
|
2014-08-03 03:00:18 +00:00
|
|
|
void softpwm_init(void);
|
2014-07-18 02:15:30 +00:00
|
|
|
void softpwm_led_init(void);
|
|
|
|
void softpwm_led_enable(void);
|
|
|
|
void softpwm_led_disable(void);
|
|
|
|
void softpwm_led_toggle(void);
|
2014-08-02 01:15:57 +00:00
|
|
|
void softpwm_led_set(uint8_t index, uint8_t val);
|
|
|
|
void softpwm_led_set_all(uint8_t val);
|
2014-08-25 05:03:23 +00:00
|
|
|
void softpwm_led_increase(uint8_t index, uint8_t offset);
|
|
|
|
void softpwm_led_increase_all(uint8_t offset);
|
|
|
|
void softpwm_led_decrease(uint8_t index, uint8_t offset);
|
|
|
|
void softpwm_led_decrease_all(uint8_t offset);
|
2014-08-02 01:15:57 +00:00
|
|
|
void softpwm_led_on(uint8_t index);
|
|
|
|
void softpwm_led_off(uint8_t index);
|
2014-07-25 05:24:57 +00:00
|
|
|
uint8_t softpwm_led_get_state(void);
|
|
|
|
void softpwm_led_state_change(uint8_t state);
|
2014-07-18 02:15:30 +00:00
|
|
|
|
2014-08-22 10:18:12 +00:00
|
|
|
enum {
|
2014-08-25 05:03:23 +00:00
|
|
|
FADING_LED_FADE_IN = 0,
|
|
|
|
FADING_LED_FADE_OUT
|
2014-08-22 10:18:12 +00:00
|
|
|
};
|
2014-08-25 05:03:23 +00:00
|
|
|
#ifdef FADING_LED_ENABLE
|
|
|
|
void fading_led_enable(uint8_t index);
|
|
|
|
void fading_led_enable_all(void);
|
|
|
|
void fading_led_disable(uint8_t index);
|
|
|
|
void fading_led_disable_all(void);
|
|
|
|
void fading_led_toggle(uint8_t index);
|
|
|
|
void fading_led_toggle_all(void);
|
|
|
|
void fading_led_set_direction(uint8_t dir);
|
|
|
|
void fading_led_set_duration(uint8_t dur);
|
|
|
|
#else
|
|
|
|
#define fading_led_enable()
|
|
|
|
#define fading_led_enable_all()
|
|
|
|
#define fading_led_disable()
|
|
|
|
#define fading_led_disable_all()
|
|
|
|
#define fading_led_toggle()
|
|
|
|
#define fading_led_toggle_all()
|
|
|
|
#define fading_led_set_direction()
|
|
|
|
#define fading_led_set_direction_all()
|
|
|
|
#define fading_led_set_duration()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BREATHING_LED_ENABLE
|
2014-07-18 02:15:30 +00:00
|
|
|
#define breathing_led_init()
|
2014-08-02 01:15:57 +00:00
|
|
|
void breathing_led_enable(uint8_t index);
|
|
|
|
void breathing_led_enable_all(void);
|
|
|
|
void breathing_led_disable(uint8_t index);
|
|
|
|
void breathing_led_disable_all(void);
|
|
|
|
void breathing_led_toggle(uint8_t index);
|
|
|
|
void breathing_led_toggle_all(void);
|
2014-08-25 05:03:23 +00:00
|
|
|
void breathing_led_set_duration(uint8_t dur);
|
2014-07-18 02:15:30 +00:00
|
|
|
#else
|
|
|
|
#define breathing_led_init()
|
|
|
|
#define breathing_led_enable()
|
2014-08-02 01:15:57 +00:00
|
|
|
#define breathing_led_enable_all()
|
2014-07-18 02:15:30 +00:00
|
|
|
#define breathing_led_disable()
|
2014-08-02 01:15:57 +00:00
|
|
|
#define breathing_led_disable_all()
|
2014-07-18 02:15:30 +00:00
|
|
|
#define breathing_led_toggle()
|
2014-08-02 01:15:57 +00:00
|
|
|
#define breathing_led_toggle_all()
|
2014-07-18 02:15:30 +00:00
|
|
|
#define breathing_led_set_duration()
|
2014-08-02 01:15:57 +00:00
|
|
|
#define breathing_led_set_duration_all()
|
2014-07-18 02:15:30 +00:00
|
|
|
#endif
|
|
|
|
|
2015-04-22 02:56:39 +00:00
|
|
|
#ifdef CUSTOM_LED_ENABLE
|
2015-04-22 09:49:49 +00:00
|
|
|
void softpwm_led_custom(void);
|
|
|
|
void fading_led_custom(uint8_t *value);
|
|
|
|
void breathing_led_custom(uint8_t *value);
|
2015-04-22 02:56:39 +00:00
|
|
|
#else
|
|
|
|
#define custom_led_proc()
|
|
|
|
#endif
|
|
|
|
|
2014-07-18 02:15:30 +00:00
|
|
|
#else
|
|
|
|
|
2014-08-03 03:00:18 +00:00
|
|
|
#define softpwm_init()
|
2014-07-18 02:15:30 +00:00
|
|
|
#define softpwm_led_init()
|
|
|
|
#define softpwm_led_enable()
|
|
|
|
#define softpwm_led_disable()
|
|
|
|
#define softpwm_led_toggle()
|
|
|
|
#define softpwm_led_set()
|
2014-08-02 01:15:57 +00:00
|
|
|
#define softpwm_led_set_all()
|
2014-08-25 05:03:23 +00:00
|
|
|
#define softpwm_led_increase()
|
|
|
|
#define softpwm_led_increase_all()
|
|
|
|
#define softpwm_led_decrease()
|
|
|
|
#define softpwm_led_decrease_all()
|
2014-07-18 02:15:30 +00:00
|
|
|
#define softpwm_led_on()
|
|
|
|
#define softpwm_led_off()
|
2014-07-25 05:24:57 +00:00
|
|
|
#define softpwm_led_get_state()
|
|
|
|
#define softpwm_led_state_change()
|
2014-07-18 02:15:30 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|