diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-05-10 19:24:58 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-05-10 19:24:58 +0000 |
commit | 359fbfe14d00ab378f85a36664820ea9ba538c3f (patch) | |
tree | 0929d5663a3be4dc078dda0aba5ba798ebb627ab /Demos | |
parent | e8570c4a37e41117e3fd1e989e0b41f1e9608f3c (diff) | |
download | lufa-359fbfe14d00ab378f85a36664820ea9ba538c3f.tar.gz lufa-359fbfe14d00ab378f85a36664820ea9ba538c3f.tar.bz2 lufa-359fbfe14d00ab378f85a36664820ea9ba538c3f.zip |
Add branch for the conversion of demos to use standard C header files for configuration, rather than makefile defined macros.
Diffstat (limited to 'Demos')
147 files changed, 856 insertions, 795 deletions
diff --git a/Demos/Device/ClassDriver/AudioInput/AudioInput.c b/Demos/Device/ClassDriver/AudioInput/AudioInput.c index 382446a80..867a09eef 100644 --- a/Demos/Device/ClassDriver/AudioInput/AudioInput.c +++ b/Demos/Device/ClassDriver/AudioInput/AudioInput.c @@ -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.DataINEndpointNumber)) + 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) diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.c b/Demos/Device/ClassDriver/AudioInput/Descriptors.c index 6b7593f52..8557e18e5 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.c @@ -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_EPNUM), + .EndpointAddress = AUDIO_STREAM_EPADDR, .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = AUDIO_STREAM_EPSIZE, .PollingIntervalMS = 0x01 diff --git a/Demos/Device/ClassDriver/AudioInput/Descriptors.h b/Demos/Device/ClassDriver/AudioInput/Descriptors.h index ac0a536de..359a28730 100644 --- a/Demos/Device/ClassDriver/AudioInput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioInput/Descriptors.h @@ -42,14 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the Audio isochronous streaming data endpoint. */ - #define AUDIO_STREAM_EPNUM 1 + /** Endpoint address of the Audio isochronous streaming data IN endpoint. */ + #define AUDIO_STREAM_EPADDR (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 diff --git a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c index 78d81f57a..82f664a9b 100644 --- a/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c +++ b/Demos/Device/ClassDriver/AudioOutput/AudioOutput.c @@ -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.DataOUTEndpointNumber)) + 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) diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c index 06cc5caf5..0df27453e 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.c +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.c @@ -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_EPNUM), + .EndpointAddress = AUDIO_STREAM_EPADDR, .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = AUDIO_STREAM_EPSIZE, .PollingIntervalMS = 0x01 diff --git a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h index ac0a536de..d5c8a2b84 100644 --- a/Demos/Device/ClassDriver/AudioOutput/Descriptors.h +++ b/Demos/Device/ClassDriver/AudioOutput/Descriptors.h @@ -42,14 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the Audio isochronous streaming data endpoint. */ - #define AUDIO_STREAM_EPNUM 1 + /** Endpoint address of the Audio isochronous streaming data OUT endpoint. */ + #define AUDIO_STREAM_EPADDR (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 diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c index 5df6808c6..1a4860ad3 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.c @@ -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_EPNUM), + .EndpointAddress = CDC1_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -183,20 +183,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC1_RX_EPNUM), + .EndpointAddress = CDC1_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC1_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC1_TX_EPNUM), + .EndpointAddress = CDC1_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_IAD = @@ -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_EPNUM), + .EndpointAddress = CDC2_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -284,20 +284,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC2_RX_EPNUM), + .EndpointAddress = CDC2_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC2_TX_EPNUM), + .EndpointAddress = CDC2_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h index 01d10f29b..dc3aa0b86 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/DualVirtualSerial/Descriptors.h @@ -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_EPNUM 1 + /** Endpoint address of the first CDC interface's device-to-host data IN endpoint. */ + #define CDC1_TX_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the first CDC interface's host-to-device data OUT endpoint. */ - #define CDC1_RX_EPNUM 2 + /** Endpoint address of the first CDC interface's host-to-device data OUT endpoint. */ + #define CDC1_RX_EPADDR (ENDPOINT_DIR_OUT | 2) - /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */ - #define CDC1_NOTIFICATION_EPNUM 3 + /** Endpoint address of the first CDC interface's device-to-host notification IN endpoint. */ + #define CDC1_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the second CDC interface's device-to-host data IN endpoint. */ - #define CDC2_TX_EPNUM 4 + /** Endpoint address of the second CDC interface's device-to-host data IN endpoint. */ + #define CDC2_TX_EPADDR (ENDPOINT_DIR_IN | 4) - /** Endpoint number of the second CDC interface's host-to-device data OUT endpoint. */ - #define CDC2_RX_EPNUM 5 + /** Endpoint address of the second CDC interface's host-to-device data OUT endpoint. */ + #define CDC2_RX_EPADDR (ENDPOINT_DIR_OUT | 5) - /** Endpoint number of the second CDC interface's device-to-host notification IN endpoint. */ - #define CDC2_NOTIFICATION_EPNUM 6 + /** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */ + #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6) /** Size in bytes of the CDC device-to-host notification IN endpoints. */ #define CDC_NOTIFICATION_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c index 8f1eb96cf..a07967c05 100644 --- a/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c @@ -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, }, }; diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.c b/Demos/Device/ClassDriver/GenericHID/Descriptors.c index ee1ba49c8..a9ca6be1c 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.c +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.c @@ -135,10 +135,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | GENERIC_IN_EPNUM), + .EndpointAddress = GENERIC_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/GenericHID/Descriptors.h b/Demos/Device/ClassDriver/GenericHID/Descriptors.h index ddeef240c..0b9ec8f71 100644 --- a/Demos/Device/ClassDriver/GenericHID/Descriptors.h +++ b/Demos/Device/ClassDriver/GenericHID/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Generic HID reporting IN endpoint. */ - #define GENERIC_IN_EPNUM 1 + /** Endpoint address of the Generic HID reporting IN endpoint. */ + #define GENERIC_IN_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Generic HID reporting endpoint. */ #define GENERIC_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/GenericHID/GenericHID.c b/Demos/Device/ClassDriver/GenericHID/GenericHID.c index 36eb8f7fe..aa365bde2 100644 --- a/Demos/Device/ClassDriver/GenericHID/GenericHID.c +++ b/Demos/Device/ClassDriver/GenericHID/GenericHID.c @@ -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), }, diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.c b/Demos/Device/ClassDriver/Joystick/Descriptors.c index da6fc3d09..903e35c63 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.c +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.c @@ -135,10 +135,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | JOYSTICK_EPNUM), + .EndpointAddress = JOYSTICK_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = JOYSTICK_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/Joystick/Descriptors.h b/Demos/Device/ClassDriver/Joystick/Descriptors.h index f0ad9c2f1..d2e294316 100644 --- a/Demos/Device/ClassDriver/Joystick/Descriptors.h +++ b/Demos/Device/ClassDriver/Joystick/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Joystick HID reporting IN endpoint. */ - #define JOYSTICK_EPNUM 1 + /** Endpoint address of the Joystick HID reporting IN endpoint. */ + #define JOYSTICK_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Joystick HID reporting IN endpoint. */ #define JOYSTICK_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/Joystick/Joystick.c b/Demos/Device/ClassDriver/Joystick/Joystick.c index 3c1913f8f..4f361daf0 100644 --- a/Demos/Device/ClassDriver/Joystick/Joystick.c +++ b/Demos/Device/ClassDriver/Joystick/Joystick.c @@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Joystick_HID_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = JOYSTICK_EPNUM, - .ReportINEndpointSize = JOYSTICK_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = JOYSTICK_EPADDR, + .Size = JOYSTICK_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevJoystickHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevJoystickHIDReportBuffer), }, diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.c b/Demos/Device/ClassDriver/Keyboard/Descriptors.c index cb7852667..c74368bb0 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.c @@ -131,10 +131,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM), + .EndpointAddress = KEYBOARD_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/Keyboard/Descriptors.h b/Demos/Device/ClassDriver/Keyboard/Descriptors.h index 370489514..f032b728e 100644 --- a/Demos/Device/ClassDriver/Keyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/Keyboard/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_EPNUM 1 + /** Endpoint address of the Keyboard HID reporting IN endpoint. */ + #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Keyboard HID reporting IN endpoint. */ #define KEYBOARD_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/Keyboard/Keyboard.c b/Demos/Device/ClassDriver/Keyboard/Keyboard.c index 15a7f1760..24bf8d5fa 100644 --- a/Demos/Device/ClassDriver/Keyboard/Keyboard.c +++ b/Demos/Device/ClassDriver/Keyboard/Keyboard.c @@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = KEYBOARD_EPNUM, - .ReportINEndpointSize = KEYBOARD_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = KEYBOARD_EPADDR, + .Size = KEYBOARD_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevKeyboardHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer), }, diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c index d6471d6e7..448fe0537 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.c @@ -147,10 +147,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM), + .EndpointAddress = KEYBOARD_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID2_MouseInterface = @@ -184,10 +184,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM), + .EndpointAddress = MOUSE_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h index fe41f923e..e35e266c0 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/KeyboardMouse/Descriptors.h @@ -62,11 +62,11 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_IN_EPNUM 1 + /** Endpoint address of the Keyboard HID reporting IN endpoint. */ + #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_IN_EPNUM 3 + /** Endpoint address of the Mouse HID reporting IN endpoint. */ + #define MOUSE_IN_EPADDR (ENDPOINT_DIR_IN | 3) /** Size in bytes of each of the HID reporting IN endpoints. */ #define HID_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c index cb2eebf81..7b5caa405 100644 --- a/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/ClassDriver/KeyboardMouse/KeyboardMouse.c @@ -52,11 +52,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = KEYBOARD_IN_EPNUM, - .ReportINEndpointSize = HID_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = KEYBOARD_IN_EPADDR, + .Size = HID_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevKeyboardHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer), }, @@ -72,10 +73,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface = .Config = { .InterfaceNumber = 1, - - .ReportINEndpointNumber = MOUSE_IN_EPNUM, - .ReportINEndpointSize = HID_EPSIZE, - + .ReportINEndpoint = + { + .Address = MOUSE_IN_EPADDR, + .Size = HID_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevMouseHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer), }, diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c index f08cdc717..f80678f19 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.c @@ -194,10 +194,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | HID_IN_EPNUM), + .EndpointAddress = HID_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h index f579edfb8..5632aa849 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the HID reporting IN endpoint. */ - #define HID_IN_EPNUM 1 + /** Endpoint address of the HID reporting IN endpoint. */ + #define HID_IN_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of each of the HID reporting IN endpoint. */ #define HID_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c index 7197959bb..c0526abfd 100644 --- a/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c +++ b/Demos/Device/ClassDriver/KeyboardMouseMultiReport/KeyboardMouseMultiReport.c @@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Device_HID_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = HID_IN_EPNUM, - .ReportINEndpointSize = HID_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = HID_IN_EPADDR, + .Size = HID_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevHIDReportBuffer), }, diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.c b/Demos/Device/ClassDriver/MIDI/Descriptors.c index 9ad0e86a5..44db1eee5 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.c +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.c @@ -199,10 +199,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM), + .EndpointAddress = MIDI_STREAM_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -224,10 +224,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM), + .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, diff --git a/Demos/Device/ClassDriver/MIDI/Descriptors.h b/Demos/Device/ClassDriver/MIDI/Descriptors.h index c5dc2e217..83844449d 100644 --- a/Demos/Device/ClassDriver/MIDI/Descriptors.h +++ b/Demos/Device/ClassDriver/MIDI/Descriptors.h @@ -42,11 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */ - #define MIDI_STREAM_IN_EPNUM 2 + /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */ + #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */ - #define MIDI_STREAM_OUT_EPNUM 1 + /** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */ + #define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 1) /** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */ #define MIDI_STREAM_EPSIZE 64 diff --git a/Demos/Device/ClassDriver/MIDI/MIDI.c b/Demos/Device/ClassDriver/MIDI/MIDI.c index 317c37db0..6a117ab4b 100644 --- a/Demos/Device/ClassDriver/MIDI/MIDI.c +++ b/Demos/Device/ClassDriver/MIDI/MIDI.c @@ -45,14 +45,18 @@ USB_ClassInfo_MIDI_Device_t Keyboard_MIDI_Interface = .Config = { .StreamingInterfaceNumber = 1, - - .DataINEndpointNumber = MIDI_STREAM_IN_EPNUM, - .DataINEndpointSize = MIDI_STREAM_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = MIDI_STREAM_OUT_EPNUM, - .DataOUTEndpointSize = MIDI_STREAM_EPSIZE, - .DataOUTEndpointDoubleBank = false, + .DataINEndpoint = + { + .Address = MIDI_STREAM_IN_EPADDR, + .Size = MIDI_STREAM_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = MIDI_STREAM_OUT_EPADDR, + .Size = MIDI_STREAM_EPSIZE, + .Banks = 1, + }, }, }; @@ -74,7 +78,7 @@ int main(void) MIDI_EventPacket_t ReceivedMIDIEvent; while (MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &ReceivedMIDIEvent)) { - if ((ReceivedMIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && (ReceivedMIDIEvent.Data3 > 0)) + if ((ReceivedMIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && (ReceivedMIDIEvent.Data3 > 0)) LEDs_SetAllLEDs(ReceivedMIDIEvent.Data2 > 64 ? LEDS_LED1 : LEDS_LED2); else LEDs_SetAllLEDs(LEDS_NO_LEDS); @@ -151,8 +155,7 @@ void CheckJoystickMovement(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.c b/Demos/Device/ClassDriver/MassStorage/Descriptors.c index fb829423a..5c62f7fb1 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.c @@ -118,20 +118,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM), + .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM), + .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/MassStorage/Descriptors.h b/Demos/Device/ClassDriver/MassStorage/Descriptors.h index 813f99520..84879e822 100644 --- a/Demos/Device/ClassDriver/MassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorage/Descriptors.h @@ -42,11 +42,11 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ - #define MASS_STORAGE_IN_EPNUM 3 + /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ + #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */ - #define MASS_STORAGE_OUT_EPNUM 4 + /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */ + #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the Mass Storage data endpoints. */ #define MASS_STORAGE_IO_EPSIZE 64 diff --git a/Demos/Device/ClassDriver/MassStorage/MassStorage.c b/Demos/Device/ClassDriver/MassStorage/MassStorage.c index 6a720f983..0ba06a5d0 100644 --- a/Demos/Device/ClassDriver/MassStorage/MassStorage.c +++ b/Demos/Device/ClassDriver/MassStorage/MassStorage.c @@ -45,15 +45,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface = .Config = { .InterfaceNumber = 0, - - .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM, - .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM, - .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataOUTEndpointDoubleBank = false, - + .DataINEndpoint = + { + .Address = MASS_STORAGE_IN_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = MASS_STORAGE_OUT_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, .TotalLUNs = TOTAL_LUNS, }, }; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c index 27909034c..6818a7acb 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.c @@ -133,20 +133,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM), + .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM), + .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_KeyboardInterface = @@ -180,10 +180,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_EPNUM), + .EndpointAddress = KEYBOARD_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, }; diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h index 86f6cc4c4..fb1a3794f 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/Descriptors.h @@ -43,17 +43,17 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_EPNUM 1 + /** Endpoint address of the Keyboard HID reporting IN endpoint. */ + #define KEYBOARD_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Keyboard HID reporting IN endpoint. */ #define KEYBOARD_EPSIZE 8 - /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ - #define MASS_STORAGE_IN_EPNUM 3 + /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ + #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */ - #define MASS_STORAGE_OUT_EPNUM 4 + /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */ + #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the Mass Storage data endpoints. */ #define MASS_STORAGE_IO_EPSIZE 64 diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c index bfdf09ceb..7e12a5d6e 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/MassStorageKeyboard.c @@ -46,15 +46,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface = .Config = { .InterfaceNumber = 0, - - .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM, - .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM, - .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataOUTEndpointDoubleBank = false, - + .DataINEndpoint = + { + .Address = MASS_STORAGE_IN_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = MASS_STORAGE_OUT_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, .TotalLUNs = TOTAL_LUNS, }, }; @@ -71,11 +74,12 @@ USB_ClassInfo_HID_Device_t Keyboard_HID_Interface = .Config = { .InterfaceNumber = 1, - - .ReportINEndpointNumber = KEYBOARD_EPNUM, - .ReportINEndpointSize = KEYBOARD_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = KEYBOARD_EPADDR, + .Size = KEYBOARD_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevKeyboardHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevKeyboardHIDReportBuffer), }, diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.c b/Demos/Device/ClassDriver/Mouse/Descriptors.c index 1a7af876c..174d23857 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.c +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.c @@ -136,10 +136,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM), + .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/Mouse/Descriptors.h b/Demos/Device/ClassDriver/Mouse/Descriptors.h index da78dd0ff..abcd938a8 100644 --- a/Demos/Device/ClassDriver/Mouse/Descriptors.h +++ b/Demos/Device/ClassDriver/Mouse/Descriptors.h @@ -41,6 +41,13 @@ #include <avr/pgmspace.h> + /* Macros: */ + /** Endpoint address of the Mouse HID reporting IN endpoint. */ + #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1) + + /** Size in bytes of the Mouse HID reporting IN endpoint. */ + #define MOUSE_EPSIZE 8 + /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which @@ -56,13 +63,6 @@ USB_Descriptor_Endpoint_t HID_ReportINEndpoint; } USB_Descriptor_Configuration_t; - /* Macros: */ - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_EPNUM 1 - - /** Size in bytes of the Mouse HID reporting IN endpoint. */ - #define MOUSE_EPSIZE 8 - /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, diff --git a/Demos/Device/ClassDriver/Mouse/Mouse.c b/Demos/Device/ClassDriver/Mouse/Mouse.c index 04d4268f0..00cadb41c 100644 --- a/Demos/Device/ClassDriver/Mouse/Mouse.c +++ b/Demos/Device/ClassDriver/Mouse/Mouse.c @@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = MOUSE_EPNUM, - .ReportINEndpointSize = MOUSE_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = MOUSE_EPADDR, + .Size = MOUSE_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevMouseHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer), }, diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c index 41bc4b59e..d1ca1df04 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.c @@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -157,20 +157,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .RNDIS_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h index 7c40d87a1..6301b83aa 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h +++ b/Demos/Device/ClassDriver/RNDISEthernet/Descriptors.h @@ -42,14 +42,14 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 3 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 1 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 2 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2) /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c index 2a8ba9735..37fb817de 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/RNDISEthernet.c @@ -45,19 +45,24 @@ USB_ClassInfo_RNDIS_Device_t Ethernet_RNDIS_Interface = .Config = { .ControlInterfaceNumber = 0, - - .DataINEndpointNumber = CDC_TX_EPNUM, - .DataINEndpointSize = CDC_TXRX_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = CDC_RX_EPNUM, - .DataOUTEndpointSize = CDC_TXRX_EPSIZE, - .DataOUTEndpointDoubleBank = false, - - .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, - .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, - .NotificationEndpointDoubleBank = false, - + .DataINEndpoint = + { + .Address = CDC_TX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = CDC_RX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .NotificationEndpoint = + { + .Address = CDC_NOTIFICATION_EPADDR, + .Size = CDC_NOTIFICATION_EPSIZE, + .Banks = 1, + }, .AdapterVendorDescription = "LUFA RNDIS Demo Adapter", .AdapterMACAddress = {ADAPTER_MAC_ADDRESS}, }, diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c index f4e9fb324..9dcf4e4d4 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.c @@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -169,20 +169,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h index fb69344cb..af9183ed2 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerial/Descriptors.h @@ -42,14 +42,14 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 2 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 3 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 4 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c index c3e16edb0..8b11c298c 100644 --- a/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c @@ -44,19 +44,25 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = { .Config = { - .ControlInterfaceNumber = 0, - - .DataINEndpointNumber = CDC_TX_EPNUM, - .DataINEndpointSize = CDC_TXRX_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = CDC_RX_EPNUM, - .DataOUTEndpointSize = CDC_TXRX_EPSIZE, - .DataOUTEndpointDoubleBank = false, - - .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, - .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, - .NotificationEndpointDoubleBank = false, + .ControlInterfaceNumber = 0, + .DataINEndpoint = + { + .Address = CDC_TX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = CDC_RX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .NotificationEndpoint = + { + .Address = CDC_NOTIFICATION_EPADDR, + .Size = CDC_NOTIFICATION_EPSIZE, + .Banks = 1, + }, }, }; diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c index 299ddbdca..cfccac02b 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.c @@ -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 | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -183,20 +183,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_Interface = @@ -219,20 +219,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM), + .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM), + .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h index b4b5ef67a..544a2b5c0 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/Descriptors.h @@ -42,14 +42,14 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 1 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 2 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 3 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 3) /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 @@ -57,11 +57,11 @@ /** Size in bytes of the CDC data IN and OUT endpoints. */ #define CDC_TXRX_EPSIZE 16 - /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ - #define MASS_STORAGE_IN_EPNUM 4 + /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ + #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 4) - /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */ - #define MASS_STORAGE_OUT_EPNUM 5 + /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */ + #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 5) /** Size in bytes of the Mass Storage data endpoints. */ #define MASS_STORAGE_IO_EPSIZE 64 diff --git a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c index d8ffea873..14d6abdd9 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c +++ b/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c @@ -45,18 +45,24 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = .Config = { .ControlInterfaceNumber = 0, - - .DataINEndpointNumber = CDC_TX_EPNUM, - .DataINEndpointSize = CDC_TXRX_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = CDC_RX_EPNUM, - .DataOUTEndpointSize = CDC_TXRX_EPSIZE, - .DataOUTEndpointDoubleBank = false, - - .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, - .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, - .NotificationEndpointDoubleBank = false, + .DataINEndpoint = + { + .Address = CDC_TX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = CDC_RX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .NotificationEndpoint = + { + .Address = CDC_NOTIFICATION_EPADDR, + .Size = CDC_NOTIFICATION_EPSIZE, + .Banks = 1, + }, }, }; @@ -69,15 +75,18 @@ USB_ClassInfo_MS_Device_t Disk_MS_Interface = .Config = { .InterfaceNumber = 2, - - .DataINEndpointNumber = MASS_STORAGE_IN_EPNUM, - .DataINEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = MASS_STORAGE_OUT_EPNUM, - .DataOUTEndpointSize = MASS_STORAGE_IO_EPSIZE, - .DataOUTEndpointDoubleBank = false, - + .DataINEndpoint = + { + .Address = MASS_STORAGE_IN_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = MASS_STORAGE_OUT_EPADDR, + .Size = MASS_STORAGE_IO_EPSIZE, + .Banks = 1, + }, .TotalLUNs = TOTAL_LUNS, }, }; diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c index af674563f..999712185 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.c @@ -176,7 +176,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -202,20 +202,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_Interface = @@ -249,10 +249,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM), + .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h index 2509314b2..06cfd459b 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/Descriptors.h @@ -42,14 +42,14 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 2 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 3 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 4 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 @@ -57,8 +57,8 @@ /** Size in bytes of the CDC data IN and OUT endpoints. */ #define CDC_TXRX_EPSIZE 16 - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_EPNUM 1 + /** Endpoint address of the Mouse HID reporting IN endpoint. */ + #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Mouse HID reporting IN endpoint. */ #define MOUSE_EPSIZE 8 diff --git a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c index f2d67542d..dbbc8e7b4 100644 --- a/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c +++ b/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c @@ -45,18 +45,24 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = .Config = { .ControlInterfaceNumber = 0, - - .DataINEndpointNumber = CDC_TX_EPNUM, - .DataINEndpointSize = CDC_TXRX_EPSIZE, - .DataINEndpointDoubleBank = false, - - .DataOUTEndpointNumber = CDC_RX_EPNUM, - .DataOUTEndpointSize = CDC_TXRX_EPSIZE, - .DataOUTEndpointDoubleBank = false, - - .NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM, - .NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE, - .NotificationEndpointDoubleBank = false, + .DataINEndpoint = + { + .Address = CDC_TX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .DataOUTEndpoint = + { + .Address = CDC_RX_EPADDR, + .Size = CDC_TXRX_EPSIZE, + .Banks = 1, + }, + .NotificationEndpoint = + { + .Address = CDC_NOTIFICATION_EPADDR, + .Size = CDC_NOTIFICATION_EPSIZE, + .Banks = 1, + }, }, }; @@ -72,11 +78,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Interface = .Config = { .InterfaceNumber = 2, - - .ReportINEndpointNumber = MOUSE_EPNUM, - .ReportINEndpointSize = MOUSE_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = MOUSE_EPADDR, + .Size = MOUSE_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevMouseHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer), }, 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; diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index 60eeaf64c..eb9c4b57c 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -118,8 +118,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup Audio Stream Endpoint */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, ENDPOINT_DIR_IN, - AUDIO_STREAM_EPSIZE, ENDPOINT_BANK_DOUBLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPADDR, EP_TYPE_ISOCHRONOUS, AUDIO_STREAM_EPSIZE, 2); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -165,7 +164,7 @@ void EVENT_USB_Device_ControlRequest(void) uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */ - if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) + if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; @@ -190,7 +189,7 @@ void EVENT_USB_Device_ControlRequest(void) uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */ - if ((EndpointAddress == (ENDPOINT_DIR_IN | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) + if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; @@ -215,7 +214,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); /* Select the audio stream endpoint */ - Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM); + Endpoint_SelectEndpoint(AUDIO_STREAM_EPADDR); /* Check if the current endpoint can be written to and that the audio interface is enabled */ if (Endpoint_IsINReady() && StreamingAudioInterfaceSelected) diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.c b/Demos/Device/LowLevel/AudioInput/Descriptors.c index 0b1652246..ee37affd2 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.c @@ -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_EPNUM), + .EndpointAddress = AUDIO_STREAM_EPADDR, .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = AUDIO_STREAM_EPSIZE, .PollingIntervalMS = 0x01 diff --git a/Demos/Device/LowLevel/AudioInput/Descriptors.h b/Demos/Device/LowLevel/AudioInput/Descriptors.h index ac0a536de..4680294c9 100644 --- a/Demos/Device/LowLevel/AudioInput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioInput/Descriptors.h @@ -42,14 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the Audio isochronous streaming data endpoint. */ - #define AUDIO_STREAM_EPNUM 1 + /** Endpoint address of the Audio isochronous streaming data IN endpoint. */ + #define AUDIO_STREAM_EPADDR (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 diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index 813108a71..ebf4ad51d 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -144,8 +144,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup Audio Stream Endpoint */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPNUM, EP_TYPE_ISOCHRONOUS, ENDPOINT_DIR_OUT, - AUDIO_STREAM_EPSIZE, ENDPOINT_BANK_DOUBLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(AUDIO_STREAM_EPADDR, EP_TYPE_ISOCHRONOUS, AUDIO_STREAM_EPSIZE, 2); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -191,7 +190,7 @@ void EVENT_USB_Device_ControlRequest(void) uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); /* Only handle SET CURRENT requests to the audio endpoint's sample frequency property */ - if ((EndpointAddress == (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) + if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; @@ -216,7 +215,7 @@ void EVENT_USB_Device_ControlRequest(void) uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); /* Only handle GET CURRENT requests to the audio endpoint's sample frequency property */ - if ((EndpointAddress == (ENDPOINT_DIR_OUT | AUDIO_STREAM_EPNUM)) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) + if ((EndpointAddress == AUDIO_STREAM_EPADDR) && (EndpointControl == AUDIO_EPCONTROL_SamplingFreq)) { uint8_t SampleRate[3]; @@ -241,7 +240,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) uint8_t PrevEndpoint = Endpoint_GetCurrentEndpoint(); /* Select the audio stream endpoint */ - Endpoint_SelectEndpoint(AUDIO_STREAM_EPNUM); + Endpoint_SelectEndpoint(AUDIO_STREAM_EPADDR); /* Check if the current endpoint can be read from (contains a packet) and the host is sending data */ if (Endpoint_IsOUTReceived() && StreamingAudioInterfaceSelected) diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.c b/Demos/Device/LowLevel/AudioOutput/Descriptors.c index 7f12fc72c..12a5a1562 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.c +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.c @@ -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_EPNUM), + .EndpointAddress = AUDIO_STREAM_EPADDR, .Attributes = (EP_TYPE_ISOCHRONOUS | ENDPOINT_ATTR_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = AUDIO_STREAM_EPSIZE, .PollingIntervalMS = 0x01 diff --git a/Demos/Device/LowLevel/AudioOutput/Descriptors.h b/Demos/Device/LowLevel/AudioOutput/Descriptors.h index ac0a536de..e0c756744 100644 --- a/Demos/Device/LowLevel/AudioOutput/Descriptors.h +++ b/Demos/Device/LowLevel/AudioOutput/Descriptors.h @@ -42,14 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the Audio isochronous streaming data endpoint. */ - #define AUDIO_STREAM_EPNUM 1 + /** Endpoint address of the Audio isochronous streaming data OUT endpoint. */ + #define AUDIO_STREAM_EPADDR (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 diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c index 5df6808c6..1a4860ad3 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.c @@ -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_EPNUM), + .EndpointAddress = CDC1_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -183,20 +183,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC1_RX_EPNUM), + .EndpointAddress = CDC1_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC1_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC1_TX_EPNUM), + .EndpointAddress = CDC1_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_IAD = @@ -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_EPNUM), + .EndpointAddress = CDC2_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -284,20 +284,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC2_RX_EPNUM), + .EndpointAddress = CDC2_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC2_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC2_TX_EPNUM), + .EndpointAddress = CDC2_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h index 0a172d83d..fee2c8552 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/DualVirtualSerial/Descriptors.h @@ -42,23 +42,23 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the first CDC interface's device-to-host data IN endpoint. */ - #define CDC1_TX_EPNUM 1 + /** Endpoint address of the first CDC interface's device-to-host data IN endpoint. */ + #define CDC1_TX_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the first CDC interface's host-to-device data OUT endpoint. */ - #define CDC1_RX_EPNUM 2 + /** Endpoint address of the first CDC interface's host-to-device data OUT endpoint. */ + #define CDC1_RX_EPADDR (ENDPOINT_DIR_OUT | 2) - /** Endpoint number of the first CDC interface's device-to-host notification IN endpoint. */ - #define CDC1_NOTIFICATION_EPNUM 3 + /** Endpoint address of the first CDC interface's device-to-host notification IN endpoint. */ + #define CDC1_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the second CDC interface's device-to-host data IN endpoint. */ - #define CDC2_TX_EPNUM 4 + /** Endpoint address of the second CDC interface's device-to-host data IN endpoint. */ + #define CDC2_TX_EPADDR (ENDPOINT_DIR_IN | 4) - /** Endpoint number of the second CDC interface's host-to-device data OUT endpoint. */ - #define CDC2_RX_EPNUM 5 + /** Endpoint address of the second CDC interface's host-to-device data OUT endpoint. */ + #define CDC2_RX_EPADDR (ENDPOINT_DIR_OUT | 5) - /** Endpoint number of the second CDC interface's device-to-host notification IN endpoint. */ - #define CDC2_NOTIFICATION_EPNUM 6 + /** Endpoint address of the second CDC interface's device-to-host notification IN endpoint. */ + #define CDC2_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 6) /** Size in bytes of the CDC device-to-host notification IN endpoints. */ #define CDC_NOTIFICATION_EPSIZE 8 diff --git a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c index 9208b2c44..2db6f4e23 100644 --- a/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c +++ b/Demos/Device/LowLevel/DualVirtualSerial/DualVirtualSerial.c @@ -123,20 +123,14 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup first CDC Interface's Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC1_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1); /* Setup second CDC Interface's Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC2_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1); /* Reset line encoding baud rates so that the host knows to send new values */ LineEncoding1.BaudRateBPS = 0; @@ -224,7 +218,7 @@ void CDC1_Task(void) ActionSent = true; /* Select the Serial Tx Endpoint */ - Endpoint_SelectEndpoint(CDC1_TX_EPNUM); + Endpoint_SelectEndpoint(CDC1_TX_EPADDR); /* Write the String to the Endpoint */ Endpoint_Write_Stream_LE(ReportString, strlen(ReportString), NULL); @@ -240,7 +234,7 @@ void CDC1_Task(void) } /* Select the Serial Rx Endpoint */ - Endpoint_SelectEndpoint(CDC1_RX_EPNUM); + Endpoint_SelectEndpoint(CDC1_RX_EPADDR); /* Throw away any received data from the host */ if (Endpoint_IsOUTReceived()) @@ -257,7 +251,7 @@ void CDC2_Task(void) return; /* Select the Serial Rx Endpoint */ - Endpoint_SelectEndpoint(CDC2_RX_EPNUM); + Endpoint_SelectEndpoint(CDC2_RX_EPADDR); /* Check to see if any data has been received */ if (Endpoint_IsOUTReceived()) @@ -275,7 +269,7 @@ void CDC2_Task(void) Endpoint_ClearOUT(); /* Select the Serial Tx Endpoint */ - Endpoint_SelectEndpoint(CDC2_TX_EPNUM); + Endpoint_SelectEndpoint(CDC2_TX_EPADDR); /* Write the received data to the endpoint */ Endpoint_Write_Stream_LE(&Buffer, DataLength, NULL); diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.c b/Demos/Device/LowLevel/GenericHID/Descriptors.c index 2dcdcf030..3a6f13526 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.c +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.c @@ -143,20 +143,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | GENERIC_IN_EPNUM), + .EndpointAddress = GENERIC_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_ReportOUTEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | GENERIC_OUT_EPNUM), + .EndpointAddress = GENERIC_OUT_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = GENERIC_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/GenericHID/Descriptors.h b/Demos/Device/LowLevel/GenericHID/Descriptors.h index 4647a05f0..e47220a1c 100644 --- a/Demos/Device/LowLevel/GenericHID/Descriptors.h +++ b/Demos/Device/LowLevel/GenericHID/Descriptors.h @@ -58,11 +58,11 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Generic HID reporting IN endpoint. */ - #define GENERIC_IN_EPNUM 1 + /** Endpoint address of the Generic HID reporting IN endpoint. */ + #define GENERIC_IN_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the Generic HID reporting OUT endpoint. */ - #define GENERIC_OUT_EPNUM 2 + /** Endpoint address of the Generic HID reporting OUT endpoint. */ + #define GENERIC_OUT_EPADDR (ENDPOINT_DIR_OUT | 2) /** Size in bytes of the Generic HID reporting endpoint. */ #define GENERIC_EPSIZE 8 diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c index 4d61acfb6..c36c33f7e 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.c +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c @@ -95,10 +95,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup HID Report Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - GENERIC_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, - GENERIC_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_IN_EPADDR, EP_TYPE_INTERRUPT, GENERIC_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(GENERIC_OUT_EPADDR, EP_TYPE_INTERRUPT, GENERIC_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -200,7 +198,7 @@ void HID_Task(void) if (USB_DeviceState != DEVICE_STATE_Configured) return; - Endpoint_SelectEndpoint(GENERIC_OUT_EPNUM); + Endpoint_SelectEndpoint(GENERIC_OUT_EPADDR); /* Check to see if a packet has been sent from the host */ if (Endpoint_IsOUTReceived()) @@ -222,7 +220,7 @@ void HID_Task(void) Endpoint_ClearOUT(); } - Endpoint_SelectEndpoint(GENERIC_IN_EPNUM); + Endpoint_SelectEndpoint(GENERIC_IN_EPADDR); /* Check to see if the host is ready to accept another packet */ if (Endpoint_IsINReady()) diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.c b/Demos/Device/LowLevel/Joystick/Descriptors.c index 272595d99..bcadacda5 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.c +++ b/Demos/Device/LowLevel/Joystick/Descriptors.c @@ -155,10 +155,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | JOYSTICK_EPNUM), + .EndpointAddress = JOYSTICK_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = JOYSTICK_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/Joystick/Descriptors.h b/Demos/Device/LowLevel/Joystick/Descriptors.h index 93b315b4e..bc90fb7cc 100644 --- a/Demos/Device/LowLevel/Joystick/Descriptors.h +++ b/Demos/Device/LowLevel/Joystick/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Joystick HID reporting IN endpoint. */ - #define JOYSTICK_EPNUM 1 + /** Endpoint address of the Joystick HID reporting IN endpoint. */ + #define JOYSTICK_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Joystick HID reporting IN endpoint. */ #define JOYSTICK_EPSIZE 8 diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index 9e84b61f9..cfdfaae2f 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -96,8 +96,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup HID Report Endpoint */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - JOYSTICK_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(JOYSTICK_EPADDR, EP_TYPE_INTERRUPT, JOYSTICK_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -183,7 +182,7 @@ void HID_Task(void) return; /* Select the Joystick Report Endpoint */ - Endpoint_SelectEndpoint(JOYSTICK_EPNUM); + Endpoint_SelectEndpoint(JOYSTICK_EPADDR); /* Check to see if the host is ready for another packet */ if (Endpoint_IsINReady()) diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.c b/Demos/Device/LowLevel/Keyboard/Descriptors.c index 46b9fdec5..f4e294239 100644 --- a/Demos/Device/LowLevel/Keyboard/Descriptors.c +++ b/Demos/Device/LowLevel/Keyboard/Descriptors.c @@ -160,20 +160,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM), + .EndpointAddress = KEYBOARD_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID_ReportOUTEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | KEYBOARD_OUT_EPNUM), + .EndpointAddress = KEYBOARD_OUT_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/Keyboard/Descriptors.h b/Demos/Device/LowLevel/Keyboard/Descriptors.h index 3c0ea1797..2e1fe3c81 100644 --- a/Demos/Device/LowLevel/Keyboard/Descriptors.h +++ b/Demos/Device/LowLevel/Keyboard/Descriptors.h @@ -59,11 +59,11 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_IN_EPNUM 1 + /** Endpoint address of the Keyboard HID reporting IN endpoint. */ + #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the Keyboard HID reporting OUT endpoint. */ - #define KEYBOARD_OUT_EPNUM 2 + /** Endpoint address of the Keyboard HID reporting OUT endpoint. */ + #define KEYBOARD_OUT_EPADDR (ENDPOINT_DIR_OUT | 2) /** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */ #define KEYBOARD_EPSIZE 8 diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c index 45bf010fc..3755d09de 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.c +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c @@ -117,10 +117,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup HID Report Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, - KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPADDR, EP_TYPE_INTERRUPT, KEYBOARD_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPADDR, EP_TYPE_INTERRUPT, KEYBOARD_EPSIZE, 1); /* Turn on Start-of-Frame events for tracking HID report period expiry */ USB_Device_EnableSOFEvents(); @@ -315,7 +313,7 @@ void SendNextReport(void) } /* Select the Keyboard Report Endpoint */ - Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); + Endpoint_SelectEndpoint(KEYBOARD_IN_EPADDR); /* Check if Keyboard Endpoint Ready for Read/Write and if we should send a new report */ if (Endpoint_IsReadWriteAllowed() && SendReport) @@ -335,7 +333,7 @@ void SendNextReport(void) void ReceiveNextReport(void) { /* Select the Keyboard LED Report Endpoint */ - Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM); + Endpoint_SelectEndpoint(KEYBOARD_OUT_EPADDR); /* Check if Keyboard LED Endpoint contains a packet */ if (Endpoint_IsOUTReceived()) diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c index 9d02fa45c..a058373fa 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c +++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.c @@ -195,20 +195,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM), + .EndpointAddress = KEYBOARD_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID1_ReportOUTEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | KEYBOARD_OUT_EPNUM), + .EndpointAddress = KEYBOARD_OUT_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .HID2_MouseInterface = @@ -242,10 +242,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_IN_EPNUM), + .EndpointAddress = MOUSE_IN_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = HID_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h index 573cb65b6..178f5ed99 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h +++ b/Demos/Device/LowLevel/KeyboardMouse/Descriptors.h @@ -65,14 +65,14 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Keyboard HID reporting IN endpoint. */ - #define KEYBOARD_IN_EPNUM 1 + /** Endpoint address of the Keyboard HID reporting IN endpoint. */ + #define KEYBOARD_IN_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the Keyboard HID reporting OUT endpoint. */ - #define KEYBOARD_OUT_EPNUM 2 + /** Endpoint address of the Keyboard HID reporting OUT endpoint. */ + #define KEYBOARD_OUT_EPADDR (ENDPOINT_DIR_OUT | 2) - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_IN_EPNUM 3 + /** Endpoint address of the Mouse HID reporting IN endpoint. */ + #define MOUSE_IN_EPADDR (ENDPOINT_DIR_IN | 3) /** Size in bytes of each of the HID reporting IN and OUT endpoints. */ #define HID_EPSIZE 8 diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index 4de6f64c9..a916659ea 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -104,14 +104,11 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup Keyboard HID Report Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - HID_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT, - HID_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_IN_EPADDR, EP_TYPE_INTERRUPT, HID_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(KEYBOARD_OUT_EPADDR, EP_TYPE_INTERRUPT, HID_EPSIZE, 1); /* Setup Mouse HID Report Endpoint */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - HID_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_IN_EPADDR, EP_TYPE_INTERRUPT, HID_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -236,7 +233,7 @@ void Keyboard_HID_Task(void) } /* Select the Keyboard Report Endpoint */ - Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); + Endpoint_SelectEndpoint(KEYBOARD_IN_EPADDR); /* Check if Keyboard Endpoint Ready for Read/Write */ if (Endpoint_IsReadWriteAllowed()) @@ -252,7 +249,7 @@ void Keyboard_HID_Task(void) } /* Select the Keyboard LED Report Endpoint */ - Endpoint_SelectEndpoint(KEYBOARD_OUT_EPNUM); + Endpoint_SelectEndpoint(KEYBOARD_OUT_EPADDR); /* Check if Keyboard LED Endpoint Ready for Read/Write */ if (Endpoint_IsReadWriteAllowed()) @@ -294,7 +291,7 @@ void Mouse_HID_Task(void) } /* Select the Mouse Report Endpoint */ - Endpoint_SelectEndpoint(MOUSE_IN_EPNUM); + Endpoint_SelectEndpoint(MOUSE_IN_EPADDR); /* Check if Mouse Endpoint Ready for Read/Write */ if (Endpoint_IsReadWriteAllowed()) diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.c b/Demos/Device/LowLevel/MIDI/Descriptors.c index 9ad0e86a5..44db1eee5 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.c +++ b/Demos/Device/LowLevel/MIDI/Descriptors.c @@ -199,10 +199,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM), + .EndpointAddress = MIDI_STREAM_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, @@ -224,10 +224,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Audio_Descriptor_StreamEndpoint_Std_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM), + .EndpointAddress = MIDI_STREAM_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MIDI_STREAM_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .Refresh = 0, diff --git a/Demos/Device/LowLevel/MIDI/Descriptors.h b/Demos/Device/LowLevel/MIDI/Descriptors.h index 5415a31cd..7947a463c 100644 --- a/Demos/Device/LowLevel/MIDI/Descriptors.h +++ b/Demos/Device/LowLevel/MIDI/Descriptors.h @@ -42,11 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the MIDI streaming data IN endpoint, for device-to-host data transfers. */ - #define MIDI_STREAM_IN_EPNUM 1 + /** Endpoint address of the MIDI streaming data IN endpoint, for device-to-host data transfers. */ + #define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */ - #define MIDI_STREAM_OUT_EPNUM 2 + /** Endpoint address of the MIDI streaming data OUT endpoint, for host-to-device data transfers. */ + #define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | 2) /** Endpoint size in bytes of the Audio isochronous streaming data IN and OUT endpoints. */ #define MIDI_STREAM_EPSIZE 64 diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index a29a8c86b..335c7143e 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -94,10 +94,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup MIDI Data Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, - MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, - MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -114,7 +112,7 @@ void MIDI_Task(void) if (USB_DeviceState != DEVICE_STATE_Configured) return; - Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPNUM); + Endpoint_SelectEndpoint(MIDI_STREAM_IN_EPADDR); if (Endpoint_IsINReady()) { @@ -162,8 +160,7 @@ void MIDI_Task(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, @@ -182,7 +179,7 @@ void MIDI_Task(void) } /* Select the MIDI OUT stream */ - Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPNUM); + Endpoint_SelectEndpoint(MIDI_STREAM_OUT_EPADDR); /* Check if a MIDI command has been received */ if (Endpoint_IsOUTReceived()) @@ -193,7 +190,7 @@ void MIDI_Task(void) Endpoint_Read_Stream_LE(&MIDIEvent, sizeof(MIDIEvent), NULL); /* Check to see if the sent command is a note on message with a non-zero velocity */ - if ((MIDIEvent.Command == (MIDI_COMMAND_NOTE_ON >> 4)) && (MIDIEvent.Data3 > 0)) + if ((MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)) && (MIDIEvent.Data3 > 0)) { /* Change LEDs depending on the pitch of the sent note */ LEDs_SetAllLEDs(MIDIEvent.Data2 > 64 ? LEDS_LED1 : LEDS_LED2); diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.c b/Demos/Device/LowLevel/MassStorage/Descriptors.c index fb829423a..5c62f7fb1 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.c +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.c @@ -118,20 +118,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM), + .EndpointAddress = MASS_STORAGE_IN_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .MS_DataOutEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM), + .EndpointAddress = MASS_STORAGE_OUT_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MASS_STORAGE_IO_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/MassStorage/Descriptors.h b/Demos/Device/LowLevel/MassStorage/Descriptors.h index 0e7a91ffd..34a85f6d1 100644 --- a/Demos/Device/LowLevel/MassStorage/Descriptors.h +++ b/Demos/Device/LowLevel/MassStorage/Descriptors.h @@ -42,11 +42,11 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the Mass Storage device-to-host data IN endpoint. */ - #define MASS_STORAGE_IN_EPNUM 3 + /** Endpoint address of the Mass Storage device-to-host data IN endpoint. */ + #define MASS_STORAGE_IN_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the Mass Storage host-to-device data OUT endpoint. */ - #define MASS_STORAGE_OUT_EPNUM 4 + /** Endpoint address of the Mass Storage host-to-device data OUT endpoint. */ + #define MASS_STORAGE_OUT_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the Mass Storage data endpoints. */ #define MASS_STORAGE_IO_EPSIZE 64 diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index 947636cf8..0e8e1083b 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -118,10 +118,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup Mass Storage Data Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, - MASS_STORAGE_IO_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, - MASS_STORAGE_IO_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_IN_EPADDR, EP_TYPE_BULK, MASS_STORAGE_IO_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MASS_STORAGE_OUT_EPADDR, EP_TYPE_BULK, MASS_STORAGE_IO_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -180,7 +178,7 @@ void MassStorage_Task(void) /* Check direction of command, select Data IN endpoint if data is from the device */ if (CommandBlock.Flags & MS_COMMAND_DIR_DATA_IN) - Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR); /* Decode the received SCSI command, set returned status code */ CommandStatus.Status = SCSI_DecodeSCSICommand() ? MS_SCSI_COMMAND_Pass : MS_SCSI_COMMAND_Fail; @@ -206,13 +204,13 @@ void MassStorage_Task(void) if (IsMassStoreReset) { /* Reset the data endpoint banks */ - Endpoint_ResetEndpoint(MASS_STORAGE_OUT_EPNUM); - Endpoint_ResetEndpoint(MASS_STORAGE_IN_EPNUM); + Endpoint_ResetEndpoint(MASS_STORAGE_OUT_EPADDR); + Endpoint_ResetEndpoint(MASS_STORAGE_IN_EPADDR); - Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPADDR); Endpoint_ClearStall(); Endpoint_ResetDataToggle(); - Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR); Endpoint_ClearStall(); Endpoint_ResetDataToggle(); @@ -231,7 +229,7 @@ static bool ReadInCommandBlock(void) uint16_t BytesTransferred; /* Select the Data Out endpoint */ - Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPADDR); /* Abort if no command has been sent from the host */ if (!(Endpoint_IsOUTReceived())) @@ -256,7 +254,7 @@ static bool ReadInCommandBlock(void) { /* Stall both data pipes until reset by host */ Endpoint_StallTransaction(); - Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR); Endpoint_StallTransaction(); return false; @@ -286,7 +284,7 @@ static void ReturnCommandStatus(void) uint16_t BytesTransferred; /* Select the Data Out endpoint */ - Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_OUT_EPADDR); /* While data pipe is stalled, wait until the host issues a control request to clear the stall */ while (Endpoint_IsStalled()) @@ -297,7 +295,7 @@ static void ReturnCommandStatus(void) } /* Select the Data In endpoint */ - Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPNUM); + Endpoint_SelectEndpoint(MASS_STORAGE_IN_EPADDR); /* While data pipe is stalled, wait until the host issues a control request to clear the stall */ while (Endpoint_IsStalled()) diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.c b/Demos/Device/LowLevel/Mouse/Descriptors.c index d42fb835c..03ea0e71f 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.c +++ b/Demos/Device/LowLevel/Mouse/Descriptors.c @@ -155,10 +155,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM), + .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/Mouse/Descriptors.h b/Demos/Device/LowLevel/Mouse/Descriptors.h index da78dd0ff..abcd938a8 100644 --- a/Demos/Device/LowLevel/Mouse/Descriptors.h +++ b/Demos/Device/LowLevel/Mouse/Descriptors.h @@ -41,6 +41,13 @@ #include <avr/pgmspace.h> + /* Macros: */ + /** Endpoint address of the Mouse HID reporting IN endpoint. */ + #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1) + + /** Size in bytes of the Mouse HID reporting IN endpoint. */ + #define MOUSE_EPSIZE 8 + /* Type Defines: */ /** Type define for the device configuration descriptor structure. This must be defined in the * application code, as the configuration descriptor contains several sub-descriptors which @@ -56,13 +63,6 @@ USB_Descriptor_Endpoint_t HID_ReportINEndpoint; } USB_Descriptor_Configuration_t; - /* Macros: */ - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_EPNUM 1 - - /** Size in bytes of the Mouse HID reporting IN endpoint. */ - #define MOUSE_EPSIZE 8 - /* Function Prototypes: */ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, const uint8_t wIndex, diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index 98da9be92..e9f92e4a2 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -116,8 +116,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup HID Report Endpoint */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MOUSE_EPADDR, EP_TYPE_INTERRUPT, MOUSE_EPSIZE, 1); /* Turn on Start-of-Frame events for tracking HID report period expiry */ USB_Device_EnableSOFEvents(); @@ -271,7 +270,7 @@ void SendNextReport(void) } /* Select the Mouse Report Endpoint */ - Endpoint_SelectEndpoint(MOUSE_EPNUM); + Endpoint_SelectEndpoint(MOUSE_EPADDR); /* Check if Mouse Endpoint Ready for Read/Write and if we should send a new report */ if (Endpoint_IsReadWriteAllowed() && SendReport) diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c index 41bc4b59e..d1ca1df04 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.c @@ -131,7 +131,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -157,20 +157,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .RNDIS_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h index 9ffa5262f..6337335ac 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h +++ b/Demos/Device/LowLevel/RNDISEthernet/Descriptors.h @@ -42,14 +42,14 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 1 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 1) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 2 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 2) - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 3 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 3) /** Size in bytes of the CDC data IN and OUT endpoints. */ #define CDC_TXRX_EPSIZE 64 diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index a36ecf4bb..c041bb91a 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -104,12 +104,9 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup RNDIS Data Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); @@ -170,7 +167,7 @@ void EVENT_USB_Device_ControlRequest(void) void RNDIS_Task(void) { /* Select the notification endpoint */ - Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPNUM); + Endpoint_SelectEndpoint(CDC_NOTIFICATION_EPADDR); /* Check if a message response is ready for the host */ if (Endpoint_IsINReady() && ResponseReady) @@ -201,7 +198,7 @@ void RNDIS_Task(void) RNDIS_Packet_Message_t RNDISPacketHeader; /* Select the data OUT endpoint */ - Endpoint_SelectEndpoint(CDC_RX_EPNUM); + Endpoint_SelectEndpoint(CDC_RX_EPADDR); /* Check if the data OUT endpoint contains data, and that the IN buffer is empty */ if (Endpoint_IsOUTReceived() && !(FrameIN.FrameLength)) @@ -227,7 +224,7 @@ void RNDIS_Task(void) } /* Select the data IN endpoint */ - Endpoint_SelectEndpoint(CDC_TX_EPNUM); + Endpoint_SelectEndpoint(CDC_TX_EPADDR); /* Check if the data IN endpoint is ready for more data, and that the IN buffer is full */ if (Endpoint_IsINReady() && FrameOUT.FrameLength) diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c index f4e9fb324..9dcf4e4d4 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.c +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.c @@ -143,7 +143,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM), + .EndpointAddress = CDC_NOTIFICATION_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_NOTIFICATION_EPSIZE, .PollingIntervalMS = 0xFF @@ -169,20 +169,20 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_OUT | CDC_RX_EPNUM), + .EndpointAddress = CDC_RX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 }, .CDC_DataInEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | CDC_TX_EPNUM), + .EndpointAddress = CDC_TX_EPADDR, .Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = CDC_TXRX_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h index 765345bc3..36ec8f9ff 100644 --- a/Demos/Device/LowLevel/VirtualSerial/Descriptors.h +++ b/Demos/Device/LowLevel/VirtualSerial/Descriptors.h @@ -42,14 +42,14 @@ #include <avr/pgmspace.h> /* Macros: */ - /** Endpoint number of the CDC device-to-host notification IN endpoint. */ - #define CDC_NOTIFICATION_EPNUM 2 + /** Endpoint address of the CDC device-to-host notification IN endpoint. */ + #define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | 2) - /** Endpoint number of the CDC device-to-host data IN endpoint. */ - #define CDC_TX_EPNUM 3 + /** Endpoint address of the CDC device-to-host data IN endpoint. */ + #define CDC_TX_EPADDR (ENDPOINT_DIR_IN | 3) - /** Endpoint number of the CDC host-to-device data OUT endpoint. */ - #define CDC_RX_EPNUM 4 + /** Endpoint address of the CDC host-to-device data OUT endpoint. */ + #define CDC_RX_EPADDR (ENDPOINT_DIR_OUT | 4) /** Size in bytes of the CDC device-to-host notification IN endpoint. */ #define CDC_NOTIFICATION_EPSIZE 8 diff --git a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c index 93fd4353e..7d185481d 100644 --- a/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c +++ b/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.c @@ -109,12 +109,9 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup CDC Data Endpoints */ - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - CDC_NOTIFICATION_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_IN, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPNUM, EP_TYPE_BULK, ENDPOINT_DIR_OUT, - CDC_TXRX_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPADDR, EP_TYPE_INTERRUPT, CDC_NOTIFICATION_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_TX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); + ConfigSuccess &= Endpoint_ConfigureEndpoint(CDC_RX_EPADDR, EP_TYPE_BULK, CDC_TXRX_EPSIZE, 1); /* Reset line encoding baud rate so that the host knows to send new values */ LineEncoding.BaudRateBPS = 0; @@ -201,7 +198,7 @@ void CDC_Task(void) ActionSent = true; /* Select the Serial Tx Endpoint */ - Endpoint_SelectEndpoint(CDC_TX_EPNUM); + Endpoint_SelectEndpoint(CDC_TX_EPADDR); /* Write the String to the Endpoint */ Endpoint_Write_Stream_LE(ReportString, strlen(ReportString), NULL); @@ -225,7 +222,7 @@ void CDC_Task(void) } /* Select the Serial Rx Endpoint */ - Endpoint_SelectEndpoint(CDC_RX_EPNUM); + Endpoint_SelectEndpoint(CDC_RX_EPADDR); /* Throw away any received data from the host */ if (Endpoint_IsOUTReceived()) diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c index 2ee35de87..71643be29 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.c @@ -136,10 +136,10 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | MOUSE_EPNUM), + .EndpointAddress = MOUSE_EPADDR, .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = MOUSE_EPSIZE, - .PollingIntervalMS = 0x01 + .PollingIntervalMS = 0x05 } }; diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h index da78dd0ff..14cb8e9a3 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/Descriptors.h @@ -57,8 +57,8 @@ } USB_Descriptor_Configuration_t; /* Macros: */ - /** Endpoint number of the Mouse HID reporting IN endpoint. */ - #define MOUSE_EPNUM 1 + /** Endpoint address of the Mouse HID reporting IN endpoint. */ + #define MOUSE_EPADDR (ENDPOINT_DIR_IN | 1) /** Size in bytes of the Mouse HID reporting IN endpoint. */ #define MOUSE_EPSIZE 8 diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c index 16fc3fb2b..39a682a60 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/DeviceFunctions.c @@ -48,11 +48,12 @@ USB_ClassInfo_HID_Device_t Mouse_HID_Device_Interface = .Config = { .InterfaceNumber = 0, - - .ReportINEndpointNumber = MOUSE_EPNUM, - .ReportINEndpointSize = MOUSE_EPSIZE, - .ReportINEndpointDoubleBank = false, - + .ReportINEndpoint = + { + .Address = MOUSE_EPADDR, + .Size = MOUSE_EPSIZE, + .Banks = 1, + }, .PrevReportINBuffer = PrevMouseHIDReportBuffer, .PrevReportINBufferSize = sizeof(PrevMouseHIDReportBuffer), }, diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c index a71e85b5a..29def30d5 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/HostFunctions.c @@ -44,9 +44,16 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Host_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataOUTPipeNumber = 2, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataINPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_MouseBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c index d0737acd7..4c53cc221 100644 --- a/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/ClassDriver/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -44,12 +44,16 @@ USB_ClassInfo_AOA_Host_t AndroidDevice_AOA_Interface = {
.Config =
{
- .DataINPipeNumber = 1,
- .DataINPipeDoubleBank = false,
-
- .DataOUTPipeNumber = 2,
- .DataOUTPipeDoubleBank = false,
-
+ .DataINPipe =
+ {
+ .Address = (PIPE_DIR_IN | 1),
+ .Banks = 1,
+ },
+ .DataOUTPipe =
+ {
+ .Address = (PIPE_DIR_OUT | 2),
+ .Banks = 1,
+ },
.PropertyStrings =
{
[AOA_STRING_Manufacturer] = "Dean Camera",
diff --git a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c index 3e4a69a05..aa274932f 100644 --- a/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c +++ b/Demos/Host/ClassDriver/AudioInputHost/AudioInputHost.c @@ -44,7 +44,10 @@ USB_ClassInfo_Audio_Host_t Microphone_Audio_Interface = { .Config = { - .DataINPipeNumber = 1, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + }, }, }; @@ -179,7 +182,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) } USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000); - if (Audio_Host_GetSetEndpointProperty(&Microphone_Audio_Interface, Microphone_Audio_Interface.Config.DataINPipeNumber, + if (Audio_Host_GetSetEndpointProperty(&Microphone_Audio_Interface, Microphone_Audio_Interface.Config.DataINPipe.Address, AUDIO_REQ_SetCurrent, AUDIO_EPCONTROL_SamplingFreq, sizeof(SampleRate), &SampleRate) != HOST_SENDCONTROL_Successful) { diff --git a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c index 783b0a5e5..833be1b2c 100644 --- a/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c +++ b/Demos/Host/ClassDriver/AudioOutputHost/AudioOutputHost.c @@ -44,7 +44,10 @@ USB_ClassInfo_Audio_Host_t Speaker_Audio_Interface = { .Config = { - .DataOUTPipeNumber = 1, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + }, }, }; @@ -187,7 +190,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) } USB_Audio_SampleFreq_t SampleRate = AUDIO_SAMPLE_FREQ(48000); - if (Audio_Host_GetSetEndpointProperty(&Speaker_Audio_Interface, Speaker_Audio_Interface.Config.DataOUTPipeNumber, + if (Audio_Host_GetSetEndpointProperty(&Speaker_Audio_Interface, Speaker_Audio_Interface.Config.DataOUTPipe.Address, AUDIO_REQ_SetCurrent, AUDIO_EPCONTROL_SamplingFreq, sizeof(SampleRate), &SampleRate) != HOST_SENDCONTROL_Successful) { diff --git a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c index 5d912497d..18c02d769 100644 --- a/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c +++ b/Demos/Host/ClassDriver/JoystickHostWithParser/JoystickHostWithParser.c @@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Joystick_HID_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, - .HIDParserData = &HIDReportInfo }, }; diff --git a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c index f67cd1161..69499089b 100644 --- a/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c +++ b/Demos/Host/ClassDriver/KeyboardHost/KeyboardHost.c @@ -44,12 +44,16 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_KeyboardBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c index 4247e9e56..6ef182000 100644 --- a/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c +++ b/Demos/Host/ClassDriver/KeyboardHostWithParser/KeyboardHostWithParser.c @@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Keyboard_HID_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, - .HIDParserData = &HIDReportInfo }, }; diff --git a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c index 8293fbd3b..472d19aee 100644 --- a/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c +++ b/Demos/Host/ClassDriver/MIDIHost/MIDIHost.c @@ -44,11 +44,16 @@ USB_ClassInfo_MIDI_Host_t Keyboard_MIDI_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, }, }; @@ -106,8 +111,8 @@ void JoystickHost_Task(void) MIDI_EventPacket_t MIDIEvent; while (MIDI_Host_ReceiveEventPacket(&Keyboard_MIDI_Interface, &MIDIEvent)) { - bool NoteOnEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4)); - bool NoteOffEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4)); + bool NoteOnEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)); + bool NoteOffEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)); /* Display note events from the host */ if (NoteOnEvent || NoteOffEvent) @@ -168,8 +173,7 @@ void CheckJoystickMovement(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, diff --git a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c index 10c7f7921..aacc07879 100644 --- a/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c +++ b/Demos/Host/ClassDriver/MassStorageHost/MassStorageHost.c @@ -44,11 +44,16 @@ USB_ClassInfo_MS_Host_t FlashDisk_MS_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, }, }; diff --git a/Demos/Host/ClassDriver/MouseHost/MouseHost.c b/Demos/Host/ClassDriver/MouseHost/MouseHost.c index 4272591d5..1290e4855 100644 --- a/Demos/Host/ClassDriver/MouseHost/MouseHost.c +++ b/Demos/Host/ClassDriver/MouseHost/MouseHost.c @@ -44,12 +44,16 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_MouseBootProtocol, }, }; diff --git a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c index 857d49412..8004b5ca1 100644 --- a/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c +++ b/Demos/Host/ClassDriver/MouseHostWithParser/MouseHostWithParser.c @@ -47,14 +47,17 @@ USB_ClassInfo_HID_Host_t Mouse_HID_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, .HIDInterfaceProtocol = HID_CSCP_NonBootProtocol, - .HIDParserData = &HIDReportInfo }, }; diff --git a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c index 3df0eedf2..51157a315 100644 --- a/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c +++ b/Demos/Host/ClassDriver/PrinterHost/PrinterHost.c @@ -44,11 +44,16 @@ USB_ClassInfo_PRNT_Host_t Printer_PRNT_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, }, }; diff --git a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c index f03ee4967..d27aab143 100644 --- a/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c +++ b/Demos/Host/ClassDriver/RNDISEthernetHost/RNDISEthernetHost.c @@ -47,16 +47,22 @@ USB_ClassInfo_RNDIS_Host_t Ethernet_RNDIS_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - - .NotificationPipeNumber = 3, - .NotificationPipeDoubleBank = false, - - .HostMaxPacketSize = sizeof(PacketBuffer), + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, + .NotificationPipe = + { + .Address = (PIPE_DIR_IN | 3), + .Banks = 1, + }, + .HostMaxPacketSize = sizeof(PacketBuffer), }, }; diff --git a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c index eeac14d11..9a89452af 100644 --- a/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c +++ b/Demos/Host/ClassDriver/StillImageHost/StillImageHost.c @@ -44,14 +44,21 @@ USB_ClassInfo_SI_Host_t DigitalCamera_SI_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - - .EventsPipeNumber = 3, - .EventsPipeDoubleBank = false, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, + .EventsPipe = + { + .Address = (PIPE_DIR_IN | 3), + .Banks = 1, + }, }, }; diff --git a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c index 631925e45..bce7804b4 100644 --- a/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c +++ b/Demos/Host/ClassDriver/VirtualSerialHost/VirtualSerialHost.c @@ -44,14 +44,21 @@ USB_ClassInfo_CDC_Host_t VirtualSerial_CDC_Interface = { .Config = { - .DataINPipeNumber = 1, - .DataINPipeDoubleBank = false, - - .DataOUTPipeNumber = 2, - .DataOUTPipeDoubleBank = false, - - .NotificationPipeNumber = 3, - .NotificationPipeDoubleBank = false, + .DataINPipe = + { + .Address = (PIPE_DIR_IN | 1), + .Banks = 1, + }, + .DataOUTPipe = + { + .Address = (PIPE_DIR_OUT | 2), + .Banks = 1, + }, + .NotificationPipe = + { + .Address = (PIPE_DIR_IN | 3), + .Banks = 1, + }, }, }; diff --git a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c index 7d1050601..fa19052a8 100644 --- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c +++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.c @@ -105,16 +105,13 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the Bluetooth data IN pipe */ - Pipe_ConfigurePipe(BLUETOOTH_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(BLUETOOTH_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the Bluetooth data OUT pipe */ - Pipe_ConfigurePipe(BLUETOOTH_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(BLUETOOTH_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Configure the Bluetooth events pipe */ - Pipe_ConfigurePipe(BLUETOOTH_EVENTS_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(BLUETOOTH_EVENTS_PIPE, EP_TYPE_INTERRUPT, EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(EventsEndpoint->PollingIntervalMS); /* Valid data found, return success */ diff --git a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h index 9c40fcdcb..c46add71a 100644 --- a/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h +++ b/Demos/Host/Incomplete/BluetoothHost/ConfigDescriptor.h @@ -40,9 +40,9 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - #define BLUETOOTH_DATA_IN_PIPE 1 - #define BLUETOOTH_DATA_OUT_PIPE 2 - #define BLUETOOTH_EVENTS_PIPE 3 + #define BLUETOOTH_DATA_IN_PIPE (PIPE_DIR_IN | 1) + #define BLUETOOTH_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) + #define BLUETOOTH_EVENTS_PIPE (PIPE_DIR_IN | 3) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c index 1b8613b69..6db853267 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c @@ -95,12 +95,10 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the Android Accessory data IN pipe */ - Pipe_ConfigurePipe(ANDROID_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(ANDROID_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the Android Accessory data OUT pipe */ - Pipe_ConfigurePipe(ANDROID_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(ANDROID_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Valid data found, return success */ return SuccessfulConfigRead; diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h index 05e1b91e1..53b7280b4 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.h @@ -40,8 +40,11 @@ #include <LUFA/Drivers/USB/USB.h> /* Macros: */ - #define ANDROID_DATA_IN_PIPE 1 - #define ANDROID_DATA_OUT_PIPE 2 + /** Pipe address of the Android Accessory data IN pipe. */ + #define ANDROID_DATA_IN_PIPE (PIPE_DIR_IN | 1) + + /** Pipe address of the Android Accessory data OUT pipe. */ + #define ANDROID_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c index b26dbb80e..9274e633d 100644 --- a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.c @@ -130,8 +130,7 @@ uint8_t ProcessConfigurationDescriptor(void) StreamingEndpointAddress = DataINEndpoint->EndpointAddress; /* Configure the Audio data IN pipe */ - Pipe_ConfigurePipe(AUDIO_DATA_IN_PIPE, EP_TYPE_ISOCHRONOUS, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_DOUBLE); + Pipe_ConfigurePipe(AUDIO_DATA_IN_PIPE, EP_TYPE_ISOCHRONOUS, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 2); /* Valid data found, return success */ return SuccessfulConfigRead; diff --git a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h index a5f425900..84d27c7e6 100644 --- a/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/AudioInputHost/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "AudioInputHost.h" /* Macros: */ - /** Pipe number for the Audio data IN pipe. */ - #define AUDIO_DATA_IN_PIPE 1 + /** Pipe address for the Audio data IN pipe. */ + #define AUDIO_DATA_IN_PIPE (PIPE_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf b/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf index b98cf1f14..44513ef35 100644 --- a/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf +++ b/Demos/Host/LowLevel/AudioInputHost/Doxygen.conf @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = "LUFA Library - Audio Input Host" +PROJECT_NAME = "LUFA Library - Audio Input Host Demo" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c index 99980fd3d..cc2506274 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.c @@ -130,8 +130,7 @@ uint8_t ProcessConfigurationDescriptor(void) StreamingEndpointAddress = DataOUTEndpoint->EndpointAddress; /* Configure the Audio data OUT pipe */ - Pipe_ConfigurePipe(AUDIO_DATA_OUT_PIPE, EP_TYPE_ISOCHRONOUS, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_DOUBLE); + Pipe_ConfigurePipe(AUDIO_DATA_OUT_PIPE, EP_TYPE_ISOCHRONOUS, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 2); /* Valid data found, return success */ return SuccessfulConfigRead; diff --git a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h index dcf367e15..0c4f06766 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/AudioOutputHost/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "AudioOutputHost.h" /* Macros: */ - /** Pipe number for the Audio data OUT pipe. */ - #define AUDIO_DATA_OUT_PIPE 1 + /** Pipe address for the Audio data OUT pipe. */ + #define AUDIO_DATA_OUT_PIPE (PIPE_DIR_OUT | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf b/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf index 55c9bb563..9cb0e55a2 100644 --- a/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf +++ b/Demos/Host/LowLevel/AudioOutputHost/Doxygen.conf @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = "LUFA Library - Audio Output Host" +PROJECT_NAME = "LUFA Library - Audio Output Host Demo" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c index 6df253cb5..9067450e2 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.c @@ -109,16 +109,14 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the HID data IN pipe */ - Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(HID_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS); /* Check if the HID interface contained an optional OUT data endpoint */ if (DataOUTEndpoint) { /* Configure the HID data OUT pipe */ - Pipe_ConfigurePipe(HID_DATA_OUT_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(HID_DATA_OUT_PIPE, EP_TYPE_INTERRUPT, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); } /* Valid data found, return success */ diff --git a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h index 4614893d5..547f1545b 100644 --- a/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/GenericHIDHost/ConfigDescriptor.h @@ -42,11 +42,11 @@ #include "GenericHIDHost.h" /* Macros: */ - /** Pipe number for the HID data IN pipe. */ - #define HID_DATA_IN_PIPE 1 + /** Pipe address for the HID data IN pipe. */ + #define HID_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number for the HID data OUT pipe. */ - #define HID_DATA_OUT_PIPE 2 + /** Pipe address for the HID data OUT pipe. */ + #define HID_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c index 4f7a0d61b..be6eb09cd 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.c @@ -110,8 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the HID data IN pipe */ - Pipe_ConfigurePipe(JOYSTICK_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(JOYSTICK_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS); /* Get the HID report size from the HID report descriptor */ diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h index 69fdfedf2..fba5713b2 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/JoystickHostWithParser/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "HIDReport.h" /* Macros: */ - /** Pipe number for the joystick report data pipe. */ - #define JOYSTICK_DATA_IN_PIPE 1 + /** Pipe address for the joystick report data pipe. */ + #define JOYSTICK_DATA_IN_PIPE (PIPE_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf b/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf index 4366e6edd..65c60866b 100644 --- a/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf +++ b/Demos/Host/LowLevel/JoystickHostWithParser/Doxygen.conf @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = "LUFA Library - Joystick Host (Using HID Descriptor Parser)" +PROJECT_NAME = "LUFA Library - Joystick Host Demo (Using HID Descriptor Parser)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c index cfcee7b8b..73dc5dfe5 100644 --- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.c @@ -98,8 +98,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the HID data IN pipe */ - Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS); /* Valid data found, return success */ diff --git a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h index 5b44d3fd5..eb09f695f 100644 --- a/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/KeyboardHost/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "KeyboardHost.h" /* Macros: */ - /** Pipe number for the keyboard data IN pipe. */ - #define KEYBOARD_DATA_IN_PIPE 1 + /** Pipe address for the keyboard data IN pipe. */ + #define KEYBOARD_DATA_IN_PIPE (PIPE_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c index 765b325f0..ddd43590b 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.c @@ -110,8 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the HID data IN pipe */ - Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(KEYBOARD_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS); /* Get the HID report size from the HID report descriptor */ diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h index ffa2afd8e..c40211cb0 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "HIDReport.h" /* Macros: */ - /** Pipe number for the keyboard report data pipe. */ - #define KEYBOARD_DATA_IN_PIPE 1 + /** Pipe address for the keyboard report data IN pipe. */ + #define KEYBOARD_DATA_IN_PIPE (PIPE_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf b/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf index 9f76d7efd..3e481571d 100644 --- a/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf +++ b/Demos/Host/LowLevel/KeyboardHostWithParser/Doxygen.conf @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = "LUFA Library - Keyboard Host (Using HID Descriptor Parser)" +PROJECT_NAME = "LUFA Library - Keyboard Host Demo (Using HID Descriptor Parser)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c index 39e513cf6..70381ea56 100644 --- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.c @@ -105,12 +105,10 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the MIDI data IN pipe */ - Pipe_ConfigurePipe(MIDI_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(MIDI_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the MIDI data OUT pipe */ - Pipe_ConfigurePipe(MIDI_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(MIDI_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Valid data found, return success */ return SuccessfulConfigRead; diff --git a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h index d41513e4e..40d4dc9cc 100644 --- a/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MIDIHost/ConfigDescriptor.h @@ -42,11 +42,11 @@ #include "MIDIHost.h" /* Macros: */ - /** Pipe number for the MIDI data IN pipe. */ - #define MIDI_DATA_IN_PIPE 1 + /** Pipe address for the MIDI data IN pipe. */ + #define MIDI_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number for the MIDI data OUT pipe. */ - #define MIDI_DATA_OUT_PIPE 2 + /** Pipe address for the MIDI data OUT pipe. */ + #define MIDI_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c index 060761f58..f4a52accd 100644 --- a/Demos/Host/LowLevel/MIDIHost/MIDIHost.c +++ b/Demos/Host/LowLevel/MIDIHost/MIDIHost.c @@ -177,8 +177,8 @@ void MIDIHost_Task(void) if (!(Pipe_BytesInPipe())) Pipe_ClearIN(); - bool NoteOnEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_ON >> 4)); - bool NoteOffEvent = ((MIDIEvent.Command & 0x0F) == (MIDI_COMMAND_NOTE_OFF >> 4)); + bool NoteOnEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_ON)); + bool NoteOffEvent = (MIDIEvent.Event == MIDI_EVENT(0, MIDI_COMMAND_NOTE_OFF)); if (NoteOnEvent || NoteOffEvent) { @@ -237,8 +237,7 @@ void MIDIHost_Task(void) { MIDI_EventPacket_t MIDIEvent = (MIDI_EventPacket_t) { - .CableNumber = 0, - .Command = (MIDICommand >> 4), + .Event = MIDI_EVENT(0, MIDICommand), .Data1 = MIDICommand | Channel, .Data2 = MIDIPitch, diff --git a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c index 566cdb10c..0e967f972 100644 --- a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.c @@ -105,12 +105,10 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the Mass Storage data IN pipe */ - Pipe_ConfigurePipe(MASS_STORE_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(MASS_STORE_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the Mass Storage data OUT pipe */ - Pipe_ConfigurePipe(MASS_STORE_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(MASS_STORE_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Valid data found, return success */ return SuccessfulConfigRead; diff --git a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h index a40debd98..eb0746b04 100644 --- a/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MassStorageHost/ConfigDescriptor.h @@ -51,11 +51,11 @@ /** Interface Protocol value for the Bulk Only transport protocol. */ #define MASS_STORE_PROTOCOL 0x50 - /** Pipe number of the Mass Storage data IN pipe. */ - #define MASS_STORE_DATA_IN_PIPE 1 + /** Pipe address of the Mass Storage data IN pipe. */ + #define MASS_STORE_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number of the Mass Storage data OUT pipe. */ - #define MASS_STORE_DATA_OUT_PIPE 2 + /** Pipe address of the Mass Storage data OUT pipe. */ + #define MASS_STORE_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c index c33e08769..4992e3a67 100644 --- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.c @@ -98,8 +98,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the HID data IN pipe */ - Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS); /* Valid data found, return success */ diff --git a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h index 9619c44ac..14051a6a9 100644 --- a/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MouseHost/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "MouseHost.h" /* Macros: */ - /** Pipe number for the mouse data IN pipe. */ - #define MOUSE_DATA_IN_PIPE 1 + /** Pipe address for the mouse data IN pipe. */ + #define MOUSE_DATA_IN_PIPE (PIPE_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c index c6647007c..7d63d2bdb 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.c @@ -110,8 +110,7 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the HID data IN pipe */ - Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(MOUSE_DATA_IN_PIPE, EP_TYPE_INTERRUPT, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(DataINEndpoint->PollingIntervalMS); /* Get the HID report size from the HID report descriptor */ diff --git a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h index 799761bba..0a2582bfe 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/MouseHostWithParser/ConfigDescriptor.h @@ -42,8 +42,8 @@ #include "HIDReport.h" /* Macros: */ - /** Pipe number for the mouse report data pipe. */ - #define MOUSE_DATA_IN_PIPE 1 + /** Pipe address for the mouse report data IN pipe. */ + #define MOUSE_DATA_IN_PIPE (ENDPOINT_DIR_IN | 1) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf b/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf index fcf83567f..b41e8d85a 100644 --- a/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf +++ b/Demos/Host/LowLevel/MouseHostWithParser/Doxygen.conf @@ -26,7 +26,7 @@ DOXYFILE_ENCODING = UTF-8 # identify the project. Note that if you do not use Doxywizard you need # to put quotes around the project name if it contains spaces. -PROJECT_NAME = "LUFA Library - Mouse Host (Using HID Descriptor Parser)" +PROJECT_NAME = "LUFA Library - Mouse Host Demo (Using HID Descriptor Parser)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or diff --git a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c index f259c1fd8..922734f33 100644 --- a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.c @@ -108,12 +108,10 @@ uint8_t ProcessConfigurationDescriptor(void) PrinterAltSetting = PrinterInterface->AlternateSetting; /* Configure the Printer data IN pipe */ - Pipe_ConfigurePipe(PRINTER_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(PRINTER_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the Printer data OUT pipe */ - Pipe_ConfigurePipe(PRINTER_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(PRINTER_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Valid data found, return success */ return SuccessfulConfigRead; diff --git a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h index cc9e2cb44..d5a32cddf 100644 --- a/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/PrinterHost/ConfigDescriptor.h @@ -38,11 +38,11 @@ #include "Lib/PrinterCommands.h" /* Macros: */ - /** Pipe number of the Printer data IN pipe. */ - #define PRINTER_DATA_IN_PIPE 1 + /** Pipe address of the Printer data IN pipe. */ + #define PRINTER_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number of the Printer data OUT pipe. */ - #define PRINTER_DATA_OUT_PIPE 2 + /** Pipe address of the Printer data OUT pipe. */ + #define PRINTER_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c index 04930009e..df317ef62 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.c @@ -131,16 +131,13 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the RNDIS data IN pipe */ - Pipe_ConfigurePipe(RNDIS_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(RNDIS_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the RNDIS data OUT pipe */ - Pipe_ConfigurePipe(RNDIS_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(RNDIS_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Configure the RNDIS notification pipe */ - Pipe_ConfigurePipe(RNDIS_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(RNDIS_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(NotificationEndpoint->PollingIntervalMS); /* Valid data found, return success */ diff --git a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h index e9cf19f4c..19f26b408 100644 --- a/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/RNDISEthernetHost/ConfigDescriptor.h @@ -42,14 +42,14 @@ #include "RNDISEthernetHost.h" /* Macros: */ - /** Pipe number for the RNDIS data IN pipe. */ - #define RNDIS_DATA_IN_PIPE 1 + /** Pipe address for the RNDIS data IN pipe. */ + #define RNDIS_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number for the RNDIS data OUT pipe. */ - #define RNDIS_DATA_OUT_PIPE 2 + /** Pipe address for the RNDIS data OUT pipe. */ + #define RNDIS_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) - /** Pipe number for the RNDIS notification pipe. */ - #define RNDIS_NOTIFICATION_PIPE 3 + /** Pipe address for the RNDIS notification IN pipe. */ + #define RNDIS_NOTIFICATION_PIPE (PIPE_DIR_IN | 3) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c index 269dc3ba4..c5c78ce60 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.c @@ -115,16 +115,13 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the Still Image data IN pipe */ - Pipe_ConfigurePipe(SIMAGE_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(SIMAGE_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the Still Image data OUT pipe */ - Pipe_ConfigurePipe(SIMAGE_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(SIMAGE_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Configure the Still Image events pipe */ - Pipe_ConfigurePipe(SIMAGE_EVENTS_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(SIMAGE_EVENTS_PIPE, EP_TYPE_INTERRUPT, EventsEndpoint->EndpointAddress, EventsEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(EventsEndpoint->PollingIntervalMS); /* Valid data found, return success */ diff --git a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h index 04b81a281..93dcfc644 100644 --- a/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/StillImageHost/ConfigDescriptor.h @@ -42,14 +42,14 @@ #include "StillImageHost.h" /* Macros: */ - /** Pipe number of the Still Image data IN pipe. */ - #define SIMAGE_DATA_IN_PIPE 1 + /** Pipe address of the Still Image data IN pipe. */ + #define SIMAGE_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number of the Still Image data OUT pipe. */ - #define SIMAGE_DATA_OUT_PIPE 2 + /** Pipe address of the Still Image data OUT pipe. */ + #define SIMAGE_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) - /** Pipe number of the Still Image events pipe. */ - #define SIMAGE_EVENTS_PIPE 3 + /** Pipe address of the Still Image events IN pipe. */ + #define SIMAGE_EVENTS_PIPE (PIPE_DIR_IN | 3) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c index 4126d761d..552b02aff 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.c @@ -131,16 +131,13 @@ uint8_t ProcessConfigurationDescriptor(void) } /* Configure the CDC data IN pipe */ - Pipe_ConfigurePipe(CDC_DATA_IN_PIPE, EP_TYPE_BULK, PIPE_TOKEN_IN, - DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(CDC_DATA_IN_PIPE, EP_TYPE_BULK, DataINEndpoint->EndpointAddress, DataINEndpoint->EndpointSize, 1); /* Configure the CDC data OUT pipe */ - Pipe_ConfigurePipe(CDC_DATA_OUT_PIPE, EP_TYPE_BULK, PIPE_TOKEN_OUT, - DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(CDC_DATA_OUT_PIPE, EP_TYPE_BULK, DataOUTEndpoint->EndpointAddress, DataOUTEndpoint->EndpointSize, 1); /* Configure the CDC notification pipe */ - Pipe_ConfigurePipe(CDC_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, PIPE_TOKEN_IN, - NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, PIPE_BANK_SINGLE); + Pipe_ConfigurePipe(CDC_NOTIFICATION_PIPE, EP_TYPE_INTERRUPT, NotificationEndpoint->EndpointAddress, NotificationEndpoint->EndpointSize, 1); Pipe_SetInterruptPeriod(NotificationEndpoint->PollingIntervalMS); /* Valid data found, return success */ diff --git a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h index c5a60b48a..e9f12dcc4 100644 --- a/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h +++ b/Demos/Host/LowLevel/VirtualSerialHost/ConfigDescriptor.h @@ -42,14 +42,14 @@ #include "VirtualSerialHost.h" /* Macros: */ - /** Pipe number for the CDC data IN pipe. */ - #define CDC_DATA_IN_PIPE 1 + /** Pipe address for the CDC data IN pipe. */ + #define CDC_DATA_IN_PIPE (PIPE_DIR_IN | 1) - /** Pipe number for the CDC data OUT pipe. */ - #define CDC_DATA_OUT_PIPE 2 + /** Pipe address for the CDC data OUT pipe. */ + #define CDC_DATA_OUT_PIPE (PIPE_DIR_OUT | 2) - /** Pipe number for the CDC notification pipe. */ - #define CDC_NOTIFICATION_PIPE 3 + /** Pipe address for the CDC notification IN pipe. */ + #define CDC_NOTIFICATION_PIPE (PIPE_DIR_IN | 3) /* Enums: */ /** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */ |