@crami25 Ok. SPI is used both for the SD card and TFT.
The link to the micropython docs is not the same as any of the m5stsck firmware.
The SPI in the machine module does not exist.
Can you tell me how I install or add SPI to a micropython build?
@crami25 Ok. SPI is used both for the SD card and TFT.
The link to the micropython docs is not the same as any of the m5stsck firmware.
The SPI in the machine module does not exist.
Can you tell me how I install or add SPI to a micropython build?
I do not have enough knowledge of python or git to find the files that write SPI.
I've found some .c files but don't know what to do with them.
While I understand that the SPI is used for the SD card.
On the back of the m5stack SPI is clearly broken out. No hand soldering required.
I do not need CS it's just what's used as example.
There is an implementation in the sited m5stack git source on software SPI on different pins.
I'm just annoyed the software and documentation are not in sync.
Do you know where I can find the source used to build 1.4.5.1 for instance?
I'll see if I can find the code to read/write to the SD card.
1.3.2 does not contain the I2C/SPI etc. in the machine module.
1.2.3 does include SPI but none of the other code works as uiflow module does not exist.
Hi,
I've got a M5basic module with fw version 1.4.5.1 and not to mention SPI sensor.
Code in Visual studio code. When importing SPI I'm getting the error: 'cannot import SPI'
I'm following the documentation: https://github.com/m5stack/M5Stack_MicroPython
I investigated and it appears the 'machine' module does not have SPI.
So my question: How do I make SPI work on M5stack with micropython 1.4.5?
Secondary question: All documentation seems old or in complete. Where can I find the newest/most complete information?
---- Code from documentation
from machine import SPI, Pin
spi = SPI(
spihost=SPI.HSPI,
baudrate=2600000
sck=Pin(18),
mosi=Pin(23),
miso=Pin(19),
cs=Pin(4)
)
spi.write(buf) #NOHEAP
spi.read(nbytes, *, write=0x00) #write is the byte to ?output on MOSI for each byte read in
spi.readinto(buf, *, write=0x00) #NOHEAP
spi.write_readinto(write_buf, read_buf) #NOHEAP; write_buf and read_buf can be the same
------Machine module, python terminal: help("machine")
object <module 'umachine'> is of type module
name -- umachine
mem8 -- <8-bit memory>
mem16 -- <16-bit memory>
mem32 -- <32-bit memory>
freq -- <function>
reset -- <function>
unique_id -- <function>
sleep -- <function>
lightsleep -- <function>
deepsleep -- <function>
idle -- <function>
disable_irq -- <function>
enable_irq -- <function>
heap_info -- <function>
time_pulse_us -- <function>
nvs_setint -- <function>
nvs_getint -- <function>
nvs_setstr -- <function>
nvs_getstr -- <function>
nvs_erase -- <function>
nvs_erase_all -- <function>
random -- <function>
Timer -- <class 'Timer'>
WDT -- <class 'WDT'>
SLEEP -- 2
DEEPSLEEP -- 4
Pin -- <class 'Pin'>
Signal -- <class 'Signal'>
TouchPad -- <class 'TouchPad'>
ADC -- <class 'ADC'>
DAC -- <class 'DAC'>
I2C -- <class 'I2C'>
I2S -- <class 'I2S'>
PWM -- <class 'PWM'>
RTC -- <class 'RTC'>
UART -- <class 'UART'>
Neopixel -- <class 'Neopixel'>
reset_cause -- <function>
HARD_RESET -- 2
PWRON_RESET -- 1
WDT_RESET -- 3
DEEPSLEEP_RESET -- 4
SOFT_RESET -- 5
wake_reason -- <function>
PIN_WAKE -- 2
EXT0_WAKE -- 2
EXT1_WAKE -- 3
TIMER_WAKE -- 4
TOUCHPAD_WAKE -- 5
ULP_WAKE -- 6