aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/Incomplete
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Device/Incomplete')
-rw-r--r--Demos/Device/Incomplete/Sideshow/Descriptors.c4
-rw-r--r--Demos/Device/Incomplete/Sideshow/Descriptors.h4
-rw-r--r--Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c32
-rw-r--r--Demos/Device/Incomplete/Sideshow/Sideshow.c8
-rw-r--r--Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c10
-rw-r--r--Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h16
-rw-r--r--Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c13
7 files changed, 41 insertions, 46 deletions
diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.c b/Demos/Device/Incomplete/Sideshow/Descriptors.c
index 533c92121..cc1a094c8 100644
--- a/Demos/Device/Incomplete/Sideshow/Descriptors.c
+++ b/Demos/Device/Incomplete/Sideshow/Descriptors.c
@@ -89,7 +89,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
- EndpointAddress: (ENDPOINT_DIR_IN | SIDESHOW_IN_EPNUM),
+ EndpointAddress: SIDESHOW_IN_EPADDR,
Attributes: EP_TYPE_BULK,
EndpointSize: SIDESHOW_IO_EPSIZE,
PollingIntervalMS: 0x00
@@ -99,7 +99,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
Header: {Size: sizeof(USB_Descriptor_Endpoint_t), Type: DTYPE_Endpoint},
- EndpointAddress: (ENDPOINT_DIR_OUT | SIDESHOW_OUT_EPNUM),
+ EndpointAddress: SIDESHOW_OUT_EPADDR,
Attributes: EP_TYPE_BULK,
EndpointSize: SIDESHOW_IO_EPSIZE,
PollingIntervalMS: 0x00
diff --git a/Demos/Device/Incomplete/Sideshow/Descriptors.h b/Demos/Device/Incomplete/Sideshow/Descriptors.h
index 6c9c6e3d7..1725a7951 100644
--- a/Demos/Device/Incomplete/Sideshow/Descriptors.h
+++ b/Demos/Device/Incomplete/Sideshow/Descriptors.h
@@ -39,8 +39,8 @@
#include "Sideshow.h"
/* Macros: */
- #define SIDESHOW_IN_EPNUM 3
- #define SIDESHOW_OUT_EPNUM 4
+ #define SIDESHOW_IN_EPADDR 3
+ #define SIDESHOW_OUT_EPADDR 4
#define SIDESHOW_IO_EPSIZE 64
/* Type Defines: */
diff --git a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c
index 4634036e7..3e2392467 100644
--- a/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c
+++ b/Demos/Device/Incomplete/Sideshow/Lib/SideshowCommands.c
@@ -47,7 +47,7 @@ void Sideshow_ProcessCommandPacket(void)
{
SideShow_PacketHeader_t PacketHeader;
- Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_OUT_EPADDR);
Endpoint_Read_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
PacketHeader.Type.TypeFields.Response = true;
@@ -110,7 +110,7 @@ void Sideshow_ProcessCommandPacket(void)
PacketHeader.Length = sizeof(SideShow_PacketHeader_t);
PacketHeader.Type.TypeFields.NAK = true;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(&PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
@@ -122,7 +122,7 @@ static void SideShow_Ping(SideShow_PacketHeader_t* const PacketHeader)
{
Endpoint_ClearOUT();
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -137,7 +137,7 @@ static void SideShow_Sync(SideShow_PacketHeader_t* const PacketHeader)
if (!(GUID_COMPARE(&ProtocolGUID, (uint32_t[])STANDARD_PROTOCOL_GUID)))
PacketHeader->Type.TypeFields.NAK = true;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_Stream_LE(&ProtocolGUID, sizeof(GUID_t), NULL);
Endpoint_ClearIN();
@@ -149,7 +149,7 @@ static void SideShow_GetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + UserSID.LengthInBytes;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
SideShow_Write_Unicode_String(&UserSID);
Endpoint_ClearIN();
@@ -162,7 +162,7 @@ static void SideShow_SetCurrentUser(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -254,7 +254,7 @@ static void SideShow_GetCapabilities(SideShow_PacketHeader_t* const PacketHeader
Property.PropertyGUID.Chunks[2], Property.PropertyGUID.Chunks[3]);
}
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
if (!(PacketHeader->Type.TypeFields.NAK))
@@ -288,7 +288,7 @@ static void SideShow_GetString(SideShow_PacketHeader_t* const PacketHeader,
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
sizeof(uint32_t) + ((Unicode_String_t*)UnicodeStruct)->LengthInBytes;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
SideShow_Write_Unicode_String(UnicodeStruct);
Endpoint_ClearIN();
@@ -309,7 +309,7 @@ static void SideShow_GetApplicationOrder(SideShow_PacketHeader_t* const PacketHe
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) +
sizeof(uint32_t) + (TotalApplications * sizeof(GUID_t));
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_32_LE(TotalApplications);
@@ -330,7 +330,7 @@ static void SideShow_GetSupportedEndpoints(SideShow_PacketHeader_t* const Packet
PacketHeader->Length = sizeof(SideShow_PacketHeader_t) + sizeof(uint32_t) + sizeof(GUID_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_Write_32_LE(1);
Endpoint_Write_Stream_LE(&SupportedEndpointGUID, sizeof(GUID_t), NULL);
@@ -377,7 +377,7 @@ static void SideShow_AddApplication(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -398,7 +398,7 @@ static void SideShow_DeleteApplication(SideShow_PacketHeader_t* const PacketHead
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -410,7 +410,7 @@ static void SideShow_DeleteAllApplications(SideShow_PacketHeader_t* const Packet
for (uint8_t App = 0; App < MAX_APPLICATIONS; App++)
InstalledApplications[App].InUse = false;
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -440,7 +440,7 @@ static void SideShow_AddContent(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -465,7 +465,7 @@ static void SideShow_DeleteContent(SideShow_PacketHeader_t* const PacketHeader)
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
@@ -488,7 +488,7 @@ static void SideShow_DeleteAllContent(SideShow_PacketHeader_t* const PacketHeade
PacketHeader->Length = sizeof(SideShow_PacketHeader_t);
- Endpoint_SelectEndpoint(SIDESHOW_IN_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_IN_EPADDR);
Endpoint_Write_Stream_LE(PacketHeader, sizeof(SideShow_PacketHeader_t), NULL);
Endpoint_ClearIN();
}
diff --git a/Demos/Device/Incomplete/Sideshow/Sideshow.c b/Demos/Device/Incomplete/Sideshow/Sideshow.c
index 3bc58d376..41009f373 100644
--- a/Demos/Device/Incomplete/Sideshow/Sideshow.c
+++ b/Demos/Device/Incomplete/Sideshow/Sideshow.c
@@ -101,10 +101,8 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup Sideshow Data Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- SIDESHOW_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- SIDESHOW_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_IN_EPADDR, EP_TYPE_BULK, SIDESHOW_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(SIDESHOW_OUT_EPADDR, EP_TYPE_BULK, SIDESHOW_IO_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -142,7 +140,7 @@ void SideShow_Task(void)
return;
/* Select the SideShow data out endpoint */
- Endpoint_SelectEndpoint(SIDESHOW_OUT_EPNUM);
+ Endpoint_SelectEndpoint(SIDESHOW_OUT_EPADDR);
/* Check to see if a new SideShow message has been received */
if (Endpoint_IsReadWriteAllowed())
diff --git a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
index 14be2ec49..bf16ab08a 100644
--- a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
+++ b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.c
@@ -119,27 +119,27 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_OUT | TMC_OUT_EPNUM),
+ .EndpointAddress = TMC_OUT_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = TMC_IO_EPSIZE,
- .PollingIntervalMS = 0x01
+ .PollingIntervalMS = 0x05
},
.TM_DataInEndpoint =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | TMC_IN_EPNUM),
+ .EndpointAddress = TMC_IN_EPADDR,
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = TMC_IO_EPSIZE,
- .PollingIntervalMS = 0x01
+ .PollingIntervalMS = 0x05
},
.TM_NotificationEndpoint =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DIR_IN | TMC_NOTIFICATION_EPNUM),
+ .EndpointAddress = TMC_NOTIFICATION_EPADDR,
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = TMC_NOTIFICATION_EPSIZE,
.PollingIntervalMS = 0xFF
diff --git a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
index 8876f732b..e45654a27 100644
--- a/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
+++ b/Demos/Device/Incomplete/TestAndMeasurement/Descriptors.h
@@ -43,20 +43,20 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
- /** Endpoint number of the TMC notification IN endpoint. */
- #define TMC_NOTIFICATION_EPNUM 2
+ /** Endpoint address of the TMC notification IN endpoint. */
+ #define TMC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2)
- /** Endpoint number of the TMC device-to-host data IN endpoint. */
- #define TMC_IN_EPNUM 3
+ /** Endpoint address of the TMC device-to-host data IN endpoint. */
+ #define TMC_IN_EPADDR (ENDPOINT_DIR_IN | 3)
- /** Endpoint number of the TMC host-to-device data OUT endpoint. */
- #define TMC_OUT_EPNUM 4
+ /** Endpoint address of the TMC host-to-device data OUT endpoint. */
+ #define TMC_OUT_EPADDR (ENDPOINT_DIR_OUT | 4)
/** Size in bytes of the TMC data endpoints. */
- #define TMC_IO_EPSIZE 64
+ #define TMC_IO_EPSIZE 64
/** Size in bytes of the TMC notification endpoint. */
- #define TMC_NOTIFICATION_EPSIZE 8
+ #define TMC_NOTIFICATION_EPSIZE 8
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
diff --git a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
index c77b01e1a..5102f101c 100644
--- a/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
+++ b/Demos/Device/Incomplete/TestAndMeasurement/TestAndMeasurement.c
@@ -129,12 +129,9 @@ void EVENT_USB_Device_ConfigurationChanged(void)
bool ConfigSuccess = true;
/* Setup TMC In, Out and Notification Endpoints */
- ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
- TMC_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN,
- TMC_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
- ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT,
- TMC_IO_EPSIZE, ENDPOINT_BANK_SINGLE);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, TMC_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_IN_EPADDR, EP_TYPE_BULK, TMC_IO_EPSIZE, 1);
+ ConfigSuccess &= Endpoint_ConfigureEndpoint(TMC_OUT_EPADDR, EP_TYPE_BULK, TMC_IO_EPSIZE, 1);
/* Indicate endpoint configuration success or failure */
LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR);
@@ -418,7 +415,7 @@ bool ReadTMCHeader(TMC_MessageHeader_t* const MessageHeader)
uint8_t ErrorCode;
/* Select the Data Out endpoint */
- Endpoint_SelectEndpoint(TMC_OUT_EPNUM);
+ Endpoint_SelectEndpoint(TMC_OUT_EPADDR);
/* Abort if no command has been sent from the host */
if (!(Endpoint_IsOUTReceived()))
@@ -450,7 +447,7 @@ bool WriteTMCHeader(TMC_MessageHeader_t* const MessageHeader)
MessageHeader->InverseTag = ~CurrentTransferTag;
/* Select the Data In endpoint */
- Endpoint_SelectEndpoint(TMC_IN_EPNUM);
+ Endpoint_SelectEndpoint(TMC_IN_EPADDR);
/* Send the command header to the host */
BytesTransferred = 0;