XenevaOS
Loading...
Searching...
No Matches
usbkeyboard.h
Go to the documentation of this file.
1//
2// usbkeyboard.h
3//
4// USPi - An USB driver for Raspberry Pi written in C
5// Copyright (C) 2014-2018 R. Stange <rsta2@o2online.de>
6//
7// This program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19//
20#ifndef _uspi_usbkeyboard_h
21#define _uspi_usbkeyboard_h
22
23#include "uspi/usbfunction.h"
24#include "uspi/usbendpoint.h"
25#include "uspi/usbrequest.h"
26#include "uspi/keymap.h"
27#include "uspi/types.h"
28
29#define BOOT_REPORT_SIZE 8
30
31typedef void TKeyPressedHandler (const char *pString);
32typedef void TSelectConsoleHandler (unsigned nConsole);
33typedef void TShutdownHandler (void);
34
35// The raw handler is called when the keyboard sends a status report (on status change and/or continously).
36typedef void TKeyStatusHandlerRaw (unsigned char ucModifiers, // see usbhid.h
37 const unsigned char RawKeys[6]); // key code or 0 in each byte
38
61
62void USBKeyboardDevice (TUSBKeyboardDevice *pThis, TUSBFunction *pFunction);
64
65boolean USBKeyboardDeviceConfigure (TUSBFunction *pUSBFunction);
66
67// cooked mode
71
73
74// raw mode (if this handler is registered the others are ignored)
76
77void USBKeyboardDeviceSetLEDs (TUSBKeyboardDevice *pThis, u8 ucLEDMask);
78
79#endif
uint8_t u8
Definition kernel.h:20
Definition keymap.h:113
Definition usbendpoint.h:41
Definition usbfunction.h:33
Definition usbkeyboard.h:40
u8 m_ucLastPhyCode
Definition usbkeyboard.h:53
TShutdownHandler * m_pShutdownHandler
Definition usbkeyboard.h:47
TUSBRequest m_URB
Definition usbkeyboard.h:50
TUSBFunction m_USBFunction
Definition usbkeyboard.h:41
TUSBEndpoint * m_pReportEndpoint
Definition usbkeyboard.h:43
TKeyStatusHandlerRaw * m_pKeyStatusHandlerRaw
Definition usbkeyboard.h:48
TSelectConsoleHandler * m_pSelectConsoleHandler
Definition usbkeyboard.h:46
u8 * m_pReportBuffer
Definition usbkeyboard.h:51
unsigned m_hTimer
Definition usbkeyboard.h:54
TKeyPressedHandler * m_pKeyPressedHandler
Definition usbkeyboard.h:45
TKeyMap m_KeyMap
Definition usbkeyboard.h:56
u8 m_ucLastLEDStatus
Definition usbkeyboard.h:58
Definition usbrequest.h:36
void _CUSBKeyboardDevice(TUSBKeyboardDevice *pThis)
Definition usbkeyboard.c:71
void USBKeyboardDevice(TUSBKeyboardDevice *pThis, TUSBFunction *pFunction)
Definition usbkeyboard.c:48
void USBKeyboardDeviceRegisterSelectConsoleHandler(TUSBKeyboardDevice *pThis, TSelectConsoleHandler *pSelectConsoleHandler)
Definition usbkeyboard.c:167
void USBKeyboardDeviceRegisterKeyStatusHandlerRaw(TUSBKeyboardDevice *pThis, TKeyStatusHandlerRaw *pKeyStatusHandlerRaw)
Definition usbkeyboard.c:193
void TKeyPressedHandler(const char *pString)
Definition usbkeyboard.h:31
void TKeyStatusHandlerRaw(unsigned char ucModifiers, const unsigned char RawKeys[6])
Definition usbkeyboard.h:36
void TSelectConsoleHandler(unsigned nConsole)
Definition usbkeyboard.h:32
void USBKeyboardDeviceSetLEDs(TUSBKeyboardDevice *pThis, u8 ucLEDMask)
Definition usbkeyboard.c:200
void USBKeyboardDeviceUpdateLEDs(TUSBKeyboardDevice *pThis)
Definition usbkeyboard.c:181
void TShutdownHandler(void)
Definition usbkeyboard.h:33
void USBKeyboardDeviceRegisterShutdownHandler(TUSBKeyboardDevice *pThis, TShutdownHandler *pShutdownHandler)
Definition usbkeyboard.c:174
void USBKeyboardDeviceRegisterKeyPressedHandler(TUSBKeyboardDevice *pThis, TKeyPressedHandler *pKeyPressedHandler)
Definition usbkeyboard.c:160
boolean USBKeyboardDeviceConfigure(TUSBFunction *pUSBFunction)
Definition usbkeyboard.c:92