vsergeev / python-periphery

A pure Python 2/3 library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux.
MIT License
519 stars 139 forks source link

Support GPIO for SPI Chip Selection? #51

Open Qingwu-Li opened 3 years ago

Qingwu-Li commented 3 years ago

Possible to support an/several GPIO for SPI Chip Selection?

vsergeev commented 3 years ago

This could be supported relatively easily by passing a GPIO object as a cs_gpio keyword argument in the SPI constructor. The SPI object would assert and deassert the chip select in transfer(). Inverted / non-inverted would be up to the GPIO.