Hi Terence!
I apologize for the delay! I missed the track of your inquirie due my workload.
You can check the value of the USB1_ID pin!
Altougth this pin does not have a GPIO alternative like USB0_ID.
To do this please, refer to the register PortMode of the LPC546 UM

This is the small code that I made to test the USB1_ID pin :
#include "fsl_power.h"
int main( void )
{
/* Init FSL debug console. */
BOARD_InitDebugConsole(); POWER_DisablePD(kPDRUNCFG_PD_USB1_PHY); /*< Turn on USB Phy */
CLOCK_EnableClock(kCLOCK_Usbh1 );
CLOCK_EnableUsbfs0HostClock(kCLOCK_UsbSrcUsbPll, 48000000U); while (1)
{
USBHSH->PORTMODE |= 1<<8;// enabling pull up resistor on USB1_ID pin
if(USBHSH->PORTMODE & (0x01))
{
//The pin is pulled up
PRINTF(" A device connected /n");
}
else
{ // the pin is pulled down
PRINTF("B device connected /n");
}
}
}
Additional comments:
This was tested using the LPCxpress54628 EVK. I can guarantee that this example code will work as intended on all situations!
To pull down the USB1_ID line I used to connect a OTG adapter to the high speed USB connector, since has the ID pin grounded.
I hope this helps!
-------------------------------------------------------------------------------
Note:
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------