mirror of
https://github.com/kidoman/embd
synced 2025-07-03 11:57:38 +02:00
Support SPI minor devices >255 (PR #33)
This commit is contained in:
parent
56cb934dbf
commit
6cfa481f30
6 changed files with 9 additions and 9 deletions
|
@ -245,7 +245,7 @@ func (b *i2cBus) WriteToReg(addr, reg byte, value []byte) error {
|
|||
message.addr = uint16(addr)
|
||||
message.flags = 0
|
||||
message.len = uint16(len(outbuf))
|
||||
message.buf = uintptr(unsafe.Pointer(&hdrp.Data))
|
||||
message.buf = uintptr(unsafe.Pointer(hdrp.Data))
|
||||
|
||||
var packets i2c_rdwr_ioctl_data
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ type spiIOCTransfer struct {
|
|||
type spiBus struct {
|
||||
file *os.File
|
||||
|
||||
spiDevMinor byte
|
||||
spiDevMinor int
|
||||
|
||||
channel byte
|
||||
mode byte
|
||||
|
@ -63,7 +63,7 @@ func spiIOCMessageN(n uint32) uint32 {
|
|||
return (spiIOCMessage0 + (n * spiIOCIncrementor))
|
||||
}
|
||||
|
||||
func NewSPIBus(spiDevMinor, mode, channel byte, speed, bpw, delay int, i func() error) embd.SPIBus {
|
||||
func NewSPIBus(spiDevMinor int, mode, channel byte, speed, bpw, delay int, i func() error) embd.SPIBus {
|
||||
return &spiBus{
|
||||
spiDevMinor: spiDevMinor,
|
||||
mode: mode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue