Skip to content

Commit

Permalink
【更新】SDK 至 V1.0.2 版本。
Browse files Browse the repository at this point in the history
Signed-off-by: armink <armink.ztl@gmail.com>
  • Loading branch information
armink committed Sep 12, 2019
1 parent 3b28a59 commit 5c56f1f
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 42 deletions.
Binary file modified README.pdf
Binary file not shown.
Binary file modified docs/UM3101-RT-Thread-W60X-SDK 开发手册.pdf
Binary file not shown.
Binary file modified docs/UM3102-RT-Thread-W60X-SDK 介绍.pdf
Binary file not shown.
Binary file modified docs/UM3103-RT-Thread-W60X-SDK 快速上手.pdf
Binary file not shown.
Binary file modified docs/UM3104-RT-Thread-W60X-SDK 发布说明.pdf
Binary file not shown.
Binary file not shown.
Binary file modified docs/UM3106-RT-Thread-基于W600 芯片的例程使用说明.pdf
Binary file not shown.
Binary file modified docs/figures/hardware/W60x_HW_origin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -764,4 +764,5 @@ QDEF(MP_QSTR_period, (const byte*)"\xa0\x06" "period")
QDEF(MP_QSTR_set_color, (const byte*)"\x25\x09" "set_color")
QDEF(MP_QSTR_file_crc32, (const byte*)"\x6f\x0a" "file_crc32")
QDEF(MP_QSTR_list_device, (const byte*)"\x20\x0b" "list_device")
QDEF(MP_QSTR_show_image, (const byte*)"\xde\x0a" "show_image")
// This file was automatically generated by makeqstrdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,30 @@ STATIC mp_obj_t machine_lcd_set_color(size_t n_args, const mp_obj_t *args) {
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lcd_set_color_obj, 3, 3, machine_lcd_set_color);

/// \method show_image array
///
/// display the image on the lcd..
/// @param x x position
/// @param y y position
/// @param length length of image
/// @param wide wide of image
/// @param p image_array
STATIC mp_obj_t machine_lcd_show_image(size_t n_args, const mp_obj_t *args) {
rt_uint16_t x = mp_obj_get_int(args[1]);
rt_uint16_t y = mp_obj_get_int(args[2]);
rt_uint16_t length = mp_obj_get_int(args[3]);
rt_uint16_t wide = mp_obj_get_int(args[4]);

mp_buffer_info_t bufinfo;
if (mp_get_buffer(args[5], &bufinfo, MP_BUFFER_READ))
{
lcd_show_image( x, y, length, wide, (const rt_uint8_t *)bufinfo.buf);
}

return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_lcd_show_image_obj, 6, 6, machine_lcd_show_image);

STATIC const mp_rom_map_elem_t machine_lcd_locals_dict_table[] = {
// instance methods
{ MP_ROM_QSTR(MP_QSTR_light), MP_ROM_PTR(&machine_lcd_light_obj) },
Expand All @@ -199,6 +223,7 @@ STATIC const mp_rom_map_elem_t machine_lcd_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_rectangle), MP_ROM_PTR(&machine_lcd_rectangle_obj) },
{ MP_ROM_QSTR(MP_QSTR_circle), MP_ROM_PTR(&machine_lcd_circle_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_color), MP_ROM_PTR(&machine_lcd_set_color_obj) },
{ MP_ROM_QSTR(MP_QSTR_show_image), MP_ROM_PTR(&machine_lcd_show_image_obj) },
// color
{ MP_ROM_QSTR(MP_QSTR_WHITE), MP_ROM_INT(WHITE) },
{ MP_ROM_QSTR(MP_QSTR_BLACK), MP_ROM_INT(BLACK) },
Expand Down
64 changes: 29 additions & 35 deletions examples/21_iot_mqtt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ mq_publish() 函数用来向指定的主题发布消息。例程里的主题就
本例程的部分示例代码如下所示:

```c
#define MQTT_URI "tcp://iot.eclipse.org:1883"
#define MQTT_USERNAME "admin"
#define MQTT_PASSWORD "admin"
#define MQTT_SUBTOPIC "/mqtt/test"
#define MQTT_PUBTOPIC "/mqtt/test"

int main(void)
{
/* 配置 wifi 工作模式 */
Expand Down Expand Up @@ -154,36 +148,36 @@ static void mqtt_online_callback(MQTTClient *c)
按下复位按键重启开发板,开发板会自动连上 WiFi ,可以看到板子会打印出如下信息:
```shell
\ | /
- RT - Thread Operating System
/ | \ 4.0.1 build Jun 3 2019
2006 - 2019 Copyright by rt-thread team
lwIP-2.0.2 initialized!
[SFUD] Find a Winbond flash chip. Size is 16777216 bytes.
[SFUD] w25q128 flash device is initialize success.
[I/sal.skt] Socket Abstraction Layer initialize success.
[I/WLAN.dev] wlan init success
[I/WLAN.lwip] eth device init ok name:w0
[I/FAL] RT-Thread Flash Abstraction Layer (V0.3.0) initialize success.
\ | /
- RT - Thread Operating System
/ | \ 4.0.2 build Sep 10 2019
2006 - 2019 Copyright by rt-thread team
lwIP-2.0.2 initialized!
[SFUD] Find a Winbond flash chip. Size is 16777216 bytes.
[SFUD] w25q128 flash device is initialize success.
[I/sal.skt] Socket Abstraction Layer initialize success.
[I/WLAN.dev] wlan init success
[I/WLAN.lwip] eth device init ok name:w0
[I/FAL] RT-Thread Flash Abstraction Layer (V0.3.0) initialize success.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:152) ENV start address is 0x0000
0000, size is 4096 bytes.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:821) Calculate ENV CRC32 number
is 0xD6363A94.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:833) Verify ENV CRC32 result is
OK.
[Flash] EasyFlash V3.3.0 is initialize success.
[Flash] You can get the latest version on https://github.com/armink/EasyFlash .
msh />[I/WLAN.mgnt] wifi connect success ssid:test
[D/main] Start mqtt client and subscribe topic:/mqtt/test/rtthread5125 #启动 MQTT 客户端
[I/main] Start to connect mqtt server
[D/MQTT] ipv4 address port: 1883
[D/MQTT] HOST = 'iot.eclipse.org'
[I/WLAN.lwip] Got IP address : 192.168.12.92
[I/MQTT] MQTT server connect success
[I/MQTT] Subscribe #0 /mqtt/test/rtthread5125 OK!
[D/main] Connect mqtt server success
[D/main] Publish message: Hello,RT-Thread! to topic: /mqtt/test/rtthread5125 #发布消息
[D/main] Topic: /mqtt/test/rtthread5125 receive a message: Hello,RT-Thread! #收到订阅消息
0000, size is 4096 bytes.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:821) Calculate ENV CRC32 number
is 0xD6363A94.
[Flash] (packages\EasyFlash-v3.3.0\src\ef_env.c:833) Verify ENV CRC32 result is
OK.
[Flash] EasyFlash V3.3.0 is initialize success.
[Flash] You can get the latest version on https://github.com/armink/EasyFlash .
msh />[I/WLAN.mgnt] wifi connect success ssid:test
[D/main] Start mqtt client and subscribe topic:/mqtt/test/rtthread5125 #启动 MQTT 客户端
[I/main] Start to connect mqtt server
[D/MQTT] ipv4 address port: 1883
[D/MQTT] HOST = 'mqtt.rt-thread.com'
[I/WLAN.lwip] Got IP address : 192.168.12.49
[I/MQTT] MQTT server connect success
[I/MQTT] Subscribe #0 /mqtt/test/rtthread9660 OK!
[D/main] Connect mqtt server success
[D/main] Publish message: Hello,RT-Thread! to topic: /mqtt/test/rtthread9660 #发布消息
[D/main] Topic: /mqtt/test/rtthread9660 receive a message: Hello,RT-Thread! #收到订阅消息
```

我们可以看到, WiFi 连接成功后,MQTT 客户端就自动连接了服务器,并订阅了我们指定的主题。连接服务器成功,处于在线状态后,发布了一条 Hello,RT-Thread! 的消息,我们很快接收到了服务器推送过来的这条消息。
Expand Down
7 changes: 4 additions & 3 deletions examples/21_iot_mqtt/applications/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@
* tcp://[fe80::20c:29ff:fe9a:a07e]:1883
* ssl://[fe80::20c:29ff:fe9a:a07e]:1884
*/
#define MQTT_URI "tcp://iot.eclipse.org:1883"
#define MQTT_USERNAME "admin"
#define MQTT_PASSWORD "admin"

#define MQTT_URI "tcp://mqtt.rt-thread.com:1883"
#define MQTT_USERNAME "test"
#define MQTT_PASSWORD "8C0E1DCCC041725E43A5D3666EFDE62E"
#define MQTT_SUBTOPIC "/mqtt/test/"
#define MQTT_PUBTOPIC "/mqtt/test/"

Expand Down
2 changes: 1 addition & 1 deletion examples/31_iot_cloud_rtt/project.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
<Name>-U20090928 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W600_QFlash -FS08000000 -FL0100000</Name>
<Name>-U59400616 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W60X_QFlash -FS08000000 -FL0100000</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
Expand Down
2 changes: 1 addition & 1 deletion examples/31_iot_cloud_rtt/template.uvoptx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<SetRegEntry>
<Number>0</Number>
<Key>JL2CM3</Key>
<Name>-U20090928 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W600_QFlash -FS08000000 -FL0100000</Name>
<Name>-U59400616 -O78 -S8 -ZTIFSpeedSel50000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO15 -FD20000000 -FC2000 -FN1 -FF0W60X_QFlash -FS08000000 -FL0100000</Name>
</SetRegEntry>
<SetRegEntry>
<Number>0</Number>
Expand Down
3 changes: 2 additions & 1 deletion rt-thread/components/drivers/wlan/wlan_mgnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ static rt_err_t rt_wlan_send_to_thread(rt_wlan_event_t event, void *buff, int le
msg->event = event;
if (len != 0)
{
msg->buff = ((char *)msg) + sizeof(struct rt_wlan_msg);
msg->buff = (void *)&msg[1];
rt_memcpy(msg->buff, buff, len);
msg->len = len;
}

Expand Down
1 change: 0 additions & 1 deletion tools/.gitignore

This file was deleted.

Empty file removed tools/.gitkeep
Empty file.
Binary file modified tools/update_fls.exe
Binary file not shown.

0 comments on commit 5c56f1f

Please sign in to comment.