micropython/ports
David (Pololu) bf3eb9dc39 rp2/machine_i2c: Add timeout parameter for machine.I2C().
This commit adds support for the `timeout` keyword argument to machine.I2C
on the rp2 port, following how it's done on other ports.

The main motivation here is avoid the interpreter crashing due to infinite
loops when SDA is stuck low, which is quite common if the board gets reset
while reading from an I2C device.

A default timeout of 50ms is chosen because it's consistent with:
- Commit a707fe50b0 which used a timeout of
  50,000us for zero-length writes on the rp2 port.
- The machine.SoftI2C class which uses 50,000us as the default timeout.
- The stm32 port's hardware I2C, which uses 50,000us for
  I2C_POLL_DEFAULT_TIMEOUT_US.

This commit also fixes the default timeout on the esp32 port to be
consistent with the above, and updates the documentation for machine.I2C to
document this keyword argument.
2023-04-21 18:03:33 +10:00
..
bare-arm bare-arm/mpconfigport.h: Disable remaining optional features. 2021-11-01 14:23:06 +11:00
cc3200 all: Fix Python comparison to None and True, and use "not in". 2023-03-10 13:32:24 +11:00
embed embed: Fix arguments to mp_raw_code_load_mem. 2023-03-13 12:35:12 +11:00
esp32 rp2/machine_i2c: Add timeout parameter for machine.I2C(). 2023-04-21 18:03:33 +10:00
esp8266 shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
mimxrt mimxrt: Fix the build for boards without ROM API. 2023-04-12 17:01:25 +02:00
minimal shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
nrf shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
pic16bit ports: Implement simple write polling for stdout. 2023-03-23 13:51:17 +11:00
powerpc shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
qemu-arm shared/runtime/gchelper: Drop cpu directive from ARM asm helpers. 2023-01-28 15:51:38 +11:00
renesas-ra shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
rp2 rp2/machine_i2c: Add timeout parameter for machine.I2C(). 2023-04-21 18:03:33 +10:00
samd shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
stm32 shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
teensy shared/runtime/pyexec: Don't allow Ctrl+C to interrupt frozen boot code. 2023-04-05 10:38:50 +10:00
unix py/gc: Make gc_dump_info/gc_dump_alloc_table take a printer as argument. 2023-03-10 10:58:10 +11:00
webassembly webassembly/library: Extract and send data to print as UInt8Array. 2022-12-13 17:16:37 +11:00
windows ports: Make BOARD default from BOARD_DIR in Makefile's. 2023-02-23 09:47:08 +11:00
zephyr py/gc: Make gc_dump_info/gc_dump_alloc_table take a printer as argument. 2023-03-10 10:58:10 +11:00