Skip to content

Commit

Permalink
drivers: spi: Add support for half-duplex (3-wire) SPI
Browse files Browse the repository at this point in the history
Add support for half-duplex (3-wire) SPI operation using the Raspberry
Pi Pico PIO.  To allow control of the size of the driver, including
half-duplex support is optional, under the control of Kconfig options.

The original PIO source code is also included as a reference.

Corrected 3-wire tx/rx counts.

Enable half-duplex code based on DTS configuration

Replace runtime checks with static BUILD_ASSERT()

Signed-off-by: Steve Boylan <stephen.boylan@beechwoods.com>
  • Loading branch information
ThreeEights committed Mar 14, 2024
1 parent a48c958 commit 33d1ca0
Show file tree
Hide file tree
Showing 4 changed files with 732 additions and 107 deletions.
23 changes: 23 additions & 0 deletions drivers/spi/Kconfig.rpi_pico
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,26 @@ config SPI_RPI_PICO_PIO
select PICOSDK_USE_CLAIM
help
Enable driving SPI via PIO on the PICO

if SPI_RPI_PICO_PIO

config SPI_RPI_PICO_PIO_8_BIT
bool "PIO 8-bit support"
default y
help
Enable any addtional code needed to
support 8-bit transfers.

config SPI_RPI_PICO_PIO_16_BIT
bool "PIO 16-bit support"
help
Enable any addtional code needed to
support 16-bit transfers.

config SPI_RPI_PICO_PIO_32_BIT
bool "PIO 32-bit support"
help
Enable any addtional code needed to
support 32-bit transfers.

endif

0 comments on commit 33d1ca0

Please sign in to comment.