Accessing BBB SPI with C/C++

3,648 views
Skip to first unread message

Rafael Fiebig-Bindner

unread,
Aug 1, 2013, 5:49:20 AM8/1/13
to beagl...@googlegroups.com
Hello everyone,

i have enabled SPI1, but now the question is: How can I send/receive data throught it, using a C/C++ program?
I have found many examples for python, but none for C/C++, althought I read, that the Python module is written in C itself.


Jacek Radzikowski

unread,
Aug 1, 2013, 8:53:20 AM8/1/13
to beagl...@googlegroups.com
This lib, for example: https://github.com/piranha32/IOoo
https://github.com/piranha32/IOoo/blob/master/examples/tlc5946.cpp is
the top level file for an example app using the SPI class.

j.
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



--
Given a choice between two theories, take the one which is funnier

Rafael Fiebig-Bindner

unread,
Aug 2, 2013, 7:49:27 AM8/2/13
to beagl...@googlegroups.com
Thanks Jacek,
this looks, as if it is exactly what I wanted.

rohit....@gmail.com

unread,
May 5, 2017, 8:54:16 AM5/5/17
to BeagleBoard

Hi Rafael and jacek,

Will you both please explain me the procedure how you both have used SPI API. i am newbie to BBB so i won't able to understand how can i implement SPI on BBB.

Please reply me as soon as possible.

Thanks and regards 
Rohit 

xxlangi...@gmail.com

unread,
Jul 5, 2017, 8:02:25 AM7/5/17
to BeagleBoard, rohit....@gmail.com
What kernel version are using? Have you load the overlay 'BB-SPIDEV0' to the cape manager? You should see something like /dev/spidev*.* after the SPI is enable.
If you are using kernel version larger than 4.4, then you just configure the pin to spi mode using 'sudo config-pin PIN_NUMBER spi', for do, di, cs and sclk.

For a lower kernel version, just load the related overlay under /lib/firmware/

在 2017年5月5日星期五 UTC+2下午2:54:16,rohit....@gmail.com写道:

Reshmi Chandran

unread,
Nov 20, 2017, 4:23:25 AM11/20/17
to BeagleBoard
I use 4.9 kernel. The spidev loopback test failed even after setting the config-pin 
Reply all
Reply to author
Forward
0 new messages