pyb SPI versus MACHINE SPI which to use or not to...

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
Delebel
Posts: 40
Joined: Thu May 25, 2017 2:21 pm
Contact:

pyb SPI versus MACHINE SPI which to use or not to...

Post by Delebel » Mon May 25, 2020 4:07 pm

Found another post related to this subject but did not find any answers from all the replies..

I'm attempting to write to a LCD12864 in SPI . Can't get an SPI.wirte() to work and the SPI.send doesn't do the job either.In the docs they are different but what I do not get is does the import from pyb and import from machine work independently can both be loaded?. Is the pyb version a low level and the machine calls it or visa versa. Bottom line like another post found on here I can get my program to find the SPI.write() function. Anyone out there can shed some light on how the 2 version of SPI import work...???

Thanks Denis

User avatar
pythoncoder
Posts: 4921
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: pyb SPI versus MACHINE SPI which to use or not to...

Post by pythoncoder » Mon May 25, 2020 4:58 pm

The pyb library is specific to STM processors (e.g. the Pyboard). It includes some features specific to that hardware.

In general best practice is to use machine where possible, not least because such code can be ported to other MicroPython hardware.
Peter Hinch

Post Reply