![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
mX mbed BaseBoard USB HID
USBMouse/usbhid.h@0:093612081f64, 2010-12-08 (annotated)
- Committer:
- ashwin_athani
- Date:
- Wed Dec 08 06:30:25 2010 +0000
- Revision:
- 0:093612081f64
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashwin_athani | 0:093612081f64 | 1 | /* usbhid.h */ |
ashwin_athani | 0:093612081f64 | 2 | /* USB HID class device */ |
ashwin_athani | 0:093612081f64 | 3 | /* Copyright (c) Phil Wright 2008 */ |
ashwin_athani | 0:093612081f64 | 4 | |
ashwin_athani | 0:093612081f64 | 5 | #ifndef USBHID_H |
ashwin_athani | 0:093612081f64 | 6 | #define USBHID_H |
ashwin_athani | 0:093612081f64 | 7 | |
ashwin_athani | 0:093612081f64 | 8 | #include "usbdevice.h" |
ashwin_athani | 0:093612081f64 | 9 | |
ashwin_athani | 0:093612081f64 | 10 | /* Mouse buttons */ |
ashwin_athani | 0:093612081f64 | 11 | #define MOUSE_L (1<<0) |
ashwin_athani | 0:093612081f64 | 12 | #define MOUSE_M (1<<1) |
ashwin_athani | 0:093612081f64 | 13 | #define MOUSE_R (1<<2) |
ashwin_athani | 0:093612081f64 | 14 | |
ashwin_athani | 0:093612081f64 | 15 | class usbhid : public usbdevice |
ashwin_athani | 0:093612081f64 | 16 | { |
ashwin_athani | 0:093612081f64 | 17 | public: |
ashwin_athani | 0:093612081f64 | 18 | usbhid(); |
ashwin_athani | 0:093612081f64 | 19 | bool keyboard(char c); |
ashwin_athani | 0:093612081f64 | 20 | bool keyboard(char *string); |
ashwin_athani | 0:093612081f64 | 21 | bool mouse(signed char x, signed char y, unsigned char buttons=0, signed char wheel=0); |
ashwin_athani | 0:093612081f64 | 22 | protected: |
ashwin_athani | 0:093612081f64 | 23 | virtual bool requestSetConfiguration(); |
ashwin_athani | 0:093612081f64 | 24 | virtual void endpointEventEP1In(void); |
ashwin_athani | 0:093612081f64 | 25 | virtual void deviceEventReset(void); |
ashwin_athani | 0:093612081f64 | 26 | virtual bool requestGetDescriptor(void); |
ashwin_athani | 0:093612081f64 | 27 | virtual bool requestSetup(void); |
ashwin_athani | 0:093612081f64 | 28 | private: |
ashwin_athani | 0:093612081f64 | 29 | bool sendInputReport(unsigned char id, unsigned char *data, unsigned char size); |
ashwin_athani | 0:093612081f64 | 30 | }; |
ashwin_athani | 0:093612081f64 | 31 | |
ashwin_athani | 0:093612081f64 | 32 | #endif |