rust-embedded / linux-embedded-hal

Implementation of the `embedded-hal` traits for Linux devices
Apache License 2.0
241 stars 41 forks source link

How to use SPI with gpio_cdev #116

Open patrickelectric opened 5 days ago

patrickelectric commented 5 days ago

Using gpio_cdev the line handler return Error { kind: Ioctl { kind: LineHandle, cause: EBUSY } } when requesting a pin configured as SPI chip select.

In my case, when running a raspberry pi 5: line 16: "GPIO16" "spi1 CS2" output active-low [used]

ls /dev/spidev*
/dev/spidev0.0  /dev/spidev1.0  /dev/spidev10.0  /dev/spidev1.1  /dev/spidev1.2

Any suggestion or example of how to use chip selects with the new API ? It appears to run fine in a Raspberry Pi 4. line 16: "GPIO16" unused output active-high

ls /dev/spidev
spidev0.0  spidev1.0  spidev1.1  spidev1.2
patrickelectric commented 5 days ago

any suggestion @eldruin ?