Documentation ¶
Overview ¶
Package spi provides interface to Serial Peripheral Interface.
Peripheral: SPI_Periph Serial Peripheral Interface. Instances:
SPI2 mmap.SPI2_BASE SPI3 mmap.SPI3_BASE SPI1 mmap.SPI1_BASE SPI4 mmap.SPI4_BASE SPI5 mmap.SPI5_BASE SPI6 mmap.SPI6_BASE
Registers:
0x00 32 CR1 Control register 1 (not used in I2S mode). 0x04 32 CR2 Control register 2. 0x08 32 SR Status register. 0x0C 32 DR Data register. 0x10 32 CRCPR CRC polynomial register (not used in I2S mode). 0x14 32 RXCRCR RX CRC register (not used in I2S mode). 0x18 32 TXCRCR TX CRC register (not used in I2S mode). 0x1C 32 I2SCFGR SPI_I2S configuration register. 0x20 32 I2SPR SPI_I2S prescaler register.
Import:
stm32/o/f746xx/mmap
Index ¶
- Constants
- Variables
- type CR1
- type CR2
- type CRCPR
- type DR
- type I2SCFGR
- type I2SPR
- type RCR1
- func (r *RCR1) AtomicClearBits(mask CR1)
- func (r *RCR1) AtomicSetBits(mask CR1)
- func (r *RCR1) AtomicStoreBits(mask, b CR1)
- func (r *RCR1) Bits(mask CR1) CR1
- func (r *RCR1) ClearBits(mask CR1)
- func (r *RCR1) Load() CR1
- func (r *RCR1) SetBits(mask CR1)
- func (r *RCR1) Store(b CR1)
- func (r *RCR1) StoreBits(mask, b CR1)
- type RCR2
- func (r *RCR2) AtomicClearBits(mask CR2)
- func (r *RCR2) AtomicSetBits(mask CR2)
- func (r *RCR2) AtomicStoreBits(mask, b CR2)
- func (r *RCR2) Bits(mask CR2) CR2
- func (r *RCR2) ClearBits(mask CR2)
- func (r *RCR2) Load() CR2
- func (r *RCR2) SetBits(mask CR2)
- func (r *RCR2) Store(b CR2)
- func (r *RCR2) StoreBits(mask, b CR2)
- type RCRCPR
- func (r *RCRCPR) AtomicClearBits(mask CRCPR)
- func (r *RCRCPR) AtomicSetBits(mask CRCPR)
- func (r *RCRCPR) AtomicStoreBits(mask, b CRCPR)
- func (r *RCRCPR) Bits(mask CRCPR) CRCPR
- func (r *RCRCPR) ClearBits(mask CRCPR)
- func (r *RCRCPR) Load() CRCPR
- func (r *RCRCPR) SetBits(mask CRCPR)
- func (r *RCRCPR) Store(b CRCPR)
- func (r *RCRCPR) StoreBits(mask, b CRCPR)
- type RDR
- type RI2SCFGR
- func (r *RI2SCFGR) AtomicClearBits(mask I2SCFGR)
- func (r *RI2SCFGR) AtomicSetBits(mask I2SCFGR)
- func (r *RI2SCFGR) AtomicStoreBits(mask, b I2SCFGR)
- func (r *RI2SCFGR) Bits(mask I2SCFGR) I2SCFGR
- func (r *RI2SCFGR) ClearBits(mask I2SCFGR)
- func (r *RI2SCFGR) Load() I2SCFGR
- func (r *RI2SCFGR) SetBits(mask I2SCFGR)
- func (r *RI2SCFGR) Store(b I2SCFGR)
- func (r *RI2SCFGR) StoreBits(mask, b I2SCFGR)
- type RI2SPR
- func (r *RI2SPR) AtomicClearBits(mask I2SPR)
- func (r *RI2SPR) AtomicSetBits(mask I2SPR)
- func (r *RI2SPR) AtomicStoreBits(mask, b I2SPR)
- func (r *RI2SPR) Bits(mask I2SPR) I2SPR
- func (r *RI2SPR) ClearBits(mask I2SPR)
- func (r *RI2SPR) Load() I2SPR
- func (r *RI2SPR) SetBits(mask I2SPR)
- func (r *RI2SPR) Store(b I2SPR)
- func (r *RI2SPR) StoreBits(mask, b I2SPR)
- type RMCR1
- type RMCR2
- type RMCRCPR
- type RMDR
- type RMI2SCFGR
- type RMI2SPR
- type RMRXCRCR
- type RMSR
- type RMTXCRCR
- type RRXCRCR
- func (r *RRXCRCR) AtomicClearBits(mask RXCRCR)
- func (r *RRXCRCR) AtomicSetBits(mask RXCRCR)
- func (r *RRXCRCR) AtomicStoreBits(mask, b RXCRCR)
- func (r *RRXCRCR) Bits(mask RXCRCR) RXCRCR
- func (r *RRXCRCR) ClearBits(mask RXCRCR)
- func (r *RRXCRCR) Load() RXCRCR
- func (r *RRXCRCR) SetBits(mask RXCRCR)
- func (r *RRXCRCR) Store(b RXCRCR)
- func (r *RRXCRCR) StoreBits(mask, b RXCRCR)
- type RSR
- type RTXCRCR
- func (r *RTXCRCR) AtomicClearBits(mask TXCRCR)
- func (r *RTXCRCR) AtomicSetBits(mask TXCRCR)
- func (r *RTXCRCR) AtomicStoreBits(mask, b TXCRCR)
- func (r *RTXCRCR) Bits(mask TXCRCR) TXCRCR
- func (r *RTXCRCR) ClearBits(mask TXCRCR)
- func (r *RTXCRCR) Load() TXCRCR
- func (r *RTXCRCR) SetBits(mask TXCRCR)
- func (r *RTXCRCR) Store(b TXCRCR)
- func (r *RTXCRCR) StoreBits(mask, b TXCRCR)
- type RXCRCR
- type SPI_Periph
- func (p *SPI_Periph) ASTRTEN() RMI2SCFGR
- func (p *SPI_Periph) BIDIMODE() RMCR1
- func (p *SPI_Periph) BIDIOE() RMCR1
- func (p *SPI_Periph) BR() RMCR1
- func (p *SPI_Periph) BSY() RMSR
- func (p *SPI_Periph) BaseAddr() uintptr
- func (p *SPI_Periph) CHLEN() RMI2SCFGR
- func (p *SPI_Periph) CHSIDE() RMSR
- func (p *SPI_Periph) CKPOL() RMI2SCFGR
- func (p *SPI_Periph) CPHA() RMCR1
- func (p *SPI_Periph) CPOL() RMCR1
- func (p *SPI_Periph) CRCEN() RMCR1
- func (p *SPI_Periph) CRCERR() RMSR
- func (p *SPI_Periph) CRCL() RMCR1
- func (p *SPI_Periph) CRCNEXT() RMCR1
- func (p *SPI_Periph) CRCPOLY() RMCRCPR
- func (p *SPI_Periph) DATLEN() RMI2SCFGR
- func (p *SPI_Periph) DS() RMCR2
- func (p *SPI_Periph) ERRIE() RMCR2
- func (p *SPI_Periph) FRE() RMSR
- func (p *SPI_Periph) FRF() RMCR2
- func (p *SPI_Periph) FRLVL() RMSR
- func (p *SPI_Periph) FRXTH() RMCR2
- func (p *SPI_Periph) FTLVL() RMSR
- func (p *SPI_Periph) I2SCFG() RMI2SCFGR
- func (p *SPI_Periph) I2SDIV() RMI2SPR
- func (p *SPI_Periph) I2SE() RMI2SCFGR
- func (p *SPI_Periph) I2SMOD() RMI2SCFGR
- func (p *SPI_Periph) I2SSTD() RMI2SCFGR
- func (p *SPI_Periph) LDMARX() RMCR2
- func (p *SPI_Periph) LDMATX() RMCR2
- func (p *SPI_Periph) LSBFIRST() RMCR1
- func (p *SPI_Periph) MCKOE() RMI2SPR
- func (p *SPI_Periph) MODF() RMSR
- func (p *SPI_Periph) MSTR() RMCR1
- func (p *SPI_Periph) NSSP() RMCR2
- func (p *SPI_Periph) ODD() RMI2SPR
- func (p *SPI_Periph) OVR() RMSR
- func (p *SPI_Periph) PCMSYNC() RMI2SCFGR
- func (p *SPI_Periph) RXCRC() RMRXCRCR
- func (p *SPI_Periph) RXDMAEN() RMCR2
- func (p *SPI_Periph) RXNE() RMSR
- func (p *SPI_Periph) RXNEIE() RMCR2
- func (p *SPI_Periph) RXONLY() RMCR1
- func (p *SPI_Periph) SPE() RMCR1
- func (p *SPI_Periph) SSI() RMCR1
- func (p *SPI_Periph) SSM() RMCR1
- func (p *SPI_Periph) SSOE() RMCR2
- func (p *SPI_Periph) TXCRC() RMTXCRCR
- func (p *SPI_Periph) TXDMAEN() RMCR2
- func (p *SPI_Periph) TXE() RMSR
- func (p *SPI_Periph) TXEIE() RMCR2
- func (p *SPI_Periph) UDR() RMSR
- type SR
- type TXCRCR
Constants ¶
View Source
const ( CPHAn = 0 CPOLn = 1 MSTRn = 2 BRn = 3 SPEn = 6 LSBFIRSTn = 7 SSIn = 8 SSMn = 9 RXONLYn = 10 CRCLn = 11 CRCNEXTn = 12 CRCENn = 13 BIDIOEn = 14 BIDIMODEn = 15 )
View Source
const ( RXDMAENn = 0 TXDMAENn = 1 SSOEn = 2 NSSPn = 3 FRFn = 4 ERRIEn = 5 RXNEIEn = 6 TXEIEn = 7 DSn = 8 FRXTHn = 12 LDMARXn = 13 LDMATXn = 14 )
View Source
const ( RXNEn = 0 TXEn = 1 CHSIDEn = 2 UDRn = 3 CRCERRn = 4 MODFn = 5 OVRn = 6 BSYn = 7 FREn = 8 FRLVLn = 9 FTLVLn = 11 )
View Source
const ( CHLENn = 0 DATLENn = 1 CKPOLn = 3 I2SSTDn = 4 PCMSYNCn = 7 I2SCFGn = 8 I2SEn = 10 I2SMODn = 11 ASTRTENn = 12 )
View Source
const ( I2SDIVn = 0 ODDn = 8 MCKOEn = 9 )
View Source
const (
CRCPOLYn = 0
)
View Source
const (
RXCRCn = 0
)
View Source
const (
TXCRCn = 0
)
Variables ¶
View Source
var SPI1 = (*SPI_Periph)(unsafe.Pointer(uintptr(mmap.SPI1_BASE)))
View Source
var SPI2 = (*SPI_Periph)(unsafe.Pointer(uintptr(mmap.SPI2_BASE)))
View Source
var SPI3 = (*SPI_Periph)(unsafe.Pointer(uintptr(mmap.SPI3_BASE)))
View Source
var SPI4 = (*SPI_Periph)(unsafe.Pointer(uintptr(mmap.SPI4_BASE)))
View Source
var SPI5 = (*SPI_Periph)(unsafe.Pointer(uintptr(mmap.SPI5_BASE)))
View Source
var SPI6 = (*SPI_Periph)(unsafe.Pointer(uintptr(mmap.SPI6_BASE)))
Functions ¶
This section is empty.
Types ¶
type CR1 ¶
type CR1 uint32
const ( CPHA CR1 = 0x01 << 0 //+ Clock Phase. CPOL CR1 = 0x01 << 1 //+ Clock Polarity. MSTR CR1 = 0x01 << 2 //+ Master Selection. BR CR1 = 0x07 << 3 //+ BR[2:0] bits (Baud Rate Control). BR_0 CR1 = 0x01 << 3 // Bit 0. BR_1 CR1 = 0x02 << 3 // Bit 1. BR_2 CR1 = 0x04 << 3 // Bit 2. SPE CR1 = 0x01 << 6 //+ SPI Enable. LSBFIRST CR1 = 0x01 << 7 //+ Frame Format. SSI CR1 = 0x01 << 8 //+ Internal slave select. SSM CR1 = 0x01 << 9 //+ Software slave management. RXONLY CR1 = 0x01 << 10 //+ Receive only. CRCL CR1 = 0x01 << 11 //+ CRC Length. CRCNEXT CR1 = 0x01 << 12 //+ Transmit CRC next. CRCEN CR1 = 0x01 << 13 //+ Hardware CRC calculation enable. BIDIOE CR1 = 0x01 << 14 //+ Output enable in bidirectional mode. BIDIMODE CR1 = 0x01 << 15 //+ Bidirectional data mode enable. )
type CR2 ¶
type CR2 uint32
const ( RXDMAEN CR2 = 0x01 << 0 //+ Rx Buffer DMA Enable. TXDMAEN CR2 = 0x01 << 1 //+ Tx Buffer DMA Enable. SSOE CR2 = 0x01 << 2 //+ SS Output Enable. NSSP CR2 = 0x01 << 3 //+ NSS pulse management Enable. FRF CR2 = 0x01 << 4 //+ Frame Format Enable. ERRIE CR2 = 0x01 << 5 //+ Error Interrupt Enable. RXNEIE CR2 = 0x01 << 6 //+ RX buffer Not Empty Interrupt Enable. TXEIE CR2 = 0x01 << 7 //+ Tx buffer Empty Interrupt Enable. DS CR2 = 0x0F << 8 //+ DS[3:0] Data Size. DS_0 CR2 = 0x01 << 8 // Bit 0. DS_1 CR2 = 0x02 << 8 // Bit 1. DS_2 CR2 = 0x04 << 8 // Bit 2. DS_3 CR2 = 0x08 << 8 // Bit 3. FRXTH CR2 = 0x01 << 12 //+ FIFO reception Threshold. LDMARX CR2 = 0x01 << 13 //+ Last DMA transfer for reception. LDMATX CR2 = 0x01 << 14 //+ Last DMA transfer for transmission. )
type I2SCFGR ¶
type I2SCFGR uint32
const ( CHLEN I2SCFGR = 0x01 << 0 //+ Channel length (number of bits per audio channel). DATLEN I2SCFGR = 0x03 << 1 //+ DATLEN[1:0] bits (Data length to be transferred). DATLEN_0 I2SCFGR = 0x01 << 1 // Bit 0. DATLEN_1 I2SCFGR = 0x02 << 1 // Bit 1. CKPOL I2SCFGR = 0x01 << 3 //+ steady state clock polarity. I2SSTD I2SCFGR = 0x03 << 4 //+ I2SSTD[1:0] bits (I2S standard selection). I2SSTD_0 I2SCFGR = 0x01 << 4 // Bit 0. I2SSTD_1 I2SCFGR = 0x02 << 4 // Bit 1. PCMSYNC I2SCFGR = 0x01 << 7 //+ PCM frame synchronization. I2SCFG I2SCFGR = 0x03 << 8 //+ I2SCFG[1:0] bits (I2S configuration mode). I2SCFG_0 I2SCFGR = 0x01 << 8 // Bit 0. I2SCFG_1 I2SCFGR = 0x02 << 8 // Bit 1. I2SE I2SCFGR = 0x01 << 10 //+ I2S Enable. I2SMOD I2SCFGR = 0x01 << 11 //+ I2S mode selection. ASTRTEN I2SCFGR = 0x01 << 12 //+ Asynchronous start enable. )
type RCR1 ¶
func (*RCR1) AtomicClearBits ¶
func (*RCR1) AtomicSetBits ¶
func (*RCR1) AtomicStoreBits ¶
type RCR2 ¶
func (*RCR2) AtomicClearBits ¶
func (*RCR2) AtomicSetBits ¶
func (*RCR2) AtomicStoreBits ¶
type RCRCPR ¶
func (*RCRCPR) AtomicClearBits ¶
func (*RCRCPR) AtomicSetBits ¶
func (*RCRCPR) AtomicStoreBits ¶
type RI2SCFGR ¶
func (*RI2SCFGR) AtomicClearBits ¶
func (*RI2SCFGR) AtomicSetBits ¶
func (*RI2SCFGR) AtomicStoreBits ¶
type RI2SPR ¶
func (*RI2SPR) AtomicClearBits ¶
func (*RI2SPR) AtomicSetBits ¶
func (*RI2SPR) AtomicStoreBits ¶
type RRXCRCR ¶
func (*RRXCRCR) AtomicClearBits ¶
func (*RRXCRCR) AtomicSetBits ¶
func (*RRXCRCR) AtomicStoreBits ¶
type RTXCRCR ¶
func (*RTXCRCR) AtomicClearBits ¶
func (*RTXCRCR) AtomicSetBits ¶
func (*RTXCRCR) AtomicStoreBits ¶
type SPI_Periph ¶
type SPI_Periph struct { CR1 RCR1 CR2 RCR2 SR RSR DR RDR CRCPR RCRCPR RXCRCR RRXCRCR TXCRCR RTXCRCR I2SCFGR RI2SCFGR I2SPR RI2SPR }
func (*SPI_Periph) ASTRTEN ¶
func (p *SPI_Periph) ASTRTEN() RMI2SCFGR
func (*SPI_Periph) BIDIMODE ¶
func (p *SPI_Periph) BIDIMODE() RMCR1
func (*SPI_Periph) BIDIOE ¶
func (p *SPI_Periph) BIDIOE() RMCR1
func (*SPI_Periph) BR ¶
func (p *SPI_Periph) BR() RMCR1
func (*SPI_Periph) BSY ¶
func (p *SPI_Periph) BSY() RMSR
func (*SPI_Periph) BaseAddr ¶
func (p *SPI_Periph) BaseAddr() uintptr
func (*SPI_Periph) CHLEN ¶
func (p *SPI_Periph) CHLEN() RMI2SCFGR
func (*SPI_Periph) CHSIDE ¶
func (p *SPI_Periph) CHSIDE() RMSR
func (*SPI_Periph) CKPOL ¶
func (p *SPI_Periph) CKPOL() RMI2SCFGR
func (*SPI_Periph) CPHA ¶
func (p *SPI_Periph) CPHA() RMCR1
func (*SPI_Periph) CPOL ¶
func (p *SPI_Periph) CPOL() RMCR1
func (*SPI_Periph) CRCEN ¶
func (p *SPI_Periph) CRCEN() RMCR1
func (*SPI_Periph) CRCERR ¶
func (p *SPI_Periph) CRCERR() RMSR
func (*SPI_Periph) CRCL ¶
func (p *SPI_Periph) CRCL() RMCR1
func (*SPI_Periph) CRCNEXT ¶
func (p *SPI_Periph) CRCNEXT() RMCR1
func (*SPI_Periph) CRCPOLY ¶
func (p *SPI_Periph) CRCPOLY() RMCRCPR
func (*SPI_Periph) DATLEN ¶
func (p *SPI_Periph) DATLEN() RMI2SCFGR
func (*SPI_Periph) DS ¶
func (p *SPI_Periph) DS() RMCR2
func (*SPI_Periph) ERRIE ¶
func (p *SPI_Periph) ERRIE() RMCR2
func (*SPI_Periph) FRE ¶
func (p *SPI_Periph) FRE() RMSR
func (*SPI_Periph) FRF ¶
func (p *SPI_Periph) FRF() RMCR2
func (*SPI_Periph) FRLVL ¶
func (p *SPI_Periph) FRLVL() RMSR
func (*SPI_Periph) FRXTH ¶
func (p *SPI_Periph) FRXTH() RMCR2
func (*SPI_Periph) FTLVL ¶
func (p *SPI_Periph) FTLVL() RMSR
func (*SPI_Periph) I2SCFG ¶
func (p *SPI_Periph) I2SCFG() RMI2SCFGR
func (*SPI_Periph) I2SDIV ¶
func (p *SPI_Periph) I2SDIV() RMI2SPR
func (*SPI_Periph) I2SE ¶
func (p *SPI_Periph) I2SE() RMI2SCFGR
func (*SPI_Periph) I2SMOD ¶
func (p *SPI_Periph) I2SMOD() RMI2SCFGR
func (*SPI_Periph) I2SSTD ¶
func (p *SPI_Periph) I2SSTD() RMI2SCFGR
func (*SPI_Periph) LDMARX ¶
func (p *SPI_Periph) LDMARX() RMCR2
func (*SPI_Periph) LDMATX ¶
func (p *SPI_Periph) LDMATX() RMCR2
func (*SPI_Periph) LSBFIRST ¶
func (p *SPI_Periph) LSBFIRST() RMCR1
func (*SPI_Periph) MCKOE ¶
func (p *SPI_Periph) MCKOE() RMI2SPR
func (*SPI_Periph) MODF ¶
func (p *SPI_Periph) MODF() RMSR
func (*SPI_Periph) MSTR ¶
func (p *SPI_Periph) MSTR() RMCR1
func (*SPI_Periph) NSSP ¶
func (p *SPI_Periph) NSSP() RMCR2
func (*SPI_Periph) ODD ¶
func (p *SPI_Periph) ODD() RMI2SPR
func (*SPI_Periph) OVR ¶
func (p *SPI_Periph) OVR() RMSR
func (*SPI_Periph) PCMSYNC ¶
func (p *SPI_Periph) PCMSYNC() RMI2SCFGR
func (*SPI_Periph) RXCRC ¶
func (p *SPI_Periph) RXCRC() RMRXCRCR
func (*SPI_Periph) RXDMAEN ¶
func (p *SPI_Periph) RXDMAEN() RMCR2
func (*SPI_Periph) RXNE ¶
func (p *SPI_Periph) RXNE() RMSR
func (*SPI_Periph) RXNEIE ¶
func (p *SPI_Periph) RXNEIE() RMCR2
func (*SPI_Periph) RXONLY ¶
func (p *SPI_Periph) RXONLY() RMCR1
func (*SPI_Periph) SPE ¶
func (p *SPI_Periph) SPE() RMCR1
func (*SPI_Periph) SSI ¶
func (p *SPI_Periph) SSI() RMCR1
func (*SPI_Periph) SSM ¶
func (p *SPI_Periph) SSM() RMCR1
func (*SPI_Periph) SSOE ¶
func (p *SPI_Periph) SSOE() RMCR2
func (*SPI_Periph) TXCRC ¶
func (p *SPI_Periph) TXCRC() RMTXCRCR
func (*SPI_Periph) TXDMAEN ¶
func (p *SPI_Periph) TXDMAEN() RMCR2
func (*SPI_Periph) TXE ¶
func (p *SPI_Periph) TXE() RMSR
func (*SPI_Periph) TXEIE ¶
func (p *SPI_Periph) TXEIE() RMCR2
func (*SPI_Periph) UDR ¶
func (p *SPI_Periph) UDR() RMSR
type SR ¶
type SR uint32
const ( RXNE SR = 0x01 << 0 //+ Receive buffer Not Empty. TXE SR = 0x01 << 1 //+ Transmit buffer Empty. CHSIDE SR = 0x01 << 2 //+ Channel side. UDR SR = 0x01 << 3 //+ Underrun flag. CRCERR SR = 0x01 << 4 //+ CRC Error flag. MODF SR = 0x01 << 5 //+ Mode fault. OVR SR = 0x01 << 6 //+ Overrun flag. BSY SR = 0x01 << 7 //+ Busy flag. FRE SR = 0x01 << 8 //+ TI frame format error. FRLVL SR = 0x03 << 9 //+ FIFO Reception Level. FRLVL_0 SR = 0x01 << 9 // Bit 0. FRLVL_1 SR = 0x02 << 9 // Bit 1. FTLVL SR = 0x03 << 11 //+ FIFO Transmission Level. FTLVL_0 SR = 0x01 << 11 // Bit 0. FTLVL_1 SR = 0x02 << 11 // Bit 1. )
Click to show internal directories.
Click to hide internal directories.