@@ -229,10 +229,8 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args,
229229MP_DEFINE_CONST_FUN_OBJ_KW (busio_i2c_readfrom_into_obj , 3 , busio_i2c_readfrom_into );
230230
231231//| def writeto(self, address: int, buffer: ReadableBuffer, *, start: int = 0, end: int = None, stop: bool = True) -> None:
232- //| """Write the bytes from ``buffer`` to the device selected by ``address``.
233- //| Transmits a stop bit when stop is True. Setting stop=False is deprecated and stop will be
234- //| removed in CircuitPython 6.x. Use `writeto_then_readfrom` when needing a write, no stop and
235- //| repeated start before a read.
232+ //| """Write the bytes from ``buffer`` to the device selected by ``address`` and
233+ //| then transmit a stop bit.
236234//|
237235//| If ``start`` or ``end`` is provided, then the buffer will be sliced
238236//| as if ``buffer[start:end]``. This will not cause an allocation like
@@ -244,9 +242,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_in
244242//| :param int address: 7-bit device address
245243//| :param bytearray buffer: buffer containing the bytes to write
246244//| :param int start: Index to start writing from
247- //| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``
248- //| :param bool stop: If true, output an I2C stop condition after the buffer is written.
249- //| Deprecated. Will be removed in 6.x and act as stop=True."""
245+ //| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``"""
250246//| ...
251247//|
252248// Shared arg parsing for writeto and writeto_then_readfrom.
@@ -267,13 +263,12 @@ STATIC void writeto(busio_i2c_obj_t *self, mp_int_t address, mp_obj_t buffer, in
267263}
268264
269265STATIC mp_obj_t busio_i2c_writeto (size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
270- enum { ARG_address , ARG_buffer , ARG_start , ARG_end , ARG_stop };
266+ enum { ARG_address , ARG_buffer , ARG_start , ARG_end };
271267 static const mp_arg_t allowed_args [] = {
272268 { MP_QSTR_address , MP_ARG_REQUIRED | MP_ARG_INT , {.u_int = 0 } },
273269 { MP_QSTR_buffer , MP_ARG_REQUIRED | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
274270 { MP_QSTR_start , MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = 0 } },
275271 { MP_QSTR_end , MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = INT_MAX } },
276- { MP_QSTR_stop , MP_ARG_KW_ONLY | MP_ARG_BOOL , {.u_bool = true} },
277272 };
278273 busio_i2c_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
279274 check_for_deinit (self );
@@ -282,7 +277,7 @@ STATIC mp_obj_t busio_i2c_writeto(size_t n_args, const mp_obj_t *pos_args, mp_ma
282277 mp_arg_parse_all (n_args - 1 , pos_args + 1 , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
283278
284279 writeto (self , args [ARG_address ].u_int , args [ARG_buffer ].u_obj , args [ARG_start ].u_int ,
285- args [ARG_end ].u_int , args [ ARG_stop ]. u_bool );
280+ args [ARG_end ].u_int , true );
286281 return mp_const_none ;
287282}
288283STATIC MP_DEFINE_CONST_FUN_OBJ_KW (busio_i2c_writeto_obj , 1 , busio_i2c_writeto );
0 commit comments