python: spidev
peter garshtja
peter.garshtja at ambient-md.com
Mon Nov 21 15:47:18 UTC 2016
Greetings,
*The only way to use SPI from userland is to either do a slow bitbang via
GPIO from userland, or by writing a kernel driver.*
Can you explain me "what is" or "how to do" slow bitbang via GPIO ?
*I did wrote a kernel driver for that case. It basicly does nothing more
than creating a /dev/apa102 device and all data you write into it will be
pushed out via SPI.*
Sounds interesting, could you please publish the code and also explain how
to write to /dev/matrix device via SPI ?
Thanks in advance,
Peter
On Sat, Nov 19, 2016 at 10:12 PM, Bernd Walter <ticso at cicely7.cicely.de>
wrote:
> On Sat, Nov 19, 2016 at 03:02:29PM -0500, Peter Garshtja wrote:
> > Greetings,
> >
> > Has anybody experience with python spidev library on RPI2 FreeBSD 11
> ?
> >
> > I have a led matrix max7219 trying to connect it with gpio, and
> > apparently python spidev library is only for linux, i just wonder if
> > there any chances to run this library on freebsd ?
>
> FreeBSD has a driver for the hardware SPI on the supported rasperry
> boards, but unfortunately no support to access it from userland.
> The only way to use SPI from userland is to either do a slow bitbang
> via GPIO from userland, or by writing a kernel driver.
>
> With such a small matrix doing bitbang via GPIO from usrland should be
> fast enough and it isn't very difficult.
>
> A few weeks ago I did a bigger matrix of 800 APA102 LEDs, which are
> also SPI and in that case I really needed high speed.
> I did wrote a kernel driver for that case.
> It basicly does nothing more than creating a /dev/apa102 device and
> all data you write into it will be pushed out via SPI.
> The FreeBSD raspberry SPI driver only supports a common SPI frequency
> and mode via sysctl interface, which may be a problem if you want to
> access different devices.
>
> If you want to experiment with that driver I can publish the code.
> It had been used on a raspberry 1 B+, but should work on any board
> with a supported SPI controller.
>
> > here is the tutorial that i tried to follow in order to make this led
> > matrix working on rpi2 under freebsd.
> >
> > https://github.com/rm-hull/max7219
> >
>
> --
> B.Walter <bernd at bwct.de> http://www.bwct.de
> Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
>
More information about the freebsd-arm
mailing list