summaryrefslogtreecommitdiff
path: root/tmk_core/common/backlight.h
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-07-16 17:56:36 +1000
committerFlorian Didron <fdidron@users.noreply.github.com>2019-07-19 10:16:35 +0900
commit408356533460cb12adad96f65e4c8a8494afa4b7 (patch)
tree88980cfe237ca1c749af01152c4146db63c3d722 /tmk_core/common/backlight.h
parentb279d2b94e1687180a1d4da354888152e584a900 (diff)
Store backlight breathing state in EEPROM (#6105)
* Store backlight breathing state in EEPROM * Reduce backlight_config.level from 6 bits to 4 (max 15 "on" levels) * Error out if BACKLIGHT_LEVELS is > 15 * Remove mention of default backlight pin in rules.mk template * Remove pointless comment
Diffstat (limited to 'tmk_core/common/backlight.h')
-rw-r--r--tmk_core/common/backlight.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/tmk_core/common/backlight.h b/tmk_core/common/backlight.h
index 420c9d19ed..cc56fb9af0 100644
--- a/tmk_core/common/backlight.h
+++ b/tmk_core/common/backlight.h
@@ -20,11 +20,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h>
#include <stdbool.h>
+#ifndef BACKLIGHT_LEVELS
+ #define BACKLIGHT_LEVELS 3
+#elif BACKLIGHT_LEVELS > 15
+ #error "Maximum value of BACKLIGHT_LEVELS is 15"
+#endif
+
typedef union {
uint8_t raw;
struct {
- bool enable :1;
- uint8_t level :7;
+ bool enable :1;
+ bool breathing :1;
+ uint8_t level :4;
};
} backlight_config_t;
@@ -40,3 +47,11 @@ void backlight_set(uint8_t level);
void backlight_level(uint8_t level);
uint8_t get_backlight_level(void);
+#ifdef BACKLIGHT_BREATHING
+void backlight_toggle_breathing(void);
+void backlight_enable_breathing(void);
+void backlight_disable_breathing(void);
+bool is_backlight_breathing(void);
+void breathing_enable(void);
+void breathing_disable(void);
+#endif