tftdci

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 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 SPIM

type SPIM struct {
	// contains filtered or unexported fields
}

SPIM is an implementation of the tftdrv.DCI that uses an SPIM peripheral to communicate with the display in what is known as 4-line serial mode.

func NewSPIM

func NewSPIM(drv *spim.Driver, dc gpio.Pin, mode spim.Config, rf, wf spim.Freq) *SPIM

NewSPIM 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 nRF5 SPI peripheral, the bus topology and the specific display design.

func (*SPIM) Cmd

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

func (*SPIM) DC

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

func (*SPIM) Driver

func (dci *SPIM) Driver() *spim.Driver

func (*SPIM) End

func (dci *SPIM) End()

func (*SPIM) Err

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

func (*SPIM) ReadBytes

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

func (*SPIM) UseCSN

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

UseCSN selects 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 (*SPIM) WriteBytes

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

Jump to

Keyboard shortcuts

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