@@ -79,7 +79,7 @@ STATIC mp_obj_t bitbangio_i2c_make_new(const mp_obj_type_t *type, size_t n_args,
7979 return (mp_obj_t )self ;
8080}
8181
82- //| def deinit(self, ) -> Any :
82+ //| def deinit(self, ) -> None :
8383//| """Releases control of the underlying hardware so other classes can use it."""
8484//| ...
8585//|
@@ -96,13 +96,13 @@ STATIC void check_for_deinit(bitbangio_i2c_obj_t *self) {
9696 }
9797}
9898
99- //| def __enter__(self, ) -> Any :
99+ //| def __enter__(self, ) -> I2C :
100100//| """No-op used in Context Managers."""
101101//| ...
102102//|
103103// Provided by context manager helper.
104104
105- //| def __exit__(self, ) -> Any :
105+ //| def __exit__(self, ) -> None :
106106//| """Automatically deinitializes the hardware on context exit. See
107107//| :ref:`lifetime-and-contextmanagers` for more info."""
108108//| ...
@@ -120,7 +120,7 @@ static void check_lock(bitbangio_i2c_obj_t *self) {
120120 }
121121}
122122
123- //| def scan(self, ) -> Any :
123+ //| def scan(self, ) -> list :
124124//| """Scan all I2C addresses between 0x08 and 0x77 inclusive and return a list of
125125//| those that respond. A device responds if it pulls the SDA line low after
126126//| its address (including a read bit) is sent on the bus."""
@@ -142,7 +142,7 @@ STATIC mp_obj_t bitbangio_i2c_scan(mp_obj_t self_in) {
142142}
143143MP_DEFINE_CONST_FUN_OBJ_1 (bitbangio_i2c_scan_obj , bitbangio_i2c_scan );
144144
145- //| def try_lock(self, ) -> Any :
145+ //| def try_lock(self, ) -> bool :
146146//| """Attempts to grab the I2C lock. Returns True on success."""
147147//| ...
148148//|
@@ -153,7 +153,7 @@ STATIC mp_obj_t bitbangio_i2c_obj_try_lock(mp_obj_t self_in) {
153153}
154154MP_DEFINE_CONST_FUN_OBJ_1 (bitbangio_i2c_try_lock_obj , bitbangio_i2c_obj_try_lock );
155155
156- //| def unlock(self, ) -> Any :
156+ //| def unlock(self, ) -> None :
157157//| """Releases the I2C lock."""
158158//| ...
159159//|
@@ -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: bytearray, *, start: int = 0, end: int = None) -> Any :
168+ //| def readfrom_into(self, address: int, buffer: bytearray, *, 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: bytearray, *, start: int = 0, end: int = None, stop: bool = True) -> Any :
220+ //| def writeto(self, address: int, buffer: bytearray, *, 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: bytearray, in_buffer: bytearray, *, out_start: int = 0, out_end: int = None, in_start: int = 0, in_end: int = None) -> Any :
280+ //| 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 :
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