Documentation
¶
Index ¶
- type I2C
- type SPI
- func (dci *SPI) Cmd(p []byte, _ int)
- func (dci *SPI) Driver() *spi.Master
- func (dci *SPI) End()
- func (dci *SPI) Err(clear bool) error
- func (dci *SPI) ReadBytes(p []byte)
- func (dci *SPI) WriteByteN(b byte, n int)
- func (dci *SPI) WriteBytes(p []uint8)
- func (dci *SPI) WriteString(s string)
- func (dci *SPI) WriteWordN(w uint16, n int)
- func (dci *SPI) WriteWords(p []uint16)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type I2C ¶ added in v0.1.2
type I2C struct {
// contains filtered or unexported fields
}
I2C is an implementation of the display/tft.DCI interface that uses an I2C peripheral to communicate with the I2C displays.
Limitations ¶
Current implementation is written with the SSD1306 OLED controller in mind and the pix/driver/fbdrv driver. It doesn't support ReadBytes, WriteWords, WriteWordN. The Cmd and the Write* methods are sending the provided commands/data bytes using a single I2C transaction: I2C Start, SSD1306 control byte, command/data bytes, I2C Stop (the Co bit in the Control Byte is cleared).
func NewI2C ¶ added in v0.1.2
NewI2C returns new I2C based implementation of tftdrv.DCI. User must provide a configured I2C master driver and the slave address.
func (*I2C) WriteByteN ¶ added in v0.1.2
func (*I2C) WriteBytes ¶ added in v0.1.2
func (*I2C) WriteString ¶ added in v0.1.2
type SPI ¶
type SPI struct {
// contains filtered or unexported fields
}
An SPI is an implementation of the tftdrv.DCI interface that uses an SPI peripheral to communicate with the display using the 4-line Serial Protocol.
func (*SPI) End ¶
func (dci *SPI) End()
End ends the SPI transaction. It sets CSn pin high, disables the SPI peripheral and unlocks the driver. Other usesrs of the same master driver can then take controll of the SPI bus locking the driver before use.