MK22FX512 and MSD library

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MK22FX512 and MSD library

788 Views
ypkdani
Contributor III

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

Tags (1)
0 Kudos
1 Reply

588 Views
jorge_a_vazquez
NXP Employee
NXP Employee

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

0 Kudos