The libpruw1 library project provides a hardware driver for
- a one wire (W1) bus for AM335x micro processors,
- designed for Beaglebone hardware, providing
- configuration any GPIO as W1 bus (without additional hardware), for
- sending digital output and receiving digital input from the bus,
- logging the bus data line state for monitoring purposes,
- supporting parasite power mode.
libpruw1 software is running on the host (ARM) and in parallel on a Programmable Realtime Unit SubSystem (= PRUSS or just PRU) for accurate bus timing. It depends on libpruio (>= 0.6). In contrast to the kernel driver it supports simultaneuos measurements on a multi sensor/devices bus.
The driver provides functions to
- scan the bus for all device IDs,
- send a single byte or a block of eight bytes to the bus,
- receive a single byte or a block of bytes from the bus,
- calculate the CRC checksum for a block of data, and
- compute the temperature in °C (centigrade) from Dallas sensors (types &h10, &h20, &h22, &h28, &h3B or &h42).
The libpruw1 project is hosted at GitHub. It’s developed and tested on a Beaglebone Black under Debian Image 2014-08-05. It should run on all Beaglebone platforms with Debian based LINUX operating system. It’s compiled by the FreeBasic compiler. A wrapper for C programming language is included.
Find more information in the online documentation at
and find the source code at GitHub.com/DTJF/libpruw1 containing
- the library source (FB and PASM code)
- Example code (FB and C code)
- the documentation (in-source Doxygen code)