mirror of
https://github.com/kidoman/embd
synced 2025-07-03 03:47:33 +02:00
spi: added write method to allow writing without transfer delays
This commit is contained in:
parent
c78563a341
commit
b6f5d8d640
2 changed files with 13 additions and 0 deletions
|
@ -233,6 +233,13 @@ func (b *spiBus) ReceiveByte() (byte, error) {
|
|||
return byte(d[0]), nil
|
||||
}
|
||||
|
||||
func (b *spiBus) Write(data []byte) (n int, err error) {
|
||||
if err := b.init(); err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return b.file.Write(data)
|
||||
}
|
||||
|
||||
func (b *spiBus) Close() error {
|
||||
b.mu.Lock()
|
||||
defer b.mu.Unlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue