[NBLUG/talk] Beaglebone SPI linux device - Jezra this is for you

jezra jezra at jezra.net
Wed Aug 14 20:54:53 PDT 2013


For those wondering what this is all about; I have a 16x4 Character LCD
that I was trying to control from my semi-fried beagle bone white using
the SPI protocol, and I have been having nothing but trouble getting
things to work. Today, however, I managed to *mostly* get things
working. 

Thanks for the info Morio. For the most part, I've been following
http://www.gigamegablog.com/2012/09/09/beaglebone-coding-101-spi-output/

jezra


On Wed, 14 Aug 2013 19:33:56 -0700
John Morio Sakaguchi <morio.earth at gmail.com> wrote:

> Looked up that Python library wrapper for the SPI interface. Here is
> the c file that does all the work.
> 
> https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/spimodule.c
> 
> Line 710 sets the variable path
> if (snprintf(path, MAXPATH, "/dev/spidev%d.%d", bus+1, device) >=
> MAXPATH) { Line 715 opens device for read/write
> if ((self->fd = open(path, O_RDWR, 0)) == -1) {
> 
> So from what I gather,
> /dev/spidev2.3
> 2 would be which spi interface you are using ( guessing there is only
> one, so it should probably be 1 ).
> 3 would be the device would would like to fiddle with (e.g. my LCD or
> LED character display also would probably be 1).
> 
> After that I don't know but here is a good place to start.
> https://www.kernel.org/doc/Documentation/spi/spidev
> 
> -Morio



More information about the talk mailing list