1
0
Fork 0
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:
Ben Delarre 2015-01-13 13:43:23 -08:00 committed by Kunal Powar
parent c78563a341
commit b6f5d8d640
2 changed files with 13 additions and 0 deletions

View file

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