aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/host.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/host.h')
-rw-r--r--tmk_core/common/host.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/tmk_core/common/host.h b/tmk_core/common/host.h
index e70bb6853..3d172eed6 100644
--- a/tmk_core/common/host.h
+++ b/tmk_core/common/host.h
@@ -15,14 +15,18 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifndef HOST_H 18#pragma once
19#define HOST_H
20 19
21#include <stdint.h> 20#include <stdint.h>
22#include <stdbool.h> 21#include <stdbool.h>
23#include "report.h" 22#include "report.h"
24#include "host_driver.h" 23#include "host_driver.h"
25 24
25#define IS_LED_ON(leds, led_name) ( (leds) & (1 << (led_name)))
26#define IS_LED_OFF(leds, led_name) (~(leds) & (1 << (led_name)))
27
28#define IS_HOST_LED_ON(led_name) IS_LED_ON(host_keyboard_leds(), led_name)
29#define IS_HOST_LED_OFF(led_name) IS_LED_OFF(host_keyboard_leds(), led_name)
26 30
27#ifdef __cplusplus 31#ifdef __cplusplus
28extern "C" { 32extern "C" {
@@ -31,7 +35,6 @@ extern "C" {
31extern uint8_t keyboard_idle; 35extern uint8_t keyboard_idle;
32extern uint8_t keyboard_protocol; 36extern uint8_t keyboard_protocol;
33 37
34
35/* host driver */ 38/* host driver */
36void host_set_driver(host_driver_t *driver); 39void host_set_driver(host_driver_t *driver);
37host_driver_t *host_get_driver(void); 40host_driver_t *host_get_driver(void);
@@ -46,14 +49,6 @@ void host_consumer_send(uint16_t data);
46uint16_t host_last_system_report(void); 49uint16_t host_last_system_report(void);
47uint16_t host_last_consumer_report(void); 50uint16_t host_last_consumer_report(void);
48 51
49#define IS_LED_ON(USB_LED, LED_NAME) ((USB_LED) & (1 << (LED_NAME)))
50#define IS_LED_OFF(USB_LED, LED_NAME) (~(USB_LED) & (1 << (LED_NAME)))
51
52#define IS_HOST_LED_ON(LED_NAME) IS_LED_ON(host_keyboard_leds(), (LED_NAME))
53#define IS_HOST_LED_OFF(LED_NAME) IS_LED_OFF(host_keyboard_leds(), (LED_NAME))
54
55#ifdef __cplusplus 52#ifdef __cplusplus
56} 53}
57#endif 54#endif
58
59#endif