Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn represents a connection to a device on an SPI bus with a multiplexed chip select.
The purpose of spimux.Conn is to allow two devices to be connected to SPI buses that only have a single chip select line. This is accomplished by placing a demux on the CS line such that a an extra gpio pin can direct the chip select to either of the two devices. The way this functions is that the spimux.Conn Tx function sets the demux select for the appropriate device and then performs a std transaction.
A sample circuit is to use an 74LVC1G19 demux with the SPI CS connected to E, the gpio select pin connected to A, and the CS inputs of the two devices attached to Y0 and Y1 respectively. A pull-down resitor on the A input of the demux is recommended to ensure both CS remain inactive when the SPI CS is not driven.
A limitation of the current implementation is that the speed setting and the configuration (SPI mode and number of bits) is shared between the two devices, i.e., it is not possible to use different settings.
func (*Conn) DevParams ¶
DevParams sets the device parameters and returns itself ('cause it's a Port as well as a Conn).
func (*Conn) LimitSpeed ¶
LimitSpeed is not implemented.