-
Notifications
You must be signed in to change notification settings - Fork 32
node-spi: added getters / setters and some examples #2
node-spi: added getters / setters and some examples #2
Conversation
1. Correctly expose constants as documented. 2. Adding "delay" as a property in the C wrapper. 3. Changed internal function full_duplex_transfer to actually accept speed, delay and size as arguments. 4. Passing aforementioned values into spi_ioc_transfer, which is ignored currently.
…me size as the tx buffer
added: mode() chipSelect() bitsPerWord() bitOrder() ORDER_MSB ORDER_LSB maxSpeed() halfDuplex() loopback() Not all options work on all platforms.
node-spi: added getters / setters and some examples
Thanks so much for doing this! I haven't had much time to work on it lately, so I appreciate all of the work you did for it! |
Thanks Russ, I have a project on this so I should be contributing a bit. -Anders On Fri, Feb 1, 2013 at 3:41 PM, Russell Hay notifications@github.comwrote:
Anders Brownworth AndersBrownworth@gmail.com andersbrownworth@gmail.com "Stay hungry; stay foolish." |
The main reason it's not async is because the spi kernel calls are not On Fri, Feb 1, 2013 at 12:49 PM, Anders Brownworth <notifications@github.com
|
Yep, seems like a threaded approach might eventually be necessary. Its fast If you get complaints on things blowing up, remind people they must .open() -a On Fri, Feb 1, 2013 at 4:24 PM, Russell Hay notifications@github.comwrote:
Anders Brownworth AndersBrownworth@gmail.com andersbrownworth@gmail.com "Stay hungry; stay foolish." |
Hi, Russell Can you suggest me How can I do this and what changes I have to do in src files. Code: var mydev = new spi.Spi("/dev/spidev2.0", { var out_buffer = new Buffer([0x41]); mydev.transfer(out_buffer, out_buffer.length, function(device, recv_buffer){ error: /home/ubuntu/node_modules/node-spi/spi.js:85 |
Alpesh, I think there are two issues here - .transfer(but, but.length, function...) -Anders On Wed, Feb 6, 2013 at 3:28 AM, Alpesh notifications@github.com wrote:
Anders Brownworth AndersBrownworth@gmail.com andersbrownworth@gmail.com "Stay hungry; stay foolish." |
Hi,
Thanks for all your work on node-spi. I've fleshed a little bit more out and have this working on a Raspberry Pi. Importantly, I removed this._spi.open() from the constructor giving people the option to run the setters but therefore requiring use of .open(). Some minimal checking on the setters is also included.
-Anders