@@ -100,7 +100,7 @@ STATIC mp_obj_t busio_spi_make_new(const mp_obj_type_t *type, size_t n_args, con
100100 return MP_OBJ_FROM_PTR (self );
101101}
102102
103- //| def deinit(self, ) -> Any :
103+ //| def deinit(self, ) -> None :
104104//| """Turn off the SPI bus."""
105105//| ...
106106//|
@@ -111,13 +111,13 @@ STATIC mp_obj_t busio_spi_obj_deinit(mp_obj_t self_in) {
111111}
112112MP_DEFINE_CONST_FUN_OBJ_1 (busio_spi_deinit_obj , busio_spi_obj_deinit );
113113
114- //| def __enter__(self, ) -> Any :
114+ //| def __enter__(self, ) -> SPI :
115115//| """No-op used by Context Managers.
116116//| Provided by context manager helper."""
117117//| ...
118118//|
119119
120- //| def __exit__(self, ) -> Any :
120+ //| def __exit__(self, ) -> None :
121121//| """Automatically deinitializes the hardware when exiting a context. See
122122//| :ref:`lifetime-and-contextmanagers` for more info."""
123123//| ...
@@ -142,7 +142,7 @@ STATIC void check_for_deinit(busio_spi_obj_t *self) {
142142 }
143143}
144144
145- //| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> Any :
145+ //| def configure(self, *, baudrate: int = 100000, polarity: int = 0, phase: int = 0, bits: int = 8) -> None :
146146//| """Configures the SPI bus. The SPI object must be locked.
147147//|
148148//| :param int baudrate: the desired clock rate in Hertz. The actual clock rate may be higher or lower
@@ -201,7 +201,7 @@ STATIC mp_obj_t busio_spi_configure(size_t n_args, const mp_obj_t *pos_args, mp_
201201}
202202MP_DEFINE_CONST_FUN_OBJ_KW (busio_spi_configure_obj , 1 , busio_spi_configure );
203203
204- //| def try_lock(self, ) -> Any :
204+ //| def try_lock(self, ) -> bool :
205205//| """Attempts to grab the SPI lock. Returns True on success.
206206//|
207207//| :return: True when lock has been grabbed
@@ -215,7 +215,7 @@ STATIC mp_obj_t busio_spi_obj_try_lock(mp_obj_t self_in) {
215215}
216216MP_DEFINE_CONST_FUN_OBJ_1 (busio_spi_try_lock_obj , busio_spi_obj_try_lock );
217217
218- //| def unlock(self, ) -> Any :
218+ //| def unlock(self, ) -> None :
219219//| """Releases the SPI lock."""
220220//| ...
221221//|
@@ -228,7 +228,7 @@ STATIC mp_obj_t busio_spi_obj_unlock(mp_obj_t self_in) {
228228}
229229MP_DEFINE_CONST_FUN_OBJ_1 (busio_spi_unlock_obj , busio_spi_obj_unlock );
230230
231- //| def write(self, buffer: bytearray , *, start: Any = 0, end: int = None) -> Any :
231+ //| def write(self, buffer: bytes , *, start: int = 0, end: int = None) -> None :
232232//| """Write the data contained in ``buffer``. The SPI object must be locked.
233233//| If the buffer is empty, nothing happens.
234234//|
@@ -270,7 +270,7 @@ STATIC mp_obj_t busio_spi_write(size_t n_args, const mp_obj_t *pos_args, mp_map_
270270MP_DEFINE_CONST_FUN_OBJ_KW (busio_spi_write_obj , 2 , busio_spi_write );
271271
272272
273- //| def readinto(self, buffer: bytearray, *, start: Any = 0, end: int = None, write_value: int = 0) -> Any :
273+ //| def readinto(self, buffer: bytearray, *, start: int = 0, end: int = None, write_value: int = 0) -> None :
274274//| """Read into ``buffer`` while writing ``write_value`` for each byte read.
275275//| The SPI object must be locked.
276276//| If the number of bytes to read is 0, nothing happens.
@@ -314,7 +314,7 @@ STATIC mp_obj_t busio_spi_readinto(size_t n_args, const mp_obj_t *pos_args, mp_m
314314}
315315MP_DEFINE_CONST_FUN_OBJ_KW (busio_spi_readinto_obj , 2 , busio_spi_readinto );
316316
317- //| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: Any = 0, out_end: int = None, in_start: Any = 0, in_end: int = None) -> Any :
317+ //| def write_readinto(self, buffer_out: bytearray, buffer_in: bytearray, *, out_start: int = 0, out_end: int = None, in_start: None = 0, in_end: int = None) -> None :
318318//| """Write out the data in ``buffer_out`` while simultaneously reading data into ``buffer_in``.
319319//| The SPI object must be locked.
320320//| The lengths of the slices defined by ``buffer_out[out_start:out_end]`` and ``buffer_in[in_start:in_end]``
@@ -377,7 +377,7 @@ STATIC mp_obj_t busio_spi_write_readinto(size_t n_args, const mp_obj_t *pos_args
377377}
378378MP_DEFINE_CONST_FUN_OBJ_KW (busio_spi_write_readinto_obj , 2 , busio_spi_write_readinto );
379379
380- //| frequency: Any = ...
380+ //| frequency: int = ...
381381//| """The actual SPI bus frequency. This may not match the frequency requested
382382//| due to internal limitations."""
383383//|
0 commit comments