summary refs log tree commit diff
path: root/common/action_code.h
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2013-06-23 09:19:04 +0900
committertmk <nobody@nowhere>2013-06-23 09:19:04 +0900
commit5a0415749d6cd6a095d9c3fbb335360ec5fa59e0 (patch)
tree7ed39e24295fbf853625a12fe273ea3ab4c7b202 /common/action_code.h
parent9de9d719527c7a8cac71d0bc49ba1d2d4f63cf06 (diff)
parent25ad212c4adae5a27dd2d5a4e9d6bcdfc17edb1b (diff)
Merge branch 'Wraul-kmac'
Diffstat (limited to 'common/action_code.h')
-rw-r--r--common/action_code.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/action_code.h b/common/action_code.h
index 0933dce136..2272091cc4 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):
+ * 1101|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 */