2014-07-19 02:27:00 +00:00
|
|
|
#ifndef LEDMAP_H
|
|
|
|
#define LEDMAP_H
|
|
|
|
|
2014-07-20 03:52:56 +00:00
|
|
|
#include "stdint.h"
|
2014-07-25 05:24:57 +00:00
|
|
|
#include "stdbool.h"
|
2014-08-02 01:15:57 +00:00
|
|
|
#include "led.h"
|
2014-07-19 02:27:00 +00:00
|
|
|
|
2014-07-20 03:52:56 +00:00
|
|
|
typedef led_pack_t led_state_t;
|
2014-07-25 05:24:57 +00:00
|
|
|
typedef led_pack_t led_binding_t;
|
2014-07-20 03:52:56 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2014-08-03 02:27:54 +00:00
|
|
|
LEDMAP_NO = 0,
|
|
|
|
LEDMAP_DEFAULT_LAYER_0,
|
|
|
|
LEDMAP_DEFAULT_LAYER_31 = LEDMAP_DEFAULT_LAYER_0 + 31,
|
|
|
|
LEDMAP_LAYER_0,
|
|
|
|
LEDMAP_LAYER_31 = LEDMAP_LAYER_0 + 31,
|
|
|
|
LEDMAP_NUM_LOCK,
|
2014-07-20 03:52:56 +00:00
|
|
|
LEDMAP_CAPS_LOCK,
|
|
|
|
LEDMAP_SCROLL_LOCK,
|
|
|
|
LEDMAP_COMPOSE,
|
|
|
|
LEDMAP_KANA,
|
2014-08-03 02:27:54 +00:00
|
|
|
LEDMAP_BACKLIGHT = 0x80
|
2014-07-20 03:52:56 +00:00
|
|
|
} ledmap_code_t;
|
|
|
|
|
2014-07-25 05:24:57 +00:00
|
|
|
#define LEDMAP_MASK 0x7F
|
|
|
|
|
|
|
|
typedef union {
|
|
|
|
uint8_t raw;
|
|
|
|
struct {
|
|
|
|
uint8_t binding : 7;
|
|
|
|
bool backlight : 1;
|
|
|
|
};
|
|
|
|
} ledmap_t;
|
|
|
|
|
2014-07-24 06:03:58 +00:00
|
|
|
#define LEDMAP_DEFAULT_LAYER(x) (LEDMAP_DEFAULT_LAYER_0 + x)
|
|
|
|
#define LEDMAP_LAYER(x) (LEDMAP_LAYER_0 + x)
|
2014-07-20 03:52:56 +00:00
|
|
|
|
2014-07-25 05:24:57 +00:00
|
|
|
void ledmap_init(void);
|
|
|
|
|
2014-07-20 03:52:56 +00:00
|
|
|
#ifdef LEDMAP_ENABLE
|
|
|
|
uint8_t ledmap_get_code(uint8_t index);
|
|
|
|
void ledmap_led_init(void);
|
|
|
|
void ledmap_led_on(uint8_t index);
|
|
|
|
void ledmap_led_off(uint8_t index);
|
2014-07-19 02:27:00 +00:00
|
|
|
#else
|
2014-07-20 03:52:56 +00:00
|
|
|
#define ledmaps
|
|
|
|
#define ledmap_get()
|
|
|
|
#define ledmap_led_init()
|
|
|
|
#define ledmap_led_on()
|
|
|
|
#define ledmap_led_off()
|
2014-07-19 02:27:00 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|