Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
47f6a350
Commit
47f6a350
authored
Apr 14, 2012
by
Dean Camera
Browse files
Reintegrate the FullEPAddresses development branch into trunk.
parent
e8570c4a
Changes
265
Hide whitespace changes
Inline
Side-by-side
Bootloaders/CDC/BootloaderCDC.c
View file @
47f6a350
...
...
@@ -122,17 +122,12 @@ ISR(TIMER1_OVF_vect, ISR_BLOCK)
void
EVENT_USB_Device_ConfigurationChanged
(
void
)
{
/* Setup CDC Notification, Rx and Tx Endpoints */
Endpoint_ConfigureEndpoint
(
CDC_NOTIFICATION_EPNUM
,
EP_TYPE_INTERRUPT
,
ENDPOINT_DIR_IN
,
CDC_NOTIFICATION_EPSIZE
,
ENDPOINT_BANK_SINGLE
);
Endpoint_ConfigureEndpoint
(
CDC_NOTIFICATION_EPADDR
,
EP_TYPE_INTERRUPT
,
CDC_NOTIFICATION_EPSIZE
,
1
);
Endpoint_ConfigureEndpoint
(
CDC_TX_EPNUM
,
EP_TYPE_BULK
,
ENDPOINT_DIR_IN
,
CDC_TXRX_EPSIZE
,
ENDPOINT_BANK_SINGLE
);
Endpoint_ConfigureEndpoint
(
CDC_TX_EPADDR
,
EP_TYPE_BULK
,
CDC_TXRX_EPSIZE
,
1
);
Endpoint_ConfigureEndpoint
(
CDC_RX_EPNUM
,
EP_TYPE_BULK
,
ENDPOINT_DIR_OUT
,
CDC_TXRX_EPSIZE
,
ENDPOINT_BANK_SINGLE
);
Endpoint_ConfigureEndpoint
(
CDC_RX_EPADDR
,
EP_TYPE_BULK
,
CDC_TXRX_EPSIZE
,
1
);
}
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
...
...
@@ -303,7 +298,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
static
uint8_t
FetchNextCommandByte
(
void
)
{
/* Select the OUT endpoint so that the next data byte can be read */
Endpoint_SelectEndpoint
(
CDC_RX_EP
NUM
);
Endpoint_SelectEndpoint
(
CDC_RX_EP
ADDR
);
/* If OUT endpoint empty, clear it and wait for the next packet from the host */
while
(
!
(
Endpoint_IsReadWriteAllowed
()))
...
...
@@ -329,7 +324,7 @@ static uint8_t FetchNextCommandByte(void)
static
void
WriteNextResponseByte
(
const
uint8_t
Response
)
{
/* Select the IN endpoint so that the next data byte can be written */
Endpoint_SelectEndpoint
(
CDC_TX_EP
NUM
);
Endpoint_SelectEndpoint
(
CDC_TX_EP
ADDR
);
/* If IN endpoint full, clear it and wait until ready for the next packet to the host */
if
(
!
(
Endpoint_IsReadWriteAllowed
()))
...
...
@@ -353,7 +348,7 @@ static void WriteNextResponseByte(const uint8_t Response)
static
void
CDC_Task
(
void
)
{
/* Select the OUT endpoint */
Endpoint_SelectEndpoint
(
CDC_RX_EP
NUM
);
Endpoint_SelectEndpoint
(
CDC_RX_EP
ADDR
);
/* Check if endpoint has a command in it sent from the host */
if
(
!
(
Endpoint_IsOUTReceived
()))
...
...
@@ -549,7 +544,7 @@ static void CDC_Task(void)
}
/* Select the IN endpoint */
Endpoint_SelectEndpoint
(
CDC_TX_EP
NUM
);
Endpoint_SelectEndpoint
(
CDC_TX_EP
ADDR
);
/* Remember if the endpoint is completely full before clearing it */
bool
IsEndpointFull
=
!
(
Endpoint_IsReadWriteAllowed
());
...
...
@@ -577,7 +572,7 @@ static void CDC_Task(void)
}
/* Select the OUT endpoint */
Endpoint_SelectEndpoint
(
CDC_RX_EP
NUM
);
Endpoint_SelectEndpoint
(
CDC_RX_EP
ADDR
);
/* Acknowledge the command from the host */
Endpoint_ClearOUT
();
...
...
Bootloaders/CDC/Descriptors.c
View file @
47f6a350
...
...
@@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
CDC_NOTIFICATION_EP
NUM
)
,
.
EndpointAddress
=
CDC_NOTIFICATION_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_INTERRUPT
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_NOTIFICATION_EPSIZE
,
.
PollingIntervalMS
=
0xFF
...
...
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_OUT
|
CDC_RX_EP
NUM
)
,
.
EndpointAddress
=
CDC_RX_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_BULK
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_TXRX_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
@@ -167,7 +167,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
CDC_TX_EP
NUM
)
,
.
EndpointAddress
=
CDC_TX_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_BULK
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_TXRX_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Bootloaders/CDC/Descriptors.h
View file @
47f6a350
...
...
@@ -92,14 +92,14 @@
#error The selected AVR part is not currently supported by this bootloader.
#endif
/** Endpoint
number
for the CDC control interface event notification endpoint. */
#define CDC_NOTIFICATION_EP
NUM
2
/** Endpoint
address
for the CDC control interface event notification endpoint. */
#define CDC_NOTIFICATION_EP
ADDR
(ENDPOINT_DIR_IN |
2
)
/** Endpoint
number
for the CDC data interface TX (data IN) endpoint. */
#define CDC_TX_EP
NUM
3
/** Endpoint
address
for the CDC data interface TX (data IN) endpoint. */
#define CDC_TX_EP
ADDR
(ENDPOINT_DIR_IN |
3
)
/** Endpoint
number
for the CDC data interface RX (data OUT) endpoint. */
#define CDC_RX_EP
NUM
4
/** Endpoint
address
for the CDC data interface RX (data OUT) endpoint. */
#define CDC_RX_EP
ADDR
(ENDPOINT_DIR_OUT |
4
)
/** Size of the CDC data interface TX and RX data endpoint banks, in bytes. */
#define CDC_TXRX_EPSIZE 16
...
...
Bootloaders/HID/BootloaderHID.c
View file @
47f6a350
...
...
@@ -85,9 +85,7 @@ static void SetupHardware(void)
void
EVENT_USB_Device_ConfigurationChanged
(
void
)
{
/* Setup HID Report Endpoint */
Endpoint_ConfigureEndpoint
(
HID_IN_EPNUM
,
EP_TYPE_INTERRUPT
,
ENDPOINT_DIR_IN
,
HID_IN_EPSIZE
,
ENDPOINT_BANK_SINGLE
);
Endpoint_ConfigureEndpoint
(
HID_IN_EPADDR
,
EP_TYPE_INTERRUPT
,
HID_IN_EPSIZE
,
1
);
}
/** Event handler for the USB_ControlRequest event. This is used to catch and process control requests sent to
...
...
Bootloaders/HID/Descriptors.c
View file @
47f6a350
...
...
@@ -137,7 +137,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
HID_IN_EP
NUM
)
,
.
EndpointAddress
=
HID_IN_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_INTERRUPT
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
HID_IN_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Bootloaders/HID/Descriptors.h
View file @
47f6a350
...
...
@@ -55,8 +55,8 @@
}
USB_Descriptor_Configuration_t
;
/* Macros: */
/** Endpoint
number
of the HID data IN endpoint. */
#define HID_IN_EP
NUM
1
/** Endpoint
address
of the HID data IN endpoint. */
#define HID_IN_EP
ADDR
(ENDPOINT_DIR_IN |
1
)
/** Size in bytes of the HID reporting IN endpoint. */
#define HID_IN_EPSIZE 64
...
...
BuildTests/ModuleTest/makefile
View file @
47f6a350
...
...
@@ -15,7 +15,7 @@
# List of device families per architecture, one device per architecture sub-family
AVR8_FAMILIES
=
at90usb1287 at90usb1286 atmega16u4 atmega16u2 at90usb162
XMEGA_FAMILIES
=
atxmega128a1u atxmega128a3u atxmega256a3bu atxmega128a4u atxmega128b1 atxmega128b3
XMEGA_FAMILIES
=
atxmega128a1u atxmega128a3u atxmega256a3bu atxmega128a4u atxmega128b1 atxmega128b3
atxmega128c3 atxmega32c4
UC3_FAMILIES
=
uc3a0256 uc3a1256 uc3a3256 uc3a4256 uc3b0256 uc3b1256
# List of all device families, with a family postfix
...
...
@@ -24,6 +24,10 @@ DEVICE_FAMILIES = $(AVR8_FAMILIES:%=%.avr8) $(XMEGA_FAMILIES:%=%.xmega) $(UC3_FA
all
:
begin $(DEVICE_FAMILIES) clean end
arch_avr8
:
begin $(AVR8_FAMILIES:%=%.avr8) end
arch_xmega
:
begin $(XMEGA_FAMILIES:%=%.xmega) end
arch_uc3
:
begin $(UC3_FAMILIES:%=%.uc3) end
begin
:
@
echo
Executing build
test
"ModuleTest"
.
@
echo
...
...
Demos/Device/ClassDriver/AudioInput/AudioInput.c
View file @
47f6a350
...
...
@@ -46,9 +46,12 @@ USB_ClassInfo_Audio_Device_t Microphone_Audio_Interface =
{
.
ControlInterfaceNumber
=
0
,
.
StreamingInterfaceNumber
=
1
,
.
DataINEndpointNumber
=
AUDIO_STREAM_EPNUM
,
.
DataINEndpointSize
=
AUDIO_STREAM_EPSIZE
,
.
DataINEndpoint
=
{
.
Address
=
AUDIO_STREAM_EPADDR
,
.
Size
=
AUDIO_STREAM_EPSIZE
,
.
Banks
=
2
,
},
},
};
...
...
@@ -197,7 +200,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
uint8_t
*
Data
)
{
/* Check the requested endpoint to see if a supported endpoint is being manipulated */
if
(
EndpointAddress
==
(
ENDPOINT_DIR_IN
|
Microphone_Audio_Interface
.
Config
.
DataINEndpoint
Number
)
)
if
(
EndpointAddress
==
Microphone_Audio_Interface
.
Config
.
DataINEndpoint
.
Address
)
{
/* Check the requested control to see if a supported control is being manipulated */
if
(
EndpointControl
==
AUDIO_EPCONTROL_SamplingFreq
)
...
...
Demos/Device/ClassDriver/AudioInput/Descriptors.c
View file @
47f6a350
...
...
@@ -220,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Audio_Descriptor_StreamEndpoint_Std_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
AUDIO_STREAM_EP
NUM
)
,
.
EndpointAddress
=
AUDIO_STREAM_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_ISOCHRONOUS
|
ENDPOINT_ATTR_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
AUDIO_STREAM_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Demos/Device/ClassDriver/AudioInput/Descriptors.h
View file @
47f6a350
...
...
@@ -42,14 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
/** Endpoint
number
of the Audio isochronous streaming data endpoint. */
#define AUDIO_STREAM_EP
NUM
1
/** Endpoint
address
of the Audio isochronous streaming data
IN
endpoint. */
#define AUDIO_STREAM_EP
ADDR
(ENDPOINT_DIR_IN | 1)
/** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
* at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
* USB AVR models will result in unavoidable distorted output.
*/
#define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
/** Endpoint size in bytes of the Audio isochronous streaming data endpoint. */
#define AUDIO_STREAM_EPSIZE 256
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
...
...
Demos/Device/ClassDriver/AudioOutput/AudioOutput.c
View file @
47f6a350
...
...
@@ -46,9 +46,12 @@ USB_ClassInfo_Audio_Device_t Speaker_Audio_Interface =
{
.
ControlInterfaceNumber
=
0
,
.
StreamingInterfaceNumber
=
1
,
.
DataOUTEndpointNumber
=
AUDIO_STREAM_EPNUM
,
.
DataOUTEndpointSize
=
AUDIO_STREAM_EPSIZE
,
.
DataOUTEndpoint
=
{
.
Address
=
AUDIO_STREAM_EPADDR
,
.
Size
=
AUDIO_STREAM_EPSIZE
,
.
Banks
=
2
,
},
},
};
...
...
@@ -234,7 +237,7 @@ bool CALLBACK_Audio_Device_GetSetEndpointProperty(USB_ClassInfo_Audio_Device_t*
uint8_t
*
Data
)
{
/* Check the requested endpoint to see if a supported endpoint is being manipulated */
if
(
EndpointAddress
==
(
ENDPOINT_DIR_OUT
|
Speaker_Audio_Interface
.
Config
.
DataOUTEndpoint
Number
)
)
if
(
EndpointAddress
==
Speaker_Audio_Interface
.
Config
.
DataOUTEndpoint
.
Address
)
{
/* Check the requested control to see if a supported control is being manipulated */
if
(
EndpointControl
==
AUDIO_EPCONTROL_SamplingFreq
)
...
...
Demos/Device/ClassDriver/AudioOutput/Descriptors.c
View file @
47f6a350
...
...
@@ -220,7 +220,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Audio_Descriptor_StreamEndpoint_Std_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_OUT
|
AUDIO_STREAM_EP
NUM
)
,
.
EndpointAddress
=
AUDIO_STREAM_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_ISOCHRONOUS
|
ENDPOINT_ATTR_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
AUDIO_STREAM_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Demos/Device/ClassDriver/AudioOutput/Descriptors.h
View file @
47f6a350
...
...
@@ -42,14 +42,11 @@
#include <avr/pgmspace.h>
/* Macros: */
/** Endpoint
number
of the Audio isochronous streaming data endpoint. */
#define AUDIO_STREAM_EP
NUM
1
/** Endpoint
address
of the Audio isochronous streaming data
OUT
endpoint. */
#define AUDIO_STREAM_EP
ADDR
(ENDPOINT_DIR_OUT | 1)
/** Endpoint size in bytes of the Audio isochronous streaming data endpoint. The Windows audio stack requires
* at least 192 bytes for correct output, thus the smaller 128 byte maximum endpoint size on some of the smaller
* USB AVR models will result in unavoidable distorted output.
*/
#define AUDIO_STREAM_EPSIZE ENDPOINT_MAX_SIZE(AUDIO_STREAM_EPNUM)
/** Endpoint size in bytes of the Audio isochronous streaming data endpoint. */
#define AUDIO_STREAM_EPSIZE 256
/* Type Defines: */
/** Type define for the device configuration descriptor structure. This must be defined in the
...
...
Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c
View file @
47f6a350
...
...
@@ -157,7 +157,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
CDC1_NOTIFICATION_EP
NUM
)
,
.
EndpointAddress
=
CDC1_NOTIFICATION_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_INTERRUPT
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_NOTIFICATION_EPSIZE
,
.
PollingIntervalMS
=
0xFF
...
...
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_OUT
|
CDC1_RX_EP
NUM
)
,
.
EndpointAddress
=
CDC1_RX_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_BULK
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_TXRX_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
@@ -193,7 +193,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
CDC1_TX_EP
NUM
)
,
.
EndpointAddress
=
CDC1_TX_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_BULK
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_TXRX_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
@@ -258,7 +258,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
CDC2_NOTIFICATION_EP
NUM
)
,
.
EndpointAddress
=
CDC2_NOTIFICATION_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_INTERRUPT
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_NOTIFICATION_EPSIZE
,
.
PollingIntervalMS
=
0xFF
...
...
@@ -284,7 +284,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_OUT
|
CDC2_RX_EP
NUM
)
,
.
EndpointAddress
=
CDC2_RX_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_BULK
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_TXRX_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
@@ -294,7 +294,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
CDC2_TX_EP
NUM
)
,
.
EndpointAddress
=
CDC2_TX_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_BULK
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
CDC_TXRX_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h
View file @
47f6a350
...
...
@@ -42,23 +42,23 @@
#include <LUFA/Drivers/USB/USB.h>
/* Macros: */
/** Endpoint
number
of the first CDC interface's device-to-host data IN endpoint. */
#define CDC1_TX_EP
NUM
1
/** Endpoint
address
of the first CDC interface's device-to-host data IN endpoint. */
#define CDC1_TX_EP
ADDR
(ENDPOINT_DIR_IN |
1
)
/** Endpoint
number
of the first CDC interface's host-to-device data OUT endpoint. */
#define CDC1_RX_EP
NUM
2
/** Endpoint
address
of the first CDC interface's host-to-device data OUT endpoint. */
#define CDC1_RX_EP
ADDR
(ENDPOINT_DIR_OUT |
2
)
/** Endpoint
number
of the first CDC interface's device-to-host notification IN endpoint. */
#define CDC1_NOTIFICATION_EP
NUM
3
/** Endpoint
address
of the first CDC interface's device-to-host notification IN endpoint. */
#define CDC1_NOTIFICATION_EP
ADDR
(ENDPOINT_DIR_IN |
3
)
/** Endpoint
number
of the second CDC interface's device-to-host data IN endpoint. */
#define CDC2_TX_EP
NUM
4
/** Endpoint
address
of the second CDC interface's device-to-host data IN endpoint. */
#define CDC2_TX_EP
ADDR
(ENDPOINT_DIR_IN |
4
)
/** Endpoint
number
of the second CDC interface's host-to-device data OUT endpoint. */
#define CDC2_RX_EP
NUM
5
/** Endpoint
address
of the second CDC interface's host-to-device data OUT endpoint. */
#define CDC2_RX_EP
ADDR
(ENDPOINT_DIR_OUT |
5
)
/** Endpoint
number
of the second CDC interface's device-to-host notification IN endpoint. */
#define CDC2_NOTIFICATION_EP
NUM
6
/** Endpoint
address
of the second CDC interface's device-to-host notification IN endpoint. */
#define CDC2_NOTIFICATION_EP
ADDR
(ENDPOINT_DIR_IN |
6
)
/** Size in bytes of the CDC device-to-host notification IN endpoints. */
#define CDC_NOTIFICATION_EPSIZE 8
...
...
Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c
View file @
47f6a350
...
...
@@ -45,19 +45,25 @@ USB_ClassInfo_CDC_Device_t VirtualSerial1_CDC_Interface =
{
.
Config
=
{
.
ControlInterfaceNumber
=
0
,
.
DataINEndpointNumber
=
CDC1_TX_EPNUM
,
.
DataINEndpointSize
=
CDC_TXRX_EPSIZE
,
.
DataINEndpointDoubleBank
=
false
,
.
DataOUTEndpointNumber
=
CDC1_RX_EPNUM
,
.
DataOUTEndpointSize
=
CDC_TXRX_EPSIZE
,
.
DataOUTEndpointDoubleBank
=
false
,
.
NotificationEndpointNumber
=
CDC1_NOTIFICATION_EPNUM
,
.
NotificationEndpointSize
=
CDC_NOTIFICATION_EPSIZE
,
.
NotificationEndpointDoubleBank
=
false
,
.
ControlInterfaceNumber
=
0
,
.
DataINEndpoint
=
{
.
Address
=
CDC1_TX_EPADDR
,
.
Size
=
CDC_TXRX_EPSIZE
,
.
Banks
=
1
,
},
.
DataOUTEndpoint
=
{
.
Address
=
CDC1_RX_EPADDR
,
.
Size
=
CDC_TXRX_EPSIZE
,
.
Banks
=
1
,
},
.
NotificationEndpoint
=
{
.
Address
=
CDC1_NOTIFICATION_EPADDR
,
.
Size
=
CDC_NOTIFICATION_EPSIZE
,
.
Banks
=
1
,
},
},
};
...
...
@@ -70,19 +76,26 @@ USB_ClassInfo_CDC_Device_t VirtualSerial2_CDC_Interface =
{
.
Config
=
{
.
ControlInterfaceNumber
=
2
,
.
DataINEndpointNumber
=
CDC2_TX_EPNUM
,
.
DataINEndpointSize
=
CDC_TXRX_EPSIZE
,
.
DataINEndpointDoubleBank
=
false
,
.
DataOUTEndpointNumber
=
CDC2_RX_EPNUM
,
.
DataOUTEndpointSize
=
CDC_TXRX_EPSIZE
,
.
DataOUTEndpointDoubleBank
=
false
,
.
ControlInterfaceNumber
=
2
,
.
DataINEndpoint
=
{
.
Address
=
CDC2_TX_EPADDR
,
.
Size
=
CDC_TXRX_EPSIZE
,
.
Banks
=
1
,
},
.
DataOUTEndpoint
=
{
.
Address
=
CDC2_RX_EPADDR
,
.
Size
=
CDC_TXRX_EPSIZE
,
.
Banks
=
1
,
},
.
NotificationEndpoint
=
{
.
Address
=
CDC2_NOTIFICATION_EPADDR
,
.
Size
=
CDC_NOTIFICATION_EPSIZE
,
.
Banks
=
1
,
},
.
NotificationEndpointNumber
=
CDC2_NOTIFICATION_EPNUM
,
.
NotificationEndpointSize
=
CDC_NOTIFICATION_EPSIZE
,
.
NotificationEndpointDoubleBank
=
false
,
},
};
...
...
Demos/Device/ClassDriver/GenericHID/Descriptors.c
View file @
47f6a350
...
...
@@ -135,7 +135,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
GENERIC_IN_EP
NUM
)
,
.
EndpointAddress
=
GENERIC_IN_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_INTERRUPT
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
GENERIC_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Demos/Device/ClassDriver/GenericHID/Descriptors.h
View file @
47f6a350
...
...
@@ -57,8 +57,8 @@
}
USB_Descriptor_Configuration_t
;
/* Macros: */
/** Endpoint
number
of the Generic HID reporting IN endpoint. */
#define GENERIC_IN_EP
NUM
1
/** Endpoint
address
of the Generic HID reporting IN endpoint. */
#define GENERIC_IN_EP
ADDR
(ENDPOINT_DIR_IN |
1
)
/** Size in bytes of the Generic HID reporting endpoint. */
#define GENERIC_EPSIZE 8
...
...
Demos/Device/ClassDriver/GenericHID/GenericHID.c
View file @
47f6a350
...
...
@@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Generic_HID_Interface =
.
Config
=
{
.
InterfaceNumber
=
0
,
.
ReportINEndpointNumber
=
GENERIC_IN_EPNUM
,
.
ReportINEndpointSize
=
GENERIC_EPSIZE
,
.
ReportINEndpointDoubleBank
=
false
,
.
ReportINEndpoint
=
{
.
Address
=
GENERIC_IN_EPADDR
,
.
Size
=
GENERIC_EPSIZE
,
.
Banks
=
1
,
},
.
PrevReportINBuffer
=
PrevHIDReportBuffer
,
.
PrevReportINBufferSize
=
sizeof
(
PrevHIDReportBuffer
),
},
...
...
Demos/Device/ClassDriver/Joystick/Descriptors.c
View file @
47f6a350
...
...
@@ -135,7 +135,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.
Header
=
{.
Size
=
sizeof
(
USB_Descriptor_Endpoint_t
),
.
Type
=
DTYPE_Endpoint
},
.
EndpointAddress
=
(
ENDPOINT_DIR_IN
|
JOYSTICK_EP
NUM
)
,
.
EndpointAddress
=
JOYSTICK_EP
ADDR
,
.
Attributes
=
(
EP_TYPE_INTERRUPT
|
ENDPOINT_ATTR_NO_SYNC
|
ENDPOINT_USAGE_DATA
),
.
EndpointSize
=
JOYSTICK_EPSIZE
,
.
PollingIntervalMS
=
0x01
...
...
Prev
1
2
3
4
5
…
14
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment