@ -16,7 +16,7 @@
* [doc/users/ ](doc/users/ ) for ready-to-use tools.
* [doc/apps/ ](doc/apps/ ) to use `periph` as a library. The complete API
documentation, including examples, is at
[](https://godoc.org/github.com/google /periph).
[](https://godoc.org/periph.io/x /periph).
* [doc/drivers/ ](doc/drivers/ ) to expand the list of supported hardware.
@ -27,7 +27,7 @@ for more info on configuring the host and using the included tools.
```bash
# Retrieve and install all the commands at once:
go get github.com/google /periph/cmd/...
go get periph.io/x /periph/cmd/...
# List the host drivers registered and/or initialized:
periph-info
# List the known headers:
@ -49,8 +49,8 @@ package main
import (
"time"
"github.com/google /periph/conn/gpio"
"github.com/google /periph/host"
"periph.io/x /periph/conn/gpio"
"periph.io/x /periph/host"
)
func main() {
@ -64,11 +64,11 @@ func main() {
The following are synonyms, use the form you prefer:
* Runtime discovery:
* [`gpio.ByNumber(13)` ](https://godoc.org/ github.com/google/periph/conn/gpio/#ByNumber) or [`gpio.ByName("13")` ](https://godoc.org/github.com/google /periph/conn/gpio/#ByName)
* [`gpio.ByName("GPIO13")` ](https://godoc.org/ github.com/google /periph/conn/gpio/#ByName)
* [`gpio.ByNumber(13)` ](https://godoc.org/ periph.io/x/periph/conn/gpio/#ByNumber) or [`gpio.ByName("13")` ](https://godoc.org/periph.io/x /periph/conn/gpio/#ByName)
* [`gpio.ByName("GPIO13")` ](https://godoc.org/ periph.io/x /periph/conn/gpio/#ByName)
* Using global variables:
* [`rpi.P1_33` ](https://godoc.org/ github.com/google /periph/host/rpi#/P1_33) to select the pin via its position on the board
* [`bcm283x.GPIO13` ](https://godoc.org/ github.com/google /periph/host/bcm283x/#GPIO13)
* [`rpi.P1_33` ](https://godoc.org/ periph.io/x /periph/host/rpi#/P1_33) to select the pin via its position on the board
* [`bcm283x.GPIO13` ](https://godoc.org/ periph.io/x /periph/host/bcm283x/#GPIO13)
This example uses basically no CPU: the `Out()` call doesn't call into the
kernel. Instead it directly changes the GPIO memory mapped register.
@ -108,12 +108,12 @@ Google Contributor License. Please see
on each platform.
3. ... yet doesn't get in the way of platform specific code.
* e.g. A user can use statically typed global variables
[rpi.P1_3 ](https://godoc.org/ github.com/google /periph/host/rpi#pkg-variables),
[bcm283x.GPIO2 ](https://godoc.org/ github.com/google /periph/host/bcm283x#Pin)
[rpi.P1_3 ](https://godoc.org/ periph.io/x /periph/host/rpi#pkg-variables),
[bcm283x.GPIO2 ](https://godoc.org/ periph.io/x /periph/host/bcm283x#Pin)
to refer to the exact same pin on a Raspberry Pi.
3. The user can chose to optimize for performance instead of usability.
* e.g.
[apa102.Dev ](https://godoc.org/ github.com/google /periph/devices/apa102#Dev)
[apa102.Dev ](https://godoc.org/ periph.io/x /periph/devices/apa102#Dev)
exposes both high level
[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
@ -124,15 +124,15 @@ Google Contributor License. Please see
"component": one for the CPU, one for the board headers, one for each
bus and sensor, etc.
5. Extensible via a [driver
registry](https://godoc.org/github.com/google /periph#Register).
registry](https://godoc.org/periph.io/x /periph#Register).
* 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
headers found on the host.
6. The drivers must use the fastest possible implementation.
* e.g. both
[allwinner ](https://godoc.org/ github.com/google /periph/host/allwinner)
[allwinner ](https://godoc.org/ periph.io/x /periph/host/allwinner)
and
[bcm283x ](https://godoc.org/ github.com/google /periph/host/bcm283x)
[bcm283x ](https://godoc.org/ periph.io/x /periph/host/bcm283x)
leverage sysfs gpio to expose interrupt driven edge detection, yet use
memory mapped GPIO registers to perform single-cycle reads and writes.