this software.\r
*/\r
\r
-#include "USBMode.h"\r
+#include "../HighLevel/USBMode.h"\r
+\r
#if defined(USB_CAN_BE_DEVICE)\r
\r
#define INCLUDE_FROM_DEVCHAPTER9_C\r
}\r
\r
break;\r
-#if !defined(NO_CLEARSET_FEATURE_REQUEST)\r
+#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)\r
case REQ_ClearFeature:\r
case REQ_SetFeature:\r
if (bmRequestType == (REQDIR_HOSTTODEVICE | REQTYPE_STANDARD | REQREC_ENDPOINT))\r
if (!(RequestHandled))\r
RAISE_EVENT(USB_UnhandledControlPacket, bRequest, bmRequestType);\r
\r
- if (Endpoint_IsSetupReceived())\r
+ if (Endpoint_IsSETUPReceived())\r
{\r
Endpoint_StallTransaction();\r
- Endpoint_ClearSetupReceived(); \r
+ Endpoint_ClearControlSETUP(); \r
}\r
}\r
\r
{\r
uint8_t wValue_LSB = Endpoint_Read_Byte();\r
\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
- while (!(Endpoint_IsSetupINReady()));\r
+ while (!(Endpoint_IsINReady()));\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
- while (!(Endpoint_IsSetupINReady()));\r
+ while (!(Endpoint_IsINReady()));\r
\r
UDADDR = ((1 << ADDEN) | (wValue_LSB & 0x7F));\r
\r
return;\r
}\r
\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
\r
USB_ConfigurationNumber = wValue_LSB;\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
if (!(AlreadyConfigured) && USB_ConfigurationNumber)\r
RAISE_EVENT(USB_DeviceEnumerationComplete);\r
\r
void USB_Device_GetConfiguration(void)\r
{\r
- Endpoint_ClearSetupReceived(); \r
+ Endpoint_ClearControlSETUP(); \r
\r
Endpoint_Write_Byte(USB_ConfigurationNumber);\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
}\r
\r
static void USB_Device_GetDescriptor(void)\r
if ((DescriptorSize = USB_GetDescriptor(wValue, wIndex, &DescriptorPointer)) == NO_DESCRIPTOR)\r
return;\r
\r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP(); \r
\r
if (wLength > DescriptorSize)\r
wLength = DescriptorSize;\r
\r
while (wLength)\r
{\r
- while (!(Endpoint_IsSetupINReady()))\r
+ while (!(Endpoint_IsINReady()))\r
{\r
- if (Endpoint_IsSetupOUTReceived())\r
+ if (Endpoint_IsOUTReceived())\r
{\r
- Endpoint_ClearSetupOUT();\r
+ Endpoint_ClearControlOUT();\r
return;\r
} \r
}\r
}\r
\r
SendZLP = (Endpoint_BytesInEndpoint() == USB_ControlEndpointSize);\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
}\r
\r
if (SendZLP)\r
{\r
- while (!(Endpoint_IsSetupINReady()));\r
- Endpoint_ClearSetupIN();\r
+ while (!(Endpoint_IsINReady()));\r
+ Endpoint_ClearControlIN();\r
}\r
\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
}\r
\r
static void USB_Device_GetStatus(const uint8_t bmRequestType)\r
\r
Endpoint_Discard_Word();\r
\r
+#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)\r
uint8_t wIndex_LSB = Endpoint_Read_Byte();\r
+#endif\r
\r
switch (bmRequestType)\r
{\r
CurrentStatus |= FEATURE_REMOTE_WAKEUP_ENABLED;\r
\r
break;\r
+#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)\r
case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_ENDPOINT):\r
Endpoint_SelectEndpoint(wIndex_LSB);\r
\r
CurrentStatus = Endpoint_IsStalled();\r
\r
break;\r
+#endif\r
}\r
\r
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); \r
- Endpoint_ClearSetupReceived();\r
+ Endpoint_ClearControlSETUP();\r
+\r
Endpoint_Write_Word_LE(CurrentStatus);\r
\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlIN();\r
\r
- while (!(Endpoint_IsSetupOUTReceived()));\r
- Endpoint_ClearSetupOUT();\r
+ while (!(Endpoint_IsOUTReceived()));\r
+ Endpoint_ClearControlOUT();\r
}\r
\r
-#if !defined(NO_CLEARSET_FEATURE_REQUEST)\r
+#if !defined(FEATURELESS_CONTROL_ONLY_DEVICE)\r
static void USB_Device_ClearSetFeature(const uint8_t bRequest, const uint8_t bmRequestType)\r
{\r
uint16_t wValue = Endpoint_Read_Word_LE();\r
}\r
\r
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
- Endpoint_ClearSetupReceived();\r
- Endpoint_ClearSetupIN();\r
+ Endpoint_ClearControlSETUP();\r
+ Endpoint_ClearControlIN();\r
}\r
}\r
\r