Hello,
my question is how to understand if the usb that i connect is a usb cable connected to a pc or only to a charger. I need this because i want to enable the msd library only if there is a pc with communicate. There are some function in the MSD library? I use the SDK 2.2 for mcuxpresso
Thanks
Hi Daniele Cortellazzi
MK22FX512 as device cannot determinate when it was connected in the USB port, there is not function for this, we normally recommend to use a GPIO to check VBUS signal (using hardware to detect attach).
In this case, as VBUS will also be connected, then the part where this two cases will differ is in the D+ D- signal; when you connected a charger, this signal should not change.
Hope this helps
Best Regards
Jorge Alcala