Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HIDKeyboard.h 922B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef HIDKEYBOARD_H
  2. #include "stdint.h"
  3. #include "stdbool.h"
  4. #include "USBHID.h"
  5. typedef union {
  6. uint8_t raw[8];
  7. struct {
  8. uint8_t mods;
  9. uint8_t reserved;
  10. uint8_t keys[6];
  11. };
  12. } __attribute__ ((packed)) report_keyboard_t;
  13. class HIDKeyboard : public USBDevice {
  14. public:
  15. HIDKeyboard(uint16_t vendor_id = 0xFEED, uint16_t product_id = 0xabed, uint16_t product_release = 0x0001);
  16. bool sendReport(report_keyboard_t report);
  17. protected:
  18. uint16_t reportLength;
  19. virtual bool USBCallback_setConfiguration(uint8_t configuration);
  20. virtual uint8_t * stringImanufacturerDesc();
  21. virtual uint8_t * stringIproductDesc();
  22. virtual uint8_t * stringIserialDesc();
  23. virtual uint16_t reportDescLength();
  24. virtual uint8_t * reportDesc();
  25. virtual uint8_t * configurationDesc();
  26. //virtual uint8_t * deviceDesc();
  27. virtual bool USBCallback_request();
  28. };
  29. #endif