Skip to content

Commit 11c89d4

Browse files
committed
more internal rename
1 parent bc63f59 commit 11c89d4

File tree

10 files changed

+100
-98
lines changed

10 files changed

+100
-98
lines changed

src/common/tusb_mcu.h

Lines changed: 80 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -51,220 +51,222 @@
5151

5252
//------------- NXP -------------//
5353
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
54-
#define DCD_ATTR_ENDPOINT_MAX 5
54+
#define TUP_DCD_ENDPOINT_MAX 5
5555

5656
#elif TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
57-
#define DCD_ATTR_ENDPOINT_MAX 16
58-
#define HCD_ATTR_OHCI
57+
#define TUP_DCD_ENDPOINT_MAX 16
58+
#define TUP_USBIP_OHCI
5959

6060
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
6161
// TODO USB0 has 6, USB1 has 4
6262
#define TUP_USBIP_CHIPIDEA_HS
63-
#define DCD_ATTR_ENDPOINT_MAX 6
64-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01 // Port0 HS, Port1 FS
63+
#define TUP_USBIP_EHCI
64+
65+
#define TUP_DCD_ENDPOINT_MAX 6
66+
#define TUP_RHPORT_HIGHSPEED 0x01 // Port0 HS, Port1 FS
6567

66-
#define HCD_ATTR_EHCI
6768

6869
#elif TU_CHECK_MCU(OPT_MCU_LPC51UXX)
69-
#define DCD_ATTR_ENDPOINT_MAX 5
70+
#define TUP_DCD_ENDPOINT_MAX 5
7071

7172
#elif TU_CHECK_MCU(OPT_MCU_LPC54XXX)
7273
// TODO USB0 has 5, USB1 has 6
73-
#define DCD_ATTR_ENDPOINT_MAX 6
74+
#define TUP_DCD_ENDPOINT_MAX 6
7475

7576
#elif TU_CHECK_MCU(OPT_MCU_LPC55XX)
7677
// TODO USB0 has 5, USB1 has 6
77-
#define DCD_ATTR_ENDPOINT_MAX 6
78+
#define TUP_DCD_ENDPOINT_MAX 6
7879

7980
#elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX)
8081
#define TUP_USBIP_CHIPIDEA_HS
81-
#define DCD_ATTR_ENDPOINT_MAX 8
82-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x03 // Port0 HS, Port1 HS
82+
#define TUP_USBIP_EHCI
83+
84+
#define TUP_DCD_ENDPOINT_MAX 8
85+
#define TUP_RHPORT_HIGHSPEED 0x03 // Port0 HS, Port1 HS
8386

84-
#define HCD_ATTR_EHCI
8587

8688
#elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX, OPT_MCU_K32L2BXX)
87-
#define DCD_ATTR_ENDPOINT_MAX 16
89+
#define TUP_DCD_ENDPOINT_MAX 16
8890

8991
#elif TU_CHECK_MCU(OPT_MCU_MM32F327X)
90-
#define DCD_ATTR_ENDPOINT_MAX 16
92+
#define TUP_DCD_ENDPOINT_MAX 16
9193

9294
//------------- Nordic -------------//
9395
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
9496
// 8 CBI + 1 ISO
95-
#define DCD_ATTR_ENDPOINT_MAX 9
97+
#define TUP_DCD_ENDPOINT_MAX 9
9698

9799
//------------- Microchip -------------//
98100
#elif TU_CHECK_MCU(OPT_MCU_SAMD21, OPT_MCU_SAMD51, OPT_MCU_SAME5X) || \
99101
TU_CHECK_MCU(OPT_MCU_SAMD11, OPT_MCU_SAML21, OPT_MCU_SAML22)
100-
#define DCD_ATTR_ENDPOINT_MAX 8
102+
#define TUP_DCD_ENDPOINT_MAX 8
101103

102104
#elif TU_CHECK_MCU(OPT_MCU_SAMG)
103-
#define DCD_ATTR_ENDPOINT_MAX 6
104-
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
105+
#define TUP_DCD_ENDPOINT_MAX 6
106+
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
105107

106108
#elif TU_CHECK_MCU(OPT_MCU_SAMX7X)
107-
#define DCD_ATTR_ENDPOINT_MAX 10
108-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01
109-
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
109+
#define TUP_DCD_ENDPOINT_MAX 10
110+
#define TUP_RHPORT_HIGHSPEED 0x01
111+
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
110112

111113
#elif TU_CHECK_MCU(OPT_MCU_PIC32MZ)
112-
#define DCD_ATTR_ENDPOINT_MAX 8
113-
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
114+
#define TUP_DCD_ENDPOINT_MAX 8
115+
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
114116

115117
//------------- ST -------------//
116118
#elif TU_CHECK_MCU(OPT_MCU_STM32F0)
117-
#define DCD_ATTR_ENDPOINT_MAX 8
119+
#define TUP_DCD_ENDPOINT_MAX 8
118120

119121
#elif TU_CHECK_MCU(OPT_MCU_STM32F1)
120122
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
121123
defined (STM32F107xB) || defined (STM32F107xC)
122-
#define DCD_ATTR_ENDPOINT_MAX 4
123-
124124
#define TUP_USBIP_DWC2
125-
#define DCD_ATTR_DWC2_STM32
125+
#define TUP_USBIP_DWC2_STM32
126+
127+
#define TUP_DCD_ENDPOINT_MAX 4
126128
#else
127-
#define DCD_ATTR_ENDPOINT_MAX 8
129+
#define TUP_DCD_ENDPOINT_MAX 8
128130
#endif
129131

130132
#elif TU_CHECK_MCU(OPT_MCU_STM32F2)
131-
// FS has 4 ep, HS has 5 ep
132-
#define DCD_ATTR_ENDPOINT_MAX 6
133-
134133
#define TUP_USBIP_DWC2
135-
#define DCD_ATTR_DWC2_STM32
134+
#define TUP_USBIP_DWC2_STM32
135+
136+
// FS has 4 ep, HS has 5 ep
137+
#define TUP_DCD_ENDPOINT_MAX 6
136138

137139
#elif TU_CHECK_MCU(OPT_MCU_STM32F3)
138-
#define DCD_ATTR_ENDPOINT_MAX 8
140+
#define TUP_DCD_ENDPOINT_MAX 8
139141

140142
#elif TU_CHECK_MCU(OPT_MCU_STM32F4)
143+
#define TUP_USBIP_DWC2
144+
#define TUP_USBIP_DWC2_STM32
145+
141146
// For most mcu, FS has 4, HS has 6. TODO 446/469/479 HS has 9
142-
#define DCD_ATTR_ENDPOINT_MAX 6
147+
#define TUP_DCD_ENDPOINT_MAX 6
143148

149+
#elif TU_CHECK_MCU(OPT_MCU_STM32F7)
144150
#define TUP_USBIP_DWC2
145-
#define DCD_ATTR_DWC2_STM32
151+
#define TUP_USBIP_DWC2_STM32
146152

147-
#elif TU_CHECK_MCU(OPT_MCU_STM32F7)
148153
// FS has 6, HS has 9
149-
#define DCD_ATTR_ENDPOINT_MAX 9
150-
151-
#define TUP_USBIP_DWC2
152-
#define DCD_ATTR_DWC2_STM32
154+
#define TUP_DCD_ENDPOINT_MAX 9
153155

154156
#elif TU_CHECK_MCU(OPT_MCU_STM32H7)
155-
#define DCD_ATTR_ENDPOINT_MAX 9
156-
157157
#define TUP_USBIP_DWC2
158-
#define DCD_ATTR_DWC2_STM32
158+
#define TUP_USBIP_DWC2_STM32
159+
160+
#define TUP_DCD_ENDPOINT_MAX 9
159161

160162
#elif TU_CHECK_MCU(OPT_MCU_STM32G4)
161-
#define DCD_ATTR_ENDPOINT_MAX 8
163+
#define TUP_DCD_ENDPOINT_MAX 8
162164

163165
#elif TU_CHECK_MCU(OPT_MCU_STM32L0, OPT_MCU_STM32L1)
164-
#define DCD_ATTR_ENDPOINT_MAX 8
166+
#define TUP_DCD_ENDPOINT_MAX 8
165167

166168
#elif TU_CHECK_MCU(OPT_MCU_STM32L4)
167169
#if defined (STM32L475xx) || defined (STM32L476xx) || \
168170
defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
169171
defined (STM32L4A6xx) || defined (STM32L4P5xx) || defined (STM32L4Q5xx) || \
170172
defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || \
171173
defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
172-
#define DCD_ATTR_ENDPOINT_MAX 6
173-
174174
#define TUP_USBIP_DWC2
175-
#define DCD_ATTR_DWC2_STM32
175+
#define TUP_USBIP_DWC2_STM32
176+
177+
#define TUP_DCD_ENDPOINT_MAX 6
176178
#else
177-
#define DCD_ATTR_ENDPOINT_MAX 8
179+
#define TUP_DCD_ENDPOINT_MAX 8
178180
#endif
179181

180182
//------------- Sony -------------//
181183
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
182-
#define DCD_ATTR_ENDPOINT_MAX 7
183-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01
184-
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
184+
#define TUP_DCD_ENDPOINT_MAX 7
185+
#define TUP_RHPORT_HIGHSPEED 0x01
186+
#define TUP_DCD_ENDPOINT_EXCLUSIVE_NUMBER
185187

186188
//------------- TI -------------//
187189
#elif TU_CHECK_MCU(OPT_MCU_MSP430x5xx)
188-
#define DCD_ATTR_ENDPOINT_MAX 8
190+
#define TUP_DCD_ENDPOINT_MAX 8
189191

190192
#elif TU_CHECK_MCU(OPT_MCU_MSP432E4, OPT_MCU_TM4C123, OPT_MCU_TM4C129)
191-
#define DCD_ATTR_ENDPOINT_MAX 8
193+
#define TUP_DCD_ENDPOINT_MAX 8
192194

193195
//------------- ValentyUSB -------------//
194196
#elif TU_CHECK_MCU(OPT_MCU_VALENTYUSB_EPTRI)
195-
#define DCD_ATTR_ENDPOINT_MAX 16
197+
#define TUP_DCD_ENDPOINT_MAX 16
196198

197199
//------------- Nuvoton -------------//
198200
#elif TU_CHECK_MCU(OPT_MCU_NUC121, OPT_MCU_NUC126)
199-
#define DCD_ATTR_ENDPOINT_MAX 8
201+
#define TUP_DCD_ENDPOINT_MAX 8
200202

201203
#elif TU_CHECK_MCU(OPT_MCU_NUC120)
202-
#define DCD_ATTR_ENDPOINT_MAX 6
204+
#define TUP_DCD_ENDPOINT_MAX 6
203205

204206
#elif TU_CHECK_MCU(OPT_MCU_NUC505)
205-
#define DCD_ATTR_ENDPOINT_MAX 12
206-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01
207+
#define TUP_DCD_ENDPOINT_MAX 12
208+
#define TUP_RHPORT_HIGHSPEED 0x01
207209

208210
//------------- Espressif -------------//
209211
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
210-
#define DCD_ATTR_ENDPOINT_MAX 6
212+
#define TUP_DCD_ENDPOINT_MAX 6
211213

212214
//------------- Dialog -------------//
213215
#elif TU_CHECK_MCU(OPT_MCU_DA1469X)
214-
#define DCD_ATTR_ENDPOINT_MAX 4
216+
#define TUP_DCD_ENDPOINT_MAX 4
215217

216218
//------------- Raspberry Pi -------------//
217219
#elif TU_CHECK_MCU(OPT_MCU_RP2040)
218-
#define DCD_ATTR_ENDPOINT_MAX 16
220+
#define TUP_DCD_ENDPOINT_MAX 16
219221

220222
//------------- Silabs -------------//
221223
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG)
222-
#define DCD_ATTR_ENDPOINT_MAX 7
224+
#define TUP_DCD_ENDPOINT_MAX 7
223225

224226
//------------- Renesas -------------//
225227
#elif TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
226-
#define DCD_ATTR_ENDPOINT_MAX 10
228+
#define TUP_DCD_ENDPOINT_MAX 10
227229

228230
//------------- GigaDevice -------------//
229231
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
230-
#define DCD_ATTR_ENDPOINT_MAX 4
232+
#define TUP_DCD_ENDPOINT_MAX 4
231233

232234
//------------- Broadcom -------------//
233235
#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
234-
#define DCD_ATTR_ENDPOINT_MAX 8
235-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01
236+
#define TUP_DCD_ENDPOINT_MAX 8
237+
#define TUP_RHPORT_HIGHSPEED 0x01
236238

237239
//------------- Broadcom -------------//
238240
#elif TU_CHECK_MCU(OPT_MCU_XMC4000)
239-
#define DCD_ATTR_ENDPOINT_MAX 8
241+
#define TUP_DCD_ENDPOINT_MAX 8
240242

241243
//------------- BridgeTek -------------//
242244
#elif TU_CHECK_MCU(OPT_MCU_FT90X)
243-
#define DCD_ATTR_ENDPOINT_MAX 8
244-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01
245+
#define TUP_DCD_ENDPOINT_MAX 8
246+
#define TUP_RHPORT_HIGHSPEED 0x01
245247

246248
#elif TU_CHECK_MCU(OPT_MCU_FT93X)
247-
#define DCD_ATTR_ENDPOINT_MAX 16
248-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x01
249+
#define TUP_DCD_ENDPOINT_MAX 16
250+
#define TUP_RHPORT_HIGHSPEED 0x01
249251

250252
//------------ Allwinner -------------//
251253
#elif TU_CHECK_MCU(OPT_MCU_F1C100S)
252-
#define DCD_ATTR_ENDPOINT_MAX 4
254+
#define TUP_DCD_ENDPOINT_MAX 4
253255

254256
#endif
255257

256258
//--------------------------------------------------------------------+
257259
// Default Values
258260
//--------------------------------------------------------------------+
259261

260-
#ifndef DCD_ATTR_ENDPOINT_MAX
261-
#warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
262-
#define DCD_ATTR_ENDPOINT_MAX 8
262+
#ifndef TUP_DCD_ENDPOINT_MAX
263+
#warning "TUP_DCD_ENDPOINT_MAX is not defined for this MCU, default to 8"
264+
#define TUP_DCD_ENDPOINT_MAX 8
263265
#endif
264266

265267
// Default to fullspeed if not defined
266-
#ifndef DCD_ATTR_RHPORT_HIGHSPEED
267-
#define DCD_ATTR_RHPORT_HIGHSPEED 0x00
268+
#ifndef TUP_RHPORT_HIGHSPEED
269+
#define TUP_RHPORT_HIGHSPEED 0x00
268270
#endif
269271

270272
#endif

src/device/dcd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
//--------------------------------------------------------------------+
4141

4242
#ifndef CFG_TUD_ENDPPOINT_MAX
43-
#define CFG_TUD_ENDPPOINT_MAX DCD_ATTR_ENDPOINT_MAX
43+
#define CFG_TUD_ENDPPOINT_MAX TUP_DCD_ENDPOINT_MAX
4444
#endif
4545

4646
//--------------------------------------------------------------------+

src/portable/chipidea/ci_hs/dcd_ci_hs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ typedef struct {
151151
// Must be at 2K alignment
152152
// Each endpoint with direction (IN/OUT) occupies a queue head
153153
// for portability, TinyUSB only queue 1 TD for each Qhd
154-
dcd_qhd_t qhd[DCD_ATTR_ENDPOINT_MAX][2] TU_ATTR_ALIGNED(64);
155-
dcd_qtd_t qtd[DCD_ATTR_ENDPOINT_MAX][2] TU_ATTR_ALIGNED(32);
154+
dcd_qhd_t qhd[TUP_DCD_ENDPOINT_MAX][2] TU_ATTR_ALIGNED(64);
155+
dcd_qtd_t qtd[TUP_DCD_ENDPOINT_MAX][2] TU_ATTR_ALIGNED(32);
156156
}dcd_data_t;
157157

158158
CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(2048)
@@ -619,7 +619,7 @@ void dcd_int_handler(uint8_t rhport)
619619

620620
if ( edpt_complete )
621621
{
622-
for(uint8_t epnum = 0; epnum < DCD_ATTR_ENDPOINT_MAX; epnum++)
622+
for(uint8_t epnum = 0; epnum < TUP_DCD_ENDPOINT_MAX; epnum++)
623623
{
624624
if ( tu_bit_test(edpt_complete, epnum) ) process_edpt_complete_isr(rhport, epnum, TUSB_DIR_OUT);
625625
if ( tu_bit_test(edpt_complete, epnum+16) ) process_edpt_complete_isr(rhport, epnum, TUSB_DIR_IN);

src/portable/ehci/ehci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "tusb_option.h"
2828

29-
#if CFG_TUH_ENABLED && defined(HCD_ATTR_EHCI)
29+
#if CFG_TUH_ENABLED && defined(TUP_USBIP_EHCI)
3030

3131
//--------------------------------------------------------------------+
3232
// INCLUDE

src/portable/mentor/musb/dcd_musb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,13 @@ static inline void print_block_list(free_block_t const *blk, unsigned num)
170170

171171
static unsigned find_free_memory(uint_fast16_t size_in_log2_minus3)
172172
{
173-
free_block_t free_blocks[2 * (DCD_ATTR_ENDPOINT_MAX - 1)];
173+
free_block_t free_blocks[2 * (TUP_DCD_ENDPOINT_MAX - 1)];
174174
unsigned num_blocks = 1;
175175

176176
/* Initialize free memory block list */
177177
free_blocks[0].beg = 64 / 8;
178178
free_blocks[0].end = (4 << 10) / 8; /* 4KiB / 8 bytes */
179-
for (int i = 1; i < DCD_ATTR_ENDPOINT_MAX; ++i) {
179+
for (int i = 1; i < TUP_DCD_ENDPOINT_MAX; ++i) {
180180
uint_fast16_t addr;
181181
int num;
182182
USB0->EPIDX = i;
@@ -575,7 +575,7 @@ static void process_bus_reset(uint8_t rhport)
575575
USB0->RXIE = 0;
576576

577577
/* Clear FIFO settings */
578-
for (unsigned i = 1; i < DCD_ATTR_ENDPOINT_MAX; ++i) {
578+
for (unsigned i = 1; i < TUP_DCD_ENDPOINT_MAX; ++i) {
579579
USB0->EPIDX = i;
580580
USB0->TXFIFOSZ = 0;
581581
USB0->TXFIFOADD = 0;
@@ -663,7 +663,7 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * ep_desc)
663663
const unsigned xfer = ep_desc->bmAttributes.xfer;
664664
const unsigned mps = tu_edpt_packet_size(ep_desc);
665665

666-
TU_ASSERT(epn < DCD_ATTR_ENDPOINT_MAX);
666+
TU_ASSERT(epn < TUP_DCD_ENDPOINT_MAX);
667667

668668
pipe_state_t *pipe = &_dcd.pipe[dir_in][epn - 1];
669669
pipe->buf = NULL;
@@ -715,7 +715,7 @@ void dcd_edpt_close_all(uint8_t rhport)
715715
NVIC_DisableIRQ(USB0_IRQn);
716716
USB0->TXIE = 1; /* Enable only EP0 */
717717
USB0->RXIE = 0;
718-
for (unsigned i = 1; i < DCD_ATTR_ENDPOINT_MAX; ++i) {
718+
for (unsigned i = 1; i < TUP_DCD_ENDPOINT_MAX; ++i) {
719719
regs->TXMAXP = 0;
720720
regs->TXCSRH = 0;
721721
if (regs->TXCSRL & USB_TXCSRL1_TXRDY)

0 commit comments

Comments
 (0)