tinyusb/stm32_fsdev: Add dcd_connect/dcd_disconnect #3536
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
STM32F1/F3 do not have internal pull-up resistor on D+ line that can be automatically attached.
Many board have external pull-up resistor that is
connected all the time.
So far when USB_DP_HAS_EXTERNAL_PULL_UP was 1 (default) code was shorting D+ line to the ground as GPIO output for a wile during startup.
It is possible to have external pull-up resistor that is switchable at runtime (via transistor or resistor is just sourced from one of the GPIO pins).
For this purpose now dcd_connect and dcd_disconnect functions are provided that can enabled pull-up resistor in several ways.
With such setup device that is connected to USB just for power does not have to be detected by host system as broken one.