orangepi-xunlong / wiringOP

wiringPi for Orange Pi
GNU Lesser General Public License v3.0
396 stars 188 forks source link

Using multiple spi devices #10

Closed dolfandringa closed 4 years ago

dolfandringa commented 4 years ago

Im WiringPiSPI.c I see you can specify the spi channel, where 0 corresponds to /dev/spidev0.0 and 1 corresponds to /dev/spidev1.0. But on at least the orangePi Zero, you can enable multiple chipselect pins in the dtb overlays. I have managed to also add /dev/spidev1.1 and /dev/spidev1.2. How can I use those spi devices? If there is no way to do this currently, would it be an idea to add a port option (aside from the channel) defaulting to 0 which allows using channel.port for the spi device? I'd be happy to create a PR for this.

orangepi-xunlong commented 4 years ago

Hi,

welcome to this, in addition, could you please provide the detailed test steps and information, as well as the version of the operating system you are using, thanks!