i2c in the FreeBSD 10.1 on the Raspberry Pi

I have noticed that my version of the i2c utilities no longer work in FreeBSD 10.1 release.
Now I know why they didn’t work and how to make they to work.

bcm2835_bsc, i2c driver for Raspberry Pi in FreeBSD 10-Stable used “normal” 7-bit addresses for i2c devices. And I have used such addresses for ioctl syscalls.

But FreeBSD, historically, has always used 8-bit addresses for i2c devices (7-bit device address << 1), always leaving the room for the read/write bit.

Commit 270243 changed the bcm2835_bsc to make them compatible with 8-bit addresses.
Ugly, but monotonous.

So, bcm2835_bsc in FreeBSD 10.1 uses 8-bit addresses for i2c devices.

I have changed source code of the newi2c, lbi2c and ds1307 to adopt them to 8-bit slave address in FreeBSD 10.1

And now all works:


3 thoughts on “i2c in the FreeBSD 10.1 on the Raspberry Pi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s