Skip to content

Commit 1139661

Browse files
aykevldeadprogram
authored andcommitted
reference/machine: add SPI.Transfer
I totally forgot about this one! So here it is.
1 parent d41f10e commit 1139661

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

content/docs/reference/machine.md

+8
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ func (spi SPI) Configure(config SPIConfig) error
129129

130130
The `Configure` call enables and configures the hardware SPI for use, setting the configuration as described in `SPIConfig`. It will return an error when an incorrect configuration is provided (for example, using pins not usable with this SPI instance). See `SPIConfig` for details.
131131

132+
```go
133+
func (spi SPI) Transfer(b byte) (byte, error)
134+
```
135+
136+
Transmit and receive a single byte. Due to the nature of the SPI protocol, they happen both at the same time.
137+
138+
Use `Tx` instead of `Transfer` for high performance bulk transfers.
139+
132140
```go
133141
func (spi SPI) Tx(w, r []byte) error
134142
```

0 commit comments

Comments
 (0)