Access code used by SPI Class

Hi, does anybody know where I could access the code used by the SPI class, at the moment for my Fez Cerb board it is confined to using particular IO pins for SPI signals whereas I’d like to create a custom SPI class and manipulate the code to use other IO pins. I’m trying to communicate with a flash device which only uses SPI.

netmf leverages the SPI peripheral that handles all the hard stuff like clock synchronisation. Depending on how fast you need, you could try using an RLP bit-bang approach, but you’re unlikely to find the netmf code much help

@ andre.m - Ok thanks, have you ever come across anyone using the SignalGenerator class as a means of creating a custom SPI interface?

@ Brett - For a bit bang approach which I’m not too familiar with, do I just setup a clock on a pin to the desired frequency and then test for say a low to high transition, on each high I then output my next data bit to flash device on another pin, is this correct?

@ andre.m - Unfortunately not, how important is it that the clock signal is set to the frequency specified in the datasheet, can you use lower frequencies?

Lower frequencies will work fine with almost all devices. It just affects the speed with which you need to use that device.

@ Dave McLaughlin - Thanks, I will test later

As @ Dave said, it will largely depend on your device, but certainly you can use a lower frequency (and you’re likely to need to). Some devices don’t need the clock pulses in any particular frequency (its the transitions, low-high-low, that trigger them) but that may not be the case everywhere. To test out your device, you could even try this not in RLP but just in C#/netmf and see if you are able to talk to the device.

Can I just go back to the currently unasked question though; SPI is a shared bus, and SPI devices can share the bus, why do you need another bus?