From 3c2467196070eeedd4171e183db04fb815677246 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 10 Apr 2018 14:31:11 +0700 Subject: [PATCH] mass rename TUSB_CFG to CFG_TUSB --- doxygen/configuration.txt | 48 ++++++------ doxygen/getting_started.md | 2 +- doxygen/started_demo.md | 2 +- .../segger/device_virtual_com.emProject | 2 +- examples/device/device_virtual_com/src/main.c | 10 +-- .../device_virtual_com/src/tusb_config.h | 66 ++++++++-------- .../device_virtual_com/src/tusb_descriptors.c | 2 +- .../device_virtual_com/src/tusb_descriptors.h | 2 +- .../device_virtual_com/xpresso/.cproject | 2 +- examples/device/nrf52840/src/main.c | 10 +-- examples/device/nrf52840/src/msc_device_app.c | 2 +- examples/device/nrf52840/src/msc_device_app.h | 4 +- .../device/nrf52840/src/msc_device_ramdisk.c | 4 +- examples/device/nrf52840/src/tusb_config.h | 32 ++++---- .../device/nrf52840/src/tusb_descriptors.c | 2 +- .../device/nrf52840/src/tusb_descriptors.h | 2 +- .../obsolete/device/device_freertos/.cproject | 36 ++++----- .../obsolete/device/device_os_none/.cproject | 24 +++--- examples/obsolete/device/src/app_os_prio.h | 6 +- examples/obsolete/device/src/cdc_device_app.c | 2 +- examples/obsolete/device/src/cdc_device_app.h | 2 +- .../obsolete/device/src/keyboard_device_app.c | 4 +- .../obsolete/device/src/keyboard_device_app.h | 2 +- examples/obsolete/device/src/main.c | 16 ++-- .../obsolete/device/src/mouse_device_app.c | 4 +- .../obsolete/device/src/mouse_device_app.h | 2 +- examples/obsolete/device/src/msc_device_app.c | 2 +- examples/obsolete/device/src/msc_device_app.h | 4 +- .../obsolete/device/src/msc_device_ramdisk.c | 4 +- .../obsolete/device/src/msc_device_romdisk.c | 4 +- examples/obsolete/device/src/tusb_config.h | 62 +++++++-------- .../obsolete/device/src/tusb_descriptors.c | 20 ++--- .../obsolete/device/src/tusb_descriptors.h | 28 +++---- .../obsolete/host/host_freertos/.cproject | 28 +++---- examples/obsolete/host/host_os_none/.cproject | 16 ++-- examples/obsolete/host/src/app_os_prio.h | 8 +- .../obsolete/host/src/cdc_serial_host_app.c | 10 +-- .../obsolete/host/src/cdc_serial_host_app.h | 2 +- .../obsolete/host/src/keyboard_host_app.c | 4 +- .../obsolete/host/src/keyboard_host_app.h | 2 +- examples/obsolete/host/src/main.c | 22 +++--- examples/obsolete/host/src/mouse_host_app.c | 4 +- examples/obsolete/host/src/mouse_host_app.h | 2 +- examples/obsolete/host/src/msc_cli.c | 4 +- examples/obsolete/host/src/msc_host_app.c | 8 +- examples/obsolete/host/src/msc_host_app.h | 2 +- examples/obsolete/host/src/rndis_host_app.c | 2 +- examples/obsolete/host/src/rndis_host_app.h | 2 +- examples/obsolete/host/src/tusb_config.h | 48 ++++++------ examples/readme.md | 2 +- hw/bsp/ea4357/board_ea4357.c | 6 +- hw/bsp/keil/board_mcb4300.c | 2 +- hw/bsp/lpcxpresso/board_lpclink2.c | 2 +- hw/bsp/lpcxpresso/board_lpcxpresso11u14.c | 2 +- .../lpcxpresso11u68/board_lpcxpresso11u68.c | 2 +- hw/bsp/lpcxpresso1347/board_lpcxpresso1347.c | 2 +- hw/bsp/lpcxpresso1769/board_lpcxpresso1769.c | 2 +- hw/bsp/ngx/board_ngx4330.c | 2 +- hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c | 2 +- hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c | 2 +- readme.markdown | 2 +- tests/.cproject | 2 +- tests/lpc175x_6x/project.yml | 2 +- tests/lpc175x_6x/test/test_usbd.c | 12 +-- tests/lpc18xx_43xx/project.yml | 2 +- .../test/host/cdc/descriptor_cdc.c | 4 +- .../test/host/cdc/test_cdc_host.c | 6 +- .../test/host/cdc/test_cdc_rndis_host.c | 6 +- .../test/host/ehci/test_ehci_init.c | 2 +- .../test/host/ehci/test_ehci_isr.c | 2 +- .../test/host/ehci/test_ehci_structure.c | 2 +- .../test/host/ehci/test_pipe_bulk_open.c | 4 +- .../test/host/ehci/test_pipe_bulk_xfer.c | 4 +- .../test/host/ehci/test_pipe_control_open.c | 4 +- .../test/host/ehci/test_pipe_control_xfer.c | 4 +- .../test/host/ehci/test_pipe_interrupt_open.c | 4 +- .../test/host/ehci/test_pipe_interrupt_xfer.c | 4 +- .../host/ehci/test_pipe_isochronous_open.c | 4 +- .../test/host/hid/test_hid_host.c | 4 +- .../test/host/hid/test_hidh_generic.c | 6 +- .../test/host/hid/test_hidh_keyboard.c | 6 +- .../test/host/hid/test_hidh_mouse.c | 6 +- tests/lpc18xx_43xx/test/host/host_helper.h | 4 +- .../test_hidh_keyboard_integrate.c | 2 +- .../test/host/msc/test_msc_host.c | 6 +- .../test/host/usbh/test_enum_task.c | 8 +- tests/lpc18xx_43xx/test/host/usbh/test_usbh.c | 6 +- tests/lpc18xx_43xx/test/test_osal_none.c | 18 ++--- tests/support/descriptor_test.c | 8 +- tests/support/descriptor_test.h | 2 +- tests/support/ehci_controller_fake.c | 2 +- tests/support/tusb_config.h | 42 +++++----- tinyusb.Doxyfile | 10 +-- tinyusb/class/cdc/cdc_device.c | 8 +- tinyusb/class/cdc/cdc_host.c | 6 +- tinyusb/class/cdc/cdc_host.h | 10 +-- tinyusb/class/cdc/cdc_rndis_host.c | 14 ++-- tinyusb/class/custom_class_host.c | 6 +- tinyusb/class/hid/hid_device.c | 10 +-- tinyusb/class/hid/hid_device.h | 8 +- tinyusb/class/hid/hid_host.c | 40 +++++----- tinyusb/class/hid/hid_host.h | 4 +- tinyusb/class/msc/msc_device.c | 6 +- tinyusb/class/msc/msc_device.h | 4 +- tinyusb/class/msc/msc_host.c | 8 +- tinyusb/class/msc/msc_host.h | 6 +- tinyusb/common/tusb_compiler.h | 2 +- tinyusb/common/tusb_error.h | 4 +- tinyusb/common/tusb_fifo.h | 2 +- tinyusb/common/tusb_verify.h | 2 +- tinyusb/device/usbd.c | 18 ++--- tinyusb/device/usbd.h | 4 +- tinyusb/host/ehci/ehci.c | 32 ++++---- tinyusb/host/ehci/ehci.h | 2 +- tinyusb/host/hcd.h | 4 +- tinyusb/host/hub.c | 8 +- tinyusb/host/ohci/ohci.c | 8 +- tinyusb/host/ohci/ohci.h | 4 +- tinyusb/host/usbh.c | 38 +++++----- tinyusb/host/usbh_hcd.h | 2 +- tinyusb/osal/osal.c | 2 +- tinyusb/osal/osal.h | 8 +- tinyusb/portable/nordic/nrf5x/dcd_nrf5x.c | 2 + .../nxp/lpc11xx_lpc13xx/dcd_lpc_11uxx_13uxx.c | 10 +-- tinyusb/portable/nxp/lpc17xx/dcd_lpc175x_6x.c | 10 +-- tinyusb/portable/nxp/lpc17xx/hal_lpc175x_6x.c | 2 +- .../nxp/lpc43xx_lpc18xx/dcd_lpc43xx.c | 12 +-- .../nxp/lpc43xx_lpc18xx/hal_lpc43xx.c | 18 ++--- tinyusb/tusb.c | 4 +- tinyusb/tusb.h | 14 ++-- tinyusb/tusb_hal.h | 8 +- tinyusb/tusb_option.h | 76 +++++++++---------- vendor/fatfs/ccsbcs.c | 4 +- vendor/fatfs/diskio.c | 10 +-- vendor/fatfs/diskio.h | 2 +- vendor/fatfs/ff.c | 4 +- vendor/fatfs/ffconf.h | 2 +- vendor/freertos/FreeRTOSConfig.h | 2 +- 138 files changed, 628 insertions(+), 626 deletions(-) diff --git a/doxygen/configuration.txt b/doxygen/configuration.txt index c84eea76e..8f5887718 100644 --- a/doxygen/configuration.txt +++ b/doxygen/configuration.txt @@ -7,46 +7,46 @@ /// \brief tell the stack which mode (host/device/otg) the usb controller0 will be operated on. Possible value is /// from \ref group_mode. Note the hardware usb controller must support the selected mode. -#define TUSB_CFG_CONTROLLER_0_MODE +#define CFG_TUSB_CONTROLLER_0_MODE /** USB controller in MCU often has limited access to specific RAM section. The Stack will use this macro to place internal variables - into the USB RAM section as follows. if your mcu's usb controller has no such limit, define TUSB_CFG_ATTR_USBRAM as empty macro. + into the USB RAM section as follows. if your mcu's usb controller has no such limit, define CFG_TUSB_ATTR_USBRAM as empty macro. @code - TUSB_CFG_ATTR_USBRAM uint8_t usb_xfer_buffer[10]; + CFG_TUSB_ATTR_USBRAM uint8_t usb_xfer_buffer[10]; @endcode */ -#define TUSB_CFG_ATTR_USBRAM +#define CFG_TUSB_ATTR_USBRAM -#define TUSB_CFG_MCU ///< Select one of the supported MCU, the value must be from \ref group_mcu -#define TUSB_CFG_OS ///< Select one of the supported RTOS, the value must be from \ref group_supported_os. -#define TUSB_CFG_OS_TASK_PRIO ///< If \ref TUSB_CFG_OS is configured to use a real RTOS (other than TUSB_OS_NONE). This determines the priority of the usb stack task. -#define TUSB_CFG_TICKS_HZ ///< The rate ticks in hert. This is used in conjunction with \ref tusb_tick_get to calculate timing. +#define CFG_TUSB_MCU ///< Select one of the supported MCU, the value must be from \ref group_mcu +#define CFG_TUSB_OS ///< Select one of the supported RTOS, the value must be from \ref group_supported_os. +#define CFG_TUSB_OS_TASK_PRIO ///< If \ref CFG_TUSB_OS is configured to use a real RTOS (other than TUSB_OS_NONE). This determines the priority of the usb stack task. +#define CFG_TUSB_TICKS_HZ ///< The rate ticks in hert. This is used in conjunction with \ref tusb_tick_get to calculate timing. //--------------------------------------------------------------------+ // HOST CONFIGURATION //--------------------------------------------------------------------+ -/** \defgroup TUSB_CFG_HOST Host Options +/** \defgroup CFG_TUSB_HOST Host Options * @{ */ /** \brief Maximum number of device host stack can manage * \n If hub class is not enabled, set this equal to number of controllers in host mode * \n If hub class is enabled, make sure hub is also counted */ -#define TUSB_CFG_HOST_DEVICE_MAX +#define CFG_TUSB_HOST_DEVICE_MAX /// \brief Buffer size used for getting device configuration descriptor. You may want to increase this from default (256) /// to support lengthy composite device especially with Audio or Video class -#define TUSB_CFG_HOST_ENUM_BUFFER_SIZE +#define CFG_TUSB_HOST_ENUM_BUFFER_SIZE /** \defgroup config_host_class Class Driver * \brief For each Class Driver a value of 1 means enable, value of 0 mean disable * @{ */ -#define TUSB_CFG_HOST_HUB ///< Enable Hub Class -#define TUSB_CFG_HOST_HID_KEYBOARD ///< Enable HID Class for Keyboard -#define TUSB_CFG_HOST_HID_MOUSE ///< Enable HID Class for Mouse -#define TUSB_CFG_HOST_HID_GENERIC ///< Enable HID Class for Generic (not supported yet) -#define TUSB_CFG_HOST_MSC ///< Enable Mass Storage Class (SCSI subclass only) -#define TUSB_CFG_HOST_CDC ///< Enable Virtual Serial (Communication Device Class) +#define CFG_TUSB_HOST_HUB ///< Enable Hub Class +#define CFG_TUSB_HOST_HID_KEYBOARD ///< Enable HID Class for Keyboard +#define CFG_TUSB_HOST_HID_MOUSE ///< Enable HID Class for Mouse +#define CFG_TUSB_HOST_HID_GENERIC ///< Enable HID Class for Generic (not supported yet) +#define CFG_TUSB_HOST_MSC ///< Enable Mass Storage Class (SCSI subclass only) +#define CFG_TUSB_HOST_CDC ///< Enable Virtual Serial (Communication Device Class) /** @} */ /** @} */ // group Host @@ -54,10 +54,10 @@ //--------------------------------------------------------------------+ // DEVICE CONFIGURATION //--------------------------------------------------------------------+ -/** \defgroup TUSB_CFG_DEVICE Device Options +/** \defgroup CFG_TUSB_DEVICE Device Options * @{ */ -#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE ///< Max packet size of Cotnrol Endpoint, default is 64 +#define CFG_TUSB_DEVICE_CONTROL_ENDOINT_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 ... @@ -66,11 +66,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 TUSB_CFG_DEVICE_HID_KEYBOARD ///< Enable HID Class for Keyboard -#define TUSB_CFG_DEVICE_HID_MOUSE ///< Enable HID Class for Mouse -#define TUSB_CFG_DEVICE_HID_GENERIC ///< Enable HID Class for Generic (not supported yet) -#define TUSB_CFG_DEVICE_MSC ///< Enable Mass Storage Class (SCSI subclass only) -#define TUSB_CFG_DEVICE_CDC ///< Enable Virtual Serial (Communication Device Class) +#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) /** @} */ /** @} */ // group Device diff --git a/doxygen/getting_started.md b/doxygen/getting_started.md index d58634845..79bc8f01f 100644 --- a/doxygen/getting_started.md +++ b/doxygen/getting_started.md @@ -35,7 +35,7 @@ It is relatively simple to incorporate tinyusb to your (existing) project 1. Copy core folder **tinyusb** to your project. Let's say it is *your_project/tinyusb* 2. Add all the .c in the core folder to your project settings (uvproj, ewp, makefile) 3. Add *your_project/tinysb* to your include path. Also make sure your current include path also contains the configuration file tusb_config.h. Or you could simply put the tusb_config.h into the tinyusb folder as well. -4. Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as TUSB_CFG_MCU, TUSB_CFG_OS, TUSB_CFG_OS_TASK_PRIO since they are passed by IDE/compiler to maintain a unique configure for all demo projects). +4. Make sure all required macros are all defined properly in tusb_config.h (configure file in demo application is sufficient, but you need to add a few more such as CFG_TUSB_MCU, CFG_TUSB_OS, CFG_TUSB_OS_TASK_PRIO since they are passed by IDE/compiler to maintain a unique configure for all demo projects). 5. If you use the device stack, make sure you have created/modified usb descriptors for your own need. Ultimately you need to fill out required pointers in tusbd_descriptor_pointers for that stack to work. 6. Add tusb_init() call to your reset initialization code. 7. Implement all enabled classes's callbacks. diff --git a/doxygen/started_demo.md b/doxygen/started_demo.md index 287c55731..7e82596f5 100644 --- a/doxygen/started_demo.md +++ b/doxygen/started_demo.md @@ -34,7 +34,7 @@ void led_blinking_task( void * p_task_para ) static uint32_t led_on_mask = 0; // FreeRTOS API's vTaskDelay is used in place of osal_task_delay. Note it takes input parameter in tick - vTaskDelay( (led_blink_interval_ms * TUSB_CFG_TICKS_HZ) / 1000); + vTaskDelay( (led_blink_interval_ms * CFG_TUSB_TICKS_HZ) / 1000); board_leds(led_on_mask, 1 - led_on_mask); led_on_mask = 1 - led_on_mask; // toggle diff --git a/examples/device/device_virtual_com/segger/device_virtual_com.emProject b/examples/device/device_virtual_com/segger/device_virtual_com.emProject index c52698a89..63927ff9d 100644 --- a/examples/device/device_virtual_com/segger/device_virtual_com.emProject +++ b/examples/device/device_virtual_com/segger/device_virtual_com.emProject @@ -201,7 +201,7 @@ + c_preprocessor_definitions="BOARD=BOARD_EA4357;CFG_TUSB_MCU=MCU_LPC43XX" /> - +