mirror of https://github.com/kidoman/embd
spi: added write method to allow writing without transfer delays
This commit is contained in:
parent
c78563a341
commit
1efc3b632e
|
@ -233,6 +233,14 @@ func (b *spiBus) ReceiveByte() (byte, error) {
|
|||
return byte(d[0]), nil
|
||||
}
|
||||
|
||||
func (b *spiBus) Write(data []uint8) (error) {
|
||||
if err := b.init(); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := b.file.Write(data)
|
||||
return err
|
||||
}
|
||||
|
||||
func (b *spiBus) Close() error {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
|
|
Loading…
Reference in New Issue