Skip to content

Commit a748fac

Browse files
update micropython library to ver1.19 and update readme files
1 parent b67a45b commit a748fac

File tree

174 files changed

+3568
-1590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+3568
-1590
lines changed

example_scripts/http_get/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import network
22
import socket
33

4+
ssid = 'demo_ap'
5+
password = 'password'
46
nic=network.WLAN(network.STA_IF)
57
nic.active(True)
6-
nic.connect('mchp_demo', 'mchp5678')
8+
nic.connect(ssid, password)
79
while not nic.isconnected():
810
pass
911
print("wifi connection is done")

example_scripts/http_server/main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import umachine
2+
import network
3+
4+
ssid = 'demo_ap'
5+
password = '12345678'
6+
27
pins = [umachine.Pin(i, umachine.Pin.IN) for i in (16, 41, 47)]
38

49
html = """<!DOCTYPE html>
@@ -10,10 +15,10 @@
1015
</html>
1116
"""
1217

13-
import network
18+
1419
nic=network.WLAN(network.STA_IF)
1520
nic.active(True)
16-
nic.connect('mchp_demo', 'mchp5678')
21+
nic.connect(ssid, password)
1722
while not nic.isconnected():
1823
pass
1924
print("wifi connection is done")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Highlights
2+
* This example show the device acting as TCP server, with a simple HTTP website to show some GPIO's value
3+
* Edit main.py, input variables *ssid* and *password* with the Target AP SSID and password
4+
* Console log display the assigned IP address
5+
* Connect your PC to the same network, browser the device webpge by typing http://<DEIVCE_IP_ADDR>, the webpage show the pin 16, 41, 47's value
6+
</p>
7+
<p align="center"><img width="500" src="./../../images/tcp_server_webpage.jpg">
8+
</p>

example_scripts/tcp_client/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import network
22
import socket
33

4+
ssid = 'demo_ap'
5+
password = '12345678'
46
ip = '192.168.2.147'
57
port = 6666
68

79
nic=network.WLAN(network.STA_IF)
810
nic.active(True)
9-
nic.connect('mchp_demo', 'mchp5678')
11+
nic.connect(ssid, password)
1012
while not nic.isconnected():
1113
pass
1214
print("wifi connection is done")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Highlights
2+
* This example show the device acting as TCP client, connect to the TCP server that running on PC
3+
* Edit main.py, input variables *ssid* and *password* with the Target AP SSID and password
4+
* Edit main.py, input *ip* with your PC's IP address
5+
* Connect your PC to the same network, execute utilities/tcp_server.py on your PC
6+
* Power on the board after the TCP server start running on your PC

example_scripts/tcp_server_with_multiple_socket/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
i = 0
88
connections = []
9+
ssid = 'demo_ap'
10+
password = '12345678'
911

1012
nic=network.WLAN(network.STA_IF)
1113
nic.active(True)
1214
nic.disconnect()
13-
nic.connect('mchp_demo', 'mchp5678')
15+
nic.connect(ssid, password)
1416
while not nic.isconnected():
1517
pass
1618
print("wifi connection is done")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Highlights
2+
* This example show the device is acting as TCP server, which can accept mutliple sockets
3+
* Edit main.py, input variables *ssid* and *password* with the Target AP SSID and password
4+
* Console log display the assigned IP address
5+
* Edit utilities/tcp_client.py, modify the *ip* value
6+
* Connect your PC to the same network, run utilities/tcp_client.py to connect the TCP server running on the device
Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,51 @@
11
// Automatically generated by makemoduledefs.py.
2-
2+
#include "../../mpconfigport.h"
33
#if (MICROPY_PY_ARRAY)
44
extern const struct _mp_obj_module_t mp_module_uarray;
55
#define MODULE_DEF_MP_QSTR_UARRAY { MP_ROM_QSTR(MP_QSTR_uarray), MP_ROM_PTR(&mp_module_uarray) },
66
#else
77
#define MODULE_DEF_MP_QSTR_UARRAY
88
#endif
99

10+
//#if MICROPY_PY_GC && MICROPY_ENABLE_GC
11+
extern const struct _mp_obj_module_t mp_module_gc;
12+
extern const struct _mp_obj_module_t mp_module_array;
13+
extern const struct _mp_obj_module_t mp_module_collections;
14+
extern const struct _mp_obj_module_t mp_module_ustruct;
15+
extern const struct _mp_obj_module_t mp_module_ujson;
16+
extern const struct _mp_obj_module_t mp_module_uselect;
17+
#define MODULE_DEF_MP_QSTR_GC { MP_ROM_QSTR(MP_QSTR_gc), MP_ROM_PTR(&mp_module_gc) },
18+
#define MODULE_DEF_MP_QSTR_ARRAY { MP_ROM_QSTR(MP_QSTR_array), MP_ROM_PTR(&mp_type_array) },
19+
#define MODULE_DEF_MP_QSTR_UCOLLECTIONS { MP_ROM_QSTR(MP_QSTR_ucollections), MP_ROM_PTR(&mp_module_collections) },
20+
#define MODULE_DEF_MP_QSTR_USTRUCT { MP_ROM_QSTR(MP_QSTR_ustruct), MP_ROM_PTR(&mp_module_ustruct) },
21+
#define MODULE_DEF_MP_QSTR_UJSON { MP_ROM_QSTR(MP_QSTR_ujson), MP_ROM_PTR(&mp_module_ujson) },
22+
#define MODULE_DEF_MP_QSTR_USELECT { MP_ROM_QSTR(MP_QSTR_uselect), MP_ROM_PTR(&mp_module_uselect) },
23+
24+
25+
//#else
26+
// #define MODULE_DEF_MP_QSTR_GC
27+
//#endif
28+
29+
extern const struct _mp_obj_module_t pyb_module;
30+
extern const struct _mp_obj_module_t test_module;
31+
extern const struct _mp_obj_module_t mp_module_network;
32+
extern const struct _mp_obj_module_t mp_module_machine;
33+
extern const struct _mp_obj_module_t mp_module_usocket;
34+
extern const struct _mp_obj_module_t utime_module;
35+
1036

1137
#define MICROPY_REGISTERED_MODULES \
1238
MODULE_DEF_MP_QSTR_UARRAY \
39+
MODULE_DEF_MP_QSTR_ARRAY \
40+
MODULE_DEF_MP_QSTR_GC \
41+
MODULE_DEF_MP_QSTR_UCOLLECTIONS \
42+
MODULE_DEF_MP_QSTR_USTRUCT \
43+
MODULE_DEF_MP_QSTR_USELECT \
44+
{ MP_ROM_QSTR(MP_QSTR_pyb), MP_ROM_PTR(&pyb_module) }, \
45+
{ MP_ROM_QSTR(MP_QSTR_test), MP_ROM_PTR(&test_module) }, \
46+
{ MP_OBJ_NEW_QSTR(MP_QSTR_network), (mp_obj_t)&mp_module_network }, \
47+
{ MP_OBJ_NEW_QSTR(MP_QSTR_umachine), (mp_obj_t)&mp_module_machine }, \
48+
{ MP_OBJ_NEW_QSTR(MP_QSTR_socket), (mp_obj_t)&mp_module_usocket }, \
49+
{ MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&utime_module }, \
50+
\
1351
// MICROPY_REGISTERED_MODULES
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// This file was generated by py/makeversionhdr.py
2-
#define MICROPY_GIT_TAG "v1.18-330-gd242a9b7f-dirty"
3-
#define MICROPY_GIT_HASH "d242a9b7f-dirty"
4-
#define MICROPY_BUILD_DATE "2022-04-13"
2+
#define MICROPY_GIT_TAG "v1.19"
3+
#define MICROPY_GIT_HASH ""
4+
#define MICROPY_BUILD_DATE "2023-04-01"

firmware/src/config/pic32mz_w1_curiosity_freertos/build/genhdr/qstrdefs.generated.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ QDEF(MP_QSTR_active, 60009, 6, "active")
251251
QDEF(MP_QSTR_addr, 31414, 4, "addr")
252252
QDEF(MP_QSTR_addrsize, 37267, 8, "addrsize")
253253
QDEF(MP_QSTR_arg, 13457, 3, "arg")
254+
QDEF(MP_QSTR_array, 29308, 5, "array")
254255
QDEF(MP_QSTR_atten, 20655, 5, "atten")
255256
QDEF(MP_QSTR_authmode, 26062, 8, "authmode")
256257
QDEF(MP_QSTR_baudrate, 55541, 8, "baudrate")
@@ -260,6 +261,7 @@ QDEF(MP_QSTR_bits, 26697, 4, "bits")
260261
QDEF(MP_QSTR_block, 26092, 5, "block")
261262
QDEF(MP_QSTR_bound_method, 41623, 12, "bound_method")
262263
QDEF(MP_QSTR_bssid, 15434, 5, "bssid")
264+
QDEF(MP_QSTR_calcsize, 14413, 8, "calcsize")
263265
QDEF(MP_QSTR_callback, 61516, 8, "callback")
264266
QDEF(MP_QSTR_channel, 37158, 7, "channel")
265267
QDEF(MP_QSTR_closure, 51828, 7, "closure")
@@ -274,6 +276,8 @@ QDEF(MP_QSTR_dhcp_hostname, 18850, 13, "dhcp_hostname")
274276
QDEF(MP_QSTR_dict_view, 43309, 9, "dict_view")
275277
QDEF(MP_QSTR_disable, 30353, 7, "disable")
276278
QDEF(MP_QSTR_disconnect, 34213, 10, "disconnect")
279+
QDEF(MP_QSTR_dump, 12265, 4, "dump")
280+
QDEF(MP_QSTR_dumps, 11642, 5, "dumps")
277281
QDEF(MP_QSTR_elapsed_millis, 49806, 14, "elapsed_millis")
278282
QDEF(MP_QSTR_enable, 56836, 6, "enable")
279283
QDEF(MP_QSTR_enumerate, 47729, 9, "enumerate")
@@ -305,6 +309,8 @@ QDEF(MP_QSTR_isconnected, 39296, 11, "isconnected")
305309
QDEF(MP_QSTR_isenabled, 58778, 9, "isenabled")
306310
QDEF(MP_QSTR_iterator, 48711, 8, "iterator")
307311
QDEF(MP_QSTR_listen, 3788, 6, "listen")
312+
QDEF(MP_QSTR_load, 9315, 4, "load")
313+
QDEF(MP_QSTR_loads, 45232, 5, "loads")
308314
QDEF(MP_QSTR_mac, 17322, 3, "mac")
309315
QDEF(MP_QSTR_makefile, 54721, 8, "makefile")
310316
QDEF(MP_QSTR_max, 17329, 3, "max")
@@ -320,11 +326,14 @@ QDEF(MP_QSTR_mode, 49190, 4, "mode")
320326
QDEF(MP_QSTR_modify, 26357, 6, "modify")
321327
QDEF(MP_QSTR_module, 39359, 6, "module")
322328
QDEF(MP_QSTR_mosi, 49693, 4, "mosi")
329+
QDEF(MP_QSTR_namedtuple, 5662, 10, "namedtuple")
323330
QDEF(MP_QSTR_network, 10331, 7, "network")
324331
QDEF(MP_QSTR_oct, 23805, 3, "oct")
325332
QDEF(MP_QSTR_off, 23690, 3, "off")
326333
QDEF(MP_QSTR_on, 28516, 2, "on")
327334
QDEF(MP_QSTR_opt_level, 26503, 9, "opt_level")
335+
QDEF(MP_QSTR_pack, 53692, 4, "pack")
336+
QDEF(MP_QSTR_pack_into, 43295, 9, "pack_into")
328337
QDEF(MP_QSTR_parity, 1346, 6, "parity")
329338
QDEF(MP_QSTR_password, 28570, 8, "password")
330339
QDEF(MP_QSTR_pend_throw, 29939, 10, "pend_throw")
@@ -361,6 +370,7 @@ QDEF(MP_QSTR_select, 16781, 6, "select")
361370
QDEF(MP_QSTR_sendall, 40760, 7, "sendall")
362371
QDEF(MP_QSTR_sendbreak, 4550, 9, "sendbreak")
363372
QDEF(MP_QSTR_sendto, 802, 6, "sendto")
373+
QDEF(MP_QSTR_separators, 3307, 10, "separators")
364374
QDEF(MP_QSTR_setblocking, 6254, 11, "setblocking")
365375
QDEF(MP_QSTR_setsockopt, 59448, 10, "setsockopt")
366376
QDEF(MP_QSTR_settimeout, 35548, 10, "settimeout")
@@ -379,10 +389,16 @@ QDEF(MP_QSTR_toggle, 17335, 6, "toggle")
379389
QDEF(MP_QSTR_trigger, 35997, 7, "trigger")
380390
QDEF(MP_QSTR_tx, 28553, 2, "tx")
381391
QDEF(MP_QSTR_txbuf, 50808, 5, "txbuf")
392+
QDEF(MP_QSTR_uarray, 34441, 6, "uarray")
393+
QDEF(MP_QSTR_ucollections, 39445, 12, "ucollections")
394+
QDEF(MP_QSTR_ujson, 12520, 5, "ujson")
382395
QDEF(MP_QSTR_umachine, 32661, 8, "umachine")
396+
QDEF(MP_QSTR_unpack, 15367, 6, "unpack")
397+
QDEF(MP_QSTR_unpack_from, 27918, 11, "unpack_from")
383398
QDEF(MP_QSTR_unregister, 54295, 10, "unregister")
384399
QDEF(MP_QSTR_uselect, 36440, 7, "uselect")
385400
QDEF(MP_QSTR_usocket, 117, 7, "usocket")
401+
QDEF(MP_QSTR_ustruct, 2119, 7, "ustruct")
386402
QDEF(MP_QSTR_width, 29987, 5, "width")
387403
QDEF(MP_QSTR_write_readinto, 33929, 14, "write_readinto")
388404
QDEF(MP_QSTR_writeto, 14595, 7, "writeto")
@@ -395,4 +411,3 @@ QDEF(MP_QSTR_mktime, 11158, 6, "mktime")
395411
QDEF(MP_QSTR_time, 49648, 4, "time")
396412
QDEF(MP_QSTR_sleep, 10218, 5, "sleep")
397413
QDEF(MP_QSTR_sleep_ms, 25355, 8, "sleep_ms")
398-

0 commit comments

Comments
 (0)