embeddedsw icon indicating copy to clipboard operation
embeddedsw copied to clipboard

TWI mode implemented

Open raczben opened this issue 5 years ago • 1 comments

TWI mode implemented. Solution of #107 This version is backward compatible with origin.

The TWI is the half duplex variant of the SPI, where the MOSI and the MISO is common and usually named as SDIO.

This implementation added two variables added to XSpi structure. First is the DirectionSwitcher which is a function pointer to a user implemented function, which has to handle the tri-state pin of the SDIO pin. The second new variable is the SwitchDirectionAfter, which is a byte counter, which tells the driver the when to switch the direction.

The driver sends SwitchDirectionAfter bytes, then waits to done of these bytes. (There is no wait in non-TWI mode.) Then the driver call DirectionSwitcher then sends other bytes.

Polled mode supported only. (Interrupt mode is not supported).

See the new example for more usage details.

raczben avatar Jan 14 '20 14:01 raczben

+1, it would be great to see this functionality supported!

ilanbiala avatar Jan 15 '21 20:01 ilanbiala