4646#include "shared-module/network/__init__.h"
4747#include "shared-module/wiznet/wiznet5k.h"
4848
49- //| .. currentmodule:: wiznet
49+ //| class WIZNET5K:
50+ //| """.. currentmodule:: wiznet
5051//|
51- //| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface
52- //| ===============================================================
52+ //| :class:`WIZNET5K` -- wrapper for Wiznet 5500 Ethernet interface
53+ //| ==============================================================="""
5354//|
54- //| .. class:: WIZNET5K(spi, cs, rst, dhcp=True)
55+ //| def __init__(self, spi: busio.SPI, cs: microcontroller.Pin, rst: microcontroller.Pin, dhcp: bool = True):
56+ //| """Create a new WIZNET5500 interface using the specified pins
5557//|
56- //| Create a new WIZNET5500 interface using the specified pins
58+ //| :param ~busio.SPI spi: spi bus to use
59+ //| :param ~microcontroller.Pin cs: pin to use for Chip Select
60+ //| :param ~microcontroller.Pin rst: pin to use for Reset (optional)
61+ //| :param bool dhcp: boolean flag, whether to start DHCP automatically (optional, keyword only, default True)
5762//|
58- //| :param ~busio.SPI spi: spi bus to use
59- //| :param ~microcontroller.Pin cs: pin to use for Chip Select
60- //| :param ~microcontroller.Pin rst: pin to use for Reset (optional)
61- //| :param bool dhcp: boolean flag, whether to start DHCP automatically (optional, keyword only, default True)
62- //|
63- //| * The reset pin is optional: if supplied it is used to reset the
64- //| wiznet board before initialization.
65- //| * The SPI bus will be initialized appropriately by this library.
66- //| * At present, the WIZNET5K object is a singleton, so only one WizNet
67- //| interface is supported at a time.
63+ //| * The reset pin is optional: if supplied it is used to reset the
64+ //| wiznet board before initialization.
65+ //| * The SPI bus will be initialized appropriately by this library.
66+ //| * At present, the WIZNET5K object is a singleton, so only one WizNet
67+ //| interface is supported at a time."""
68+ //| ...
6869//|
6970
7071STATIC mp_obj_t wiznet5k_make_new (const mp_obj_type_t * type , size_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
@@ -86,9 +87,8 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons
8687 return ret ;
8788}
8889
89- //| .. attribute:: connected
90- //|
91- //| (boolean, readonly) is this device physically connected?
90+ //| connected: Any = ...
91+ //| """(boolean, readonly) is this device physically connected?"""
9292//|
9393
9494STATIC mp_obj_t wiznet5k_connected_get_value (mp_obj_t self_in ) {
@@ -104,11 +104,10 @@ const mp_obj_property_t wiznet5k_connected_obj = {
104104 (mp_obj_t )& mp_const_none_obj },
105105};
106106
107- //| .. attribute:: dhcp
107+ //| dhcp: Any = ...
108+ //| """(boolean, readwrite) is DHCP active on this device?
108109//|
109- //| (boolean, readwrite) is DHCP active on this device?
110- //|
111- //| * set to True to activate DHCP, False to turn it off
110+ //| * set to True to activate DHCP, False to turn it off"""
112111//|
113112
114113STATIC mp_obj_t wiznet5k_dhcp_get_value (mp_obj_t self_in ) {
@@ -138,13 +137,13 @@ const mp_obj_property_t wiznet5k_dhcp_obj = {
138137 (mp_obj_t )& mp_const_none_obj },
139138};
140139
141- //| .. method:: ifconfig(params=None)
142- //|
143- //| Called without parameters, returns a tuple of
144- //| (ip_address, subnet_mask, gateway_address, dns_server)
140+ //| def ifconfig(self, params: Any = None) -> Any:
141+ //| """Called without parameters, returns a tuple of
142+ //| (ip_address, subnet_mask, gateway_address, dns_server)
145143//|
146- //| Or can be called with the same tuple to set those parameters.
147- //| Setting ifconfig parameters turns DHCP off, if it was on.
144+ //| Or can be called with the same tuple to set those parameters.
145+ //| Setting ifconfig parameters turns DHCP off, if it was on."""
146+ //| ...
148147//|
149148
150149STATIC mp_obj_t wiznet5k_ifconfig (size_t n_args , const mp_obj_t * args ) {
0 commit comments