PyBoard emulator
Note
early development state
- Allows minor testing of micropython code without an actual pyboard.
- Simulate hardware interaction from a script.
- Contains Pins configuration.
Include the following import command to avoid the need of a pyboard:
import <path-to-file>.pybolator.pyboard as pyb
One can actually have a simple API to interface the pyboard commands. In such case it is suggested to use the following import command:
- try:
- import pyb
- except:
- import <path-to-file>.pybolator.pyboard as pyb print("Run pyb as mock.")
This will import pyb (when on a pyboard) and mock it everywhere else.
I wanted test my micropython scripts for a pyboard without the actual hardware. Although there is a similar project that actually emulates a pyboard (https://github.com/alej0varas/pybolator), it was outside the scope of my testint (at that moment).
- delay(ms)
- udelay(us)
- accel.x()
- accel.y()
- adc.read()
- adc.read_timed()
- lcd(skin_position)
- lcd.contrast(value)
- lcd.fill(colour)
- lcd.get(x, y)
- lcd.light(value)
- lcd.pixel(x, y, colour)
- lcd.show()
- lcd.text(str, x, y, colour)
- lcd.write(str)
- extint.disable()
- extint.enable()
- dac.write_timed()
- dac.write()
- i2c.init()
- i2c.is_ready()
- i2c.recv()
- i2c.send()
- i2c.scan()
- led.intensity([value])
- led.off()
- led.on()
- led.toggle()
- pin.debug()
- pin.dict()
- pin.mapper()
- pin.init()
- pin.value()
- pin.name()
- pin.pull()
- spi.send()
- spi.recv()
- spi.send_recv()
- switch()
- switch.callback(fun)
- timer.counter()
- timer.freq()
- timer.period()
- timer.prescaler()
- timer.source_freq()
- timerchannel.pulse_width_percent()
- uart.any()
- uart.read()
- uart.write()
- uart.writerchar()
- bootloader()
- disable_irq()
- enable_irq(state=True)
- freq([sysclk[, hclk[, pclk1[, pclk2]]]])
- wfi()
- stop()
- standby()
- have_cdc()
- hid((buttons, x, y, z))
- info([dump_alloc_table])
- main(filename)
- mount(device, mountpoint, *, readonly=False, mkfs=False)
- repl_uart(uart)
- rng()
- sync()
- unique_id()
- accel.filtered_xyz()
- accel.tilt()
- accel.z()
- dac.init()
- dac.deinit()
- dac.noise()
- dac.triangle()
- extint.line()
- extint.swint()
- i2c.deinit()
- i2c.mem_read()
- i2c.mem_write()
- lcd.command(instr_data, buf)
- pin.af()
- pin.af_list()
- pin.gpio()
- pin.names()
- pin.pin()
- pin.port()
- spi.deinit()
- spi.init()
- timer.init()
- timer.deinit()
- timer.callback()
- timerchannel.capture()
- timerchannel.compare()
- timerchannel.pulse_width()
- uart.init()
- uart.deinit()
- uart.readchar()
- uart.readinto()
- uart.readline()
- uart.sendbreak()