diff options
author | Purdea Andrei <andrei@purdea.ro> | 2023-09-25 05:54:22 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 12:54:22 +1000 |
commit | 408d61dcfb26b257a69fb0aa68fea3b52a629252 (patch) | |
tree | 41ef8b2d3f7e51ce2e692e90e640954660f287a3 /docs/spi_driver.md | |
parent | e0eb90aba127f6bceacc9112bb89cb86da19f768 (diff) |
Chibios SPI driver: allow some SPI pins to be left unassigned (#20315)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
Diffstat (limited to 'docs/spi_driver.md')
-rw-r--r-- | docs/spi_driver.md | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/spi_driver.md b/docs/spi_driver.md index c1c6831e73..1faa9f0773 100644 --- a/docs/spi_driver.md +++ b/docs/spi_driver.md @@ -49,6 +49,11 @@ Configuration-wise, you'll need to set up the peripheral as per your MCU's datas As per the AVR configuration, you may choose any other standard GPIO as a slave select pin, which should be supplied to `spi_start()`. +If a complete SPI interface is not required, then the following can be done to disable certain SPI pins, so they don't occupy a GPIO unnecessarily: + - in `config.h`: `#define SPI_MISO_PIN NO_PIN` + - in `config.h`: `#define SPI_MOSI_PIN NO_PIN` + - in `mcuconf.h`: `#define SPI_SELECT_MODE SPI_SELECT_MODE_NONE`, in this case the `slavePin` argument passed to `spi_start()` may be `NO_PIN` if the slave select pin is not used. + ## API :id=api ### `void spi_init(void)` :id=api-spi-init |