Replies: 2 comments 1 reply
-
to be honest, I don't know the detail as well. I would picture otg will add a thin layer of switching to determine device/host role. It could introduce a few new API like tuo_int_handler( o for otg) to forward isr to either host/device isr, and/or tud/tuh_disable() to disable/enable the role that is not active etc ... However, each port will has different otg implementation, some could have dedicated hardware for actual role negotiation, other like rp2040 will probably use ID pin to detect the role. I guess we will actually need to do the work and figure it out on the way, any PRs is welcome. |
Beta Was this translation helpful? Give feedback.
-
I did a pull request a good time ago that allows implementing OTG without changing too much about the TinyUSB logic: |
Beta Was this translation helpful? Give feedback.
-
I need to support OTG (on NXP RT1024).
Looking for advice on how to add OTG to tinyUSB, hopefully in a way that can be merged into tinyUSB mainline!
I can set up an ISR trigger when OTG line changes (board mode changes device<->host).
Expect I need to shut down any activity (including failing anything in-progress without crashing),
then initialize the new mode.
What is the best way to do this?
I know many others have faced this, most recently I see from @MasterQ32 here: #1835 but
this pull request has conflicts and has not been merged into mainline ;-(
So, I am hoping for some advice? @hathach ?
I don't mind doing the work but prefer it is useful for others...
Thanks!
Best Regards, Dave
PS: Hope I can get OTG to work as I already built the hardware ;-)
Beta Was this translation helpful? Give feedback.
All reactions