tftdci

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

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

func NewSPI(drv *spi.Driver, dc gpio.Pin, mode spi.Config, rclkHz, wclkHz int) *SPI

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) Cmd

func (dci *SPI) Cmd(p []byte, _ int)

func (*SPI) DC

func (dci *SPI) DC() gpio.Pin

func (*SPI) Driver

func (dci *SPI) Driver() *spi.Driver

func (*SPI) End

func (dci *SPI) End()

func (*SPI) Err

func (dci *SPI) Err(clear bool) error

func (*SPI) ReadBytes

func (dci *SPI) ReadBytes(p []byte)

func (*SPI) UseCSN

func (dci *SPI) UseCSN(csn gpio.Pin, reconf bool)

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).

func (*SPI) WriteByteN

func (dci *SPI) WriteByteN(b byte, n int)

func (*SPI) WriteBytes

func (dci *SPI) WriteBytes(p []uint8)

func (*SPI) WriteString

func (dci *SPI) WriteString(s string)

func (*SPI) WriteWordN

func (dci *SPI) WriteWordN(w uint16, n int)

func (*SPI) WriteWords

func (dci *SPI) WriteWords(p []uint16)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL