Is there a way for a USB 2.0 Device to detect if it is connected to a USB 2.0 or USB 3.X host port? I need this to figure out the maximum current the device can safely take.
Some more details about the project:
I'm designing a gaming controller that have addressable RGB lights. Those currently use an external 5V supply (a standard DC barrel jack wall supply + USB cable for data). I would like to have a single USB cable powering the device and the lights but those can take more than 500mA sometimes.
If there is a way to check if the device can or cannot draw more than 500mA I would design it to run into two different power modes based on the host port.
The MCU I use is an STM32F103C8 which only support USB 2.0 FS.