extmod/machine_i2c: Add optional support for write-then-read transfers.

This option is useful for ports where it's more efficient to do a full I2C
transfer in one go.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2022-06-01 11:57:20 +10:00
parent ea9a904b72
commit 4a1ae99ac3
3 changed files with 27 additions and 0 deletions

View File

@@ -1585,6 +1585,11 @@ typedef double mp_float_t;
#define MICROPY_PY_MACHINE_I2C (0)
#endif
// Whether the low-level I2C transfer function supports a separate write as the first transfer
#ifndef MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1
#define MICROPY_PY_MACHINE_I2C_TRANSFER_WRITE1 (0)
#endif
// Whether to provide the "machine.SoftI2C" class
#ifndef MICROPY_PY_MACHINE_SOFTI2C
#define MICROPY_PY_MACHINE_SOFTI2C (0)