summaryrefslogtreecommitdiff
path: root/shared-bindings/busio/I2C.c
diff options
context:
space:
mode:
authordherrada <dylan.herrada@adafruit.com>2020-07-02 12:39:17 -0400
committerdherrada <dylan.herrada@adafruit.com>2020-07-02 12:39:17 -0400
commitac113fdc815f31b54d742f73265359787bd95290 (patch)
treeea416b40e21c39f5e987802a0bcfe13599ef8c91 /shared-bindings/busio/I2C.c
parentffc5f0c3382bf76e73cfcb9d0ba45b4c1fb19b26 (diff)
Changed bytearray to a union
Diffstat (limited to 'shared-bindings/busio/I2C.c')
-rw-r--r--shared-bindings/busio/I2C.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c
index 7de9d5d4d..eb33a2459 100644
--- a/shared-bindings/busio/I2C.c
+++ b/shared-bindings/busio/I2C.c
@@ -164,7 +164,7 @@ STATIC mp_obj_t busio_i2c_obj_try_lock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_try_lock_obj, busio_i2c_obj_try_lock);
-//| def unlock(self, ) -> none:
+//| def unlock(self, ) -> None:
//| """Releases the I2C lock."""
//| ...
//|
@@ -176,7 +176,7 @@ STATIC mp_obj_t busio_i2c_obj_unlock(mp_obj_t self_in) {
}
MP_DEFINE_CONST_FUN_OBJ_1(busio_i2c_unlock_obj, busio_i2c_obj_unlock);
-//| def readfrom_into(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None) -> None:
+//| def readfrom_into(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None) -> None:
//| """Read into ``buffer`` from the device selected by ``address``.
//| The number of bytes read will be the length of ``buffer``.
//| At least one byte must be read.
@@ -228,7 +228,7 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args,
}
MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_into);
-//| def writeto(self, address: int, buffer: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> None:
+//| def writeto(self, address: int, buffer: Union[bytes, bytearray, memoryview], *, start: int = 0, end: int = None, stop: bool = True) -> None:
//| """Write the bytes from ``buffer`` to the device selected by ``address``.
//| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be
//| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and
@@ -287,7 +287,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);
-//| def writeto_then_readfrom(self, address: int, out_buffer: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
+//| def writeto_then_readfrom(self, address: int, out_buffer: Union[bytes, bytearray, memoryview], in_buffer: Union[bytes, bytearray, memoryview], *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
//| ``in_buffer`` can be the same buffer because they are used sequentially.