Is it even set? I can't find it in any of the examples, nor have I spotted any direct access to the pin, but the pin would have to be enabled for the board to supply power to a USB device.
I was looking for it because I wanted to know under what conditions that pin might be toggled. Like, which functions toggle it and when.
I guess, those look like the same files I have. I'm not "using" them though, I'm just looking through the code trying to figure out when and where it toggles that pin, if at all.
I just did a search on that repository for USB_HOST_ENABLE as well and I only see the pin defined I don't see it used anywhere. And if it's not toggled somewhere, then the host will never supply power.
The Atmel's developer that made the USBHost porting has decided to put some very low level code in these two files samd21_host.c/h, so we need both (these files and the library).
To put it in another way: the USBHost library uses those samd21_host.c/h as a "driver".
The host mode is not documented, it's a very advanced topic and I guess it's a bit out of the Arduino's target audience.
cmaglie:
To put it in another way: the USBHost library uses those samd21_host.c/h as a "driver".
ah OK, now I understand ...
cmaglie:
The host mode is not documented, it's a very advanced topic and I guess it's a bit out of the Arduino's target audience.
to be honest: I can not understand this opinion/attitude.
I think it is always necessary to document each feature of an arduino board extensively,
doing this in the past is one thing that helped making the arduino ecosystem so great ...
Since there were "USB-Host shields" and an "Arduino Mega ADK" in the past, I can not see that this is "out of the Arduino's target audience" (?)
I can understand your disappointment, but what kind of documentation you're reasonably expecting?
On the reference site we usually provide information on how the API works and give some examples (in the USBHost case we do not provide details on the USBHost class itself but on the two classes KeyboardController and MouseController that uses the USBHost and that are simple enough to be used by an average skilled user).
We can surely provide more detailed docs on the USBHost API too, but do you think that documenting methods like:
on the arduino.cc website may be of any help to anyone that is not a USB Host guru? (I'm having hard time too to figure out what this method does or how it may be used together with the other 40+ methods available in that class)
nonetheless, the library is much more well documented on the website of the upstream developers:
maybe we should put some notes on the reference page that the USBHost library derives from the circuits@home library?
PS:
I see from the c@h's website that the USB_Host_3 has been released in alpha! This may be a good time to update the library with the new API from USB_Host_3.