0

I am new to Android Things, and I'm trying to power off the usb device that connected to the i.MX7 Dual. After I read https://developer.android.com/guide/topics/connectivity/usb/host.html#api , I find that there is no result of the VID and PID of it.

My question is that I just want to control my device via power on and power off it, how can I do it? Thanks in advance.

chiyomin
  • 11
  • 2

1 Answers1

1

You can try "software" solution like this or that, but seems, better way is to use MOSFET power switch, like in this answer of yo':

MOSFET power key

which connected to GPIO pin of Android Things board. In that case you can control your device via that GPIO pin:

...
gpio.setDirection(Gpio.DIRECTION_OUT_INITIALLY_LOW);
gpio.setActiveType(Gpio.ACTIVE_HIGH);
// set your USB device ON
gpio.setValue(true);
...
Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79