Add support for RM2 with STM32F (429, 746) #3086
Open
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.
TO BE REBASED after merging #3083 (Ignore first 3 commits for review)
Introduces MG_TCPIP_EV_DRIVER, fired when the driver requests user action (see below)
Adds
hs
to enable "high-speed mode" instead of defaulting to keeping it enabledAdds examples with actual SPI hardware, with and without FIFO
Rationale: CYW chips have this weird mode enabled by default. Instead of using SPI like the rest of the world and enabling this manually, these chips default to clocking data out with the rising clock edge (instead of the falling edge).

On a typical connection with long paths, this can actually be good, as there is a longer setup time for data arriving at the master. However, with short connections, there can be a race condition depending on master and slave logic thresholds (or master internal design), as both master data strobe and slave data change occur at the rising edge.
So, the driver initializes the chip according to the
hs
parameter and fires the aforementioned event, the user may just ignore it (ad hoc SPI with a PIO accounting for this) or catch it and change SPI settings (STM32F)Response to TEST command on start, high-speed mode and 16-bit little endian (swapped words and bytes):
"FEEDBEAD" ("BEADFEED") is correctly decoded by the microcontroller, but the logic analyzer has a longer path and misses some bits.
Setup, change of speed, response to TEST command with normal mode and 32-bit big endian (all 32-bits from MSB to LSB):

"FEEDBEAD" ("ADBEEDFE"