summaryrefslogtreecommitdiff
path: root/examples/device
diff options
context:
space:
mode:
Diffstat (limited to 'examples/device')
-rw-r--r--examples/device/device_virtual_com/segger/device_virtual_com.emProject2
-rw-r--r--examples/device/device_virtual_com/src/main.c10
-rw-r--r--examples/device/device_virtual_com/src/tusb_config.h66
-rw-r--r--examples/device/device_virtual_com/src/tusb_descriptors.c2
-rw-r--r--examples/device/device_virtual_com/src/tusb_descriptors.h2
-rw-r--r--examples/device/device_virtual_com/xpresso/.cproject2
-rw-r--r--examples/device/nrf52840/src/main.c10
-rw-r--r--examples/device/nrf52840/src/msc_device_app.c2
-rw-r--r--examples/device/nrf52840/src/msc_device_app.h4
-rw-r--r--examples/device/nrf52840/src/msc_device_ramdisk.c4
-rw-r--r--examples/device/nrf52840/src/tusb_config.h32
-rw-r--r--examples/device/nrf52840/src/tusb_descriptors.c2
-rw-r--r--examples/device/nrf52840/src/tusb_descriptors.h2
13 files changed, 70 insertions, 70 deletions
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 @@
</folder>
<configuration
Name="EA4357"
- c_preprocessor_definitions="BOARD=BOARD_EA4357;TUSB_CFG_MCU=MCU_LPC43XX" />
+ c_preprocessor_definitions="BOARD=BOARD_EA4357;CFG_TUSB_MCU=MCU_LPC43XX" />
</project>
<configuration
Name="Debug"
diff --git a/examples/device/device_virtual_com/src/main.c b/examples/device/device_virtual_com/src/main.c
index 3ee3a74d3..8d4065194 100644
--- a/examples/device/device_virtual_com/src/main.c
+++ b/examples/device/device_virtual_com/src/main.c
@@ -146,9 +146,9 @@ void print_greeting(void)
);
puts("This DEVICE demo is configured to support:");
- printf(" - RTOS = %s\n", rtos_name[TUSB_CFG_OS]);
- if (TUSB_CFG_DEVICE_HID_MOUSE ) puts(" - HID Mouse");
- if (TUSB_CFG_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard");
- if (TUSB_CFG_DEVICE_MSC ) puts(" - Mass Storage");
- if (TUSB_CFG_DEVICE_CDC ) puts(" - Communication Device Class");
+ 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");
}
diff --git a/examples/device/device_virtual_com/src/tusb_config.h b/examples/device/device_virtual_com/src/tusb_config.h
index be2aaf71a..d0737de13 100644
--- a/examples/device/device_virtual_com/src/tusb_config.h
+++ b/examples/device/device_virtual_com/src/tusb_config.h
@@ -46,70 +46,70 @@
//--------------------------------------------------------------------+
// CONTROLLER CONFIGURATION
//--------------------------------------------------------------------+
-//#define TUSB_CFG_MCU will be passed from IDE/command line for easy board/mcu switching
+//#define CFG_TUSB_MCU will be passed from IDE/command line for easy board/mcu switching
-#define TUSB_CFG_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
-//#define TUSB_CFG_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
+#define CFG_TUSB_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
+//#define CFG_TUSB_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
//--------------------------------------------------------------------+
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE 64
+#define CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE 64
//------------- CLASS -------------//
-#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
-#define TUSB_CFG_DEVICE_HID_MOUSE 0
-#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
-#define TUSB_CFG_DEVICE_MSC 0
-#define TUSB_CFG_DEVICE_CDC 1
+#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
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEBUG 2
+#define CFG_TUSB_DEBUG 2
-//#define TUSB_CFG_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
-//#define TUSB_CFG_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
-#define TUSB_CFG_TICKS_HZ 1000
+//#define CFG_TUSB_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
+//#define CFG_TUSB_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
+#define CFG_TUSB_TICKS_HZ 1000
-//#define TUSB_CFG_OS TUSB_OS_NONE
+//#define CFG_TUSB_OS TUSB_OS_NONE
//--------------------------------------------------------------------+
// USB RAM PLACEMENT
//--------------------------------------------------------------------+
#ifdef __CODE_RED // compiled with lpcxpresso
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
- #elif TUSB_CFG_MCU == MCU_LPC175X_6X
- #define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
+ #if (CFG_TUSB_MCU == MCU_LPC11UXX) || (CFG_TUSB_MCU == MCU_LPC13UXX)
+ #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
+ #elif CFG_TUSB_MCU == MCU_LPC175X_6X
+ #define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all
+ #elif (CFG_TUSB_MCU == MCU_LPC43XX)
+ #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
#endif
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
- #elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
- #define TUSB_CFG_ATTR_USBRAM // LPC17xx USB DMA can access all address
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
+ #if (CFG_TUSB_MCU == MCU_LPC11UXX) || (CFG_TUSB_MCU == MCU_LPC13UXX)
+ #define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
+ #elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
+ #define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
+ #elif (CFG_TUSB_MCU == MCU_LPC43XX)
+ #define CFG_TUSB_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
#endif
#elif defined __ICCARM__ // compiled with IAR
- #if (TUSB_CFG_MCU == MCU_LPC11UXX) || (TUSB_CFG_MCU == MCU_LPC13UXX)
- #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
- #elif (TUSB_CFG_MCU == MCU_LPC175X_6X)
- #define TUSB_CFG_ATTR_USBRAM
- #elif (TUSB_CFG_MCU == MCU_LPC43XX)
- #define TUSB_CFG_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
+ #if (CFG_TUSB_MCU == MCU_LPC11UXX) || (CFG_TUSB_MCU == MCU_LPC13UXX)
+ #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
+ #elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
+ #define CFG_TUSB_ATTR_USBRAM
+ #elif (CFG_TUSB_MCU == MCU_LPC43XX)
+ #define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
#endif
#elif defined __SES_ARM
-#define TUSB_CFG_ATTR_USBRAM ATTR_SECTION(.bss2)
+#define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.bss2)
#else
diff --git a/examples/device/device_virtual_com/src/tusb_descriptors.c b/examples/device/device_virtual_com/src/tusb_descriptors.c
index 74954ba1c..f0867585a 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 = TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE,
+ .bMaxPacketSize0 = CFG_TUSB_DEVICE_CONTROL_ENDOINT_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 af200946c..2d362bc0b 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) ( (TUSB_CFG_DEVICE_##interface) << (n) )
+ #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##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/device_virtual_com/xpresso/.cproject b/examples/device/device_virtual_com/xpresso/.cproject
index 346f46d92..ffe0a240e 100644
--- a/examples/device/device_virtual_com/xpresso/.cproject
+++ b/examples/device/device_virtual_com/xpresso/.cproject
@@ -31,7 +31,7 @@
<listOptionValue builtIn="false" value="__LPC43XX__"/>
<listOptionValue builtIn="false" value="__REDLIB__"/>
<listOptionValue builtIn="false" value="__MULTICORE_NONE"/>
- <listOptionValue builtIn="false" value="TUSB_CFG_MCU=MCU_LPC43XX"/>
+ <listOptionValue builtIn="false" value="CFG_TUSB_MCU=MCU_LPC43XX"/>
<listOptionValue builtIn="false" value="BOARD=BOARD_EA4357"/>
</option>
<option id="gnu.c.compiler.option.misc.other.1756693195" name="Other flags" superClass="gnu.c.compiler.option.misc.other" useByScannerDiscovery="false" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fsingle-precision-constant" valueType="string"/>
diff --git a/examples/device/nrf52840/src/main.c b/examples/device/nrf52840/src/main.c
index 203cd3f18..bb26f3a4e 100644
--- a/examples/device/nrf52840/src/main.c
+++ b/examples/device/nrf52840/src/main.c
@@ -144,9 +144,9 @@ void print_greeting(void)
printf("--------------------------------------------------------------------\n\n");
printf("This DEVICE demo is configured to support:");
- printf(" - RTOS = %s\n", rtos_name[TUSB_CFG_OS]);
- if (TUSB_CFG_DEVICE_HID_MOUSE ) puts(" - HID Mouse");
- if (TUSB_CFG_DEVICE_HID_KEYBOARD ) puts(" - HID Keyboard");
- if (TUSB_CFG_DEVICE_MSC ) puts(" - Mass Storage");
- if (TUSB_CFG_DEVICE_CDC ) puts(" - Communication Device Class");
+ 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");
}
diff --git a/examples/device/nrf52840/src/msc_device_app.c b/examples/device/nrf52840/src/msc_device_app.c
index 401a32d1d..6609257e2 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 TUSB_CFG_DEVICE_MSC
+#if CFG_TUSB_DEVICE_MSC
//--------------------------------------------------------------------+
// INCLUDE
//--------------------------------------------------------------------+
diff --git a/examples/device/nrf52840/src/msc_device_app.h b/examples/device/nrf52840/src/msc_device_app.h
index cd087b8a3..185ceb260 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 TUSB_CFG_DEVICE_MSC
+#if CFG_TUSB_DEVICE_MSC
enum
{
@@ -63,7 +63,7 @@ enum
If you find any bugs or get any questions, feel free to file an\r\n\
issue at github.com/hathach/tinyusb"
-#if TUSB_CFG_MCU==MCU_LPC11UXX || TUSB_CFG_MCU==MCU_LPC13UXX
+#if CFG_TUSB_MCU==MCU_LPC11UXX || CFG_TUSB_MCU==MCU_LPC13UXX
#define MSCD_APP_ROMDISK
#else // defaults is ram disk
#define MSCD_APP_RAMDISK
diff --git a/examples/device/nrf52840/src/msc_device_ramdisk.c b/examples/device/nrf52840/src/msc_device_ramdisk.c
index fefbfdf79..b19b37252 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 TUSB_CFG_DEVICE_MSC && defined (MSCD_APP_RAMDISK)
+#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_RAMDISK)
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
@@ -47,7 +47,7 @@
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+CFG_TUSB_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
{
//------------- Boot Sector -------------//
diff --git a/examples/device/nrf52840/src/tusb_config.h b/examples/device/nrf52840/src/tusb_config.h
index e517376c3..54ec51cce 100644
--- a/examples/device/nrf52840/src/tusb_config.h
+++ b/examples/device/nrf52840/src/tusb_config.h
@@ -46,41 +46,41 @@
//--------------------------------------------------------------------+
// CONTROLLER CONFIGURATION
//--------------------------------------------------------------------+
-//#define TUSB_CFG_MCU will be passed from IDE/command line for easy board/mcu switching
+//#define CFG_TUSB_MCU will be passed from IDE/command line for easy board/mcu switching
-#define TUSB_CFG_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
-//#define TUSB_CFG_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
+#define CFG_TUSB_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
+//#define CFG_TUSB_CONTROLLER_1_MODE (TUSB_MODE_DEVICE)
//--------------------------------------------------------------------+
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE 64
+#define CFG_TUSB_DEVICE_CONTROL_ENDOINT_SIZE 64
//------------- CLASS -------------//
-#define TUSB_CFG_DEVICE_HID_KEYBOARD 0
-#define TUSB_CFG_DEVICE_HID_MOUSE 0
-#define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet
-#define TUSB_CFG_DEVICE_MSC 1
-#define TUSB_CFG_DEVICE_CDC 1
+#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
//--------------------------------------------------------------------+
// COMMON CONFIGURATION
//--------------------------------------------------------------------+
-#define TUSB_CFG_DEBUG 2
+#define CFG_TUSB_DEBUG 2
-#define TUSB_CFG_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
-//#define TUSB_CFG_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
-#define TUSB_CFG_TICKS_HZ 1000
+#define CFG_TUSB_OS TUSB_OS_NONE // be passed from IDE/command line for easy project switching
+//#define CFG_TUSB_OS_TASK_PRIO 0 // be passed from IDE/command line for easy project switching
+#define CFG_TUSB_TICKS_HZ 1000
-//#define TUSB_CFG_OS TUSB_OS_NONE
+//#define CFG_TUSB_OS TUSB_OS_NONE
//--------------------------------------------------------------------+
// USB RAM PLACEMENT
//--------------------------------------------------------------------+
-#define TUSB_CFG_ATTR_USBRAM
+#define CFG_TUSB_ATTR_USBRAM
// LPC11uxx and LPC13uxx requires each buffer has to be 64-byte alignment
-#if TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX
+#if CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX
#define ATTR_USB_MIN_ALIGNMENT ATTR_ALIGNED(64)
#elif defined NRF52840_XXAA
#define ATTR_USB_MIN_ALIGNMENT ATTR_ALIGNED(4)
diff --git a/examples/device/nrf52840/src/tusb_descriptors.c b/examples/device/nrf52840/src/tusb_descriptors.c
index a36786961..99a47618a 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 = TUSB_CFG_DEVICE_CONTROL_ENDOINT_SIZE,
+ .bMaxPacketSize0 = CFG_TUSB_DEVICE_CONTROL_ENDOINT_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 cf291e25e..b8d07357e 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) ( (TUSB_CFG_DEVICE_##interface) << (n) )
+ #define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##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) ) )