Documentation ¶
Index ¶
- func UseIntPin(pin gpio.Pin)
- type SPI
- func (dci *SPI) Begin()
- func (dci *SPI) End()
- func (dci *SPI) Err(clear bool) error
- func (dci *SPI) Read(s []byte)
- func (dci *SPI) SetClk(clkHz int)
- func (dci *SPI) SetMaxClk(clkHz int)
- func (dci *SPI) SetPDN(pdn int)
- func (dci *SPI) UseCSN(csn gpio.Pin, reconfSPI bool)
- func (dci *SPI) Write(s []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SPI ¶
type SPI struct {
// contains filtered or unexported fields
}
SPI implements eve.DCI using Serial Peripheral Interface.
func NewSPI ¶
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) SetMaxClk ¶
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) UseCSN ¶
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.