Documentation
¶
Overview ¶
Package spi provides access to the registers of SPI peripheral. It also provides the driver that implements asynchronous and synchronous I/O.
Index ¶
- type Config
- type Event
- type Freq
- type Periph
- func (p *Periph) Event(e Event) *te.Event
- func (p *Periph) LoadCONFIG() Config
- func (p *Periph) LoadENABLE() bool
- func (p *Periph) LoadFREQUENCY() Freq
- func (p *Periph) LoadPSEL(s Signal) (pin gpio.Pin, connected bool)
- func (p *Periph) LoadRXD() byte
- func (p *Periph) StoreCONFIG(c Config)
- func (p *Periph) StoreENABLE(en bool)
- func (p *Periph) StoreFREQUENCY(f Freq)
- func (p *Periph) StorePSEL(s Signal, pin gpio.Pin, connected bool)
- func (p *Periph) StoreTXD(b byte)
- type Signal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config byte
Config is a bitfield that describes SPI configuration.
const ( MSBF Config = 0 // Most significant bit shifted out first. LSBF Config = 1 << 0 // Most significant bit shifted out first. CPHA0 Config = 0 // Sample on leading SCK edge, shift data on trailing edge. CPHA1 Config = 1 << 1 // Sample on trailing SCK edge, shift data on leading edge. CPOL0 Config = 0 // SCK polarity: active high. CPOL1 Config = 1 << 2 // SCK polarity: active low. )
type Periph ¶
func (*Periph) LoadCONFIG ¶
LoadCONFIG returns current SPI configuration.
func (*Periph) LoadENABLE ¶
LoadENABLE reports whether the SPI peripheral is enabled.
func (*Periph) LoadFREQUENCY ¶
LoadFREQUENCY returns configured SCK frequency.
func (*Periph) StoreCONFIG ¶
StoreCONFIG stores SPI configuration..
func (*Periph) StoreENABLE ¶
StoreENABLE enables or disables SPI peripheral.
func (*Periph) StoreFREQUENCY ¶
StoreFREQUENCY stores SCK frequency.
Click to show internal directories.
Click to hide internal directories.