|
@@ -6,26 +6,26 @@
|
|
|
#ifndef _usbkvm_
|
|
|
#define _usbkvm_
|
|
|
|
|
|
-/* Hardware Configurations */
|
|
|
+/* ----------- Hardware Configurations -----------*/
|
|
|
#define MIN_KEY_EVENTS_DELAY 20 //ms
|
|
|
-#define LED_RW_SIG 16
|
|
|
-#define USB_SW_SEL 32
|
|
|
+#define USB_SW_SEL 32 // Switching pin number for connecting / disconnecting USB Mass Storage Drive
|
|
|
+#define HID_SW_SEL 11 // Switching pin number for connecting / disconnecting USB HID
|
|
|
+
|
|
|
+/* ----------- Operation Types -----------*/
|
|
|
+#define OPR_TYPE_RESERVED 0x00 // Reserved
|
|
|
+#define OPR_TYPE_KEYBOARD_WRITE 0x01 // Keyboard-related operation
|
|
|
+#define OPR_TYPE_MOUSE_WRITE 0x02 // Mouse-related operation
|
|
|
+#define OPR_TYPE_MOUSE_MOVE 0x03 // Mouse-move operation (Notes: When opr_type is OPR_TYPE_MOUSE_MOVE, opr_subtype is the X position value)
|
|
|
+#define OPR_TYPE_MOUSE_SCROLL 0x04 // Mouse scroll (Notes: when opr_type is OPR_TYPE_MOUSE_SCROLL, opr_subtype is up/down and payload is scroll tilt valie (max 127))
|
|
|
+#define OPR_TYPE_SWITCH_SET 0x05 // Switch/button operation
|
|
|
|
|
|
-/* Operation Types */
|
|
|
-#define OPR_TYPE_RESERVED 0x00 // Reserved
|
|
|
-#define OPR_TYPE_KEYBOARD_WRITE 0x01 // Keyboard-related operation
|
|
|
-#define OPR_TYPE_MOUSE_WRITE 0x02 // Mouse-related operation
|
|
|
-#define OPR_TYPE_MOUSE_MOVE 0x03 // Mouse-move operation (Notes: When opr_type is OPR_TYPE_MOUSE_MOVE, opr_subtype is the X position value)
|
|
|
-#define OPR_TYPE_MOUSE_SCROLL 0x04 //Mouse scroll (Notes: when opr_type is OPR_TYPE_MOUSE_SCROLL, opr_subtype is up/down and payload is scroll tilt valie (max 127))
|
|
|
-#define OPR_TYPE_SWITCH_WRITE 0x05 // Switch/button operation
|
|
|
-#define OPR_TYPE_LED_WRITE 0x06 // LED control operation
|
|
|
#define OPR_TYPE_RESET_INSTR_COUNT 0xFE // Reset instruction counter
|
|
|
#define OPR_TYPE_DATA_RESET 0xFF //Reset opr data queue, if state of device is unknown, clear before use
|
|
|
|
|
|
/* Operation Sub-types */
|
|
|
#define SUBTYPE_RESERVED 0x00
|
|
|
|
|
|
-/* Keyboard Subtypes */
|
|
|
+/* ----------- Keyboard Subtypes ----------- */
|
|
|
#define SUBTYPE_KEYBOARD_ASCII_WRITE 0x01 // Write ASCII characters (32-127)
|
|
|
#define SUBTYPE_KEYBOARD_ASCII_PRESS 0x02 // Press a key (ASCII 32-127)
|
|
|
#define SUBTYPE_KEYBOARD_ASCII_RELEASE 0x03 // Release a key (ASCII 32-127)
|
|
@@ -74,10 +74,10 @@
|
|
|
#define PAYLOAD_NUMPAD_ENTER 0x0F
|
|
|
#define PAYLOAD_NUMPAD_NUMLOCK 0x10
|
|
|
|
|
|
-/* Mouse Subtypes */
|
|
|
+/* ----------- Mouse Subtypes -----------*/
|
|
|
#define SUBTYPE_MOUSE_CLICK 0x01
|
|
|
-#define SUBTYPE_MOUSE_PRESS 0x02
|
|
|
-#define SUBTYPE_MOUSE_RELEASE 0x03
|
|
|
+#define SUBTYPE_MOUSE_PRESS 0x02
|
|
|
+#define SUBTYPE_MOUSE_RELEASE 0x03
|
|
|
#define SUBTYPE_MOUSE_SETPOS 0x04
|
|
|
#define SUBTYPE_MOUSE_RESET 0x05
|
|
|
|
|
@@ -86,7 +86,11 @@
|
|
|
#define PAYLOAD_MOUSE_BTN_RIGHT 0x02
|
|
|
#define PAYLOAD_MOUSE_BTN_MID 0x03
|
|
|
|
|
|
-/* Response Codes */
|
|
|
+/* ----------- Switches Subtypes -----------*/
|
|
|
+#define SUBTYPE_SWITCH_USBHID 0x01
|
|
|
+#define SUBTYPE_SWITCH_USBMASS 0x02
|
|
|
+
|
|
|
+/* ----------- Response Codes ----------- */
|
|
|
#define resp_ok 0x00
|
|
|
#define resp_unknown_opr 0x01
|
|
|
#define resp_invalid_opr_type 0x02
|