diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-11-24 16:46:11 -0500 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-11-24 16:46:11 -0500 |
| commit | 59458a9013786f79c78a36ce5d6298f16fdd6a1a (patch) | |
| tree | 9127e47c5ef5573c9f1ce4505390c2a99b9fb015 /ports | |
| parent | 0836abba41c3e7ce26277bb12f3d597a54edae55 (diff) | |
Add pin claiming to SPI construct
Diffstat (limited to 'ports')
| -rw-r--r-- | ports/esp32s2/common-hal/busio/SPI.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ports/esp32s2/common-hal/busio/SPI.c b/ports/esp32s2/common-hal/busio/SPI.c index 490419f34..da738bbfd 100644 --- a/ports/esp32s2/common-hal/busio/SPI.c +++ b/ports/esp32s2/common-hal/busio/SPI.c @@ -204,6 +204,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, // hal->dummy_bits = 0; // hal->addr = 0; + claim_pin(self->clock_pin); + if (self->MOSI_pin != NULL) { + claim_pin(self->MOSI_pin); + } + if (self->MISO_pin != NULL) { + claim_pin(self->MISO_pin); + } + hal->io_mode = SPI_LL_IO_MODE_NORMAL; common_hal_busio_spi_configure(self, 250000, 0, 0, 8); |
