Documentation ¶
Overview ¶
Package spi provides an example bit-bashed spi driver.
The intent of the package is to demonstrate using GPIO pins to implement bit-bashed interfaces for prototyping.
The package is not related to the SPI device drivers provided by the Linux kernel. Kernel device drivers are the preferred solution for production applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SPI ¶
type SPI struct { // time between clock edges (i.e. half the cycle time) Tclk time.Duration // Clock line Sclk *gpiod.Line // Slave select - active low Ssz *gpiod.Line // Master-out slave-in Mosi *gpiod.Line // Master-in slave-out Miso *gpiod.Line // contains filtered or unexported fields }
SPI represents a device connected an SPI bus using 4 GPIO lines.
This is the basis for bit bashed SPI interfaces using GPIO pins. It is not related to the SPI device drivers provided by the Linux kernel.
func (*SPI) ClockIn ¶
ClockIn clocks in a data bit from the SPI device on Miso.
Starts and ends just after the falling edge of the clock.
Directories ¶
Path | Synopsis |
---|---|
Package adc0832 provides a bit bashed device driver ADC0832s.
|
Package adc0832 provides a bit bashed device driver ADC0832s. |
Package mcp3w0c provides bit bashed device drivers for MCP3004/3008/3204/3208 SPI ADCs.
|
Package mcp3w0c provides bit bashed device drivers for MCP3004/3008/3204/3208 SPI ADCs. |