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
Beaglebone Essentials

You're reading from   Beaglebone Essentials Harness the power of the BeagleBone Black to manage external environments using C, Bash, and Python/PHP programming

Arrow left icon
Product type Paperback
Published in May 2015
Publisher
ISBN-13 9781784393526
Length 240 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Rodolfo Giometti Rodolfo Giometti
Author Profile Icon Rodolfo Giometti
Rodolfo Giometti
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Installing the Developing System 2. Managing the System Console FREE CHAPTER 3. Compiling versus Cross-compiling 4. Quick Programming with Scripts 5. Device Drivers 6. Serial Ports and TTY Devices 7. Universal Serial Bus – USB 8. Inter-integrated Circuit – I2C 9. Serial Peripheral Interface – SPI 10. 1-Wire Bus – W1 11. Useful System Daemons Index

The 1-Wire bus in Linux

On our BeagleBone Black, there are no 1-Wire controllers, so we have to find a way to implement one in order to be able to talk to a 1-Wire device. Several solutions exist but considering the low data transfer of this bus, the best and cheapest option is to use a software solution.

In Linux, several buses can be emulated by the software and the 1-Wire bus (along with the I2C and SPI buses) is one of them. In order to do so, we need to locate the driver, in Linux's sources, in the drivers/w1/masters/w1-gpio.c file, and we simply need to choose a GPIO, which is to be selected as the data bus, and the trick is done.

The DTS file used to set up the BeagleBone Black and the w1-gpio driver can be written in the chapter_10/BB-W1-GPIO-00A0.dts file in the book's example code repository. In this file, the pin P8.11 is used as a data signal, and in fragment@0, there is the related GPIO setup:

    /* Define the pins usage */
    exclusive-use =
            /* the pin...
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