From ae8f61857309523767c84525d75fdefdb2d10830 Mon Sep 17 00:00:00 2001 From: M-A Date: Mon, 24 Oct 2016 21:16:53 -0400 Subject: [PATCH] Rename pio to periph. (#27) 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 #11. --- AUTHORS | 2 +- CONTRIBUTORS | 2 +- README.md | 43 +++++++++++---------- devices/apa102/apa102.go | 6 +-- devices/apa102/apa102_test.go | 6 +-- devices/apa102/doc.go | 2 +- devices/bme280/bme280.go | 10 ++--- devices/bme280/bme280_test.go | 8 ++-- devices/devices.go | 2 +- devices/devices_test.go | 2 +- devices/devicestest/display.go | 4 +- devices/devicestest/doc.go | 2 +- devices/doc.go | 2 +- devices/lirc/doc.go | 4 +- devices/lirc/lirc.go | 14 +++---- devices/ssd1306/image1bit/image1bit.go | 2 +- devices/ssd1306/image1bit/image1bit_test.go | 2 +- devices/ssd1306/ssd1306.go | 10 ++--- devices/ssd1306/ssd1306_test.go | 10 ++--- devices/tm1637/tm1637.go | 6 +-- devices/tm1637/tm1637_test.go | 10 ++--- experimental/devices/bitbang/doc.go | 2 +- experimental/devices/bitbang/i2c.go | 8 ++-- experimental/devices/bitbang/spi.go | 8 ++-- experimental/devices/piblaster/piblaster.go | 4 +- 25 files changed, 86 insertions(+), 85 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4ce072d..589c760 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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 diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 5611806..52b9e98 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -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. diff --git a/README.md b/README.md index f434a97..08f992b 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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() { @@ -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. @@ -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 @@ -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. diff --git a/devices/apa102/apa102.go b/devices/apa102/apa102.go index d1a9249..6e95889 100644 --- a/devices/apa102/apa102.go +++ b/devices/apa102/apa102.go @@ -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. @@ -9,8 +9,8 @@ import ( "image" "image/color" - "github.com/google/pio/conn/spi" - "github.com/google/pio/devices" + "github.com/google/periph/conn/spi" + "github.com/google/periph/devices" "github.com/maruel/temperature" ) diff --git a/devices/apa102/apa102_test.go b/devices/apa102/apa102_test.go index 0be5b22..1df2ad4 100644 --- a/devices/apa102/apa102_test.go +++ b/devices/apa102/apa102_test.go @@ -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. @@ -13,8 +13,8 @@ import ( "log" "testing" - "github.com/google/pio/conn/spi" - "github.com/google/pio/conn/spi/spitest" + "github.com/google/periph/conn/spi" + "github.com/google/periph/conn/spi/spitest" ) func TestRamp(t *testing.T) { diff --git a/devices/apa102/doc.go b/devices/apa102/doc.go index 40b9b3d..40b65e0 100644 --- a/devices/apa102/doc.go +++ b/devices/apa102/doc.go @@ -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. diff --git a/devices/bme280/bme280.go b/devices/bme280/bme280.go index 1f88c43..dba8907 100644 --- a/devices/bme280/bme280.go +++ b/devices/bme280/bme280.go @@ -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. @@ -12,10 +12,10 @@ package bme280 import ( "errors" - "github.com/google/pio/conn" - "github.com/google/pio/conn/i2c" - "github.com/google/pio/conn/spi" - "github.com/google/pio/devices" + "github.com/google/periph/conn" + "github.com/google/periph/conn/i2c" + "github.com/google/periph/conn/spi" + "github.com/google/periph/devices" ) // Oversampling affects how much time is taken to measure each of temperature, diff --git a/devices/bme280/bme280_test.go b/devices/bme280/bme280_test.go index cf48618..338d3d9 100644 --- a/devices/bme280/bme280_test.go +++ b/devices/bme280/bme280_test.go @@ -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. @@ -9,9 +9,9 @@ import ( "log" "testing" - "github.com/google/pio/conn/i2c" - "github.com/google/pio/conn/i2c/i2ctest" - "github.com/google/pio/devices" + "github.com/google/periph/conn/i2c" + "github.com/google/periph/conn/i2c/i2ctest" + "github.com/google/periph/devices" ) // Real data extracted from a device. diff --git a/devices/devices.go b/devices/devices.go index 7e60b99..ad00b34 100644 --- a/devices/devices.go +++ b/devices/devices.go @@ -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. diff --git a/devices/devices_test.go b/devices/devices_test.go index 511c406..b81d228 100644 --- a/devices/devices_test.go +++ b/devices/devices_test.go @@ -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. diff --git a/devices/devicestest/display.go b/devices/devicestest/display.go index e939e57..7f177ae 100644 --- a/devices/devicestest/display.go +++ b/devices/devicestest/display.go @@ -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. @@ -10,7 +10,7 @@ import ( "image/color" "image/draw" - "github.com/google/pio/devices" + "github.com/google/periph/devices" ) // Display is a fake devices.Display. diff --git a/devices/devicestest/doc.go b/devices/devicestest/doc.go index 88f4134..49cbbfb 100644 --- a/devices/devicestest/doc.go +++ b/devices/devicestest/doc.go @@ -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. diff --git a/devices/doc.go b/devices/doc.go index bdc3d1f..6dfbe08 100644 --- a/devices/doc.go +++ b/devices/doc.go @@ -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. diff --git a/devices/lirc/doc.go b/devices/lirc/doc.go index 62282ef..3f7f72d 100644 --- a/devices/lirc/doc.go +++ b/devices/lirc/doc.go @@ -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. @@ -43,6 +43,6 @@ // // Raspbian // -// Please see documentation of package pio/host/rpi for details on how to set +// Please see documentation of package periph/host/rpi for details on how to set // it up. package lirc diff --git a/devices/lirc/lirc.go b/devices/lirc/lirc.go index 1233709..24e753c 100644 --- a/devices/lirc/lirc.go +++ b/devices/lirc/lirc.go @@ -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. @@ -14,9 +14,9 @@ import ( "strings" "sync" - "github.com/google/pio" - "github.com/google/pio/conn/gpio" - "github.com/google/pio/conn/ir" + "github.com/google/periph" + "github.com/google/periph/conn/gpio" + "github.com/google/periph/conn/ir" ) // Conn is an open port to lirc. @@ -207,7 +207,7 @@ func read(r *bufio.Reader) (string, error) { return string(raw), nil } -// driver implements pio.Driver. +// driver implements periph.Driver. type driver struct { } @@ -215,9 +215,9 @@ func (d *driver) String() string { return "lirc" } -func (d *driver) Type() pio.Type { +func (d *driver) Type() periph.Type { // Return the lowest priority, which is Functional. - return pio.Functional + return periph.Functional } func (d *driver) Init() (bool, error) { diff --git a/devices/ssd1306/image1bit/image1bit.go b/devices/ssd1306/image1bit/image1bit.go index 6dfdcc1..6ddf1ca 100644 --- a/devices/ssd1306/image1bit/image1bit.go +++ b/devices/ssd1306/image1bit/image1bit.go @@ -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. diff --git a/devices/ssd1306/image1bit/image1bit_test.go b/devices/ssd1306/image1bit/image1bit_test.go index a979dc0..af9cdd7 100644 --- a/devices/ssd1306/image1bit/image1bit_test.go +++ b/devices/ssd1306/image1bit/image1bit_test.go @@ -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. diff --git a/devices/ssd1306/ssd1306.go b/devices/ssd1306/ssd1306.go index d4c456b..10f05e5 100644 --- a/devices/ssd1306/ssd1306.go +++ b/devices/ssd1306/ssd1306.go @@ -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. @@ -25,10 +25,10 @@ import ( "io" "log" - "github.com/google/pio/conn/i2c" - "github.com/google/pio/conn/spi" - "github.com/google/pio/devices" - "github.com/google/pio/devices/ssd1306/image1bit" + "github.com/google/periph/conn/i2c" + "github.com/google/periph/conn/spi" + "github.com/google/periph/devices" + "github.com/google/periph/devices/ssd1306/image1bit" ) // FrameRate determines scrolling speed. diff --git a/devices/ssd1306/ssd1306_test.go b/devices/ssd1306/ssd1306_test.go index 27d4322..a017b8c 100644 --- a/devices/ssd1306/ssd1306_test.go +++ b/devices/ssd1306/ssd1306_test.go @@ -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. @@ -14,9 +14,9 @@ import ( "golang.org/x/image/font/basicfont" "golang.org/x/image/math/fixed" - "github.com/google/pio/conn/i2c" - "github.com/google/pio/conn/i2c/i2ctest" - "github.com/google/pio/devices/ssd1306/image1bit" + "github.com/google/periph/conn/i2c" + "github.com/google/periph/conn/i2c/i2ctest" + "github.com/google/periph/devices/ssd1306/image1bit" ) func TestDrawGray(t *testing.T) { @@ -99,7 +99,7 @@ func Example() { Face: f, Dot: fixed.P(0, img.Bounds().Dy()-1-f.Descent), } - drawer.DrawString("Hello from pio!") + drawer.DrawString("Hello from periph!") dev.Draw(dev.Bounds(), img, image.Point{}) } diff --git a/devices/tm1637/tm1637.go b/devices/tm1637/tm1637.go index ab378ae..98e06ab 100644 --- a/devices/tm1637/tm1637.go +++ b/devices/tm1637/tm1637.go @@ -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. @@ -14,8 +14,8 @@ import ( "runtime" "time" - "github.com/google/pio/conn/gpio" - "github.com/google/pio/host" + "github.com/google/periph/conn/gpio" + "github.com/google/periph/host" ) // Clock converts time to a slice of bytes as segments. diff --git a/devices/tm1637/tm1637_test.go b/devices/tm1637/tm1637_test.go index 2c2f194..db6efab 100644 --- a/devices/tm1637/tm1637_test.go +++ b/devices/tm1637/tm1637_test.go @@ -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. @@ -8,9 +8,9 @@ import ( "log" "testing" - "github.com/google/pio/conn/gpio" - "github.com/google/pio/conn/gpio/gpiotest" - "github.com/google/pio/host" + "github.com/google/periph/conn/gpio" + "github.com/google/periph/conn/gpio/gpiotest" + "github.com/google/periph/host" ) func TestNew(t *testing.T) { @@ -28,7 +28,7 @@ func TestNew(t *testing.T) { func Example() { if _, err := host.Init(); err != nil { - log.Fatalf("failed to initialize pio: %v", err) + log.Fatalf("failed to initialize periph: %v", err) } dev, err := New(gpio.ByNumber(6), gpio.ByNumber(12)) if err != nil { diff --git a/experimental/devices/bitbang/doc.go b/experimental/devices/bitbang/doc.go index 8327f04..a6ae9d7 100644 --- a/experimental/devices/bitbang/doc.go +++ b/experimental/devices/bitbang/doc.go @@ -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. diff --git a/experimental/devices/bitbang/i2c.go b/experimental/devices/bitbang/i2c.go index 2a3fdd1..98717d2 100644 --- a/experimental/devices/bitbang/i2c.go +++ b/experimental/devices/bitbang/i2c.go @@ -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. @@ -15,9 +15,9 @@ import ( "sync" "time" - "github.com/google/pio/conn/gpio" - "github.com/google/pio/conn/i2c" - "github.com/google/pio/host" + "github.com/google/periph/conn/gpio" + "github.com/google/periph/conn/i2c" + "github.com/google/periph/host" ) // Use SkipAddr to skip the address from being sent. diff --git a/experimental/devices/bitbang/spi.go b/experimental/devices/bitbang/spi.go index b7ebac4..99268b0 100644 --- a/experimental/devices/bitbang/spi.go +++ b/experimental/devices/bitbang/spi.go @@ -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. @@ -17,9 +17,9 @@ import ( "sync" "time" - "github.com/google/pio/conn/gpio" - "github.com/google/pio/conn/spi" - "github.com/google/pio/host" + "github.com/google/periph/conn/gpio" + "github.com/google/periph/conn/spi" + "github.com/google/periph/host" ) // SPI represents a SPI master implemented as bit-banging on 3 or 4 GPIO pins. diff --git a/experimental/devices/piblaster/piblaster.go b/experimental/devices/piblaster/piblaster.go index 14a97da..e784ee7 100644 --- a/experimental/devices/piblaster/piblaster.go +++ b/experimental/devices/piblaster/piblaster.go @@ -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. @@ -21,7 +21,7 @@ import ( "io" "os" - "github.com/google/pio/conn/gpio" + "github.com/google/periph/conn/gpio" ) // SetPWM enables and sets the PWM duty on a GPIO output pin via piblaster.