[beagleboard] Documentation and Examples for SPI, I2C, etc.

Hello All,

I'm looking at BeagleBone for a project I have. But before I buy the boards
I need I want to make sure I understand how to use them. Specifically I'm
having trouble finding info on SPI and I2C.

Linus kernel Documentation/ folder has good info on SPI and I2C.
You have a well defined user interface for these two sub-systems, so
that you can write a simple linux application to talk to the i2c/spi
peripheral.

Eg: psudo code just to give an idea:
main()
    open(/dev/spi0.1)
    ioctl(tx)
    ioctl(rx)
....

Hello All,

I'm looking at BeagleBone for a project I have. But before I buy the boards
I need I want to make sure I understand how to use them. Specifically I'm
having trouble finding info on SPI and I2C.

Linus kernel Documentation/ folder has good info on SPI and I2C.
You have a well defined user interface for these two sub-systems, so
that you can write a simple linux application to talk to the i2c/spi
peripheral.

Eg: psudo code just to give an idea:
main()
    open(/dev/spi0.1)
    ioctl(tx)
    ioctl(rx)
....

Check these:
spi:
http://lxr.linux.no/linux+v3.7/Documentation/spi/
spidev_test.c
spidev_fdx.c

i2c:
http://lxr.linux.no/linux+v3.7/Documentation/i2c/dev-interface

Thanks for your replies. I’m looking for an easy to use library. Don’t like re-inventing the wheel. My son has a Rpi and I found this the other day: http://www.open.com.au/mikem/bcm2835/
and this: https://projects.drogon.net/raspberry-pi/
So I’m running some tests on I/O but still have to wait for SPI displays and A2Ds to show up in the mail for further testing.

This type of library and support are needed for the BeagleBone before I will buy 1 for testing and then more for a larger project.

Have you tried to search some basic low-level info in the Technical Reference Manual?

Regards,
Tom

2013/2/19 Ri H <haytown@embarqmail.com>

You don't need a library for the BB because Linux insulates you from the
intricacies of the hardware. The twin problems are the implementations
are incomplete and they're not documented. If you only need 2 SPI
devices then the BB is fine. I can send you a test program that shows
how to use the API if you like.

If you clone the kernel sources, there is also a test program in
Documentation/spi. It's not commented very well so you do have to
noodle it a little and be familiar with SPI. For that I recommend

http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols/?/article/AA-00255/

John