Skip to content

Commit

Permalink
Migrate to devices/v3
Browse files Browse the repository at this point in the history
Ran:
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/conn#periph.io/x/conn/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/host#periph.io/x/host/v3#g'
  git ls-files -z -- . | xargs -0 -L 1 sed -i 's#periph\.io/x/devices#periph.io/x/devices/v3#g'
  go test ./...
  go mod tidy
  • Loading branch information
maruel committed Dec 30, 2020
1 parent 50dea9a commit 402bbcc
Show file tree
Hide file tree
Showing 100 changed files with 366 additions and 362 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Documentation is at https://periph.io

[![PkgGoDev](https://pkg.go.dev/badge/periph.io/x/devices)](https://pkg.go.dev/periph.io/x/devices)
[![PkgGoDev](https://pkg.go.dev/badge/periph.io/x/devices/v3)](https://pkg.go.dev/periph.io/x/devices/v3)
[![Coverage
Status](https://codecov.io/gh/periph/devices/graph/badge.svg)](https://codecov.io/gh/periph/devices)

Expand All @@ -22,9 +22,9 @@ package main

import (
"time"
"periph.io/x/conn/gpio"
"periph.io/x/host"
"periph.io/x/host/rpi"
"periph.io/x/conn/v3/gpio"
"periph.io/x/host/v3"
"periph.io/x/host/v3/rpi"
)

func main() {
Expand Down
8 changes: 4 additions & 4 deletions ads1x15/ads1x15.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"sync"
"time"

"periph.io/x/conn/analog"
"periph.io/x/conn/i2c"
"periph.io/x/conn/physic"
"periph.io/x/conn/pin"
"periph.io/x/conn/v3/analog"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/pin"
)

// I2CAddr is the default I2C address for the ADS1x15 components.
Expand Down
8 changes: 4 additions & 4 deletions ads1x15/ads1x15_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"reflect"
"testing"

"periph.io/x/conn/analog"
"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/pin"
"periph.io/x/conn/v3/analog"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/pin"
)

func TestChannel_String(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions ads1x15/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"fmt"
"log"

"periph.io/x/conn/i2c/i2creg"
"periph.io/x/conn/physic"
"periph.io/x/devices/ads1x15"
"periph.io/x/host"
"periph.io/x/conn/v3/i2c/i2creg"
"periph.io/x/conn/v3/physic"
"periph.io/x/devices/v3/ads1x15"
"periph.io/x/host/v3"
)

func Example() {
Expand Down
6 changes: 3 additions & 3 deletions apa102/apa102.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"image/color"
"image/draw"

"periph.io/x/conn/display"
"periph.io/x/conn/physic"
"periph.io/x/conn/spi"
"periph.io/x/conn/v3/display"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi"
)

// ToRGB converts a slice of color.NRGBA to a byte stream of RGB pixels.
Expand Down
8 changes: 4 additions & 4 deletions apa102/apa102_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"io/ioutil"
"testing"

"periph.io/x/conn/conntest"
"periph.io/x/conn/physic"
"periph.io/x/conn/spi"
"periph.io/x/conn/spi/spitest"
"periph.io/x/conn/v3/conntest"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi"
"periph.io/x/conn/v3/spi/spitest"
)

func TestRamp(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions apa102/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"image/color"
"log"

"periph.io/x/conn/spi/spireg"
"periph.io/x/devices/apa102"
"periph.io/x/host"
"periph.io/x/conn/v3/spi/spireg"
"periph.io/x/devices/v3/apa102"
"periph.io/x/host/v3"
)

func Example() {
Expand Down
8 changes: 4 additions & 4 deletions as7262/as7262.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import (
"sync"
"time"

"periph.io/x/conn"
"periph.io/x/conn/gpio"
"periph.io/x/conn/i2c"
"periph.io/x/conn/physic"
"periph.io/x/conn/v3"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/physic"
)

// Opts holds the configuration options.
Expand Down
10 changes: 5 additions & 5 deletions as7262/as7262_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"testing"
"time"

"periph.io/x/conn/gpio"
"periph.io/x/conn/gpio/gpiotest"
"periph.io/x/conn/i2c"
"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/gpio/gpiotest"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
)

var defaultSensorTimeOut = time.Millisecond * 200
Expand Down
8 changes: 4 additions & 4 deletions as7262/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"log"
"time"

"periph.io/x/conn/physic"
"periph.io/x/conn/v3/physic"

"periph.io/x/conn/i2c/i2creg"
"periph.io/x/devices/as7262"
"periph.io/x/host"
"periph.io/x/conn/v3/i2c/i2creg"
"periph.io/x/devices/v3/as7262"
"periph.io/x/host/v3"
)

func Example() {
Expand Down
4 changes: 2 additions & 2 deletions as7262/testdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ package as7262
import (
"time"

"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
)

// Expected response from sensorTestCaseValidRead or
Expand Down
4 changes: 2 additions & 2 deletions bh1750/bh1750.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"encoding/binary"
"time"

"periph.io/x/conn/i2c"
"periph.io/x/conn/physic"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/physic"
)

// I2CAddr i2c default address.
Expand Down
6 changes: 3 additions & 3 deletions bh1750/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"fmt"
"log"

"periph.io/x/conn/i2c/i2creg"
"periph.io/x/devices/bh1750"
"periph.io/x/host"
"periph.io/x/conn/v3/i2c/i2creg"
"periph.io/x/devices/v3/bh1750"
"periph.io/x/host/v3"
)

func Example() {
Expand Down
8 changes: 4 additions & 4 deletions bitbang/i2c.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"sync"
"time"

"periph.io/x/conn/gpio"
"periph.io/x/conn/i2c"
"periph.io/x/conn/physic"
"periph.io/x/host/cpu"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/physic"
"periph.io/x/host/v3/cpu"
)

// SkipAddr can be used to skip the address from being sent.
Expand Down
10 changes: 5 additions & 5 deletions bitbang/spi.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"sync"
"time"

"periph.io/x/conn"
"periph.io/x/conn/gpio"
"periph.io/x/conn/physic"
"periph.io/x/conn/spi"
"periph.io/x/host/cpu"
"periph.io/x/conn/v3"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi"
"periph.io/x/host/v3/cpu"
)

// NewSPI returns an spi.PortCloser that communicates SPI over 3 or 4 pins.
Expand Down
2 changes: 1 addition & 1 deletion bmxx80/bmp180.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/binary"
"time"

"periph.io/x/conn/physic"
"periph.io/x/conn/v3/physic"
)

// sense180 reads the device's registers for bmp180.
Expand Down
4 changes: 2 additions & 2 deletions bmxx80/bmp180_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
)

var opts180 = &Opts{Temperature: O1x, Pressure: O1x}
Expand Down
2 changes: 1 addition & 1 deletion bmxx80/bmx280.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package bmxx80
import (
"time"

"periph.io/x/conn/physic"
"periph.io/x/conn/v3/physic"
)

// sense280 reads the device's registers for bme280/bmp280.
Expand Down
10 changes: 5 additions & 5 deletions bmxx80/bmx280_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"testing"
"time"

"periph.io/x/conn/conntest"
"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/spi"
"periph.io/x/conn/spi/spitest"
"periph.io/x/conn/v3/conntest"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi"
"periph.io/x/conn/v3/spi/spitest"
)

// Real data extracted from a device.
Expand Down
16 changes: 8 additions & 8 deletions bmxx80/bmx280smoketest/bmx280smoketest.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import (
"flag"
"fmt"

"periph.io/x/conn/i2c"
"periph.io/x/conn/i2c/i2creg"
"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/spi"
"periph.io/x/conn/spi/spireg"
"periph.io/x/conn/spi/spitest"
"periph.io/x/devices/bmxx80"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/i2c/i2creg"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi"
"periph.io/x/conn/v3/spi/spireg"
"periph.io/x/conn/v3/spi/spitest"
"periph.io/x/devices/v3/bmxx80"
)

// SmokeTest is imported by periph-smoketest.
Expand Down
10 changes: 5 additions & 5 deletions bmxx80/bmxx80.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (
"sync"
"time"

"periph.io/x/conn"
"periph.io/x/conn/i2c"
"periph.io/x/conn/mmr"
"periph.io/x/conn/physic"
"periph.io/x/conn/spi"
"periph.io/x/conn/v3"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/mmr"
"periph.io/x/conn/v3/physic"
"periph.io/x/conn/v3/spi"
)

// Oversampling affects how much time is taken to measure each of temperature,
Expand Down
8 changes: 4 additions & 4 deletions bmxx80/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"fmt"
"log"

"periph.io/x/conn/i2c/i2creg"
"periph.io/x/conn/physic"
"periph.io/x/devices/bmxx80"
"periph.io/x/host"
"periph.io/x/conn/v3/i2c/i2creg"
"periph.io/x/conn/v3/physic"
"periph.io/x/devices/v3/bmxx80"
"periph.io/x/host/v3"
)

func Example() {
Expand Down
8 changes: 4 additions & 4 deletions cap1xxx/cap1xxx.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import (
"strconv"
"time"

"periph.io/x/conn"
"periph.io/x/conn/gpio"
"periph.io/x/conn/i2c"
"periph.io/x/conn/mmr"
"periph.io/x/conn/v3"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/mmr"
)

// TouchStatus is the status of an input sensor.
Expand Down
2 changes: 1 addition & 1 deletion cap1xxx/cap1xxx_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package cap1xxx
import (
"errors"

"periph.io/x/conn/gpio"
"periph.io/x/conn/v3/gpio"
)

// SamplingTime determines the time to make a single sample.
Expand Down
4 changes: 2 additions & 2 deletions cap1xxx/cap1xxx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"testing"
"time"

"periph.io/x/conn/i2c"
"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/v3/i2c"
"periph.io/x/conn/v3/i2c/i2ctest"
)

func TestNewI2C(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions cap1xxx/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"fmt"
"log"

"periph.io/x/conn/gpio"
"periph.io/x/conn/gpio/gpioreg"
"periph.io/x/conn/i2c/i2creg"
"periph.io/x/devices/cap1xxx"
"periph.io/x/conn/v3/gpio"
"periph.io/x/conn/v3/gpio/gpioreg"
"periph.io/x/conn/v3/i2c/i2creg"
"periph.io/x/devices/v3/cap1xxx"
)

func Example() {
Expand Down
6 changes: 3 additions & 3 deletions ccs811/ccs811.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ package ccs811
import (
"fmt"

"periph.io/x/conn/physic"
"periph.io/x/conn/v3/physic"

"periph.io/x/conn"
"periph.io/x/conn/i2c"
"periph.io/x/conn/v3"
"periph.io/x/conn/v3/i2c"
)

// MeasurementMode represents different ways how data is read
Expand Down
4 changes: 2 additions & 2 deletions ccs811/ccs811_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"testing"

"periph.io/x/conn/i2c/i2ctest"
"periph.io/x/conn/physic"
"periph.io/x/conn/v3/i2c/i2ctest"
"periph.io/x/conn/v3/physic"
)

func TestBasicInitialisationAndDataRead(t *testing.T) {
Expand Down
Loading

0 comments on commit 402bbcc

Please sign in to comment.