doceme / py-spidev

MIT License
461 stars 203 forks source link

Setting Number of Bits #1

Closed pacmac closed 12 years ago

pacmac commented 12 years ago

Hi, I have searched for an answer on this but have not found anything.

Is it possible to set the number of bits (i.e. 9) and the clock frequency from python ?

doceme commented 12 years ago

You can set the bits_per_word property on the spidev object to change the number of bits to use per transaction. This will only work if the SPI controller for the chip you are using implements support for it.

pacmac commented 12 years ago

Thanks, but if I set the bits_per_word to anything other than 8, I get a kernel panic:

"Unable to handle kernel NULL pointer dereference at virtual address 00000000"

On 23/9/12 10:28 AM, doceme wrote:

You can set the bits_per_word property on the spidev object to change the number of bits to use per transaction. This will only work if the SPI controller for the chip you are using implements support for it.

— Reply to this email directly or view it on GitHub https://github.com/doceme/py-spidev/issues/1#issuecomment-8794747.

doceme commented 12 years ago

What CPU and kernel are you using?