The latch edge is configurable yes, CLOCK_2ND_EDGE sets it to latch on the second edge (which would be falling edge with a clock that idles low, or rising edge with a clock that idles high).
I’ll check into this some more, but on inspection the code looks fine. If there’s a bug we’ll get a fix out ASAP.
Somewhat continuing from another thread, I used brandon’s code from this thread, and it worked. As I’m slowly learning, SPI receives a byte whenever one is written. That being said, should I write twice (real command, then junk) then read, or write, read (and discard junk) write (junk), then read the real response?
You should be writing one byte, reading one byte at the moment - the API will have a block read-write added soon. There’s currently no buffering on SPI as noted in http://devwiki.electricimp.com/doku.php?id=whatisthere
I finally got it working; I wound up hooking up two April boards, configured one to use SPI-257, the other 189 and the latter started working. I eventually tried running both boards from one imp (power from two different Aprils, and SPI from one) and only one would work. Ultimately, I’ve come to the conclusion one is bad bad, or I killed it somehow when hooking things up. A pull-up resistor was not needed and was eventually taken out. I’m trying to communicate with the medical device now, and it appears to not be working - however, I believe it’s because I (stupidly) ordered a 433 board when I should have ordered a 915. Looks like I’ll be re-ordering some more boards. sigh
I’ll eventually post my working code for the chip - but not for my project (yet).
Thanks to all who’ve helped, and I hope my troubles have helped someone!