Initial support for SPI BIDIR (3-wire)#181
Conversation
|
All good and merged, thanks ! Also please take some time to update the wiki ;) |
| proto->config.spi.dev_polarity = 0; | ||
| proto->config.spi.dev_phase = 0; | ||
| proto->config.spi.dev_bit_lsb_msb = DEV_FIRSTBIT_MSB; | ||
| proto->config.spi.dev_bidir = 0; |
There was a problem hiding this comment.
Isn't bidir intended to be enabled by default in serprog mode?
Documentation of serprog protocol states that S_SPI_MODE command (0x17), have two available modes, and the 0x00 mode that means Half Duplex is default one.
Source: https://www.flashrom.org/supported_hw/supported_prog/serprog/serprog-protocol.html, and look for S_SPI_MODE command
There was a problem hiding this comment.
bidir uses only one data line compared to the usual two in SPI.
The two serprog modes are for deciding whether you can write and read data at the same time (ie. the same clock cycle).
That is handled by proto->config.wwr in Hydrafw SPI mode but the serprog S_SPI_MODE is currently not handled, as I have no device to test and validate this feature. If you have some, feel free to submit a PR adding this mode ;)
Initial support half-duplex bi-directionnal mode for SPI.
Added subcommand for BBIO. If the changes are OK I can update the wiki and pyHydrabus accordingly, just let me know.
Not tested on a real device yet, but seems to work between two Hydrabus in master-slave mode.