usbkvm_fw.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. usbkvm_fw.h
  3. Author: tobychui
  4. */
  5. #ifndef _usbkvm_
  6. #define _usbkvm_
  7. /* Hardware Configurations */
  8. #define LED_RW_SIG 16
  9. #define USB_SW_SEL 32
  10. /* Operation Types */
  11. #define OPR_TYPE_RESERVED 0x00 // Reserved
  12. #define OPR_TYPE_KEYBOARD_WRITE 0x01 // Keyboard-related operation
  13. #define OPR_TYPE_MOUSE_WRITE 0x02 // Mouse-related operation
  14. #define OPR_TYPE_SWITCH_WRITE 0x03 // Switch/button operation
  15. #define OPR_TYPE_LED_WRITE 0x04 // LED control operation
  16. #define OPR_TYPE_RESET_INSTR_COUNT 0xFE // Reset instruction counter
  17. #define OPR_TYPE_DATA_RESET 0xFF //Reset opr data queue, if state of device is unknown, clear before use
  18. /* Operation Sub-types */
  19. #define SUBTYPE_RESERVED 0x00
  20. /* Keyboard Subtypes */
  21. #define SUBTYPE_KEYBOARD_ASCII_WRITE 0x01 // Write ASCII characters (32-127)
  22. #define SUBTYPE_KEYBOARD_ASCII_PRESS 0x02 // Press a key (ASCII 32-127)
  23. #define SUBTYPE_KEYBOARD_ASCII_RELEASE 0x03 // Release a key (ASCII 32-127)
  24. #define SUBTYPE_KEYBOARD_MODIFIER_SET 0x04 // Modifier key write (bit flags)
  25. #define SUBTYPE_KEYBOARD_MODIFIER_CLEAR 0x05 // Modifier key press (bit flags)
  26. #define SUBTYPE_KEYBOARD_FUNCTKEY_WRITE 0x06 //Function key write
  27. #define SUBTYPE_KEYBOARD_OTHERKEY_PRESS 0x07 //Other keys press
  28. #define SUBTYPE_KEYBOARD_OTHERKEY_RELEASE 0x08 //Other keys release
  29. #define SUBTYPE_KEYBOARD_SPECIAL_CTRLALTDEL 0xFD //Ctrl + Alt + Del
  30. #define SUBTYPE_KEYBOARD_SPECIAL_RESET 0xFE //Reset all keypress state
  31. #define SUBTYPE_KEYBOARD_SPECIAL_RESERVED 0xFF //Reserved
  32. /* Response Codes */
  33. #define resp_ok 0x00
  34. #define resp_unknown_opr 0x01
  35. #define resp_invalid_opr_type 0x02
  36. #define resp_invalid_key_value 0x03
  37. #define resp_not_implemented 0x04
  38. #define resp_start_of_debug_msg 0xE0
  39. #define resp_end_of_debug_msg 0xE1
  40. #define resp_start_of_err_msg 0xEE
  41. #define resp_end_of_err_msg 0xEF
  42. #endif