How to Detect in Firmware if the Device has Enumerated as a High Speed or Full Speed Device

Question: How can it be detected in firmware whether a device has enumerated as a full speed device or a high speed device?

 

Answer:

The register USBCS in FX2LP contains a bit HSM(USBC.7) which is set high when enumeration happens in high speed. Also, the 0-1 transition of this bit will cause an HSGRANT interrupt request.