Skip to content

Problem with SPI #300

@NYFB8888

Description

@NYFB8888

Following the instructions, I built the lv_micropython image but I have a problem with the instantiations of the SPI class. The first snippet shows the instantiation of the SPI class in the MicroPython environment.

MicroPython v1.24.1 on 2024-11-29; Generic ESP32S3 module with ESP32S3

from machine import SPI
help(SPI)
object <class 'SPI'> is of type type
init --
deinit --
read --
readinto --
write --
write_readinto --
MSB -- 0
LSB -- 1
print(dir(SPI))
['class', 'name', 'read', 'readinto', 'write', 'LSB', 'MSB', 'bases', 'dict', 'deinit', 'init', 'write_readinto']

End the same as lv_micropython.

LVGL (9.2.2) MicroPython (1.24.1) Binding compiled on 2025-02-16; Generic ESP32S3 module with Octal-SPIRAM with ESP32S3
Type "help()" for more information.

from machine import SPI
help(SPI)
object <class 'SPI'> is of type type
name -- SPI
Bus -- <class 'Bus'>
Device -- <class 'Device'>
print(dir(SPI))
['class', 'name', 'Bus', 'Device', 'bases', 'dict']

from machine import Pin, SPI

Initialize SPI

spi = SPI(1, baudrate=1000000, polarity=0, phase=0, sck=Pin(12), mosi=Pin(11), miso=Pin(13))
Traceback (most recent call last):
File "", line 3, in
TypeError: can't create 'SPI' instances

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions