File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change
1
+ ../../../extras/tinyusb/src/host
Original file line number Diff line number Diff line change @@ -268,12 +268,18 @@ void __USBStart() {
268
268
return ;
269
269
}
270
270
271
- /* Enable USB_BASE */
271
+ /*
272
+ * ENABLE USB
273
+ */
272
274
R_SYSTEM->PRCR = (uint16_t ) BSP_PRV_PRCR_PRC1_UNLOCK;
273
275
R_MSTP->MSTPCRB &= ~(1U << 11U );
274
276
R_MSTP->MSTPCRB &= ~(1U << 12U );
275
277
R_SYSTEM->PRCR = (uint16_t ) BSP_PRV_PRCR_LOCK;
276
278
279
+ /*
280
+ * CONFIGURE USB INTERRUPTS
281
+ */
282
+
277
283
#ifdef CFG_TUSB_RHPORT0_MODE
278
284
#if (CFG_TUSB_RHPORT0_MODE != 0)
279
285
usb_irq_cfg.num_of_irqs_required = 4 ;
@@ -294,7 +300,15 @@ void __USBStart() {
294
300
295
301
__SetupUSBDescriptor ();
296
302
303
+ /*
304
+ * INIT Tiny USB
305
+ */
306
+
307
+ assert (BOARD_TUD_RHPORT != BOARD_TUH_RHPORT);
308
+ /* init device port*/
297
309
tud_init (BOARD_TUD_RHPORT);
310
+ /* init host port */
311
+ tuh_init (BOARD_TUH_RHPORT);
298
312
299
313
#if 0 //defined(AZURE_RTOS_THREADX)
300
314
static TX_BYTE_POOL byte_pool_0;
Original file line number Diff line number Diff line change 12
12
extern "C" {
13
13
#endif
14
14
15
+ /*
16
+ * USB PORT 0 CONFIGURATION: HOST, FULL SPEED
17
+ */
18
+
19
+ // RHPort number used for device can be defined by board.mk, default to port 0
20
+ #ifndef BOARD_TUH_RHPORT
21
+ #define BOARD_TUH_RHPORT 0
22
+ #endif
23
+
24
+ #define CFG_TUSB_RHPORT0_MODE (OPT_MODE_HOST | OPT_MODE_FULL_SPEED)
25
+
26
+ #ifndef BOARD_TUH_MAX_SPEED
27
+ #define BOARD_TUH_MAX_SPEED OPT_MODE_FULL_SPEED
28
+ #endif
29
+
30
+ /*
31
+ * USB PORT 1 CONFIGURATION: DEVICE, HIGH SPEED
32
+ */
33
+
15
34
// RHPort number used for device can be defined by board.mk, default to port 0
16
35
#ifndef BOARD_TUD_RHPORT
17
36
#define BOARD_TUD_RHPORT 1
You can’t perform that action at this time.
0 commit comments