<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to distinguish USB is connected to PC or power adaptor?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/35556/how-to-distinguish-usb-is-connected-to-pc-or-power-adaptor</link><description> 
Hello All, 

 
I&amp;#39;m using the keil USB middleware on LPC4357. The usb is
configured as MSC SD card device. 

 
I want to implement that 

 
1. SD card can be access by file system functions when not
connected to anything 2. SD card can be access by file</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: How to distinguish USB is connected to PC or power adaptor?</title><link>https://community.arm.com/thread/108761?ContentTypeID=1</link><pubDate>Sun, 22 May 2016 23:17:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f8eae10d-77a0-44d1-89e8-531ade04b838</guid><dc:creator>Milorad Cvjetkovic</dc:creator><description>&lt;p&gt;&lt;p&gt;
Reset event is not available for MSC handling, so you will have to
add this handling into the driver yourself.&lt;/p&gt;

&lt;p&gt;
In next version of middleware user events will be available so you
will be able to check reset event for the device.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to distinguish USB is connected to PC or power adaptor?</title><link>https://community.arm.com/thread/83169?ContentTypeID=1</link><pubDate>Sun, 22 May 2016 22:48:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:315e7de2-814d-4d7b-859f-85c961af251e</guid><dc:creator>Leo Cheng</dc:creator><description>&lt;p&gt;&lt;p&gt;
I would like to check the USB reset event. So is there any USB
reset callback can be used in MSC mode? If not, I have to modify the
USB interrupt routine.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to distinguish USB is connected to PC or power adaptor?</title><link>https://community.arm.com/thread/64725?ContentTypeID=1</link><pubDate>Thu, 19 May 2016 22:39:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b7573653-e72d-4080-8399-66a68f65cf9d</guid><dc:creator>Milorad Cvjetkovic</dc:creator><description>&lt;p&gt;&lt;p&gt;
Only way you could detect that power adapter is connected is if
your device is not enumerated a few seconds after VBUS is active then
it is not connected to USB Host but to power adapter.&lt;/p&gt;

&lt;p&gt;
USBD_MSC0_SetMediaOwnerFS() and USBD_MSC0_SetMediaOwnerUSB()
depend that USB Host is actively sending TestUnitReady requests and
on those requests actual media owner change happens. If you are not
connected to USB Host but for example to power adapter then these
requests are not happening so media ownership change does not work as
expected.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>