Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/exp/io/spi: support csChange on a per-tx basis in spidev #16239

Closed
bgentry opened this issue Jul 1, 2016 · 2 comments
Closed

x/exp/io/spi: support csChange on a per-tx basis in spidev #16239

bgentry opened this issue Jul 1, 2016 · 2 comments

Comments

@bgentry
Copy link
Contributor

bgentry commented Jul 1, 2016

I'm interfacing with a Silicon Labs ZigBee chip as a network co-processor using their EZSP protocol over SPI (that's documented here FYI). It's a bit non-standard in that they expect you to transmit a command frame, then continue reading off the SPI until a response has been received (which can take up to 300ms). During this whole time, the chip select must stay active, then get released when the whole transaction is done.

The devfs/spidev driver has a struct that contains a csChange field, however that is not exposed anywhere. I tried tweaking the payload in the source to set csChange to 1, and that does seem to give me the behavior that I want in that I can keep submitting multiple Tx() calls and keep the chip select enabled.

This is the basic flow I'll need to make this work:

  1. Send a message payload with the bytes of the EZSP command. Set csChange to 1 for this payload so chip select stays enabled.
  2. Repeatedly send small (~8 byte) message payloads and read equal amounts of response, keeping csChange at 1.
  3. Once one of these calls returns bytes that contain the EZSP response frame terminator, send an empty payload that sets csChange to its default value of 0.

I'm happy to attempt this change myself but thought it would be good to see if anybody has thought about how this might fit in with the Driver and Device interfaces (especially @rakyll).

Thanks!

@rakyll rakyll self-assigned this Jul 13, 2016
@rakyll rakyll added this to the Unreleased milestone Jul 13, 2016
@bgentry
Copy link
Contributor Author

bgentry commented Jul 13, 2016

I made an attempt to expose this setting here: https://go-review.googlesource.com/24910

@rakyll
Copy link
Contributor

rakyll commented Sep 28, 2016

Closed via golang/exp@77b4e87.

@rakyll rakyll closed this as completed Sep 28, 2016
@golang golang locked and limited conversation to collaborators Sep 28, 2017
@rsc rsc unassigned rakyll Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants