1 /*-------------------------------------------------------------
3 usbkeyboard.h -- Usb keyboard support(boot protocol)
5 Copyright (C) 2008, 2009
6 DAVY Guillaume davyg2@gmail.com
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any
11 damages arising from the use of this software.
13 Permission is granted to anyone to use this software for any
14 purpose, including commercial applications, and to alter it and
15 redistribute it freely, subject to the following restrictions:
17 1. The origin of this software must not be misrepresented; you
18 must not claim that you wrote the original software. If you use
19 this software in a product, an acknowledgment in the product
20 documentation would be appreciated but is not required.
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
25 3. This notice may not be removed or altered from any source
28 -------------------------------------------------------------*/
30 #ifndef __USBKEYBOARD_H__
31 #define __USBKEYBOARD_H__
35 #endif /* __cplusplus */
39 USBKEYBOARD_PRESSED
= 0,
41 USBKEYBOARD_DISCONNECTED
42 } USBKeyboard_eventType
;
46 USBKEYBOARD_LEDNUM
= 0,
53 USBKeyboard_eventType type
;
57 typedef void (*eventcallback
) (USBKeyboard_event event
);
59 s32
USBKeyboard_Initialize(void);
60 s32
USBKeyboard_Deinitialize(void);
62 s32
USBKeyboard_Open(const eventcallback cb
);
63 void USBKeyboard_Close(void);
65 bool USBKeyboard_IsConnected(void);
66 s32
USBKeyboard_Scan(void);
68 s32
USBKeyboard_SetLed(const USBKeyboard_led led
, bool on
);
69 s32
USBKeyboard_ToggleLed(const USBKeyboard_led led
);
73 #endif /* __cplusplus */
75 #endif /* __USBKEYBOARD_H__ */