Skip to content

Commit

Permalink
Rename pio to periph. (google#27)
Browse files Browse the repository at this point in the history
Ran:
    git sed 's/pio/periph/g
    git sed 's/gperiph/gpio/g'
    git sed 's/Gperiph/Gpio/g'
    git sed 's/PIO/Periph/g'
    git sed 's/GPeriph/GPIO/g'
    git mv pio.go periph.go
    git mv pio_test.go periph_test.go
    cd cmd
    git mv pio-info periph-info
    git mv pio-setup periph-setup

where 'git sed' is an alias to run sed over all files in git ls-files.

Fixes google#11.
  • Loading branch information
maruel authored and tve committed Oct 25, 2016
1 parent d8c552c commit 8f6e889
Show file tree
Hide file tree
Showing 165 changed files with 597 additions and 591 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is the list of The PIO Authors for copyright purposes.
# This is the list of The Periph Authors for copyright purposes.
#
# This does not necessarily list everyone who has contributed code, since in
# some cases, their employer may be the copyright holder. To see the full list
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is the official list of people who can contribute
# (and typically have contributed) code to the pio repository.
# (and typically have contributed) code to the periph repository.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright 2016 The PIO Authors. All rights reserved.
# Copyright 2016 The Periph Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.

# This Makefile captures common tasks for the pio library. The hope is that this Makefile can remain
# This Makefile captures common tasks for the periph library. The hope is that this Makefile can remain
# simple and straightforward...

# *** This Makefile is a work in progress, please help impove it! ***
Expand Down Expand Up @@ -34,13 +34,13 @@ depend:
# this relatively simple and not descend into makefile hell...

# Get a list of all main.go in cmd subdirs
# MAINS becomes: cmd/pio-setup/main.go cmd/pio-info/main.go ...
# MAINS becomes: cmd/periph-setup/main.go cmd/periph-info/main.go ...
MAINS := $(wildcard cmd/*/main.go)
# Get a list of all the commands, i.e. names of dirs that contain a main.go
# CMDS becomes: pio-setup pio-info ...
# CMDS becomes: periph-setup periph-info ...
CMDS := $(patsubst cmd/%/main.go,%,$(MAINS))
# Get a list of binaries to build
# BINS becomes: bin/pio-setup-arm bin/pio-info-arm ... bin/pio-setup-arm64 bin/pio-info-arm64 ...
# BINS becomes: bin/periph-setup-arm bin/periph-info-arm ... bin/periph-setup-arm64 bin/periph-info-arm64 ...
ARCHS := arm arm64 amd64 win64.exe
BINS=$(foreach arch,$(ARCHS),$(foreach cmd,$(CMDS),bin/$(cmd)-$(arch)))

Expand Down
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/apps/](doc/apps/) to use `pio` as a library. The complete API
* [doc/apps/](doc/apps/) to use `periph` as a library. The complete API
documentation, including examples, is at
[![GoDoc](https://godoc.org/github.com/google/pio?status.svg)](https://godoc.org/github.com/google/pio).
[![GoDoc](https://godoc.org/github.com/google/periph?status.svg)](https://godoc.org/github.com/google/periph).
* [doc/drivers/](doc/drivers/) to expand the list of supported hardware.


## 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.

```bash
go get github.com/google/pio/cmd/...
pio-info
go get github.com/google/periph/cmd/...
periph-info
headers-list
```


## Application developers

For [application developers](doc/apps/), `pio` provides OS-independent bus
For [application developers](doc/apps/), `periph` provides OS-independent bus
interfacing. The following gets the current temperature, barometric pressure and
relative humidity using a bme280:

Expand All @@ -32,9 +32,9 @@ import (
"fmt"
"log"

"github.com/google/pio/devices"
"github.com/google/pio/devices/bme280"
"github.com/google/pio/host"
"github.com/google/periph/devices"
"github.com/google/periph/devices/bme280"
"github.com/google/periph/host"
)

func main() {
Expand Down Expand Up @@ -72,10 +72,11 @@ See more examples at [doc/apps/SAMPLES.md](doc/apps/SAMPLES.md)!

## Contributions

`pio` provides an extensible driver registry and common bus interfaces which are
explained in more details at [doc/drivers/](doc/drivers/). `pio` is designed to
work well with drivers living in external repositories so you are not _required_
to fork the pio repository to load out-of-tree drivers for your platform.
`periph` provides an extensible driver registry and common bus interfaces which
are explained in more details at [doc/drivers/](doc/drivers/). `periph` is
designed to work well with drivers living in external repositories so you are
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
requests, as long as the author has signed the Google Contributor License.
Expand All @@ -95,15 +96,15 @@ details.
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/pio/host/rpi#pkg-variables),
[bcm283x.GPIO2](https://godoc.org/github.com/google/pio/host/bcm283x#Pin)
[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)
or
[bcm283x.I2C1_SDA](https://godoc.org/github.com/google/pio/host/bcm283x#pkg-variables)
[bcm283x.I2C1_SDA](https://godoc.org/github.com/google/periph/host/bcm283x#pkg-variables)
to refer to the exact same pin when I²C bus #1 is enabled 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/pio/devices/apa102#Dev)
[apa102.Dev](https://godoc.org/github.com/google/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
Expand All @@ -114,15 +115,15 @@ details.
"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/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.
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/pio/host/allwinner)
[allwinner](https://godoc.org/github.com/google/periph/host/allwinner)
and
[bcm283x](https://godoc.org/github.com/google/pio/host/bcm283x)
[bcm283x](https://godoc.org/github.com/google/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.

Expand Down
25 changes: 13 additions & 12 deletions cmd/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# pio/cmd - read-to-use executables
# periph/cmd - read-to-use executables

This directory contains directly usable tools installable via `go get
github.com/google/pio/cmd/...`.
github.com/google/periph/cmd/...`.


## Recommended first use

Try first `pio-info`. It will print out if any driver failed to run, for example
if you have to run as root to access certain drivers.
Try first `periph-info`. It will print out if any driver failed to run, for
example if you have to run as root to access certain drivers.

`pio-setup` is a rule based configuration tool that will modify the host to
`periph-setup` is a rule based configuration tool that will modify the host to
enable more functionality.

Then run `headers-list` to list all the headers on your board and confirm that
Expand All @@ -31,10 +31,10 @@ it](../doc/drivers/CONTRIBUTING.md).

## Buses

* [gpio-list](gpio-list): Looking for the GPIO pins per functionality? Prints
the state of each GPIO pin.
* [gpio-read](gpio-read): Read the input value of a GPIO pin and change input
resistor.
* [gpio-list](gpio-list): Looking for the GPIO pins per functionality?
Prints the state of each GPIO pin.
* [gpio-read](gpio-read): Read the input value of a GPIO pin and change
input resistor.
* [gpio-write](gpio-write): Change the output value of a GPIO pin.
* [headers-list](headers-list): Pinrts the location of the pin on the header to
connect your GPIO. This is the perfect tool to know where to connect the
Expand All @@ -48,9 +48,10 @@ it](../doc/drivers/CONTRIBUTING.md).

## Other

* [pio-info](pio-info): Lists which pio drivers loaded and which failed.
* [pio-setup](pio-setup): Modifies the host to enable more functionality (load
drivers, install udev rules, etc).
* [periph-info](periph-info): Lists which periph drivers loaded and which
failed.
* [periph-setup](periph-setup): Modifies the host to enable more functionality
(load drivers, install udev rules, etc).


## Troubleshooting
Expand Down
16 changes: 8 additions & 8 deletions cmd/apa102/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -21,12 +21,12 @@ import (
"strings"
"time"

"github.com/google/pio/conn/gpio"
"github.com/google/pio/conn/spi"
"github.com/google/pio/devices"
"github.com/google/pio/devices/apa102"
"github.com/google/pio/experimental/devices/bitbang"
"github.com/google/pio/host"
"github.com/google/periph/conn/gpio"
"github.com/google/periph/conn/spi"
"github.com/google/periph/devices"
"github.com/google/periph/devices/apa102"
"github.com/google/periph/experimental/devices/bitbang"
"github.com/google/periph/host"
"github.com/nfnt/resize"
)

Expand All @@ -41,7 +41,7 @@ func findFile(name string) string {
}
for _, p := range strings.Split(os.Getenv("GOPATH"), ":") {
if len(p) != 0 {
if p2 := filepath.Join(p, "src/github.com/google/pio/cmd/apa102", name); access(p2) {
if p2 := filepath.Join(p, "src/github.com/google/periph/cmd/apa102", name); access(p2) {
return p2
}
}
Expand Down
18 changes: 9 additions & 9 deletions cmd/bme280/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -13,14 +13,14 @@ import (
"os"
"time"

"github.com/google/pio/conn/i2c"
"github.com/google/pio/conn/i2c/i2ctest"
"github.com/google/pio/conn/pins"
"github.com/google/pio/conn/spi"
"github.com/google/pio/devices"
"github.com/google/pio/devices/bme280"
"github.com/google/pio/host"
"github.com/google/pio/host/headers"
"github.com/google/periph/conn/i2c"
"github.com/google/periph/conn/i2c/i2ctest"
"github.com/google/periph/conn/pins"
"github.com/google/periph/conn/spi"
"github.com/google/periph/devices"
"github.com/google/periph/devices/bme280"
"github.com/google/periph/host"
"github.com/google/periph/host/headers"
)

func printPin(fn string, p pins.Pin) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/gpio-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ I²C or SPI pin).

* Looking for the location of the pin on the header to connect your GPIO? Look
at [headers-list](../headers-list).
* Looking for pio drivers loaded? Look at [pio-info](../pio-info).
* Looking for periph drivers loaded? Look at [periph-info](../periph-info).


## Examples
Expand All @@ -29,7 +29,7 @@ then running:
sudo systemctl disable hciuart

For more information for enabling functional pins, see
[![GoDoc](https://godoc.org/github.com/google/pio/host/rpi?status.svg)](https://godoc.org/github.com/google/pio/host/rpi).
[![GoDoc](https://godoc.org/github.com/google/periph/host/rpi?status.svg)](https://godoc.org/github.com/google/periph/host/rpi).


### Functional
Expand Down
10 changes: 5 additions & 5 deletions cmd/gpio-list/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -13,10 +13,10 @@ import (
"os"
"sort"

"github.com/google/pio/conn/gpio"
"github.com/google/pio/conn/pins"
"github.com/google/pio/host"
"github.com/google/pio/host/headers"
"github.com/google/periph/conn/gpio"
"github.com/google/periph/conn/pins"
"github.com/google/periph/host"
"github.com/google/periph/host/headers"
)

func printFunc(invalid bool) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/gpio-read/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -14,8 +14,8 @@ import (
"os"
"strconv"

"github.com/google/pio/conn/gpio"
"github.com/google/pio/host"
"github.com/google/periph/conn/gpio"
"github.com/google/periph/host"
)

func printLevel(l gpio.Level) error {
Expand Down
6 changes: 3 additions & 3 deletions cmd/gpio-write/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -11,8 +11,8 @@ import (
"os"
"strconv"

"github.com/google/pio/conn/gpio"
"github.com/google/pio/host"
"github.com/google/periph/conn/gpio"
"github.com/google/periph/host"
)

func mainImpl() error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/headers-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Prints physical headers pins and the associated functionality of each pin.

* Looking for the GPIO pins per functionality? Look at
[gpio-list](../gpio-list).
* Looking for pio drivers loaded? Look at [pio-info](../pio-info).
* Looking for periph drivers loaded? Look at [periph-info](../periph-info).


## Example
Expand Down
6 changes: 3 additions & 3 deletions cmd/headers-list/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -14,8 +14,8 @@ import (
"os"
"sort"

"github.com/google/pio/host"
"github.com/google/pio/host/headers"
"github.com/google/periph/host"
"github.com/google/periph/host/headers"
)

func printHardware(invalid bool) {
Expand Down
10 changes: 5 additions & 5 deletions cmd/i2c-list/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -10,10 +10,10 @@ import (
"os"
"sort"

"github.com/google/pio/conn/i2c"
"github.com/google/pio/conn/pins"
"github.com/google/pio/host"
"github.com/google/pio/host/headers"
"github.com/google/periph/conn/i2c"
"github.com/google/periph/conn/pins"
"github.com/google/periph/host"
"github.com/google/periph/host/headers"
)

func printPin(fn string, p pins.Pin) {
Expand Down
6 changes: 3 additions & 3 deletions cmd/i2c/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2016 The PIO Authors. All rights reserved.
// Copyright 2016 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

Expand All @@ -15,8 +15,8 @@ import (
"os"
"strconv"

"github.com/google/pio/conn/i2c"
"github.com/google/pio/host"
"github.com/google/periph/conn/i2c"
"github.com/google/periph/host"
)

func mainImpl() error {
Expand Down
Loading

0 comments on commit 8f6e889

Please sign in to comment.