Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Android Hardware Interfacing with the BeagleBone Black

You're reading from   Android Hardware Interfacing with the BeagleBone Black Design and implement Android apps that interface with your own custom hardware circuits and the BeagleBone Black

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784392161
Length 134 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Representing I2C devices in the Linux kernel


I2C buses and devices are exposed in user space as files in the /dev filesystem. I2C buses are exposed as the /dev/i2c-X file, where X is the logical number of the I2C channel. While the hardware signals for the I2C bus are clearly numbered as 0, 1, and 2, the logical channel numbers won't necessarily be the same as their hardware counterparts.

Logical channel numbers are assigned in the order that the I2C channels are initialized in the Device Tree. For example, the I2C2 channel is usually the second I2C channel initialized by the kernel. Therefore, even though it is physical I2C channel 2, it will be logical I2C channel 1 and accessible as the /dev/i2c-1 file.

Underneath all of the layers of Android APIs and services, Android ultimately interacts with device drivers in the kernel by opening files in the /dev and /sys filesystems and then reading, writing, or performing ioctl() calls on those files. While it is possible to interact with any I2C...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image