Skip to content

SPI bus management T-DECK Lilygo #8739

@Freyr86

Description

@Freyr86

I am working on programming the Lilygo T-Deck. I have chosen CircuitPython because of its flexibility, which is welcome for conducting tests.

In this module, there are two systems that operate on the SPI bus: the screen (ST7789) and a LORA transceiver (SX1262).

During the boot of CircuitPython on this board, the REPL activates on the screen, so the SPI is initialized for the screen. If I want to send data to the LORA module, I need to have the name of the object managing the SPI bus.

For example, if I make the following code call to prepare the SPI for using the LORA module:

import busio
import board
testSPI = busio.SPI(clock = board.SCK, MOSI=board.MOSI, MISO=board.MISO)

The error that comes up is the following:

ValueError: IO40 en cours d'utilisation

That makes perfect sense since the bus is used for the screen.

I can, of course, use the command
displayio.release_displays()

But that would force me to redo its initialization. However, if I could access the busio.SPI object used for the REPL, I could simply use the CS outputs to operate both the screen and the LORA module.

Do you have any ideas?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions