diff options
author | Chris Browne <cbbrowne@hpaq.int.linuxdatabases.info> | 2016-10-10 17:18:15 -0400 |
---|---|---|
committer | Chris Browne <cbbrowne@hpaq.int.linuxdatabases.info> | 2016-10-10 17:18:15 -0400 |
commit | 4b682ea63e2b3dd0bc1132917be7985ce0da57a6 (patch) | |
tree | 6d79874c5542148c27907511ecdb2e9e5e12b24b /quantum/visualizer/lcd_backlight.h | |
parent | 04759d63ef9b520fc41d76de64bb65198448fc1c (diff) | |
parent | a9df99b81c787862dc3fa11bd854fe39e704da81 (diff) |
Merge branch 'master' of github.com:cbbrowne/qmk_firmware
Diffstat (limited to 'quantum/visualizer/lcd_backlight.h')
-rw-r--r-- | quantum/visualizer/lcd_backlight.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/quantum/visualizer/lcd_backlight.h b/quantum/visualizer/lcd_backlight.h new file mode 100644 index 0000000000..dd3e37a064 --- /dev/null +++ b/quantum/visualizer/lcd_backlight.h @@ -0,0 +1,42 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 Fred Sundvik + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ + +#ifndef LCD_BACKLIGHT_H_ +#define LCD_BACKLIGHT_H_ +#include "stdint.h" + +// Helper macros for storing hue, staturation and intensity as unsigned integers +#define LCD_COLOR(hue, saturation, intensity) (hue << 16 | saturation << 8 | intensity) +#define LCD_HUE(color) ((color >> 16) & 0xFF) +#define LCD_SAT(color) ((color >> 8) & 0xFF) +#define LCD_INT(color) (color & 0xFF) + +void lcd_backlight_init(void); +void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity); +void lcd_backlight_brightness(uint8_t b); + +void lcd_backlight_hal_init(void); +void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b); + +#endif /* LCD_BACKLIGHT_H_ */ |