Giter VIP home page Giter VIP logo

Comments (4)

obtitus avatar obtitus commented on July 24, 2024 1

hi sophiekovalevsky, the following example demonstrate how you can set channel 0 to cshigh=True and channel 1 to cshigh=False. I am not sure this is the only way to achieve this, but it seems to work.

import spidev
spi0 = spidev.SpiDev()
spi0.open(0, 0)
spi0.cshigh = True

spi1 = spidev.SpiDev()
spi1.open(0, 1)
spi1.cshigh = False

You can now use say spi0.xfer for channel 0 and spi1.xfer for channel 1.

from py-spidev.

Gadgetoid avatar Gadgetoid commented on July 24, 2024

I've been grappling with low-level SPI recently, trying to figure out how to not assert a chip-select line at all so I can control 4 devices instead of two. So hopefully I'm not going to spout complete nonsense.

The chip select lines correspond to the SPI device you pick with spi.open(). The first argument being the SPI bus number and the second being either 0 for CS0 ( BCM 8 ) or 1 for CS1 ( BCM 7 ) : http://pinout.xyz/pinout/spi

If you want to use any pin, you can just assert it manually before an xfer, while it's super handy to have the SPI library take care of chip-select for you ( and probably ever so slightly faster ), it's certainly not necessary.

from py-spidev.

sophiekovalevsky avatar sophiekovalevsky commented on July 24, 2024

Thanks for the quick response.
So, if I have to instance of the spi library, which mean that I'm using the two ports that my embedded offer, how do I know which port affect the cshigh method?

Thanks a lot.

from py-spidev.

sophiekovalevsky avatar sophiekovalevsky commented on July 24, 2024

Thanks a lot.

from py-spidev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.