![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
RC_Simulator.....By Jafar Qutteineh with mods to connect my Futaba 9C to \'RC Helicopter\' by http://www.alphamacsoftware.com/
Diff: USBHID/usbhid.h
- Revision:
- 0:65b9d8f621d2
diff -r 000000000000 -r 65b9d8f621d2 USBHID/usbhid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBHID/usbhid.h Thu Dec 15 03:24:33 2011 +0000 @@ -0,0 +1,55 @@ +/* usbhid.h */ +/* USB HID class device */ +/* Copyright (c) Phil Wright 2008 */ + +/* modified by Shinichiro Oba <http://mbed.org/users/bricklife/> */ + +#ifndef USBHID_H +#define USBHID_H + +#include "usbdevice.h" + +/* Mouse buttons */ +#define MOUSE_L (1<<0) +#define MOUSE_M (1<<1) +#define MOUSE_R (1<<2) + +class usbhid : public usbdevice +{ +public: + usbhid(); + bool keyboard(char c); + bool keyboard(char *string); + bool mouse(signed char x, signed char y, unsigned char buttons=0, signed char wheel=0); +protected: + virtual bool requestSetConfiguration(); + virtual void endpointEventEP1In(void); + virtual void deviceEventReset(void); + virtual bool requestGetDescriptor(void); + virtual bool requestSetup(void); +private: + bool sendInputReport(unsigned char id, unsigned char *data, unsigned char size); +}; + + +// +// USBJoystick +// + +#define JOYSTICK_UP (1<<0) +#define JOYSTICK_DOWN (1<<1) +#define JOYSTICK_LEFT (1<<2) +#define JOYSTICK_RIGHT (1<<3) + +class USBJoystick : public usbhid +{ +public: + USBJoystick(); + bool joystick(unsigned char throttle=0, unsigned char rudder=0, unsigned char x=0, unsigned char y=0, bool button1=0, bool button2 =0); +protected: + virtual bool requestGetDescriptor(void); +private: + bool sendInputReport(unsigned char *data, unsigned char size); +}; + +#endif \ No newline at end of file