master
Friedl Ulrich 10 years ago
parent d9d9b0837e
commit 23f88df1ad

@ -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,

@ -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)
}

Loading…
Cancel
Save