1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
tmk_keyboard_custom/common/softpwm_led.h

79 lines
2.2 KiB
C
Raw Normal View History

2014-07-18 02:15:30 +00:00
#ifndef SOFTPWM_LED_H
#define SOFTPWM_LED_H
#include "stdint.h"
#include "led.h"
2014-07-18 02:15:30 +00:00
#ifdef SOFTPWM_LED_ENABLE
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);
void softpwm_led_set(uint8_t index, uint8_t val);
void softpwm_led_set_all(uint8_t val);
void softpwm_led_on(uint8_t index);
void softpwm_led_off(uint8_t index);
uint8_t softpwm_led_get_state(void);
void softpwm_led_state_change(uint8_t state);
2014-07-18 02:15:30 +00:00
#ifdef BREATHING_LED_ENABLE
2014-08-22 10:18:12 +00:00
enum {
BREATHING_LED_NO = 0,
BREATHING_LED_UP,
BREATHING_LED_DOWN,
BREATHING_LED_CYCLE
};
2014-07-18 02:15:30 +00:00
#define breathing_led_init()
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-22 10:18:12 +00:00
void breathing_led_set_mode(uint8_t index, uint8_t mode);
void breathing_led_set_duration(uint8_t index, uint8_t dur);
2014-08-22 10:18:12 +00:00
void breathing_led_increase(uint8_t index, uint8_t offset);
void breathing_led_decrease(uint8_t index, uint8_t offset);
void breathing_led_set_mode_all(uint8_t mode);
void breathing_led_set_duration_all(uint8_t dur);
2014-08-22 10:18:12 +00:00
void breathing_led_increase_all(uint8_t offset);
void breathing_led_decrease_all(uint8_t offset);
2014-07-18 02:15:30 +00:00
#else
#define breathing_led_init()
#define breathing_led_enable()
#define breathing_led_enable_all()
2014-07-18 02:15:30 +00:00
#define breathing_led_disable()
#define breathing_led_disable_all()
2014-07-18 02:15:30 +00:00
#define breathing_led_toggle()
#define breathing_led_toggle_all()
2014-08-22 10:18:12 +00:00
#define breathing_led_set_mode()
2014-07-18 02:15:30 +00:00
#define breathing_led_set_duration()
2014-08-22 10:18:12 +00:00
#define breathing_led_increase()
#define breathing_led_decrease()
#define breathing_led_set_mode_all()
#define breathing_led_set_duration_all()
2014-08-22 10:18:12 +00:00
#define breathing_led_increase_all()
#define breathing_led_decrease_all()
2014-07-18 02:15:30 +00:00
#endif
#else
#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()
#define softpwm_led_set_all()
2014-07-18 02:15:30 +00:00
#define softpwm_led_on()
#define softpwm_led_off()
#define softpwm_led_get_state()
#define softpwm_led_state_change()
2014-07-18 02:15:30 +00:00
#endif
#endif