Closed pjsg closed 2 years ago
Also, if you want to use the cs
config item when you create the device, then you need to configure that as a gpio
output pin and write the inactive state to it. I wonder if this should just be builtin to our device creation function. I don't think that it would do any harm -- and might save people a bunch of time. [I had to get my logic analyzer out to see what was going on!]
Expected behavior
ought to work
Actual behavior
It actually says
Root cause
It appears that the code in
spi_master.c
is broken:in
lspi_device_transfer
the following code is missing the line that I've markedWithout this line, the txdata doesn't get fetched from the right place (as the lua_getfield pushes an element onto the stack).
This leads to a more general question -- does anybody have working spi code? I'm trying to talk to a device but it doesn't appear to work. I may have to break out the logic analyzer....