]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/protocol/lufa/LUFA-git/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h
Merge commit '22b6e15a179031afb7c3534cf7b109b0668b602c'
[max/tmk_keyboard.git] / tmk_core / protocol / lufa / LUFA-git / Demos / Device / LowLevel / KeyboardMouse / KeyboardMouse.h
1 /*
2              LUFA Library
3      Copyright (C) Dean Camera, 2014.
4
5   dean [at] fourwalledcubicle [dot] com
6            www.lufa-lib.org
7 */
8
9 /*
10   Copyright 2014  Dean Camera (dean [at] fourwalledcubicle [dot] com)
11   Copyright 2010  Denver Gingerich (denver [at] ossguy [dot] com)
12
13   Permission to use, copy, modify, distribute, and sell this
14   software and its documentation for any purpose is hereby granted
15   without fee, provided that the above copyright notice appear in
16   all copies and that both that the copyright notice and this
17   permission notice and warranty disclaimer appear in supporting
18   documentation, and that the name of the author not be used in
19   advertising or publicity pertaining to distribution of the
20   software without specific, written prior permission.
21
22   The author disclaims all warranties with regard to this
23   software, including all implied warranties of merchantability
24   and fitness.  In no event shall the author be liable for any
25   special, indirect or consequential damages or any damages
26   whatsoever resulting from loss of use, data or profits, whether
27   in an action of contract, negligence or other tortious action,
28   arising out of or in connection with the use or performance of
29   this software.
30 */
31
32 #ifndef _KEYBOARD_MOUSE_H_
33 #define _KEYBOARD_MOUSE_H_
34
35         /* Includes: */
36                 #include <avr/io.h>
37                 #include <avr/wdt.h>
38                 #include <avr/power.h>
39                 #include <avr/interrupt.h>
40                 #include <stdbool.h>
41                 #include <string.h>
42
43                 #include "Descriptors.h"
44
45                 #include <LUFA/Drivers/USB/USB.h>
46                 #include <LUFA/Drivers/Board/Joystick.h>
47                 #include <LUFA/Drivers/Board/LEDs.h>
48                 #include <LUFA/Drivers/Board/Buttons.h>
49                 #include <LUFA/Platform/Platform.h>
50
51         /* Macros: */
52                 /** LED mask for the library LED driver, to indicate that the USB interface is not ready. */
53                 #define LEDMASK_USB_NOTREADY        LEDS_LED1
54
55                 /** LED mask for the library LED driver, to indicate that the USB interface is enumerating. */
56                 #define LEDMASK_USB_ENUMERATING     (LEDS_LED2 | LEDS_LED3)
57
58                 /** LED mask for the library LED driver, to indicate that the USB interface is ready. */
59                 #define LEDMASK_USB_READY           (LEDS_LED2 | LEDS_LED4)
60
61                 /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */
62                 #define LEDMASK_USB_ERROR           (LEDS_LED1 | LEDS_LED3)
63
64         /* Function Prototypes: */
65                 void SetupHardware(void);
66                 void Keyboard_ProcessLEDReport(const uint8_t LEDStatus);
67                 void Keyboard_HID_Task(void);
68                 void Mouse_HID_Task(void);
69
70                 void EVENT_USB_Device_Connect(void);
71                 void EVENT_USB_Device_Disconnect(void);
72                 void EVENT_USB_Device_ConfigurationChanged(void);
73                 void EVENT_USB_Device_ControlRequest(void);
74                 void EVENT_USB_Device_StartOfFrame(void);
75
76 #endif
77