Merge pull request #2 from adafruit/revb_usb
add usb host power for rev b
This commit is contained in:
commit
6eb0b4d8d7
2 changed files with 9 additions and 1 deletions
|
|
@ -67,5 +67,6 @@
|
|||
|
||||
#define PIN_USB_HOST_DP (1u)
|
||||
#define PIN_USB_HOST_DM (2u)
|
||||
#define PIN_USB_HOST_VBUS (11u)
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1594,8 +1594,15 @@ void emu_init(void)
|
|||
_Static_assert(PIN_USB_HOST_DP + 1 == PIN_USB_HOST_DM || PIN_USB_HOST_DP - 1 == PIN_USB_HOST_DM, "Permitted USB D+/D- configuration");
|
||||
pio_cfg.pinout = PIN_USB_HOST_DP + 1 == PIN_USB_HOST_DM ? PIO_USB_PINOUT_DPDM : PIO_USB_PINOUT_DMDP;
|
||||
pio_cfg.pin_dp = PIN_USB_HOST_DP;
|
||||
tuh_configure(BOARD_TUH_RHPORT, TUH_CFGID_RPI_PIO_USB_CONFIGURATION, &pio_cfg);
|
||||
|
||||
#ifdef PIN_USB_HOST_VBUS
|
||||
printf("Enabling USB host VBUS power on GP%d\r\n", PIN_USB_HOST_VBUS);
|
||||
gpio_init(PIN_USB_HOST_VBUS);
|
||||
gpio_set_dir(PIN_USB_HOST_VBUS, GPIO_OUT);
|
||||
gpio_put(PIN_USB_HOST_VBUS, 1);
|
||||
#endif
|
||||
|
||||
tuh_configure(BOARD_TUH_RHPORT, TUH_CFGID_RPI_PIO_USB_CONFIGURATION, &pio_cfg);
|
||||
printf("Init USB...\n");
|
||||
printf("USB D+/D- on GP%d and GP%d\r\n", PIN_USB_HOST_DP, PIN_USB_HOST_DM);
|
||||
printf("TinyUSB Host HID Controller Example\r\n");
|
||||
|
|
|
|||
Loading…
Reference in a new issue