mirror of
https://github.com/stianeikeland/go-rpio.git
synced 2025-01-23 02:31:05 +01:00
17 lines
220 B
Go
17 lines
220 B
Go
package rpio
|
|
|
|
import ()
|
|
|
|
func Example_SPI() {
|
|
SpiBegin(SPI0) // BCM pins 7 to 11
|
|
|
|
SpiSpeed(144000) // 144kHz
|
|
SpiChipSelect(1) // CE1
|
|
|
|
SpiTransmit(0xFF)
|
|
SpiTransmit(0xDE, 0xAD)
|
|
SpiTransmit(data...)
|
|
|
|
SpiEnd(SPI0)
|
|
}
|