3

Is there any way that I can interface with an SPI pin extender from a Mono C# application running in Arch Linux on the RPi?

EDIT: I want to use the hardware SPI interface like can be done with SpiDev, I do not want to use bit banging because it will probably be to slow

0

2 Answers 2

1

Take a look at my solution RaspiSharp, https://github.com/gusmanb/RaspiSharp , it uses a native interface (an improved version of bcm2835 lib by Mike McCauley) to attain very high speeds and uses the SPI hardware interface.

3

There is a project called Raspberry♯ (RaspberrySharp)

At the site you find a sub project called raspberry-sharp-io which contians examples on how to use the SPI, I2C, GPIO and some other general purpose things.

You can get the GPIO using Nuget

Install-Package Raspberry.IO.GeneralPurpose

but to use the SPI you will need to compile or add the project and then reference Raspberry.IO.SerialPeripheralInterface

It is only very new this project so you might find some issues but it seems like it works. You could also look into the source and see how the wrapped everything to call SPI and that could give you some insight for your own library.

1
  • Sorry, I just noticed this seems to use a bit bang SPI interface and I would like to use the hardware SPI instead, in order to achieve higher speeds, I know this can be done with SpiDev in C but how can I access it from C#?
    – Gerharddc
    Commented Nov 14, 2013 at 18:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.