2015-04-09 18:32:04 +02:00
|
|
|
#ifndef HIDKEYBOARD_H
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
# include "stdint.h"
|
|
|
|
# include "stdbool.h"
|
|
|
|
# include "USBHID.h"
|
|
|
|
# include "report.h"
|
2015-04-09 18:32:04 +02:00
|
|
|
|
|
|
|
class HIDKeyboard : public USBDevice {
|
2019-08-30 20:19:03 +02:00
|
|
|
public:
|
2015-04-09 18:32:04 +02:00
|
|
|
HIDKeyboard(uint16_t vendor_id = 0xFEED, uint16_t product_id = 0xabed, uint16_t product_release = 0x0001);
|
|
|
|
|
2019-08-30 20:19:03 +02:00
|
|
|
bool sendReport(report_keyboard_t report);
|
2015-04-09 18:32:04 +02:00
|
|
|
uint8_t leds(void);
|
2019-08-30 20:19:03 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
uint16_t reportLength;
|
|
|
|
virtual bool USBCallback_setConfiguration(uint8_t configuration);
|
|
|
|
virtual uint8_t* stringImanufacturerDesc();
|
|
|
|
virtual uint8_t* stringIproductDesc();
|
|
|
|
virtual uint8_t* stringIserialDesc();
|
2015-04-09 18:32:04 +02:00
|
|
|
virtual uint16_t reportDescLength();
|
2019-08-30 20:19:03 +02:00
|
|
|
virtual uint8_t* reportDesc();
|
|
|
|
virtual uint8_t* configurationDesc();
|
|
|
|
// virtual uint8_t * deviceDesc();
|
2015-04-09 18:32:04 +02:00
|
|
|
virtual bool USBCallback_request();
|
2019-08-30 20:19:03 +02:00
|
|
|
virtual void USBCallback_requestCompleted(uint8_t* buf, uint32_t length);
|
|
|
|
|
|
|
|
private:
|
2015-04-09 18:32:04 +02:00
|
|
|
uint8_t led_state;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|