summaryrefslogtreecommitdiffstatshomepage
path: root/extmod/machine_spi.c
Commit message (Collapse)AuthorAge
* extmod/machine_spi: Add optional support for fast software SPI.Damien George2016-10-04
| | | | | | If a port defines MICROPY_PY_MACHINE_SPI_MIN_DELAY then it can use a faster software SPI loop that does not make calls to the delay_us function.
* extmod/machine_spi: Use delay_half, not baudrate, for internal timing.Damien George2016-10-04
| | | | | | | The delay_half parameter must be specified by the port to set up the timing of the software SPI. This allows the port to adjust the timing value to better suit its timing characteristics, as well as provide a more accurate printing of the baudrate.
* extmod/machine_spi: Factor out software SPI code from esp8266 to extmod.Damien George2016-10-03
|
* extmod/machine_spi: Simplify SPI xfer function to only take one buf len.Damien George2016-10-03
| | | | | | | | There is no need to take src_len and dest_len arguments. The case of reading-only with a single output byte (originally src_len=1, dest_len>1) is now handled by using the output buffer as the input buffer, and using memset to fill the output byte into this buffer. This simplifies the implementations of the spi_transfer protocol function.
* extmod: Add machine_spi with generic SPI C-protocol and helper methods.Damien George2016-09-01
The idea is that all ports can use these helper methods and only need to provide initialisation of the SPI bus, as well as a single transfer function. The coding pattern follows the stream protocol and helper methods.