File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 1- //go:build rp2040
1+ //go:build rp2040 || rp2350
22
33package machine
44
@@ -207,7 +207,7 @@ func (spi SPI) initSPI(config SPIConfig) (err error) {
207207 }
208208 err = spi .SetBaudRate (config .Frequency )
209209 // Set SPI Format (CPHA and CPOL) and frame format (default is Motorola)
210- spi .setFormat (config .Mode , rp . XIP_SSI_CTRLR0_SPI_FRF_STD )
210+ spi .setFormat (config .Mode )
211211
212212 // Always enable DREQ signals -- harmless if DMA is not listening
213213 spi .Bus .SSPDMACR .SetBits (rp .SPI0_SSPDMACR_TXDMAE | rp .SPI0_SSPDMACR_RXDMAE )
@@ -217,14 +217,13 @@ func (spi SPI) initSPI(config SPIConfig) (err error) {
217217}
218218
219219//go:inline
220- func (spi SPI ) setFormat (mode uint8 , frameFormat uint32 ) {
220+ func (spi SPI ) setFormat (mode uint8 ) {
221221 cpha := uint32 (mode ) & 1
222222 cpol := uint32 (mode >> 1 ) & 1
223223 spi .Bus .SSPCR0 .ReplaceBits (
224224 (cpha << rp .SPI0_SSPCR0_SPH_Pos )|
225225 (cpol << rp .SPI0_SSPCR0_SPO_Pos )|
226- (uint32 (7 )<< rp .SPI0_SSPCR0_DSS_Pos )| // Set databits (SPI word length) to 8 bits.
227- (frameFormat & 0b11 )<< rp .SPI0_SSPCR0_FRF_Pos , // Frame format bits 4:5
226+ (uint32 (7 )<< rp .SPI0_SSPCR0_DSS_Pos ), // Set databits (SPI word length) to 8 bits.
228227 rp .SPI0_SSPCR0_SPH_Msk | rp .SPI0_SSPCR0_SPO_Msk | rp .SPI0_SSPCR0_DSS_Msk | rp .SPI0_SSPCR0_FRF_Msk , 0 )
229228}
230229
Original file line number Diff line number Diff line change 1- //go:build !baremetal || atmega || esp32 || fe310 || k210 || nrf || (nxp && !mk66f18) || rp2040 || sam || (stm32 && !stm32f7x2 && !stm32l5x2)
1+ //go:build !baremetal || atmega || esp32 || fe310 || k210 || nrf || (nxp && !mk66f18) || rp2040 || rp2350 || sam || (stm32 && !stm32f7x2 && !stm32l5x2)
22
33package machine
44
You can’t perform that action at this time.
0 commit comments