BBB spi dts follow up
Oleksandr Tymoshenko
gonzo at bluezbox.com
Sat Apr 1 23:13:31 UTC 2017
ash (ash at aeria.net) wrote:
> I decompiled the stock dts to get started with:
>
> #dtc -I dtb -O dts /boot/dtb/beaglebone-black.dtb
... skipped ...
> But still no /dev/spi0 device. Any pointers are welcome.
There is no /dev/spi0 in FreeBSD at the moment. The only
way to access SPI from userland is by using spigen device.
With later HEAD builds (post r314934) you can load it as
a module: "kldload spigen" otherwise you'll need to add it
to kernel config as a "device spigen".
spigen functionality is very limited, you can't specify
SPI mode or CS line. General procedure is to open
/dev/spigen0 with O_RDWR and then use ioctls to transfer
data. You can use this example as a simple reference:
https://github.com/gonzoua/freebsd-embedded-demos/blob/master/libssd1306/ssd1306_spi.c#L86
--
gonzo
More information about the freebsd-arm
mailing list