Hi all,
On those days I'm trying to study the usb protocol, applied to the TivaC MCU, but I have a little doubt, and hope a brainstornming from the community.
I'm trying to understand if there is a bit, a register or some trick in the TivaC mcu to detect the end of an USB stage.
I mean: How can I detect the end of the Setup stage? The start of the setup stage itself is simple, I can check USBIF register to get the SOF bit updated, or the frame count to check if the count goes up, but for the end of the same stage?
Let's try to figure out this situation: I'm in the SET_ADDRESS request in the StandardRequest, ok? I got my new address from the host, but I can't update the mcu USBFADDR register, because before I need the relative IN-setup stage from the host itself, to reply with a ZLP to ensure that all the SET_ADDRESS requests got success.
How can I detect the end of the previous setup stage (the OUT stage, where the host sent me the new address)?
Does I need just to wait for the next stage and check in the bmRequest Type if this last one is an IN Stage?
Is this one, the only way?
Thanks