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

Control SPI chip select #52

Open webmeister opened 3 years ago

webmeister commented 3 years ago

I need to keep the SPI chip select asserted while transferring multiple messages (and doing some processing in between). The necessary low-level interface already exists (_CSpiIocTransfer.cs_change). Can this be made accessible from the high-level Python interface (i.e. SPI.transfer)?

Livius90 commented 2 years ago

Duplicated issue: https://github.com/vsergeev/python-periphery/issues/37, https://github.com/vsergeev/c-periphery/issues/19

It would be useful for me also. I made a modified def transfer_burst(self, data): method to do it. I could send it in a pull-request.

But pay attention that not all SPI controller driver can support it, i had to implement it in spi kernel driver for my SPI controller, too.