Modifying USB descriptors well after enumeration

I'm looking for suggests on how to proceed here:

A few seconds after boot I may find an I2C device connected to the Teensy 4.0 and it would be great if I could add a new device to the USB descriptors. The device is a variant of a HID device - a I2CHID PTP device. I'd like the Teensy 4.0 to be a CDC device + a HID PTP device (if found). The main code will bridge the I2CHID to the USBHID and take some commands from CDC. The exact details of the PTP device descriptor are unknown at compile time.
So I see two paths forward here: first, delay enumeration until I find that I2C device and read out it's descriptors, then build the descriptors in RAM and enumerate.
Or, enumerate at boot, and if I find the second device, re-enumerate later.
Is there an easier way that might exist?
Is there a way hold off enumeration and do it manually in main?
Is there a way to re-enumerate?
What files/functions are a good starting point for figuring this out?
 
Back
Top