Skip to content

can we share the SPI bus with SDCard? #17961

@xlla

Description

@xlla

Description

I am using M5Stack's M5Paper base on esp32 port.
it shares the spi bus with eink panel controller it8951e and tfcard reader using two cs lines.
I can communicate it8951e use SPI bus via eink_cs.
but when I want to create a TFCard object using same SPI bus, it raise error.

SDCard(slot=3, width=1, cd=None, wp=None, sck=Pin.board.SPI_SCK, miso=Pin.board.SPI_MISO, mosi=Pin.board.SPI_MOSI,cs=Pin.board.TF_CS, freq=20000000)
Traceback (most recent call last):
  File "", line 1, in 
OSError: (-259, 'ESP_ERR_INVALID_STATE')

the micropython manual about TFCard said "SPI mode makes use of a SPI host peripheral, which cannot concurrently be used for other SPI interactions."

I thought share the SPI bus with multiply peripherals is a common demands.

I have look the implement of TFCard of esp32 port, it initialize SPI bus while choose SPI mode, can we pass in a SPI bus directly instead of just pass in mosi/miso/clk/freq etc?

Code Size

No response

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions