Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SPI ¶
type SPI struct { Mu sync.Mutex // time between clock edges (i.e. half the cycle time) Tclk time.Duration Sclk *gpio.Pin Ssz *gpio.Pin Mosi *gpio.Pin Miso *gpio.Pin }
SPI represents a device connected to the Raspberry Pi via an SPI bus using 3 or 4 GPIO lines.
Depending on the device, the two data pins, Mosi and Miso, may be tied and connected to a single GPIO pin. This is the basis for bit bashed SPI interfaces using GPIO pins. It is not related to the SPI device drivers provided by Linux.
func (*SPI) ClockIn ¶
ClockIn clocks in a data bit from the SPI device on Miso. Assumes clock starts high and ends with the rising edge of the next clock. Assumes caller already holds the Mu lock.
Click to show internal directories.
Click to hide internal directories.