We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c8aead commit 227f6dcCopy full SHA for 227f6dc
src/machine/machine_nrf52xxx.go
@@ -330,6 +330,16 @@ func (spi SPI) Tx(w, r []byte) error {
330
return nil
331
}
332
333
+// Read implements [io.Reader]. And reads as many bytes as the given buffer is long
334
+func (spi *SPI) Read(r []byte) (int, error) {
335
+ return spi.Tx(nil, r), len(r)
336
+}
337
+
338
+// Write implements [io.Writer]. And writes as long as there are bytes in w.
339
+func (spi *SPI) Write(w []byte) (int, error) {
340
+ return spi.Tx(w, nil), len(w)
341
342
343
// PWM is one PWM peripheral, which consists of a counter and multiple output
344
// channels (that can be connected to actual pins). You can set the frequency
345
// using SetPeriod, but only for all the channels in this PWM peripheral at
0 commit comments