test

Dependencies:   mbed

Fork of USBMouse by Simon Ford

Committer:
USER10
Date:
Fri Jan 19 01:42:11 2018 +0000
Revision:
2:554ad697ebbb
Parent:
1:eb68149218fd
test;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
simon 1:eb68149218fd 1 /* usbhid.h */
simon 1:eb68149218fd 2 /* USB HID class device */
simon 1:eb68149218fd 3 /* Copyright (c) Phil Wright 2008 */
simon 1:eb68149218fd 4
simon 1:eb68149218fd 5 #ifndef USBHID_H
simon 1:eb68149218fd 6 #define USBHID_H
simon 1:eb68149218fd 7
simon 1:eb68149218fd 8 #include "usbdevice.h"
simon 1:eb68149218fd 9
simon 1:eb68149218fd 10 /* Mouse buttons */
simon 1:eb68149218fd 11 #define MOUSE_L (1<<0)
simon 1:eb68149218fd 12 #define MOUSE_M (1<<1)
simon 1:eb68149218fd 13 #define MOUSE_R (1<<2)
simon 1:eb68149218fd 14
simon 1:eb68149218fd 15 class usbhid : public usbdevice
simon 1:eb68149218fd 16 {
simon 1:eb68149218fd 17 public:
simon 1:eb68149218fd 18 usbhid();
simon 1:eb68149218fd 19 bool keyboard(char c);
simon 1:eb68149218fd 20 bool keyboard(char *string);
simon 1:eb68149218fd 21 bool mouse(signed char x, signed char y, unsigned char buttons=0, signed char wheel=0);
simon 1:eb68149218fd 22 protected:
simon 1:eb68149218fd 23 virtual bool requestSetConfiguration();
simon 1:eb68149218fd 24 virtual void endpointEventEP1In(void);
simon 1:eb68149218fd 25 virtual void deviceEventReset(void);
simon 1:eb68149218fd 26 virtual bool requestGetDescriptor(void);
simon 1:eb68149218fd 27 virtual bool requestSetup(void);
simon 1:eb68149218fd 28 private:
simon 1:eb68149218fd 29 bool sendInputReport(unsigned char id, unsigned char *data, unsigned char size);
simon 1:eb68149218fd 30 };
simon 1:eb68149218fd 31
simon 1:eb68149218fd 32 #endif