@@ -165,7 +165,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_unlock(mp_obj_t self_in) {
165165}
166166MP_DEFINE_CONST_FUN_OBJ_1 (bitbangio_i2c_unlock_obj , bitbangio_i2c_obj_unlock );
167167
168- //| def readfrom_into(self, address: int, buffer: Union[bytearray, memoryview] , *, start: int = 0, end: int = None) -> None:
168+ //| def readfrom_into(self, address: int, buffer: WriteableBuffer , *, start: int = 0, end: int = None) -> None:
169169//| """Read into ``buffer`` from the device selected by ``address``.
170170//| The number of bytes read will be the length of ``buffer``.
171171//| At least one byte must be read.
@@ -217,7 +217,7 @@ STATIC mp_obj_t bitbangio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_a
217217}
218218MP_DEFINE_CONST_FUN_OBJ_KW (bitbangio_i2c_readfrom_into_obj , 3 , bitbangio_i2c_readfrom_into );
219219
220- //| def writeto(self, address: int, buffer: Union[bytes, bytearray, memoryview] , *, start: int = 0, end: int = None, stop: bool = True) -> None:
220+ //| def writeto(self, address: int, buffer: ReadableBuffer , *, start: int = 0, end: int = None, stop: bool = True) -> None:
221221//| """Write the bytes from ``buffer`` to the device selected by ``address`` and then transmits a
222222//| stop bit. Use `writeto_then_readfrom` when needing a write, no stop and repeated start
223223//| before a read.
@@ -277,7 +277,7 @@ STATIC mp_obj_t bitbangio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, m
277277STATIC MP_DEFINE_CONST_FUN_OBJ_KW (bitbangio_i2c_writeto_obj , 1 , bitbangio_i2c_writeto );
278278
279279
280- //| def writeto_then_readfrom(self, address: int, out_buffer: Union[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:
280+ //| def writeto_then_readfrom(self, address: int, out_buffer: WriteableBuffer, in_buffer: ReadableBuffer , *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> None:
281281//| """Write the bytes from ``out_buffer`` to the device selected by ``address``, generate no stop
282282//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
283283//| ``in_buffer`` can be the same buffer because they are used sequentially.
0 commit comments