Previous to this patch the USB CDC driver used TIM3 to trigger the
sending of outgoing data over USB serial. This patch changes the
behaviour so that the USB SOF interrupt is used to trigger the processing
of the sending. This reduces latency and increases bandwidth of outgoing
data.
Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype.
See PR #1713.
This is refactoring to enable support for the two USB PHYs available on
some STM32F4 processors to be used at the same time. The F405/7 & F429
have two USB PHYs, others such as the F411 only have one PHY.
This has been tested separately on a pyb10 (USB_FS PHY) and F429DISC
(USB_HS PHY) to be able to invoke a REPL/USB. I have modified a PYBV10
to support two PHYs.
The long term objective is to support a 2nd USB PHY to be brought up as a
USB HOST, and possibly a single USB PHY to be OTG.
The STMCube examples define both USE_USB_HS and USE_USB_HS_IN_FS when they
use the HS in FS mode.
The STM32F401 doesn't have a USB_HS at all, so the USB_OTG_HS instance
doesn't even exist.
This config option is for the USB OTG pin, pin A10. This is used on
some boards but not others. Eg PYBv3 uses PA10 for LED(2), so it
shouldn't be used for OTG ID (actually PA10 is multiplexed on this
board, but defaults to LED(2)).
Partially addresses issue #1059.
Since all currently supported boards use pin A9 for this function, the
value of the macro MICROPY_HW_USB_VBUS_DETECT_PIN is not actually used,
just the fact that it is defined.
Addresses issue #1048.
Blanket wide to all .c and .h files. Some files originating from ST are
difficult to deal with (license wise) so it was left out of those.
Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.