Hi,
I would like to ask, on the FRDM-MCXN947 board I am using USB1_HS with OTG USB, I am trying to detect the connection and disconnection of this USB. Connection detection works fine, so I use this function:
usb_device_notification_t USB_State(usb_device_struct_t *pDeviceHandle)
{
usb_device_ehci_state_struct_t *ehciState;
ehciState = (usb_device_ehci_state_struct_t *)(pDeviceHandle->controllerHandle);
if (0U != (ehciState->registerBase->OTGSC & USBHS_OTGSC_BSV_MASK))
{
return kUSB_DeviceNotifyAttach;
}
return kUSB_DeviceNotifyDetach;
}
However, for some reason this USB OTG register does not detect the disconnection correctly. Is it possible to use some other register to detect the disconnection?
Thank you for any advise!
John Adams