evedci

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UseIntPin

func UseIntPin(pin gpio.Pin)

UseIntPin setups GPIO pin and EXTI peripheral to detect EVE interrupts.

Types

type SPI

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

SPI implements eve.DCI using Serial Peripheral Interface.

func NewSPI

func NewSPI(spidrv *spi.Driver, pdn gpio.Pin) *SPI

NewSPI returns a new SPI based eve.DCI implementation. By default it expects the SPI NSS signal is used to drive EVE CSN. Use UseCSN method to move to software control of CSN. The pdn pin is configured as high-speed output.

func (*SPI) Begin

func (dci *SPI) Begin()

func (*SPI) End

func (dci *SPI) End()

func (*SPI) Err

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

func (*SPI) Read

func (dci *SPI) Read(s []byte)

func (*SPI) SetClk

func (dci *SPI) SetClk(clkHz int)

SetClk setups SPI peripheral to use clkHz clock speed.

func (*SPI) SetMaxClk

func (dci *SPI) SetMaxClk(clkHz int)

SetMaxClk allow to reduce the clock speed set by SetClk. The eve.Driver.Init method uses SetClk to set 30 MHz clock speed. Use this function to reduce this speed as required.

func (*SPI) SetPDN

func (dci *SPI) SetPDN(pdn int)

func (*SPI) UseCSN

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

UseCSN specifies the GPIO pin to be used as CSN signal. The pin is configured as high-speed output. If reconfSPI is true the SPI peripheral will be reconfigured before start any new transaction. This allows to share SPI bus with other external peripherals that use different SPI configuration.

func (*SPI) Write

func (dci *SPI) Write(s []byte)

Jump to

Keyboard shortcuts

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