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.

usb_extra.h 715B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef USB_EXTRA_H
  2. #define USB_EXTRA_H 1
  3. /*
  4. * Enhanced keyboard features for Windows:
  5. * Audio control and System control
  6. *
  7. * http://www.microsoft.com/whdc/archive/w2kbd.mspx
  8. */
  9. #include <stdint.h>
  10. #include "usb.h"
  11. #define EXTRA_INTERFACE 3
  12. #define EXTRA_ENDPOINT 4
  13. #define EXTRA_SIZE 2
  14. #define EXTRA_BUFFER EP_DOUBLE_BUFFER
  15. // Consumer Page(0x0C) Consumer Control(0x01)
  16. #define AUDIO_VOL_UP (1<<0)
  17. #define AUDIO_VOL_DOWN (1<<1)
  18. #define AUDIO_MUTE (1<<2)
  19. // Generic Desktop Page(0x01) System Control(0x80)
  20. #define SYSTEM_POWER_DOWN (1<<0)
  21. #define SYSTEM_SLEEP (1<<1)
  22. #define SYSTEM_WAKE_UP (1<<2)
  23. int8_t usb_extra_audio_send(uint8_t bits);
  24. int8_t usb_extra_system_send(uint8_t bits);
  25. #endif