← index #10999Issue #11404
Related · high · value 0.226
QUERY · ISSUE

SoftSPI: Implement 'bits' and 'firstbit' parameters

openby sebert007opened 2023-03-10updated 2023-03-11
enhancement

SPI offers both this parameters to specify. SoftSPI rejects both of them, although they are really useful (and needed).

But first probably this issue should be fixed along with it.

#5225

CANDIDATE · ISSUE

RP2: machine.spi LSB first is unsupported (also SoftSPI)

closedby peterhinchopened 2023-05-03updated 2024-07-18
bug

This arose here. The driver sets up a passed SPI instance as follows:

    def __init__(self, spi, pincs, height=240, width=400, vcom=False):
        spi.init(baudrate=2_000_000, firstbit=machine.SPI.LSB)
        self._spi = spi

which fails with NotImplementedError: LSB (hard SPI) or ValueError:firstbit must be MSB (soft SPI).

The constant LSB does exist.

>>> dir(SPI)
['__class__', '__name__', 'read', 'readinto', 'write', '__bases__', '__dict__', 'LSB', 'MSB', 'deinit', 'init', 'write_readinto']

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied