forked from rsta2/circle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
USB mouse support added, prepared for Model A(+)
README.md is not updated yet Model A(+) support is not tested yet and not activated class CUSBHIDDevice added class CUSBMouseDevice added class CUSBKeyboardDevice is based on CUSBHIDDevice now Library libinput.a added (must be used together with libusb.a) class CKeyMap moved to input class CKeyboardBehaviour added to input class CDWHCIRootPort added CUSBStandardHub must not be instanciated in CKernel anymore! sample/10-usbmouse added Other USB samples updated
- Loading branch information
Showing
49 changed files
with
1,413 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ For what | |
|
||
Aurelien Bidon | ||
Improving build and .git support | ||
|
||
tufty | ||
Architectural advise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// | ||
// keyboardbehaviour.h | ||
// | ||
// Circle - A C++ bare metal environment for Raspberry Pi | ||
// Copyright (C) 2014 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
#ifndef _circle_input_keyboardbehaviour_h | ||
#define _circle_input_keyboardbehaviour_h | ||
|
||
#include <circle/input/keymap.h> | ||
#include <circle/types.h> | ||
|
||
enum TModifierKey | ||
{ | ||
ModifierKeyLeftCtrl = 0x80, | ||
ModifierKeyLeftShift, | ||
ModifierKeyAlt, | ||
ModifierKeyLeftWin, | ||
ModifierKeyRightCtrl, | ||
ModifierKeyRightShift, | ||
ModifierKeyAltGr, | ||
ModifierKeyRightWin, | ||
ModifierKeyUnknown | ||
}; | ||
|
||
#define KEY_LCTRL_MASK (1 << 0) | ||
#define KEY_LSHIFT_MASK (1 << 1) | ||
#define KEY_ALT_MASK (1 << 2) | ||
#define KEY_LWIN_MASK (1 << 3) | ||
#define KEY_RCTRL_MASK (1 << 4) | ||
#define KEY_RSHIFT_MASK (1 << 5) | ||
#define KEY_ALTGR_MASK (1 << 6) | ||
#define KEY_RWIN_MASK (1 << 7) | ||
|
||
#define KEYB_LED_NUM_LOCK (1 << 0) | ||
#define KEYB_LED_CAPS_LOCK (1 << 1) | ||
#define KEYB_LED_SCROLL_LOCK (1 << 2) | ||
|
||
typedef void TKeyPressedHandler (const char *pString); | ||
typedef void TSelectConsoleHandler (unsigned nConsole); | ||
typedef void TShutdownHandler (void); | ||
|
||
class CKeyboardBehaviour | ||
{ | ||
public: | ||
CKeyboardBehaviour (void); | ||
~CKeyboardBehaviour (void); | ||
|
||
void RegisterKeyPressedHandler (TKeyPressedHandler *pKeyPressedHandler); | ||
void RegisterSelectConsoleHandler (TSelectConsoleHandler *pSelectConsoleHandler); | ||
void RegisterShutdownHandler (TShutdownHandler *pShutdownHandler); | ||
|
||
void KeyPressed (u8 ucKeyCode); | ||
void KeyReleased (u8 ucKeyCode); | ||
|
||
u8 GetLEDStatus (void) const; | ||
|
||
private: | ||
void GenerateKeyEvent (u8 ucKeyCode); | ||
|
||
void TimerHandler (unsigned hTimer); | ||
static void TimerStub (unsigned hTimer, void *pParam, void *pContext); | ||
|
||
private: | ||
TKeyPressedHandler *m_pKeyPressedHandler; | ||
TSelectConsoleHandler *m_pSelectConsoleHandler; | ||
TShutdownHandler *m_pShutdownHandler; | ||
|
||
u8 m_ucModifiers; | ||
u8 m_ucLastKeyCode; | ||
|
||
unsigned m_hTimer; | ||
|
||
CKeyMap m_KeyMap; | ||
}; | ||
|
||
#endif |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// dwhcirootport.h | ||
// | ||
// Circle - A C++ bare metal environment for Raspberry Pi | ||
// Copyright (C) 2014 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
#ifndef _circle_usb_dwhcirootport_h | ||
#define _circle_usb_dwhcirootport_h | ||
|
||
#include <circle/usb/usbdevice.h> | ||
#include <circle/types.h> | ||
|
||
class CDWHCIDevice; | ||
|
||
class CDWHCIRootPort | ||
{ | ||
public: | ||
CDWHCIRootPort (CDWHCIDevice *pHost); | ||
~CDWHCIRootPort (void); | ||
|
||
boolean Initialize (void); | ||
|
||
private: | ||
CDWHCIDevice *m_pHost; | ||
|
||
CUSBDevice *m_pDevice; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// | ||
// usbhiddevice.h | ||
// | ||
// Circle - A C++ bare metal environment for Raspberry Pi | ||
// Copyright (C) 2014 R. Stange <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
#ifndef _circle_usb_usbhiddevice_h | ||
#define _circle_usb_usbhiddevice_h | ||
|
||
#include <circle/usb/usbdevice.h> | ||
#include <circle/usb/usbendpoint.h> | ||
#include <circle/usb/usbrequest.h> | ||
#include <circle/types.h> | ||
|
||
class CUSBHIDDevice : public CUSBDevice | ||
{ | ||
public: | ||
CUSBHIDDevice (CUSBDevice *pDevice, unsigned nReportSize); | ||
~CUSBHIDDevice (void); | ||
|
||
boolean Configure (void); | ||
|
||
private: | ||
virtual void ReportHandler (const u8 *pReport) = 0; // pReport is 0 on failure | ||
|
||
private: | ||
boolean StartRequest (void); | ||
|
||
void CompletionRoutine (CUSBRequest *pURB); | ||
static void CompletionStub (CUSBRequest *pURB, void *pParam, void *pContext); | ||
|
||
private: | ||
unsigned m_nReportSize; | ||
|
||
u8 m_ucInterfaceNumber; | ||
u8 m_ucAlternateSetting; | ||
|
||
CUSBEndpoint *m_pReportEndpoint; | ||
|
||
CUSBRequest *m_pURB; | ||
|
||
u8 *m_pReportBuffer; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.