@@ -229,10 +229,8 @@ STATIC mp_obj_t busio_i2c_readfrom_into(size_t n_args, const mp_obj_t *pos_args,
229
229
MP_DEFINE_CONST_FUN_OBJ_KW (busio_i2c_readfrom_into_obj , 3 , busio_i2c_readfrom_into );
230
230
231
231
//| 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.
236
234
//|
237
235
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
238
236
//| 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
244
242
//| :param int address: 7-bit device address
245
243
//| :param bytearray buffer: buffer containing the bytes to write
246
244
//| :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)``"""
250
246
//| ...
251
247
//|
252
248
// 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
267
263
}
268
264
269
265
STATIC 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 };
271
267
static const mp_arg_t allowed_args [] = {
272
268
{ MP_QSTR_address , MP_ARG_REQUIRED | MP_ARG_INT , {.u_int = 0 } },
273
269
{ MP_QSTR_buffer , MP_ARG_REQUIRED | MP_ARG_OBJ , {.u_obj = MP_OBJ_NULL } },
274
270
{ MP_QSTR_start , MP_ARG_KW_ONLY | MP_ARG_INT , {.u_int = 0 } },
275
271
{ 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} },
277
272
};
278
273
busio_i2c_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
279
274
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
282
277
mp_arg_parse_all (n_args - 1 , pos_args + 1 , kw_args , MP_ARRAY_SIZE (allowed_args ), allowed_args , args );
283
278
284
279
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 );
286
281
return mp_const_none ;
287
282
}
288
283
STATIC MP_DEFINE_CONST_FUN_OBJ_KW (busio_i2c_writeto_obj , 1 , busio_i2c_writeto );
0 commit comments