SPI Device with cgo
This commit is contained in:
parent
ea4fca9a65
commit
610f9824a2
1 changed files with 2 additions and 2 deletions
|
@ -58,11 +58,11 @@ func (r *Device) readReg(addr byte) (byte, error) {
|
||||||
tx[0] = addr & 0x7f
|
tx[0] = addr & 0x7f
|
||||||
tx[1] = 0
|
tx[1] = 0
|
||||||
log.Printf("read %x", addr)
|
log.Printf("read %x", addr)
|
||||||
err := r.SpiDevice.Xfer(tx)
|
rx, err := r.SpiDevice.Xfer(tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
return tx[1], err
|
return rx[1], err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Device) setup() error {
|
func (r *Device) setup() error {
|
||||||
|
|
Loading…
Add table
Reference in a new issue