LUA SPI (master) example?
Posted: Sat Jan 31, 2015 6:43 pm
I have nodemcu updated with the spi functions, but there is not yet any example. A simple, even trivial one that would send and receive some bytes from any peripheral would be welcome (I specifically need master mode).
But I also need wiring and need to know if I have to do something with the GPIO pin settings before I use the SPI pins (and which pins - yes, I've seen the data sheet, but it would help to confirm which is HSPI v.s. SPI, which one will I be talking to with the call).
Also, can I just do spi.recv(id,N) without doing any transmits (right now I just need to receive)? And if I need to transmit and receive at the same time, can it be done and how does it work?
There really isn't any explanation of what the functions actually do in the wiki yet. But one complete working example with the hardware and software would make it easy to understand.
But I also need wiring and need to know if I have to do something with the GPIO pin settings before I use the SPI pins (and which pins - yes, I've seen the data sheet, but it would help to confirm which is HSPI v.s. SPI, which one will I be talking to with the call).
Also, can I just do spi.recv(id,N) without doing any transmits (right now I just need to receive)? And if I need to transmit and receive at the same time, can it be done and how does it work?
There really isn't any explanation of what the functions actually do in the wiki yet. But one complete working example with the hardware and software would make it easy to understand.