diff options
author | Wraul <wraul@dbox.se> | 2013-05-30 20:24:39 +0200 |
---|---|---|
committer | tmk <nobody@nowhere> | 2013-06-22 17:23:36 +0900 |
commit | 1eb8523e9506c752fb726208d8853a82f06e6659 (patch) | |
tree | 999363ab141da73f3e59f2edf7d2778b298aef5f /common/action_code.h | |
parent | 9de9d719527c7a8cac71d0bc49ba1d2d4f63cf06 (diff) | |
download | qmk_firmware-1eb8523e9506c752fb726208d8853a82f06e6659.tar.gz |
Add support for backlight
Diffstat (limited to 'common/action_code.h')
-rw-r--r-- | common/action_code.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/action_code.h b/common/action_code.h index 0933dce13..d28b74f84 100644 --- a/common/action_code.h +++ b/common/action_code.h @@ -85,6 +85,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. * 1100|opt | id(8) Macro play? * 1100|1111| id(8) Macro record? * + * ACT_BACKLIGHT(1101): + * 1110|xxxx| id(8) Backlight commands + * * ACT_COMMAND(1110): * 1110|opt | id(8) Built-in Command exec * @@ -109,6 +112,7 @@ enum action_kind_id { ACT_LAYER_TAP1 = 0b1011, /* Extensions */ ACT_MACRO = 0b1100, + ACT_BACKLIGHT = 0b1101, ACT_COMMAND = 0b1110, ACT_FUNCTION = 0b1111 }; @@ -157,6 +161,9 @@ typedef union { uint8_t page :2; uint8_t kind :4; } usage; + struct action_backlight { + uint8_t id :8; + } backlight; struct action_command { uint8_t id :8; uint8_t opt :4; @@ -272,10 +279,21 @@ enum layer_pram_tap_op { /* * Extensions */ +enum backlight_id { + BACKLIGHT_INCREASE = 0, + BACKLIGHT_DECREASE = 1, + BACKLIGHT_TOGGLE = 2, + BACKLIGHT_STEP = 3, +}; /* Macro */ #define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) #define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) #define ACTION_MACRO_OPT(id, opt) ACTION(ACT_MACRO, (opt)<<8 | (id)) +/* Backlight */ +#define ACTION_BACKLIGHT_INCREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_INCREASE) +#define ACTION_BACKLIGHT_DECREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE) +#define ACTION_BACKLIGHT_TOGGLE() ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE) +#define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP) /* Command */ #define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr)) /* Function */ |