the gpio.py will be called in several files, and the boot.py file will be the only file that gets changed to define which device pins file to use.
I will have multiple pins files, i.e pins_8266. pins_pyb, pins_esp32 and
gpio.py
Code: Select all
_power = 10
power = mc.Pin(_power, mode=mc.Pin.OUT)
def init(pins):
import pins
for var in dir():
if not var.startswith("__"):
this.var = pins[var]
Code: Select all
_power = 15
Code: Select all
_power = 12
boot.py
Code: Select all
import gpio
gpio.init('pins_pyb')