Documentation ¶
Index ¶
- type SPI
- func (dci *SPI) Cmd(p []byte, _ int)
- func (dci *SPI) DC() gpio.Pin
- func (dci *SPI) Driver() *spi.Driver
- func (dci *SPI) End()
- func (dci *SPI) Err(clear bool) error
- func (dci *SPI) ReadBytes(p []byte)
- func (dci *SPI) UseCSN(csn gpio.Pin, reconf bool)
- 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 SPI ¶
type SPI struct {
// contains filtered or unexported fields
}
SPI is an implementation of the display/tft.DCI that uses an SPI peripheral to communicate with the display in what is known as 4-line serial mode.
func NewSPI ¶
NewSPI returns new SPI based implementation of tftdrv.DCI. It properly configures the provided SPI driver and DC pin to communicate with a display controller. Select the SPI mode (CPOL,CPHA), write and read clock speed according to the display controller specification. Note that the maximum speed may be limited by the concrete instance of STM32 SPI peripheral, the bus topology and the specific display design.
func (*SPI) UseCSN ¶
UseCSN setups the underlying SPI peripheral in software slave select mode and setups csn as slave select pin. If reconf is true the SPI peripheral is reconfigured by any Cmd call so it can be shared with other applications (exclusive acces is required until End call).