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

Dave Tweed
  • 171
  • 4
  • 8
Gerharddc
  • 307
  • 1
  • 5
  • 12

2 Answers2

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.

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105
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.

Gusman
  • 211
  • 2
  • 5