57
57
//|
58
58
//| :param ~busio.SPI spi: spi bus to use
59
59
//| :param ~microcontroller.Pin cs: pin to use for Chip Select
60
- //| :param ~microcontroller.Pin rst: pin to use for Reset
61
- //| :param bool dhcp: boolean flag, whether to start DHCP automatically (default True)
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.
62
68
//|
63
69
64
70
STATIC 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 ) {
@@ -82,7 +88,7 @@ STATIC mp_obj_t wiznet5k_make_new(const mp_obj_type_t *type, size_t n_args, cons
82
88
83
89
//| .. attribute:: connected
84
90
//|
85
- //| is this device physically connected?
91
+ //| (boolean, readonly) is this device physically connected?
86
92
//|
87
93
88
94
STATIC mp_obj_t wiznet5k_connected_get_value (mp_obj_t self_in ) {
@@ -100,7 +106,9 @@ const mp_obj_property_t wiznet5k_connected_obj = {
100
106
101
107
//| .. attribute:: dhcp
102
108
//|
103
- //| is DHCP active on this device? (set to true to activate DHCP, false to turn it off)
109
+ //| (boolean, readwrite) is DHCP active on this device?
110
+ //|
111
+ //| * set to True to activate DHCP, False to turn it off
104
112
//|
105
113
106
114
STATIC mp_obj_t wiznet5k_dhcp_get_value (mp_obj_t self_in ) {
@@ -152,6 +160,7 @@ STATIC mp_obj_t wiznet5k_ifconfig(size_t n_args, const mp_obj_t *args) {
152
160
return mp_obj_new_tuple (4 , tuple );
153
161
} else {
154
162
// set
163
+ // XXX should this automatically stop DHCP here?
155
164
mp_obj_t * items ;
156
165
mp_obj_get_array_fixed_n (args [1 ], 4 , & items );
157
166
netutils_parse_ipv4_addr (items [0 ], netinfo .ip , NETUTILS_BIG );
0 commit comments