]> granicus.if.org Git - esp-idf/commit
spi: fix the bug of connecting SPI peripheral to read-only pins
authorMichael (XIAO Xufeng) <xiaoxufeng@espressif.com>
Mon, 11 Feb 2019 06:17:31 +0000 (14:17 +0800)
committerMichael (XIAO Xufeng) <xiaoxufeng@espressif.com>
Mon, 1 Apr 2019 10:39:02 +0000 (18:39 +0800)
commit325fca94c0eb1d40bd5f84362ff3d6bb9d47cfdd
treebb596b5e3812046d19a88af9e4f58b401016b750
parent286202caa31b61c2182209f37f8069a0b60fb942
spi: fix the bug of connecting SPI peripheral to read-only pins

The requirements of pin capabilites is different for spi master and
slave.  The master needs CS, SCLK, MOSI to be output-able, while slave
needs MISO to be output-able.

Previous code is for master only.

This commit allows to place other 3 pins than MISO on input-only pins
for slaves. Refactoring for spi_common is also included.

Resolves https://github.com/espressif/esp-idf/issues/2455
components/driver/spi_common.c
components/driver/test/test_spi_master.c