diff options
| author | hathach <[email protected]> | 2018-04-12 13:23:52 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-04-12 13:23:52 +0700 |
| commit | 4b660175beea2c76a1a761e3840937d9784ab201 (patch) | |
| tree | 2d3b595aa8bf9e1ffcb7dd1feafd92275e92994e | |
| parent | 3d31f921068d906f6f63f59a3b10784f28e97d4d (diff) | |
rename CFG_TUSB_DEVICE_* to CFG_TUD_*
40 files changed, 113 insertions, 113 deletions
diff --git a/doxygen/configuration.txt b/doxygen/configuration.txt index 9c6b4a3c6..e79345416 100644 --- a/doxygen/configuration.txt +++ b/doxygen/configuration.txt @@ -56,7 +56,7 @@ /** \defgroup CFG_TUSB_DEVICE Device Options * @{ */ -#define CFG_TUSB_DEVICE_ENDOINT0_SIZE ///< Max packet size of Cotnrol Endpoint, default is 64 +#define CFG_TUD_ENDOINT0_SIZE ///< Max packet size of Cotnrol Endpoint, default is 64 /// Application MUST define this variable and initialize its pointers's member to all required USB descriptors including /// Device Descriptor, Configuration Descriptor, String Descriptors, HID Report Descriptors etc ... @@ -65,11 +65,11 @@ tusbd_descriptor_pointer_t tusbd_descriptor_pointers; /** \defgroup config_device_class Class Driver * \brief For each Class Driver a value of 1 means enable, value of 0 mean disable * @{ */ -#define CFG_TUSB_DEVICE_HID_KEYBOARD ///< Enable HID Class for Keyboard -#define CFG_TUSB_DEVICE_HID_MOUSE ///< Enable HID Class for Mouse -#define CFG_TUSB_DEVICE_HID_GENERIC ///< Enable HID Class for Generic (not supported yet) -#define CFG_TUSB_DEVICE_MSC ///< Enable Mass Storage Class (SCSI subclass only) -#define CFG_TUSB_DEVICE_CDC ///< Enable Virtual Serial (Communication Device Class) +#define CFG_TUD_HID_KEYBOARD ///< Enable HID Class for Keyboard +#define CFG_TUD_HID_MOUSE ///< Enable HID Class for Mouse +#define CFG_TUD_HID_GENERIC ///< Enable HID Class for Generic (not supported yet) +#define CFG_TUD_MSC ///< Enable Mass Storage Class (SCSI subclass only) +#define CFG_TUD_CDC ///< Enable Virtual Serial (Communication Device Class) /** @} */ /** @} */ // group Device diff --git a/examples/device/device_virtual_com/src/main.c b/examples/device/device_virtual_com/src/main.c index 68837e134..531733cdc 100644 --- a/examples/device/device_virtual_com/src/main.c +++ b/examples/device/device_virtual_com/src/main.c @@ -147,8 +147,8 @@ void print_greeting(void) puts("This DEVICE demo is configured to support:"); printf(" - RTOS = %s\n", rtos_name[CFG_TUSB_OS]); - if (CFG_TUSB_DEVICE_HID_MOUSE ) puts(" - HID Mouse"); - if (CFG_TUSB_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard"); - if (CFG_TUSB_DEVICE_MSC ) puts(" - Mass Storage"); - if (CFG_TUSB_DEVICE_CDC ) puts(" - Communication Device Class"); + if (CFG_TUD_HID_MOUSE ) puts(" - HID Mouse"); + if (CFG_TUD_HID_KEYBOARD ) puts(" - HID Keyboard"); + if (CFG_TUD_MSC ) puts(" - Mass Storage"); + if (CFG_TUD_CDC ) puts(" - Communication Device Class"); } diff --git a/examples/device/device_virtual_com/src/tusb_config.h b/examples/device/device_virtual_com/src/tusb_config.h index 26ed087bc..7d2a9c539 100644 --- a/examples/device/device_virtual_com/src/tusb_config.h +++ b/examples/device/device_virtual_com/src/tusb_config.h @@ -54,14 +54,14 @@ //--------------------------------------------------------------------+ // DEVICE CONFIGURATION //--------------------------------------------------------------------+ -#define CFG_TUSB_DEVICE_ENDOINT0_SIZE 64 +#define CFG_TUD_ENDOINT0_SIZE 64 //------------- CLASS -------------// -#define CFG_TUSB_DEVICE_HID_KEYBOARD 0 -#define CFG_TUSB_DEVICE_HID_MOUSE 0 -#define CFG_TUSB_DEVICE_HID_GENERIC 0 // not supported yet -#define CFG_TUSB_DEVICE_MSC 0 -#define CFG_TUSB_DEVICE_CDC 1 +#define CFG_TUD_HID_KEYBOARD 0 +#define CFG_TUD_HID_MOUSE 0 +#define CFG_TUD_HID_GENERIC 0 // not supported yet +#define CFG_TUD_MSC 0 +#define CFG_TUD_CDC 1 //--------------------------------------------------------------------+ // COMMON CONFIGURATION diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.c b/examples/device/device_virtual_com/src/tusb_descriptors.c index 6a057d0a4..09543e0de 100644 --- a/examples/device/device_virtual_com/src/tusb_descriptors.c +++ b/examples/device/device_virtual_com/src/tusb_descriptors.c @@ -53,7 +53,7 @@ tusb_desc_device_t const desc_device = .bDeviceSubClass = MISC_SUBCLASS_COMMON, .bDeviceProtocol = MISC_PROTOCOL_IAD, - .bMaxPacketSize0 = CFG_TUSB_DEVICE_ENDOINT0_SIZE, + .bMaxPacketSize0 = CFG_TUD_ENDOINT0_SIZE, .idVendor = CFG_VENDORID, .idProduct = CFG_PRODUCTID, diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.h b/examples/device/device_virtual_com/src/tusb_descriptors.h index 2d362bc0b..0c80579e1 100644 --- a/examples/device/device_virtual_com/src/tusb_descriptors.h +++ b/examples/device/device_virtual_com/src/tusb_descriptors.h @@ -50,7 +50,7 @@ // each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug. // Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB) #ifndef CFG_PRODUCTID - #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##interface) << (n) ) + #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUD_##interface) << (n) ) #define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \ PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \ PRODUCTID_BITMAP(MSC, 4) ) ) diff --git a/examples/device/nrf52840/src/main.c b/examples/device/nrf52840/src/main.c index 42dfaaaa5..9b173c802 100644 --- a/examples/device/nrf52840/src/main.c +++ b/examples/device/nrf52840/src/main.c @@ -145,8 +145,8 @@ void print_greeting(void) printf("This DEVICE demo is configured to support:"); printf(" - RTOS = %s\n", rtos_name[CFG_TUSB_OS]); - if (CFG_TUSB_DEVICE_HID_MOUSE ) puts(" - HID Mouse"); - if (CFG_TUSB_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard"); - if (CFG_TUSB_DEVICE_MSC ) puts(" - Mass Storage"); - if (CFG_TUSB_DEVICE_CDC ) puts(" - Communication Device Class"); + if (CFG_TUD_HID_MOUSE ) puts(" - HID Mouse"); + if (CFG_TUD_HID_KEYBOARD ) puts(" - HID Keyboard"); + if (CFG_TUD_MSC ) puts(" - Mass Storage"); + if (CFG_TUD_CDC ) puts(" - Communication Device Class"); } diff --git a/examples/device/nrf52840/src/msc_device_app.c b/examples/device/nrf52840/src/msc_device_app.c index 6609257e2..1730975dd 100644 --- a/examples/device/nrf52840/src/msc_device_app.c +++ b/examples/device/nrf52840/src/msc_device_app.c @@ -38,7 +38,7 @@ #include "msc_device_app.h" -#if CFG_TUSB_DEVICE_MSC +#if CFG_TUD_MSC //--------------------------------------------------------------------+ // INCLUDE //--------------------------------------------------------------------+ diff --git a/examples/device/nrf52840/src/msc_device_app.h b/examples/device/nrf52840/src/msc_device_app.h index 83b460743..0ed04d285 100644 --- a/examples/device/nrf52840/src/msc_device_app.h +++ b/examples/device/nrf52840/src/msc_device_app.h @@ -50,7 +50,7 @@ extern "C" { #endif -#if CFG_TUSB_DEVICE_MSC +#if CFG_TUD_MSC enum { diff --git a/examples/device/nrf52840/src/msc_device_ramdisk.c b/examples/device/nrf52840/src/msc_device_ramdisk.c index 45932e0c3..bb9c53e4c 100644 --- a/examples/device/nrf52840/src/msc_device_ramdisk.c +++ b/examples/device/nrf52840/src/msc_device_ramdisk.c @@ -38,7 +38,7 @@ #include "msc_device_app.h" -#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_RAMDISK) +#if CFG_TUD_MSC && defined (MSCD_APP_RAMDISK) //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF diff --git a/examples/device/nrf52840/src/tusb_config.h b/examples/device/nrf52840/src/tusb_config.h index 0f7ff7b8c..c58798040 100644 --- a/examples/device/nrf52840/src/tusb_config.h +++ b/examples/device/nrf52840/src/tusb_config.h @@ -54,14 +54,14 @@ //--------------------------------------------------------------------+ // DEVICE CONFIGURATION //--------------------------------------------------------------------+ -#define CFG_TUSB_DEVICE_ENDOINT0_SIZE 64 +#define CFG_TUD_ENDOINT0_SIZE 64 //------------- CLASS -------------// -#define CFG_TUSB_DEVICE_HID_KEYBOARD 0 -#define CFG_TUSB_DEVICE_HID_MOUSE 0 -#define CFG_TUSB_DEVICE_HID_GENERIC 0 // not supported yet -#define CFG_TUSB_DEVICE_MSC 1 -#define CFG_TUSB_DEVICE_CDC 1 +#define CFG_TUD_HID_KEYBOARD 0 +#define CFG_TUD_HID_MOUSE 0 +#define CFG_TUD_HID_GENERIC 0 // not supported yet +#define CFG_TUD_MSC 1 +#define CFG_TUD_CDC 1 //--------------------------------------------------------------------+ // COMMON CONFIGURATION diff --git a/examples/device/nrf52840/src/tusb_descriptors.c b/examples/device/nrf52840/src/tusb_descriptors.c index b8f0a89d9..b7256c2e7 100644 --- a/examples/device/nrf52840/src/tusb_descriptors.c +++ b/examples/device/nrf52840/src/tusb_descriptors.c @@ -53,7 +53,7 @@ tusb_desc_device_t const desc_device = .bDeviceSubClass = MISC_SUBCLASS_COMMON, .bDeviceProtocol = MISC_PROTOCOL_IAD, - .bMaxPacketSize0 = CFG_TUSB_DEVICE_ENDOINT0_SIZE, + .bMaxPacketSize0 = CFG_TUD_ENDOINT0_SIZE, .idVendor = CFG_VENDORID, .idProduct = CFG_PRODUCTID, diff --git a/examples/device/nrf52840/src/tusb_descriptors.h b/examples/device/nrf52840/src/tusb_descriptors.h index b8d07357e..03269cca7 100644 --- a/examples/device/nrf52840/src/tusb_descriptors.h +++ b/examples/device/nrf52840/src/tusb_descriptors.h @@ -50,7 +50,7 @@ // each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug. // Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB) #ifndef CFG_PRODUCTID - #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##interface) << (n) ) + #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUD_##interface) << (n) ) #define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \ PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \ PRODUCTID_BITMAP(MSC, 4) ) ) diff --git a/examples/obsolete/device/src/cdc_device_app.c b/examples/obsolete/device/src/cdc_device_app.c index d72e6bcd9..c6e903fcf 100644 --- a/examples/obsolete/device/src/cdc_device_app.c +++ b/examples/obsolete/device/src/cdc_device_app.c @@ -38,7 +38,7 @@ #include "cdc_device_app.h" -#if CFG_TUSB_DEVICE_CDC +#if CFG_TUD_CDC #include "common/tusb_fifo.h" // TODO refractor #include "app_os_prio.h" diff --git a/examples/obsolete/device/src/cdc_device_app.h b/examples/obsolete/device/src/cdc_device_app.h index 45f02baef..71b4bdf28 100644 --- a/examples/obsolete/device/src/cdc_device_app.h +++ b/examples/obsolete/device/src/cdc_device_app.h @@ -53,7 +53,7 @@ extern "C" { #endif -#if CFG_TUSB_DEVICE_CDC +#if CFG_TUD_CDC void cdc_serial_app_init(void); void cdc_serial_app_task(void* param); diff --git a/examples/obsolete/device/src/keyboard_device_app.c b/examples/obsolete/device/src/keyboard_device_app.c index a4ae81a46..df9172c68 100644 --- a/examples/obsolete/device/src/keyboard_device_app.c +++ b/examples/obsolete/device/src/keyboard_device_app.c @@ -38,7 +38,7 @@ #include "keyboard_device_app.h" -#if CFG_TUSB_DEVICE_HID_KEYBOARD +#if CFG_TUD_HID_KEYBOARD //--------------------------------------------------------------------+ // INCLUDE //--------------------------------------------------------------------+ diff --git a/examples/obsolete/device/src/keyboard_device_app.h b/examples/obsolete/device/src/keyboard_device_app.h index 1d2a8b39e..45c843876 100644 --- a/examples/obsolete/device/src/keyboard_device_app.h +++ b/examples/obsolete/device/src/keyboard_device_app.h @@ -53,7 +53,7 @@ extern "C" { #endif -#if CFG_TUSB_DEVICE_HID_KEYBOARD +#if CFG_TUD_HID_KEYBOARD void keyboard_app_init(void); void keyboard_app_task(void* param); diff --git a/examples/obsolete/device/src/main.c b/examples/obsolete/device/src/main.c index 5d1a4bb5f..e11bbc7cd 100644 --- a/examples/obsolete/device/src/main.c +++ b/examples/obsolete/device/src/main.c @@ -194,8 +194,8 @@ void print_greeting(void) puts("This DEVICE demo is configured to support:"); printf(" - RTOS = %s\n", rtos_name[CFG_TUSB_OS]); - if (CFG_TUSB_DEVICE_HID_MOUSE ) puts(" - HID Mouse"); - if (CFG_TUSB_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard"); - if (CFG_TUSB_DEVICE_MSC ) puts(" - Mass Storage"); - if (CFG_TUSB_DEVICE_CDC ) puts(" - Communication Device Class"); + if (CFG_TUD_HID_MOUSE ) puts(" - HID Mouse"); + if (CFG_TUD_HID_KEYBOARD ) puts(" - HID Keyboard"); + if (CFG_TUD_MSC ) puts(" - Mass Storage"); + if (CFG_TUD_CDC ) puts(" - Communication Device Class"); } diff --git a/examples/obsolete/device/src/mouse_device_app.c b/examples/obsolete/device/src/mouse_device_app.c index 3cc2e0d68..9bbb799df 100644 --- a/examples/obsolete/device/src/mouse_device_app.c +++ b/examples/obsolete/device/src/mouse_device_app.c @@ -38,7 +38,7 @@ #include "mouse_device_app.h" -#if CFG_TUSB_DEVICE_HID_MOUSE +#if CFG_TUD_HID_MOUSE //--------------------------------------------------------------------+ // INCLUDE //--------------------------------------------------------------------+ diff --git a/examples/obsolete/device/src/mouse_device_app.h b/examples/obsolete/device/src/mouse_device_app.h index 48bfb3315..2eeb5794a 100644 --- a/examples/obsolete/device/src/mouse_device_app.h +++ b/examples/obsolete/device/src/mouse_device_app.h @@ -53,7 +53,7 @@ extern "C" { #endif -#if CFG_TUSB_DEVICE_HID_MOUSE +#if CFG_TUD_HID_MOUSE void mouse_app_init(void); void mouse_app_task(void * param); diff --git a/examples/obsolete/device/src/msc_device_app.c b/examples/obsolete/device/src/msc_device_app.c index df78ccd6e..81dab9258 100644 --- a/examples/obsolete/device/src/msc_device_app.c +++ b/examples/obsolete/device/src/msc_device_app.c @@ -38,7 +38,7 @@ #include "msc_device_app.h" -#if CFG_TUSB_DEVICE_MSC +#if CFG_TUD_MSC //--------------------------------------------------------------------+ // INCLUDE //--------------------------------------------------------------------+ diff --git a/examples/obsolete/device/src/msc_device_app.h b/examples/obsolete/device/src/msc_device_app.h index 83b460743..0ed04d285 100644 --- a/examples/obsolete/device/src/msc_device_app.h +++ b/examples/obsolete/device/src/msc_device_app.h @@ -50,7 +50,7 @@ extern "C" { #endif -#if CFG_TUSB_DEVICE_MSC +#if CFG_TUD_MSC enum { diff --git a/examples/obsolete/device/src/msc_device_ramdisk.c b/examples/obsolete/device/src/msc_device_ramdisk.c index e2a7a110f..74b64d4e0 100644 --- a/examples/obsolete/device/src/msc_device_ramdisk.c +++ b/examples/obsolete/device/src/msc_device_ramdisk.c @@ -38,7 +38,7 @@ #include "msc_device_app.h" -#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_RAMDISK) +#if CFG_TUD_MSC && defined (MSCD_APP_RAMDISK) //--------------------------------------------------------------------+ // MACRO CONSTANT TYPEDEF diff --git a/examples/obsolete/device/src/msc_device_romdisk.c b/examples/obsolete/device/src/msc_device_romdisk.c index 9f80c8001..135532b61 100644 --- a/examples/obsolete/device/src/msc_device_romdisk.c +++ b/examples/obsolete/device/src/msc_device_romdisk.c @@ -38,7 +38,7 @@ #include "msc_device_app.h" -#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_ROMDISK) +#if CFG_TUD_MSC && defined (MSCD_APP_ROMDISK) //--------------------------------------------------------------------+ // INCLUDE diff --git a/examples/obsolete/device/src/tusb_config.h b/examples/obsolete/device/src/tusb_config.h index 20dd2bcfa..35101ff98 100644 --- a/examples/obsolete/device/src/tusb_config.h +++ b/examples/obsolete/device/src/tusb_config.h @@ -54,14 +54,14 @@ //--------------------------------------------------------------------+ // DEVICE CONFIGURATION //--------------------------------------------------------------------+ -#define CFG_TUSB_DEVICE_ENDOINT0_SIZE 64 +#define CFG_TUD_ENDOINT0_SIZE 64 //------------- CLASS -------------// -#define CFG_TUSB_DEVICE_HID_KEYBOARD 1 -#define CFG_TUSB_DEVICE_HID_MOUSE 1 -#define CFG_TUSB_DEVICE_HID_GENERIC 0 // not supported yet -#define CFG_TUSB_DEVICE_MSC 1 -#define CFG_TUSB_DEVICE_CDC 1 +#define CFG_TUD_HID_KEYBOARD 1 +#define CFG_TUD_HID_MOUSE 1 +#define CFG_TUD_HID_GENERIC 0 // not supported yet +#define CFG_TUD_MSC 1 +#define CFG_TUD_CDC 1 //--------------------------------------------------------------------+ // COMMON CONFIGURATION diff --git a/examples/obsolete/device/src/tusb_descriptors.c b/examples/obsolete/device/src/tusb_descriptors.c index 75ea1a88a..51e9b2b79 100644 --- a/examples/obsolete/device/src/tusb_descriptors.c +++ b/examples/obsolete/device/src/tusb_descriptors.c @@ -41,7 +41,7 @@ //--------------------------------------------------------------------+ // Keyboard Report Descriptor //--------------------------------------------------------------------+ -#if CFG_TUSB_DEVICE_HID_KEYBOARD +#if CFG_TUD_HID_KEYBOARD uint8_t const desc_keyboard_report[] = { HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ), HID_USAGE ( HID_USAGE_DESKTOP_KEYBOARD ), @@ -87,7 +87,7 @@ uint8_t const desc_keyboard_report[] = { //--------------------------------------------------------------------+ // Mouse Report Descriptor //--------------------------------------------------------------------+ -#if CFG_TUSB_DEVICE_HID_MOUSE +#if CFG_TUD_HID_MOUSE uint8_t const desc_mouse_report[] = { HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ), HID_USAGE ( HID_USAGE_DESKTOP_MOUSE ), @@ -140,7 +140,7 @@ tusb_desc_device_t const desc_device = .bLength = sizeof(tusb_desc_device_t), .bDescriptorType = TUSB_DESC_DEVICE, .bcdUSB = 0x0200, - #if CFG_TUSB_DEVICE_CDC + #if CFG_TUD_CDC // Use Interface Association Descriptor (IAD) for CDC // As required by USB Specs IAD's subclass must be common class (2) and protocol must be IAD (1) .bDeviceClass = TUSB_CLASS_MISC, @@ -152,7 +152,7 @@ tusb_desc_device_t const desc_device = .bDeviceProtocol = 0x00, #endif - .bMaxPacketSize0 = CFG_TUSB_DEVICE_ENDOINT0_SIZE, + .bMaxPacketSize0 = CFG_TUD_ENDOINT0_SIZE, .idVendor = CFG_VENDORID, .idProduct = CFG_PRODUCTID, @@ -184,7 +184,7 @@ app_descriptor_configuration_t const desc_configuration = .bMaxPower = TUSB_DESC_CONFIG_POWER_MA(500) }, - #if CFG_TUSB_DEVICE_CDC + #if CFG_TUD_CDC // IAD points to CDC Interfaces .cdc_iad = { @@ -296,7 +296,7 @@ app_descriptor_configuration_t const desc_configuration = #endif //------------- HID Keyboard -------------// - #if CFG_TUSB_DEVICE_HID_KEYBOARD + #if CFG_TUD_HID_KEYBOARD .keyboard_interface = { .bLength = sizeof(tusb_desc_interface_t), @@ -333,7 +333,7 @@ app_descriptor_configuration_t const desc_configuration = #endif //------------- HID Mouse -------------// - #if CFG_TUSB_DEVICE_HID_MOUSE + #if CFG_TUD_HID_MOUSE .mouse_interface = { .bLength = sizeof(tusb_desc_interface_t), @@ -370,7 +370,7 @@ app_descriptor_configuration_t const desc_configuration = #endif //------------- Mass Storage -------------// - #if CFG_TUSB_DEVICE_MSC + #if CFG_TUD_MSC .msc_interface = { .bLength = sizeof(tusb_desc_interface_t), @@ -465,11 +465,11 @@ tusbd_descriptor_pointer_t tusbd_descriptor_pointers = .p_configuration = (uint8_t const * ) &desc_configuration, .p_string_arr = (uint8_t const **) string_descriptor_arr, - #if CFG_TUSB_DEVICE_HID_KEYBOARD + #if CFG_TUD_HID_KEYBOARD .p_hid_keyboard_report = (uint8_t const *) desc_keyboard_report, #endif - #if CFG_TUSB_DEVICE_HID_MOUSE + #if CFG_TUD_HID_MOUSE .p_hid_mouse_report = (uint8_t const *) desc_mouse_report, #endif }; diff --git a/examples/obsolete/device/src/tusb_descriptors.h b/examples/obsolete/device/src/tusb_descriptors.h index 56ba60002..7aa4c806c 100644 --- a/examples/obsolete/device/src/tusb_descriptors.h +++ b/examples/obsolete/device/src/tusb_descriptors.h @@ -50,20 +50,20 @@ // each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug. // Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB) #ifndef CFG_PRODUCTID - #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##interface) << (n) ) + #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUD_##interface) << (n) ) #define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \ PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \ PRODUCTID_BITMAP(MSC, 4) ) ) #endif #define ITF_NUM_CDC 0 -#define INTERFACE_NO_HID_KEYBOARD (ITF_NUM_CDC + 2*(CFG_TUSB_DEVICE_CDC ? 1 : 0) ) -#define INTERFACE_NO_HID_MOUSE (INTERFACE_NO_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_KEYBOARD ) -#define INTERFACE_NO_HID_GENERIC (INTERFACE_NO_HID_MOUSE + CFG_TUSB_DEVICE_HID_MOUSE ) -#define ITF_NUM_MSC (INTERFACE_NO_HID_GENERIC + CFG_TUSB_DEVICE_HID_GENERIC ) +#define INTERFACE_NO_HID_KEYBOARD (ITF_NUM_CDC + 2*(CFG_TUD_CDC ? 1 : 0) ) +#define INTERFACE_NO_HID_MOUSE (INTERFACE_NO_HID_KEYBOARD + CFG_TUD_HID_KEYBOARD ) +#define INTERFACE_NO_HID_GENERIC (INTERFACE_NO_HID_MOUSE + CFG_TUD_HID_MOUSE ) +#define ITF_NUM_MSC (INTERFACE_NO_HID_GENERIC + CFG_TUD_HID_GENERIC ) -#define ITF_TOTAL (2*CFG_TUSB_DEVICE_CDC + CFG_TUSB_DEVICE_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_MOUSE + \ - CFG_TUSB_DEVICE_HID_GENERIC + CFG_TUSB_DEVICE_MSC) +#define ITF_TOTAL (2*CFG_TUD_CDC + CFG_TUD_HID_KEYBOARD + CFG_TUD_HID_MOUSE + \ + CFG_TUD_HID_GENERIC + CFG_TUD_MSC) #if (CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13UXX) && (ITF_TOTAL > 4) #error These MCUs do not have enough number of endpoints for the current configuration @@ -135,7 +135,7 @@ typedef struct ATTR_PACKED tusb_desc_configuration_t configuration; //------------- CDC -------------// -#if CFG_TUSB_DEVICE_CDC +#if CFG_TUD_CDC tusb_desc_interface_assoc_t cdc_iad; //CDC Control Interface @@ -153,21 +153,21 @@ typedef struct ATTR_PACKED #endif //------------- HID Keyboard -------------// -#if CFG_TUSB_DEVICE_HID_KEYBOARD +#if CFG_TUD_HID_KEYBOARD tusb_desc_interface_t keyboard_interface; tusb_hid_descriptor_hid_t keyboard_hid; tusb_desc_endpoint_t keyboard_endpoint; #endif //------------- HID Mouse -------------// -#if CFG_TUSB_DEVICE_HID_MOUSE +#if CFG_TUD_HID_MOUSE tusb_desc_interface_t mouse_interface; tusb_hid_descriptor_hid_t mouse_hid; tusb_desc_endpoint_t mouse_endpoint; #endif //------------- Mass Storage -------------// -#if CFG_TUSB_DEVICE_MSC +#if CFG_TUD_MSC tusb_desc_interface_t msc_interface; tusb_desc_endpoint_t msc_endpoint_in; tusb_desc_endpoint_t msc_endpoint_out; diff --git a/hw/mcu/nordic/nrf52/sdk/device/nrf.h b/hw/mcu/nordic/nrf52/sdk/device/nrf.h index bbba4d6c5..002ae9921 100644 --- a/hw/mcu/nordic/nrf52/sdk/device/nrf.h +++ b/hw/mcu/nordic/nrf52/sdk/device/nrf.h @@ -64,7 +64,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #if defined(_WIN32) /* Do not include nrf specific files when building for PC host */ -#elif defined(__unix) +//#elif defined(__unix) /* Do not include nrf specific files when building for PC host */ #elif defined(__APPLE__) /* Do not include nrf specific files when building for PC host */ diff --git a/tests/lpc175x_6x/test/test_usbd.c b/tests/lpc175x_6x/test/test_usbd.c index 6ace0085b..5cb7c232d 100644 --- a/tests/lpc175x_6x/test/test_usbd.c +++ b/tests/lpc175x_6x/test/test_usbd.c @@ -128,26 +128,26 @@ void test_usbd_string_descriptor(void) //------------- manufacturer string descriptor -------------// - uint32_t const manufacturer_len = sizeof(CFG_TUSB_DEVICE_STRING_MANUFACTURER) - 1; + uint32_t const manufacturer_len = sizeof(CFG_TUD_STRING_MANUFACTURER) - 1; TEST_ASSERT_EQUAL(manufacturer_len*2 + 2, app_tusb_desc_strings.manufacturer.bLength); for(uint32_t i=0; i<manufacturer_len; i++) { - TEST_ASSERT_EQUAL(CFG_TUSB_DEVICE_STRING_MANUFACTURER[i], app_tusb_desc_strings.manufacturer.unicode_string[i]); + TEST_ASSERT_EQUAL(CFG_TUD_STRING_MANUFACTURER[i], app_tusb_desc_strings.manufacturer.unicode_string[i]); } //------------- product string descriptor -------------// - uint32_t const product_len = sizeof(CFG_TUSB_DEVICE_STRING_PRODUCT) - 1; + uint32_t const product_len = sizeof(CFG_TUD_STRING_PRODUCT) - 1; TEST_ASSERT_EQUAL(product_len*2 + 2, app_tusb_desc_strings.product.bLength); for(uint32_t i=0; i < product_len; i++) { - TEST_ASSERT_EQUAL(CFG_TUSB_DEVICE_STRING_PRODUCT[i], app_tusb_desc_strings.product.unicode_string[i]); + TEST_ASSERT_EQUAL(CFG_TUD_STRING_PRODUCT[i], app_tusb_desc_strings.product.unicode_string[i]); } //------------- serial string descriptor -------------// - uint32_t const serial_len = sizeof(CFG_TUSB_DEVICE_STRING_SERIAL) - 1; + uint32_t const serial_len = sizeof(CFG_TUD_STRING_SERIAL) - 1; TEST_ASSERT_EQUAL(serial_len*2 + 2, app_tusb_desc_strings.serial.bLength); for(uint32_t i=0; i<serial_len; i++) { - TEST_ASSERT_EQUAL(CFG_TUSB_DEVICE_STRING_SERIAL[i], app_tusb_desc_strings.serial.unicode_string[i]); + TEST_ASSERT_EQUAL(CFG_TUD_STRING_SERIAL[i], app_tusb_desc_strings.serial.unicode_string[i]); } } diff --git a/tests/support/descriptor_test.h b/tests/support/descriptor_test.h index a0455f4ba..4861c3f30 100644 --- a/tests/support/descriptor_test.h +++ b/tests/support/descriptor_test.h @@ -69,7 +69,7 @@ typedef struct tusb_desc_interface_assoc_t CDC_IAD; #endif -#if 0 //&& CFG_TUSB_DEVICE_CDC +#if 0 //&& CFG_TUD_CDC //CDC - Serial //CDC Control Interface tusb_desc_interface_t CDC_CCI_Interface; diff --git a/tests/support/tusb_config.h b/tests/support/tusb_config.h index 6ed735bc7..91902acff 100644 --- a/tests/support/tusb_config.h +++ b/tests/support/tusb_config.h @@ -70,14 +70,14 @@ //--------------------------------------------------------------------+
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+
-#define CFG_TUSB_DEVICE_ENDOINT0_SIZE 64
+#define CFG_TUD_ENDOINT0_SIZE 64
//------------- CLASS -------------//
-#define CFG_TUSB_DEVICE_HID_KEYBOARD 1
-#define CFG_TUSB_DEVICE_HID_MOUSE 1
-#define CFG_TUSB_DEVICE_HID_GENERIC 0
-#define CFG_TUSB_DEVICE_MSC 1
-#define CFG_TUSB_DEVICE_CDC 1
+#define CFG_TUD_HID_KEYBOARD 1
+#define CFG_TUD_HID_MOUSE 1
+#define CFG_TUD_HID_GENERIC 0
+#define CFG_TUD_MSC 1
+#define CFG_TUD_CDC 1
//--------------------------------------------------------------------+
diff --git a/tinyusb/class/cdc/cdc_device.c b/tinyusb/class/cdc/cdc_device.c index c0a5ff6cf..26994362b 100644 --- a/tinyusb/class/cdc/cdc_device.c +++ b/tinyusb/class/cdc/cdc_device.c @@ -38,7 +38,7 @@ #include "tusb_option.h"
-#if (MODE_DEVICE_SUPPORTED && CFG_TUSB_DEVICE_CDC)
+#if (MODE_DEVICE_SUPPORTED && CFG_TUD_CDC)
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
diff --git a/tinyusb/class/hid/hid_device.c b/tinyusb/class/hid/hid_device.c index da296260e..a6080e69d 100644 --- a/tinyusb/class/hid/hid_device.c +++ b/tinyusb/class/hid/hid_device.c @@ -78,7 +78,7 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] = {
// [HID_PROTOCOL_NONE] = for HID Generic
-#if CFG_TUSB_DEVICE_HID_KEYBOARD
+#if CFG_TUD_HID_KEYBOARD
[HID_PROTOCOL_KEYBOARD] =
{
.p_interface = &keyboardd_data,
@@ -88,7 +88,7 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] = },
#endif
-#if CFG_TUSB_DEVICE_HID_MOUSE
+#if CFG_TUD_HID_MOUSE
[HID_PROTOCOL_MOUSE] =
{
.p_interface = &moused_data,
@@ -105,7 +105,7 @@ CFG_TUSB_ATTR_USBRAM STATIC_VAR uint8_t m_hid_buffer[ HIDD_BUFFER_SIZE ]; //--------------------------------------------------------------------+
// KEYBOARD APPLICATION API
//--------------------------------------------------------------------+
-#if CFG_TUSB_DEVICE_HID_KEYBOARD
+#if CFG_TUD_HID_KEYBOARD
STATIC_VAR hidd_interface_t keyboardd_data;
bool tud_hid_keyboard_busy(uint8_t rhport)
@@ -128,7 +128,7 @@ tusb_error_t tud_hid_keyboard_send(uint8_t rhport, hid_keyboard_report_t const * //--------------------------------------------------------------------+
// MOUSE APPLICATION API
//--------------------------------------------------------------------+
-#if CFG_TUSB_DEVICE_HID_MOUSE
+#if CFG_TUD_HID_MOUSE
STATIC_VAR hidd_interface_t moused_data;
bool tud_hid_mouse_is_busy(uint8_t rhport)
diff --git a/tinyusb/class/msc/msc_device.c b/tinyusb/class/msc/msc_device.c index 4c0659292..afb341f61 100644 --- a/tinyusb/class/msc/msc_device.c +++ b/tinyusb/class/msc/msc_device.c @@ -38,7 +38,7 @@ #include "tusb_option.h"
-#if (MODE_DEVICE_SUPPORTED && CFG_TUSB_DEVICE_MSC)
+#if (MODE_DEVICE_SUPPORTED && CFG_TUD_MSC)
#define _TINY_USB_SOURCE_FILE_
//--------------------------------------------------------------------+
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c index 8929212a7..4a13f471a 100644 --- a/tinyusb/device/usbd.c +++ b/tinyusb/device/usbd.c @@ -76,7 +76,7 @@ typedef struct { // MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
usbd_device_info_t usbd_devices[CONTROLLER_DEVICE_NUMBER];
-CFG_TUSB_ATTR_USBRAM CFG_TUSB_MEM_ALIGN uint8_t usbd_enum_buffer[CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE];
+CFG_TUSB_ATTR_USBRAM CFG_TUSB_MEM_ALIGN uint8_t usbd_enum_buffer[CFG_TUD_ENUM_BUFFER_SIZE];
static usbd_class_driver_t const usbd_class_drivers[] =
{
@@ -93,7 +93,7 @@ static usbd_class_driver_t const usbd_class_drivers[] = },
#endif
- #if CFG_TUSB_DEVICE_MSC
+ #if CFG_TUD_MSC
[TUSB_CLASS_MSC] =
{
.init = mscd_init,
@@ -106,7 +106,7 @@ static usbd_class_driver_t const usbd_class_drivers[] = },
#endif
- #if CFG_TUSB_DEVICE_CDC
+ #if CFG_TUD_CDC
[TUSB_CLASS_CDC] =
{
.init = cdcd_init,
@@ -489,7 +489,7 @@ static uint16_t get_descriptor(uint8_t rhport, tusb_control_request_t const * co // up to Host's length
len = min16_of(p_request->wLength, len );
- TU_ASSERT( len <= CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE, 0);
+ TU_ASSERT( len <= CFG_TUD_ENUM_BUFFER_SIZE, 0);
memcpy(usbd_enum_buffer, desc_data, len);
(*pp_buffer) = usbd_enum_buffer;
diff --git a/tinyusb/device/usbd.h b/tinyusb/device/usbd.h index 3f8fc1be9..d6955ffc7 100644 --- a/tinyusb/device/usbd.h +++ b/tinyusb/device/usbd.h @@ -63,8 +63,8 @@ typedef struct { uint8_t const * p_configuration; ///< pointer to the whole configuration descriptor, starting by \ref tusb_desc_configuration_t
uint8_t const** p_string_arr; ///< a array of pointers to string descriptors
- uint8_t const * p_hid_keyboard_report; ///< pointer to HID report descriptor of Keybaord interface. Only needed if CFG_TUSB_DEVICE_HID_KEYBOARD is enabled
- uint8_t const * p_hid_mouse_report; ///< pointer to HID report descriptor of Mouse interface. Only needed if CFG_TUSB_DEVICE_HID_MOUSE is enabled
+ uint8_t const * p_hid_keyboard_report; ///< pointer to HID report descriptor of Keybaord interface. Only needed if CFG_TUD_HID_KEYBOARD is enabled
+ uint8_t const * p_hid_mouse_report; ///< pointer to HID report descriptor of Mouse interface. Only needed if CFG_TUD_HID_MOUSE is enabled
}tusbd_descriptor_pointer_t;
// define by application
diff --git a/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c b/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c index 0a6ad97ed..09325ab88 100644 --- a/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c +++ b/tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c @@ -128,8 +128,8 @@ bool dcd_init(uint8_t rhport) //------------- user manual 11.13 usb device controller initialization -------------// LPC_USB->USBEpInd = 0;
// step 6 : set up control endpoint
- edpt_set_max_packet_size(0, CFG_TUSB_DEVICE_ENDOINT0_SIZE);
- edpt_set_max_packet_size(1, CFG_TUSB_DEVICE_ENDOINT0_SIZE);
+ edpt_set_max_packet_size(0, CFG_TUD_ENDOINT0_SIZE);
+ edpt_set_max_packet_size(1, CFG_TUD_ENDOINT0_SIZE);
bus_reset();
@@ -312,7 +312,7 @@ static inline uint16_t length_byte2dword(uint16_t length_in_bytes) static tusb_error_t pipe_control_xfer(uint8_t ep_id, uint8_t* p_buffer, uint16_t length)
{
- uint16_t const packet_len = min16_of(length, CFG_TUSB_DEVICE_ENDOINT0_SIZE);
+ uint16_t const packet_len = min16_of(length, CFG_TUD_ENDOINT0_SIZE);
if (ep_id)
{
diff --git a/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c b/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c index 460e305ac..084231b14 100644 --- a/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c +++ b/tinyusb/portable/nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c @@ -138,7 +138,7 @@ static void bus_reset(uint8_t rhport) //------------- Set up Control Endpoints (0 OUT, 1 IN) -------------//
p_dcd->qhd[0].zero_length_termination = p_dcd->qhd[1].zero_length_termination = 1;
- p_dcd->qhd[0].max_package_size = p_dcd->qhd[1].max_package_size = CFG_TUSB_DEVICE_ENDOINT0_SIZE;
+ p_dcd->qhd[0].max_package_size = p_dcd->qhd[1].max_package_size = CFG_TUD_ENDOINT0_SIZE;
p_dcd->qhd[0].qtd_overlay.next = p_dcd->qhd[1].qtd_overlay.next = QTD_NEXT_INVALID;
p_dcd->qhd[0].int_on_setup = 1; // OUT only
diff --git a/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c b/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c index 80e26cb42..65895b5dd 100644 --- a/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c +++ b/tinyusb/portable/nxp/lpc43xx_lpc18xx/hal_lpc43xx.c @@ -98,7 +98,7 @@ bool tusb_hal_init(void) #else // TODO OTG
LPC_USB0->USBMODE_D = LPC43XX_USBMODE_DEVICE;
LPC_USB0->OTGSC = (1<<3) | (1<<0) /*| (1<<16)| (1<<24)| (1<<25)| (1<<26)| (1<<27)| (1<<28)| (1<<29)| (1<<30)*/;
- #if CFG_TUSB_DEVICE_FULLSPEED // TODO for easy testing
+ #if CFG_TUD_FULLSPEED // TODO for easy testing
LPC_USB0->PORTSC1_D |= (1<<24); // force full speed
#endif
#endif
diff --git a/tinyusb/tusb.h b/tinyusb/tusb.h index f469ca33e..f719e159d 100644 --- a/tinyusb/tusb.h +++ b/tinyusb/tusb.h @@ -80,11 +80,11 @@ #include "class/hid/hid_device.h"
#endif
- #if CFG_TUSB_DEVICE_CDC
+ #if CFG_TUD_CDC
#include "class/cdc/cdc_device.h"
#endif
- #if CFG_TUSB_DEVICE_MSC
+ #if CFG_TUD_MSC
#include "class/msc/msc_device.h"
#endif
#endif
diff --git a/tinyusb/tusb_option.h b/tinyusb/tusb_option.h index 060850f82..2777dfbb3 100644 --- a/tinyusb/tusb_option.h +++ b/tinyusb/tusb_option.h @@ -157,19 +157,19 @@ //--------------------------------------------------------------------+
#if MODE_DEVICE_SUPPORTED
- #define DEVICE_CLASS_HID ( CFG_TUSB_DEVICE_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_MOUSE + CFG_TUSB_DEVICE_HID_GENERIC )
+ #define DEVICE_CLASS_HID ( CFG_TUD_HID_KEYBOARD + CFG_TUD_HID_MOUSE + CFG_TUD_HID_GENERIC )
- #ifndef CFG_TUSB_DEVICE_ENDOINT0_SIZE
- #define CFG_TUSB_DEVICE_ENDOINT0_SIZE 64
+ #ifndef CFG_TUD_ENDOINT0_SIZE
+ #define CFG_TUD_ENDOINT0_SIZE 64
#endif
- #if CFG_TUSB_DEVICE_ENDOINT0_SIZE > 64
+ #if CFG_TUD_ENDOINT0_SIZE > 64
#error Control Endpoint Max Package Size cannot larger than 64
#endif
- #ifndef CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE
- #define CFG_TUSB_DEVICE_ENUM_BUFFER_SIZE 256
+ #ifndef CFG_TUD_ENUM_BUFFER_SIZE
+ #define CFG_TUD_ENUM_BUFFER_SIZE 256
#endif
#endif // MODE_DEVICE_SUPPORTED
|
