diff --git a/device.go b/device.go index e1c5d92..ff0cb2e 100644 --- a/device.go +++ b/device.go @@ -5,11 +5,12 @@ import ( "log" "github.com/davecheney/gpio" + spidev "github.com/fulr/spidev" ) // Device RFM69 Device type Device struct { - SpiDevice *SPIDevice + SpiDevice *spidev.SPIDevice gpio gpio.Pin mode byte address byte @@ -35,7 +36,7 @@ type Data struct { } // NewDevice creates a new device -func NewDevice(spi *SPIDevice, gpio gpio.Pin, nodeID, networkID byte, isRfm69HW bool) (*Device, error) { +func NewDevice(spi *spidev.SPIDevice, gpio gpio.Pin, nodeID, networkID byte, isRfm69HW bool) (*Device, error) { ret := &Device{ SpiDevice: spi, gpio: gpio, diff --git a/device_test.go b/device_test.go index bf2086d..b9eecd3 100644 --- a/device_test.go +++ b/device_test.go @@ -4,6 +4,7 @@ import ( "log" "github.com/davecheney/gpio" + spidev "github.com/fulr/spidev" ) const ( @@ -19,7 +20,7 @@ func main() { } defer pin.Close() - spiBus, err := NewSPIDevice("/dev/spidev0.0") + spiBus, err := spidev.NewSPIDevice("/dev/spidev0.0") if err != nil { panic(err) }