From 70f3a511cc89715e5d9e7fe2c007c99041285aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20G=C3=BCthner?= Date: Fri, 23 Jul 2021 12:12:51 +0200 Subject: [PATCH 1/4] APA102: Allow to specify SPI Mode --- apa102/apa102.go | 8 ++++++-- apa102/apa102_test.go | 28 ++++++++++++++-------------- apa102/example_test.go | 5 +++-- rainbowhat/rainbowhat.go | 3 ++- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/apa102/apa102.go b/apa102/apa102.go index b68b8e7..d07ad78 100644 --- a/apa102/apa102.go +++ b/apa102/apa102.go @@ -92,8 +92,12 @@ type Opts struct { // As per APA102-C spec, the chip's max refresh rate is 400hz. // https://en.wikipedia.org/wiki/Flicker_fusion_threshold is a recommended // reading. -func New(p spi.Port, o *Opts) (*Dev, error) { - c, err := p.Connect(20*physic.MegaHertz, spi.Mode3, 8) +// +// Most devices can use spi.Mode3, but the raspberry pi 3 secondary SPI +// for example does not support this Mode. You may need to use spi.Mode0 +// in this and similar cases. +func New(p spi.Port, o *Opts, spiMode spi.Mode) (*Dev, error) { + c, err := p.Connect(20*physic.MegaHertz, spiMode, 8) if err != nil { return nil, err } diff --git a/apa102/apa102_test.go b/apa102/apa102_test.go index 9697127..90915e1 100644 --- a/apa102/apa102_test.go +++ b/apa102/apa102_test.go @@ -333,7 +333,7 @@ func TestDevEmpty(t *testing.T) { buf := bytes.Buffer{} o := DefaultOpts o.NumPixels = 0 - d, _ := New(spitest.NewRecordRaw(&buf), &o) + d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) if n, err := d.Write([]byte{}); n != 0 || err != nil { t.Fatalf("%d %v", n, err) } @@ -346,7 +346,7 @@ func TestDevEmpty(t *testing.T) { } func TestConnectFail(t *testing.T) { - if d, err := New(&configFail{}, &DefaultOpts); d != nil || err == nil { + if d, err := New(&configFail{}, &DefaultOpts, spi.Mode3); d != nil || err == nil { t.Fatal("Connect() call have failed") } } @@ -355,7 +355,7 @@ func TestDevLen(t *testing.T) { buf := bytes.Buffer{} o := DefaultOpts o.NumPixels = 1 - d, _ := New(spitest.NewRecordRaw(&buf), &o) + d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) if n, err := d.Write([]byte{0}); n != 0 || err == nil { t.Fatalf("%d %v", n, err) } @@ -555,7 +555,7 @@ func TestWrites(t *testing.T) { for _, tt := range writeTests { buf := bytes.Buffer{} tt.opts.NumPixels = len(tt.pixels) / 3 - d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts) + d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts, spi.Mode3) n, err := d.Write(tt.pixels) if err != nil { t.Fatal(err) @@ -580,7 +580,7 @@ func TestDevLong(t *testing.T) { colors := make([]color.NRGBA, 256) o := DefaultOpts o.NumPixels = len(colors) - d, _ := New(spitest.NewRecordRaw(&buf), &o) + d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) if n, err := d.Write(ToRGB(colors)); n != len(colors)*3 || err != nil { t.Fatalf("%d %v", n, err) } @@ -601,7 +601,7 @@ func TestDevWrite_Long(t *testing.T) { buf := bytes.Buffer{} o := DefaultOpts o.NumPixels = 1 - d, _ := New(spitest.NewRecordRaw(&buf), &o) + d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) if n, err := d.Write([]byte{0, 0, 0, 1, 1, 1}); n != 0 || err == nil { t.Fatal(n, err) } @@ -769,7 +769,7 @@ var drawTests = []struct { func TestDraws(t *testing.T) { for _, tt := range drawTests { buf := bytes.Buffer{} - d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts) + d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts, spi.Mode3) if err := d.Draw(d.Bounds(), tt.img, image.Point{}); err != nil { t.Fatalf("%s: %v", tt.name, err) } @@ -874,7 +874,7 @@ var offsetDrawTests = []struct { func TestOffsetDraws(t *testing.T) { for _, tt := range offsetDrawTests { buf := bytes.Buffer{} - d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts) + d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts, spi.Mode3) if err := d.Draw(tt.offset, tt.img, tt.point); err != nil { t.Fatalf("%s: %v", tt.name, err) } @@ -895,7 +895,7 @@ func TestHalt(t *testing.T) { o := DefaultOpts o.NumPixels = 4 o.Temperature = 5000 - d, _ := New(&s, &o) + d, _ := New(&s, &o, spi.Mode3) if err := d.Halt(); err != nil { t.Fatal(err) } @@ -925,7 +925,7 @@ func benchmarkWrite(b *testing.B, o Opts, length int, f genColor) { } o.NumPixels = length b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) _, _ = d.Write(pixels[:]) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -983,7 +983,7 @@ func BenchmarkWriteColorfulVariation(b *testing.B) { o.NumPixels = len(pixels) / 3 o.Intensity = 250 o.Temperature = 5000 - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) _, _ = d.Write(pixels[:]) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -1003,7 +1003,7 @@ func benchmarkDraw(b *testing.B, o Opts, img draw.Image, f genColor) { } o.NumPixels = img.Bounds().Max.X b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) r := d.Bounds() p := image.Point{} if err := d.Draw(r, img, p); err != nil { @@ -1062,7 +1062,7 @@ func BenchmarkDrawSlowpath(b *testing.B) { o := DefaultOpts o.NumPixels = img.Bounds().Max.X b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) r := d.Bounds() p := image.Point{} if err := d.Draw(r, img, p); err != nil { @@ -1078,7 +1078,7 @@ func BenchmarkDrawSlowpath(b *testing.B) { func BenchmarkHalt(b *testing.B) { b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &DefaultOpts) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &DefaultOpts, spi.Mode3) b.ResetTimer() for i := 0; i < b.N; i++ { if err := d.Halt(); err != nil { diff --git a/apa102/example_test.go b/apa102/example_test.go index f37061c..b0e5709 100644 --- a/apa102/example_test.go +++ b/apa102/example_test.go @@ -9,6 +9,7 @@ import ( "image/color" "log" + "periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi/spireg" "periph.io/x/devices/v3/apa102" "periph.io/x/host/v3" @@ -33,7 +34,7 @@ func Example() { o.NumPixels = 300 o.Intensity = 127 o.Temperature = 3500 - dev, err := apa102.New(p, &o) + dev, err := apa102.New(p, &o, spi.Mode0) if err != nil { log.Fatalf("failed to open: %v", err) } @@ -61,7 +62,7 @@ func ExampleToRGB() { o := apa102.PassThruOpts o.NumPixels = 2 - dev, err := apa102.New(p, &o) + dev, err := apa102.New(p, &o, spi.Mode3) if err != nil { log.Fatalf("failed to open: %v", err) } diff --git a/rainbowhat/rainbowhat.go b/rainbowhat/rainbowhat.go index 0853aeb..e7d6816 100644 --- a/rainbowhat/rainbowhat.go +++ b/rainbowhat/rainbowhat.go @@ -7,6 +7,7 @@ package rainbowhat import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/i2c/i2creg" + "periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi/spireg" "periph.io/x/devices/v3/apa102" "periph.io/x/devices/v3/bmxx80" @@ -53,7 +54,7 @@ func NewRainbowHat(ao *apa102.Opts) (*Dev, error) { opts := *ao opts.NumPixels = 7 - ledstrip, err := apa102.New(spiPort, &opts) + ledstrip, err := apa102.New(spiPort, &opts, spi.Mode3) if err != nil { return nil, err } From c768f7de3c9fe0d198842c13822db1b8900027e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20G=C3=BCthner?= Date: Fri, 23 Jul 2021 13:46:51 +0200 Subject: [PATCH 2/4] update go.mod --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b64427e..2b2c857 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. -module periph.io/x/devices/v3 +module github.com/GermanBionicSystems/devices go 1.13 From 20c235b4ec20a852fd1a1f37d6c5245f0b96492c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20G=C3=BCthner?= Date: Tue, 10 Aug 2021 12:44:36 +0200 Subject: [PATCH 3/4] apa102: make spimode part of the Opts --- apa102/apa102.go | 24 ++++++++++++++---------- apa102/apa102_test.go | 28 ++++++++++++++-------------- apa102/example_test.go | 5 ++--- go.mod | 2 +- rainbowhat/rainbowhat.go | 3 +-- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/apa102/apa102.go b/apa102/apa102.go index d07ad78..859d6c9 100644 --- a/apa102/apa102.go +++ b/apa102/apa102.go @@ -36,10 +36,11 @@ const NeutralTemp uint16 = 6500 // DefaultOpts is the recommended default options. var DefaultOpts = Opts{ - NumPixels: 150, // 150 LEDs is a common strip length. - Intensity: 255, // Full blinding power. - Temperature: 5000, // More pleasing white balance than NeutralTemp. - DisableGlobalPWM: false, // Use full 13 bits range. + NumPixels: 150, // 150 LEDs is a common strip length. + Intensity: 255, // Full blinding power. + Temperature: 5000, // More pleasing white balance than NeutralTemp. + DisableGlobalPWM: false, // Use full 13 bits range. + SpiMode: spi.Mode3, // SPI Mode3 works on most devices. } // PassThruOpts makes the driver draw RGB pixels exactly as specified. @@ -51,6 +52,7 @@ var PassThruOpts = Opts{ Intensity: 255, Temperature: NeutralTemp, DisableGlobalPWM: true, + SpiMode: spi.Mode3, } // Opts defines the options for the device. @@ -81,6 +83,12 @@ type Opts struct { // to 8 bits, this also disables the dynamic perceptual mapping of intensity // since there is not enough bits of resolution to do it effectively. DisableGlobalPWM bool + // SpiMode sets the clock polarity and phase as one of the 4 possible SPI Modes. + // + // Most devices can use spi.Mode3, but the Raspberry Pi 3 secondary SPI port + // for example does not support this Mode. You may need to use spi.Mode0 + // in this and similar cases. + SpiMode spi.Mode } // New returns a strip that communicates over SPI to APA102 LEDs. @@ -92,12 +100,8 @@ type Opts struct { // As per APA102-C spec, the chip's max refresh rate is 400hz. // https://en.wikipedia.org/wiki/Flicker_fusion_threshold is a recommended // reading. -// -// Most devices can use spi.Mode3, but the raspberry pi 3 secondary SPI -// for example does not support this Mode. You may need to use spi.Mode0 -// in this and similar cases. -func New(p spi.Port, o *Opts, spiMode spi.Mode) (*Dev, error) { - c, err := p.Connect(20*physic.MegaHertz, spiMode, 8) +func New(p spi.Port, o *Opts) (*Dev, error) { + c, err := p.Connect(20*physic.MegaHertz, o.SpiMode, 8) if err != nil { return nil, err } diff --git a/apa102/apa102_test.go b/apa102/apa102_test.go index 90915e1..9697127 100644 --- a/apa102/apa102_test.go +++ b/apa102/apa102_test.go @@ -333,7 +333,7 @@ func TestDevEmpty(t *testing.T) { buf := bytes.Buffer{} o := DefaultOpts o.NumPixels = 0 - d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &o) if n, err := d.Write([]byte{}); n != 0 || err != nil { t.Fatalf("%d %v", n, err) } @@ -346,7 +346,7 @@ func TestDevEmpty(t *testing.T) { } func TestConnectFail(t *testing.T) { - if d, err := New(&configFail{}, &DefaultOpts, spi.Mode3); d != nil || err == nil { + if d, err := New(&configFail{}, &DefaultOpts); d != nil || err == nil { t.Fatal("Connect() call have failed") } } @@ -355,7 +355,7 @@ func TestDevLen(t *testing.T) { buf := bytes.Buffer{} o := DefaultOpts o.NumPixels = 1 - d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &o) if n, err := d.Write([]byte{0}); n != 0 || err == nil { t.Fatalf("%d %v", n, err) } @@ -555,7 +555,7 @@ func TestWrites(t *testing.T) { for _, tt := range writeTests { buf := bytes.Buffer{} tt.opts.NumPixels = len(tt.pixels) / 3 - d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts) n, err := d.Write(tt.pixels) if err != nil { t.Fatal(err) @@ -580,7 +580,7 @@ func TestDevLong(t *testing.T) { colors := make([]color.NRGBA, 256) o := DefaultOpts o.NumPixels = len(colors) - d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &o) if n, err := d.Write(ToRGB(colors)); n != len(colors)*3 || err != nil { t.Fatalf("%d %v", n, err) } @@ -601,7 +601,7 @@ func TestDevWrite_Long(t *testing.T) { buf := bytes.Buffer{} o := DefaultOpts o.NumPixels = 1 - d, _ := New(spitest.NewRecordRaw(&buf), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &o) if n, err := d.Write([]byte{0, 0, 0, 1, 1, 1}); n != 0 || err == nil { t.Fatal(n, err) } @@ -769,7 +769,7 @@ var drawTests = []struct { func TestDraws(t *testing.T) { for _, tt := range drawTests { buf := bytes.Buffer{} - d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts) if err := d.Draw(d.Bounds(), tt.img, image.Point{}); err != nil { t.Fatalf("%s: %v", tt.name, err) } @@ -874,7 +874,7 @@ var offsetDrawTests = []struct { func TestOffsetDraws(t *testing.T) { for _, tt := range offsetDrawTests { buf := bytes.Buffer{} - d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(&buf), &tt.opts) if err := d.Draw(tt.offset, tt.img, tt.point); err != nil { t.Fatalf("%s: %v", tt.name, err) } @@ -895,7 +895,7 @@ func TestHalt(t *testing.T) { o := DefaultOpts o.NumPixels = 4 o.Temperature = 5000 - d, _ := New(&s, &o, spi.Mode3) + d, _ := New(&s, &o) if err := d.Halt(); err != nil { t.Fatal(err) } @@ -925,7 +925,7 @@ func benchmarkWrite(b *testing.B, o Opts, length int, f genColor) { } o.NumPixels = length b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) _, _ = d.Write(pixels[:]) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -983,7 +983,7 @@ func BenchmarkWriteColorfulVariation(b *testing.B) { o.NumPixels = len(pixels) / 3 o.Intensity = 250 o.Temperature = 5000 - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) _, _ = d.Write(pixels[:]) b.ResetTimer() for i := 0; i < b.N; i++ { @@ -1003,7 +1003,7 @@ func benchmarkDraw(b *testing.B, o Opts, img draw.Image, f genColor) { } o.NumPixels = img.Bounds().Max.X b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) r := d.Bounds() p := image.Point{} if err := d.Draw(r, img, p); err != nil { @@ -1062,7 +1062,7 @@ func BenchmarkDrawSlowpath(b *testing.B) { o := DefaultOpts o.NumPixels = img.Bounds().Max.X b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &o) r := d.Bounds() p := image.Point{} if err := d.Draw(r, img, p); err != nil { @@ -1078,7 +1078,7 @@ func BenchmarkDrawSlowpath(b *testing.B) { func BenchmarkHalt(b *testing.B) { b.ReportAllocs() - d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &DefaultOpts, spi.Mode3) + d, _ := New(spitest.NewRecordRaw(ioutil.Discard), &DefaultOpts) b.ResetTimer() for i := 0; i < b.N; i++ { if err := d.Halt(); err != nil { diff --git a/apa102/example_test.go b/apa102/example_test.go index b0e5709..f37061c 100644 --- a/apa102/example_test.go +++ b/apa102/example_test.go @@ -9,7 +9,6 @@ import ( "image/color" "log" - "periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi/spireg" "periph.io/x/devices/v3/apa102" "periph.io/x/host/v3" @@ -34,7 +33,7 @@ func Example() { o.NumPixels = 300 o.Intensity = 127 o.Temperature = 3500 - dev, err := apa102.New(p, &o, spi.Mode0) + dev, err := apa102.New(p, &o) if err != nil { log.Fatalf("failed to open: %v", err) } @@ -62,7 +61,7 @@ func ExampleToRGB() { o := apa102.PassThruOpts o.NumPixels = 2 - dev, err := apa102.New(p, &o, spi.Mode3) + dev, err := apa102.New(p, &o) if err != nil { log.Fatalf("failed to open: %v", err) } diff --git a/go.mod b/go.mod index 2b2c857..b64427e 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. -module github.com/GermanBionicSystems/devices +module periph.io/x/devices/v3 go 1.13 diff --git a/rainbowhat/rainbowhat.go b/rainbowhat/rainbowhat.go index e7d6816..0853aeb 100644 --- a/rainbowhat/rainbowhat.go +++ b/rainbowhat/rainbowhat.go @@ -7,7 +7,6 @@ package rainbowhat import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi/spireg" "periph.io/x/devices/v3/apa102" "periph.io/x/devices/v3/bmxx80" @@ -54,7 +53,7 @@ func NewRainbowHat(ao *apa102.Opts) (*Dev, error) { opts := *ao opts.NumPixels = 7 - ledstrip, err := apa102.New(spiPort, &opts, spi.Mode3) + ledstrip, err := apa102.New(spiPort, &opts) if err != nil { return nil, err } From 422dd59a65b46d0e0744e2fac322f72fc8466a9a Mon Sep 17 00:00:00 2001 From: Chris Pahl Date: Wed, 2 Jul 2025 11:18:29 +0200 Subject: [PATCH 4/4] chores: rename to github.com/GermanBionicSystems/devices/v3 to fix go mod issues --- README.md | 2 +- ads1x15/example_test.go | 2 +- apa102/example_test.go | 2 +- as7262/example_test.go | 2 +- bh1750/example_test.go | 2 +- bmxx80/bmx280smoketest/bmx280smoketest.go | 2 +- bmxx80/example_test.go | 2 +- cap1xxx/example_test.go | 2 +- ds248x/example_test.go | 2 +- ep0099/example_test.go | 2 +- epd/epd.go | 2 +- epd/example_test.go | 4 ++-- go.mod | 2 +- ht16k33/example_test.go | 2 +- ina219/example_test.go | 2 +- ina219/ina219smoketest/ina219smoketest.go | 2 +- inky/example_test.go | 2 +- lepton/cci/cci.go | 2 +- lepton/cci/cci_test.go | 2 +- lepton/lepton.go | 6 +++--- lepton/lepton_test.go | 4 ++-- mcp23xxx/example_test.go | 2 +- mcp9808/example_test.go | 2 +- mcp9808/mcp9808smoketest/mcp9808smoketest.go | 2 +- mfrc522/example_test.go | 4 ++-- mfrc522/mfrc522.go | 2 +- mpu9250/mpu9250.go | 2 +- pca9685/example_test.go | 2 +- rainbowhat/example_test.go | 4 ++-- rainbowhat/rainbowhat.go | 6 +++--- sn3218/example_test.go | 2 +- ssd1306/example_test.go | 4 ++-- ssd1306/ssd1306.go | 2 +- ssd1306/ssd1306_test.go | 2 +- ssd1306/ssd1306smoketest/ssd1306smoketest.go | 4 ++-- st7567/example_test.go | 2 +- tlv493d/example_test.go | 2 +- tm1637/example_test.go | 2 +- waveshare2in13v2/example_test.go | 4 ++-- waveshare2in13v2/waveshare213v2.go | 2 +- 40 files changed, 51 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 0afa360..941bbad 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ get an [invite here](https://invite.slack.golangbridge.org/). [![mascot](https://raw.githubusercontent.com/periph/website/master/site/static/img/periph-mascot-280.png)](https://periph.io/) -[![PkgGoDev](https://pkg.go.dev/badge/periph.io/x/devices/v3)](https://pkg.go.dev/periph.io/x/devices/v3) +[![PkgGoDev](https://pkg.go.dev/badge/github.com/GermanBionicSystems/devices/v3)](https://pkg.go.dev/github.com/GermanBionicSystems/devices/v3) [![Coverage Status](https://codecov.io/gh/periph/devices/graph/badge.svg)](https://codecov.io/gh/periph/devices) diff --git a/ads1x15/example_test.go b/ads1x15/example_test.go index 53f5c2a..982d28e 100644 --- a/ads1x15/example_test.go +++ b/ads1x15/example_test.go @@ -10,7 +10,7 @@ import ( "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/ads1x15" + "github.com/GermanBionicSystems/devices/v3/ads1x15" "periph.io/x/host/v3" ) diff --git a/apa102/example_test.go b/apa102/example_test.go index f37061c..bc1a2b7 100644 --- a/apa102/example_test.go +++ b/apa102/example_test.go @@ -10,7 +10,7 @@ import ( "log" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/apa102" + "github.com/GermanBionicSystems/devices/v3/apa102" "periph.io/x/host/v3" ) diff --git a/as7262/example_test.go b/as7262/example_test.go index b362f54..64d8cb5 100644 --- a/as7262/example_test.go +++ b/as7262/example_test.go @@ -12,7 +12,7 @@ import ( "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/as7262" + "github.com/GermanBionicSystems/devices/v3/as7262" "periph.io/x/host/v3" ) diff --git a/bh1750/example_test.go b/bh1750/example_test.go index caf20e3..fde4f64 100644 --- a/bh1750/example_test.go +++ b/bh1750/example_test.go @@ -9,7 +9,7 @@ import ( "log" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/bh1750" + "github.com/GermanBionicSystems/devices/v3/bh1750" "periph.io/x/host/v3" ) diff --git a/bmxx80/bmx280smoketest/bmx280smoketest.go b/bmxx80/bmx280smoketest/bmx280smoketest.go index 77688d1..16c5590 100644 --- a/bmxx80/bmx280smoketest/bmx280smoketest.go +++ b/bmxx80/bmx280smoketest/bmx280smoketest.go @@ -19,7 +19,7 @@ import ( "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" + "github.com/GermanBionicSystems/devices/v3/bmxx80" ) // SmokeTest is imported by periph-smoketest. diff --git a/bmxx80/example_test.go b/bmxx80/example_test.go index aee37f1..a022265 100644 --- a/bmxx80/example_test.go +++ b/bmxx80/example_test.go @@ -10,7 +10,7 @@ import ( "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/bmxx80" + "github.com/GermanBionicSystems/devices/v3/bmxx80" "periph.io/x/host/v3" ) diff --git a/cap1xxx/example_test.go b/cap1xxx/example_test.go index 75b64b2..a11f8a4 100644 --- a/cap1xxx/example_test.go +++ b/cap1xxx/example_test.go @@ -11,7 +11,7 @@ import ( "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" + "github.com/GermanBionicSystems/devices/v3/cap1xxx" ) func Example() { diff --git a/ds248x/example_test.go b/ds248x/example_test.go index ed14186..cfb1233 100644 --- a/ds248x/example_test.go +++ b/ds248x/example_test.go @@ -9,7 +9,7 @@ import ( "log" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/ds248x" + "github.com/GermanBionicSystems/devices/v3/ds248x" "periph.io/x/host/v3" ) diff --git a/ep0099/example_test.go b/ep0099/example_test.go index b0d5b9d..5c8c959 100644 --- a/ep0099/example_test.go +++ b/ep0099/example_test.go @@ -9,7 +9,7 @@ import ( "time" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/ep0099" + "github.com/GermanBionicSystems/devices/v3/ep0099" "periph.io/x/host/v3" ) diff --git a/epd/epd.go b/epd/epd.go index 5308287..8b08139 100644 --- a/epd/epd.go +++ b/epd/epd.go @@ -17,7 +17,7 @@ import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" "periph.io/x/host/v3/rpi" ) diff --git a/epd/example_test.go b/epd/example_test.go index 5bf4870..022a978 100644 --- a/epd/example_test.go +++ b/epd/example_test.go @@ -8,11 +8,11 @@ import ( "image" "log" - "periph.io/x/devices/v3/epd" + "github.com/GermanBionicSystems/devices/v3/epd" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" "periph.io/x/host/v3" ) diff --git a/go.mod b/go.mod index b64427e..353a7c5 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. -module periph.io/x/devices/v3 +module github.com/GermanBionicSystems/devices/v3 go 1.13 diff --git a/ht16k33/example_test.go b/ht16k33/example_test.go index 7edd32c..213fecd 100644 --- a/ht16k33/example_test.go +++ b/ht16k33/example_test.go @@ -9,7 +9,7 @@ import ( "time" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/ht16k33" + "github.com/GermanBionicSystems/devices/v3/ht16k33" "periph.io/x/host/v3" ) diff --git a/ina219/example_test.go b/ina219/example_test.go index 78c3cb5..fcfb772 100644 --- a/ina219/example_test.go +++ b/ina219/example_test.go @@ -9,7 +9,7 @@ import ( "log" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/ina219" + "github.com/GermanBionicSystems/devices/v3/ina219" "periph.io/x/host/v3" ) diff --git a/ina219/ina219smoketest/ina219smoketest.go b/ina219/ina219smoketest/ina219smoketest.go index cbe5fec..d6478d0 100644 --- a/ina219/ina219smoketest/ina219smoketest.go +++ b/ina219/ina219smoketest/ina219smoketest.go @@ -12,7 +12,7 @@ import ( "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/ina219" + "github.com/GermanBionicSystems/devices/v3/ina219" "periph.io/x/host/v3" ) diff --git a/inky/example_test.go b/inky/example_test.go index e3e4583..c585d71 100644 --- a/inky/example_test.go +++ b/inky/example_test.go @@ -13,7 +13,7 @@ import ( "periph.io/x/conn/v3/gpio/gpioreg" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/inky" + "github.com/GermanBionicSystems/devices/v3/inky" "periph.io/x/host/v3" ) diff --git a/lepton/cci/cci.go b/lepton/cci/cci.go index a5174cc..8ddaafd 100644 --- a/lepton/cci/cci.go +++ b/lepton/cci/cci.go @@ -21,7 +21,7 @@ import ( "periph.io/x/conn/v3/i2c" "periph.io/x/conn/v3/mmr" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/lepton/internal" + "github.com/GermanBionicSystems/devices/v3/lepton/internal" ) // StatusBit is the status as returned by the FLIR Lepton. diff --git a/lepton/cci/cci_test.go b/lepton/cci/cci_test.go index c5e6b78..d21bc71 100644 --- a/lepton/cci/cci_test.go +++ b/lepton/cci/cci_test.go @@ -12,7 +12,7 @@ import ( "periph.io/x/conn/v3/i2c/i2ctest" "periph.io/x/conn/v3/mmr" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/lepton/internal" + "github.com/GermanBionicSystems/devices/v3/lepton/internal" ) func TestStatusBit(t *testing.T) { diff --git a/lepton/lepton.go b/lepton/lepton.go index 6a89e46..fe159a2 100644 --- a/lepton/lepton.go +++ b/lepton/lepton.go @@ -17,9 +17,9 @@ import ( "periph.io/x/conn/v3/i2c" "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" - "periph.io/x/devices/v3/lepton/cci" - "periph.io/x/devices/v3/lepton/image14bit" - "periph.io/x/devices/v3/lepton/internal" + "github.com/GermanBionicSystems/devices/v3/lepton/cci" + "github.com/GermanBionicSystems/devices/v3/lepton/image14bit" + "github.com/GermanBionicSystems/devices/v3/lepton/internal" ) // Metadata is constructed from telemetry data, which is sent with each frame. diff --git a/lepton/lepton_test.go b/lepton/lepton_test.go index cf320ca..f31f9fe 100644 --- a/lepton/lepton_test.go +++ b/lepton/lepton_test.go @@ -17,8 +17,8 @@ import ( "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi/spitest" - "periph.io/x/devices/v3/lepton/image14bit" - "periph.io/x/devices/v3/lepton/internal" + "github.com/GermanBionicSystems/devices/v3/lepton/image14bit" + "github.com/GermanBionicSystems/devices/v3/lepton/internal" ) func TestNew_cs(t *testing.T) { diff --git a/mcp23xxx/example_test.go b/mcp23xxx/example_test.go index e3901b0..a828ee7 100644 --- a/mcp23xxx/example_test.go +++ b/mcp23xxx/example_test.go @@ -10,7 +10,7 @@ import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/mcp23xxx" + "github.com/GermanBionicSystems/devices/v3/mcp23xxx" "periph.io/x/host/v3" ) diff --git a/mcp9808/example_test.go b/mcp9808/example_test.go index ead77ab..7a1984f 100644 --- a/mcp9808/example_test.go +++ b/mcp9808/example_test.go @@ -10,7 +10,7 @@ import ( "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/mcp9808" + "github.com/GermanBionicSystems/devices/v3/mcp9808" "periph.io/x/host/v3" ) diff --git a/mcp9808/mcp9808smoketest/mcp9808smoketest.go b/mcp9808/mcp9808smoketest/mcp9808smoketest.go index cb4370b..b10ffd5 100644 --- a/mcp9808/mcp9808smoketest/mcp9808smoketest.go +++ b/mcp9808/mcp9808smoketest/mcp9808smoketest.go @@ -11,7 +11,7 @@ import ( "fmt" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/mcp9808" + "github.com/GermanBionicSystems/devices/v3/mcp9808" "periph.io/x/host/v3" ) diff --git a/mfrc522/example_test.go b/mfrc522/example_test.go index 9d1f764..70cc1da 100644 --- a/mfrc522/example_test.go +++ b/mfrc522/example_test.go @@ -11,8 +11,8 @@ import ( "time" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/mfrc522" - "periph.io/x/devices/v3/mfrc522/commands" + "github.com/GermanBionicSystems/devices/v3/mfrc522" + "github.com/GermanBionicSystems/devices/v3/mfrc522/commands" "periph.io/x/host/v3" "periph.io/x/host/v3/rpi" ) diff --git a/mfrc522/mfrc522.go b/mfrc522/mfrc522.go index 3cdc13f..22f9f60 100644 --- a/mfrc522/mfrc522.go +++ b/mfrc522/mfrc522.go @@ -17,7 +17,7 @@ import ( "periph.io/x/conn/v3" "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/spi" - "periph.io/x/devices/v3/mfrc522/commands" + "github.com/GermanBionicSystems/devices/v3/mfrc522/commands" ) // Dev is an handle to an MFRC522 RFID reader. diff --git a/mpu9250/mpu9250.go b/mpu9250/mpu9250.go index 360789e..3bdbbfc 100644 --- a/mpu9250/mpu9250.go +++ b/mpu9250/mpu9250.go @@ -15,7 +15,7 @@ import ( "math" "time" - "periph.io/x/devices/v3/mpu9250/reg" + "github.com/GermanBionicSystems/devices/v3/mpu9250/reg" ) const ( diff --git a/pca9685/example_test.go b/pca9685/example_test.go index 750b568..ae1a8e1 100644 --- a/pca9685/example_test.go +++ b/pca9685/example_test.go @@ -9,7 +9,7 @@ import ( "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/pca9685" + "github.com/GermanBionicSystems/devices/v3/pca9685" "periph.io/x/host/v3" ) diff --git a/rainbowhat/example_test.go b/rainbowhat/example_test.go index 4c052a1..2c53a21 100644 --- a/rainbowhat/example_test.go +++ b/rainbowhat/example_test.go @@ -16,8 +16,8 @@ import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/apa102" - "periph.io/x/devices/v3/rainbowhat" + "github.com/GermanBionicSystems/devices/v3/apa102" + "github.com/GermanBionicSystems/devices/v3/rainbowhat" "periph.io/x/host/v3" ) diff --git a/rainbowhat/rainbowhat.go b/rainbowhat/rainbowhat.go index 0853aeb..ff5ec21 100644 --- a/rainbowhat/rainbowhat.go +++ b/rainbowhat/rainbowhat.go @@ -8,9 +8,9 @@ import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/apa102" - "periph.io/x/devices/v3/bmxx80" - "periph.io/x/devices/v3/ht16k33" + "github.com/GermanBionicSystems/devices/v3/apa102" + "github.com/GermanBionicSystems/devices/v3/bmxx80" + "github.com/GermanBionicSystems/devices/v3/ht16k33" "periph.io/x/host/v3/rpi" ) diff --git a/sn3218/example_test.go b/sn3218/example_test.go index b657f47..ba0f7a8 100644 --- a/sn3218/example_test.go +++ b/sn3218/example_test.go @@ -9,7 +9,7 @@ import ( "time" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/sn3218" + "github.com/GermanBionicSystems/devices/v3/sn3218" "periph.io/x/host/v3" ) diff --git a/ssd1306/example_test.go b/ssd1306/example_test.go index cfc2060..bb09edf 100644 --- a/ssd1306/example_test.go +++ b/ssd1306/example_test.go @@ -9,8 +9,8 @@ import ( "log" "periph.io/x/conn/v3/i2c/i2creg" - "periph.io/x/devices/v3/ssd1306" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" "periph.io/x/host/v3" ) diff --git a/ssd1306/ssd1306.go b/ssd1306/ssd1306.go index 9a8d29d..226c379 100644 --- a/ssd1306/ssd1306.go +++ b/ssd1306/ssd1306.go @@ -22,7 +22,7 @@ import ( "periph.io/x/conn/v3/i2c" "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" ) const ( diff --git a/ssd1306/ssd1306_test.go b/ssd1306/ssd1306_test.go index af4b671..383d439 100644 --- a/ssd1306/ssd1306_test.go +++ b/ssd1306/ssd1306_test.go @@ -18,7 +18,7 @@ import ( "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" "periph.io/x/conn/v3/spi/spitest" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" ) func TestNewI2C_fail(t *testing.T) { diff --git a/ssd1306/ssd1306smoketest/ssd1306smoketest.go b/ssd1306/ssd1306smoketest/ssd1306smoketest.go index a101579..e9628a4 100644 --- a/ssd1306/ssd1306smoketest/ssd1306smoketest.go +++ b/ssd1306/ssd1306smoketest/ssd1306smoketest.go @@ -25,8 +25,8 @@ import ( "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/ssd1306" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" ) // SmokeTest is imported by periph-smoketest. diff --git a/st7567/example_test.go b/st7567/example_test.go index aeb2d24..7a14ca2 100644 --- a/st7567/example_test.go +++ b/st7567/example_test.go @@ -20,7 +20,7 @@ import ( "periph.io/x/conn/v3/gpio/gpioreg" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/st7567" + "github.com/GermanBionicSystems/devices/v3/st7567" "periph.io/x/host/v3" ) diff --git a/tlv493d/example_test.go b/tlv493d/example_test.go index 2b221b5..b5a1e06 100644 --- a/tlv493d/example_test.go +++ b/tlv493d/example_test.go @@ -10,7 +10,7 @@ import ( "periph.io/x/conn/v3/i2c/i2creg" "periph.io/x/conn/v3/physic" - "periph.io/x/devices/v3/tlv493d" + "github.com/GermanBionicSystems/devices/v3/tlv493d" "periph.io/x/host/v3" ) diff --git a/tm1637/example_test.go b/tm1637/example_test.go index 54b25df..99de5a2 100644 --- a/tm1637/example_test.go +++ b/tm1637/example_test.go @@ -8,7 +8,7 @@ import ( "log" "periph.io/x/conn/v3/gpio/gpioreg" - "periph.io/x/devices/v3/tm1637" + "github.com/GermanBionicSystems/devices/v3/tm1637" "periph.io/x/host/v3" ) diff --git a/waveshare2in13v2/example_test.go b/waveshare2in13v2/example_test.go index 7453598..3d2434e 100644 --- a/waveshare2in13v2/example_test.go +++ b/waveshare2in13v2/example_test.go @@ -18,8 +18,8 @@ import ( "golang.org/x/image/font/gofont/goregular" "periph.io/x/conn/v3/spi/spireg" - "periph.io/x/devices/v3/ssd1306/image1bit" - "periph.io/x/devices/v3/waveshare2in13v2" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/waveshare2in13v2" "periph.io/x/host/v3" ) diff --git a/waveshare2in13v2/waveshare213v2.go b/waveshare2in13v2/waveshare213v2.go index 597fdc0..a2dba3b 100644 --- a/waveshare2in13v2/waveshare213v2.go +++ b/waveshare2in13v2/waveshare213v2.go @@ -17,7 +17,7 @@ import ( "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/physic" "periph.io/x/conn/v3/spi" - "periph.io/x/devices/v3/ssd1306/image1bit" + "github.com/GermanBionicSystems/devices/v3/ssd1306/image1bit" "periph.io/x/host/v3/rpi" )