- break;\r
- case REQ_GetProtocol:\r
- if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
- {\r
- Endpoint_ClearSetupReceived();\r
- \r
- /* Write the current protocol flag to the host */\r
- Endpoint_Write_Byte(UsingReportProtocol);\r
- \r
- /* Send the flag to the host */\r
- Endpoint_ClearSetupIN();\r
- }\r
- \r
- break;\r
- case REQ_SetProtocol:\r
- if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
- {\r
- /* Read in the wValue parameter containing the new protocol mode */\r
- uint16_t wValue = Endpoint_Read_Word_LE();\r
- \r
- Endpoint_ClearSetupReceived();\r
-\r
- /* Set or clear the flag depending on what the host indicates that the current Protocol should be */\r
- UsingReportProtocol = (wValue != 0x0000);\r
- \r
- /* Send an empty packet to acknowedge the command */\r
- Endpoint_ClearSetupIN();\r
- }\r
- \r
- break;\r
- case REQ_SetIdle:\r
- if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_INTERFACE))\r
- {\r
- /* Read in the wValue parameter containing the idle period */\r
- uint16_t wValue = Endpoint_Read_Word_LE();\r
- \r
- Endpoint_ClearSetupReceived();\r
- \r
- /* Get idle period in MSB */\r
- IdleCount = (wValue >> 8);\r
- \r
- /* Send an empty packet to acknowedge the command */\r
- Endpoint_ClearSetupIN();\r
- }\r
- \r
- break;\r
- case REQ_GetIdle:\r
- if (bmRequestType == (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_INTERFACE))\r
- { \r
- Endpoint_ClearSetupReceived();\r
- \r
- /* Write the current idle duration to the host */\r
- Endpoint_Write_Byte(IdleCount);\r
- \r
- /* Send the flag to the host */\r
- Endpoint_ClearSetupIN();\r
- }\r