Skip to content

Port config/init confusion, whats the recomended way? #2558

Answered by hathach
duckylotl asked this question in Q&A
Discussion options

You must be logged in to vote

the old CFG_TUSB_RHPORT0_MODE style requires the port must be hard coded to host/device. tud_init()/tuh_init() allow user to dynamically init an roothub port as device/host as needed, and deinit() it if want to (save/power/switch role, configuration etc..). deinit() is not implemented for device, but is added for host #2530.

In summary, it make it easier to switch role dynamically on multiple roothub port controller. If you don't need it, you don't have to use it. tusb_init() can still be invoked to initialize both host + device

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@duckylotl
Comment options

@hathach
Comment options

Answer selected by duckylotl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants