@ -1,27 +1,27 @@
# pio - Peripherals I/O in Go
# periph - Peripherals I/O in Go
* [doc/users/ ](doc/users/ ) for ready-to-use tools.
* [doc/users/ ](doc/users/ ) for ready-to-use tools.
* [doc/apps/ ](doc/apps/ ) to use `p io ` as a library. The complete API
* [doc/apps/ ](doc/apps/ ) to use `p eriph ` as a library. The complete API
documentation, including examples, is at
documentation, including examples, is at
[](https://godoc.org/github.com/google/pio ).
[](https://godoc.org/github.com/google/periph ).
* [doc/drivers/ ](doc/drivers/ ) to expand the list of supported hardware.
* [doc/drivers/ ](doc/drivers/ ) to expand the list of supported hardware.
## Users
## Users
pio includes [many ready-to-use tools ](cmd/ )! See [doc/users/ ](doc/users/ ) for
periph includes [many ready-to-use tools ](cmd/ )! See [doc/users/ ](doc/users/ ) for
more info on configuring the host and using the included tools.
more info on configuring the host and using the included tools.
```bash
```bash
go get github.com/google/pio /cmd/...
go get github.com/google/periph /cmd/...
pio -info
periph -info
headers-list
headers-list
```
```
## Application developers
## Application developers
For [application developers ](doc/apps/ ), `p io ` provides OS-independent bus
For [application developers ](doc/apps/ ), `p eriph ` provides OS-independent bus
interfacing. The following gets the current temperature, barometric pressure and
interfacing. The following gets the current temperature, barometric pressure and
relative humidity using a bme280:
relative humidity using a bme280:
@ -32,9 +32,9 @@ import (
"fmt"
"fmt"
"log"
"log"
"github.com/google/pio /devices"
"github.com/google/periph /devices"
"github.com/google/pio /devices/bme280"
"github.com/google/periph /devices/bme280"
"github.com/google/pio /host"
"github.com/google/periph /host"
)
)
func main() {
func main() {
@ -72,10 +72,11 @@ See more examples at [doc/apps/SAMPLES.md](doc/apps/SAMPLES.md)!
## Contributions
## Contributions
`pio` provides an extensible driver registry and common bus interfaces which are
`periph` provides an extensible driver registry and common bus interfaces which
explained in more details at [doc/drivers/ ](doc/drivers/ ). `pio` is designed to
are explained in more details at [doc/drivers/ ](doc/drivers/ ). `periph` is
work well with drivers living in external repositories so you are not _required_
designed to work well with drivers living in external repositories so you are
to fork the pio repository to load out-of-tree drivers for your platform.
not _required_ to fork the periph repository to load out-of-tree drivers for
your platform.
We gladly accept contributions from device driver developers via GitHub pull
We gladly accept contributions from device driver developers via GitHub pull
requests, as long as the author has signed the Google Contributor License.
requests, as long as the author has signed the Google Contributor License.
@ -95,15 +96,15 @@ details.
on each platform.
on each platform.
3. ... yet doesn't get in the way of platform specific code.
3. ... yet doesn't get in the way of platform specific code.
* e.g. A user can use statically typed global variables
* e.g. A user can use statically typed global variables
[rpi.P1_3 ](https://godoc.org/github.com/google/p io /host/rpi#pkg-variables),
[rpi.P1_3 ](https://godoc.org/github.com/google/p eriph /host/rpi#pkg-variables),
[bcm283x.GPIO2 ](https://godoc.org/github.com/google/p io /host/bcm283x#Pin)
[bcm283x.GPIO2 ](https://godoc.org/github.com/google/p eriph /host/bcm283x#Pin)
or
or
[bcm283x.I2C1_SDA ](https://godoc.org/github.com/google/p io /host/bcm283x#pkg-variables)
[bcm283x.I2C1_SDA ](https://godoc.org/github.com/google/p eriph /host/bcm283x#pkg-variables)
to refer to the exact same pin when I²C bus #1 is enabled on a Raspberry
to refer to the exact same pin when I²C bus #1 is enabled on a Raspberry
Pi.
Pi.
3. The user can chose to optimize for performance instead of usability.
3. The user can chose to optimize for performance instead of usability.
* e.g.
* e.g.
[apa102.Dev ](https://godoc.org/github.com/google/p io /devices/apa102#Dev)
[apa102.Dev ](https://godoc.org/github.com/google/p eriph /devices/apa102#Dev)
exposes both high level
exposes both high level
[draw.Image ](https://golang.org/pkg/image/draw/#Image ) to draw an image and
[draw.Image ](https://golang.org/pkg/image/draw/#Image ) to draw an image and
low level [io.Writer ](https://golang.org/pkg/io/#Writer ) to write raw RGB
low level [io.Writer ](https://golang.org/pkg/io/#Writer ) to write raw RGB
@ -114,15 +115,15 @@ details.
"component": one for the CPU, one for the board headers, one for each
"component": one for the CPU, one for the board headers, one for each
bus and sensor, etc.
bus and sensor, etc.
5. Extensible via a [driver
5. Extensible via a [driver
registry](https://godoc.org/github.com/google/pio #Register).
registry](https://godoc.org/github.com/google/periph #Register).
* e.g. a user can inject a custom driver to expose more pins, headers, etc.
* e.g. a user can inject a custom driver to expose more pins, headers, etc.
A USB device (like an FT232H) can expose headers _in addition_ to the
A USB device (like an FT232H) can expose headers _in addition_ to the
headers found on the host.
headers found on the host.
6. The drivers must use the fastest possible implementation.
6. The drivers must use the fastest possible implementation.
* e.g. both
* e.g. both
[allwinner ](https://godoc.org/github.com/google/p io /host/allwinner)
[allwinner ](https://godoc.org/github.com/google/p eriph /host/allwinner)
and
and
[bcm283x ](https://godoc.org/github.com/google/p io /host/bcm283x)
[bcm283x ](https://godoc.org/github.com/google/p eriph /host/bcm283x)
leverage sysfs gpio to expose interrupt driven edge detection, yet use
leverage sysfs gpio to expose interrupt driven edge detection, yet use
memory mapped GPIO registers to perform single-cycle reads and writes.
memory mapped GPIO registers to perform single-cycle reads and writes.