diff --git a/en-us/api/QuecPythonClasslib.md b/en-us/api/QuecPythonClasslib.md
index 04f2ceb..08302d3 100644
--- a/en-us/api/QuecPythonClasslib.md
+++ b/en-us/api/QuecPythonClasslib.md
@@ -2676,7 +2676,6 @@ This function sets the current modem functionality.
#### checkNet - Wait for Network to be Ready
Function: The checkNet module is mainly used for the script programs [auto-startup], and provides APIs to wait for the network to be ready. If it times out or exits abnormally, the program returns an error code. Therefore, if there are network-related operations in the your program, the method in the checkNet module should be called at the beginning of the user program to wait for the network to be ready. Of course, you can also implement the functions of this module by yourselves.
-Note: The BC25PA platform does not support this module function.
##### Create checkNet Object
> **import checkNet**
@@ -3076,7 +3075,6 @@ if __name__ == '__main__':
#### app_fota - Upgrade User File
Module function: Upgrade user file
-Note: The BC25PA platform does not support this module function.
##### Create an app_fota Object
1. Import app_fota module
@@ -4772,11 +4770,11 @@ usb.setCallback(usb_callback)
It provides the USB network adapter function.
-NOTE:Currently, only the ASR platform and Unisoc supports it.
+NOTE:Currently, only the ASR platform supports it.
###### Setting the USBNET working type (Take effect after restart)
-> **USBNET.set_worktype(type)**
+USBNET.set_worktype(type)
- Parameter
@@ -4788,46 +4786,6 @@ NOTE:Currently, only the ASR platform and Unisoc supports it.
Return 0 if the setting is successful, otherwise return -1.
-
-
-###### Getting the USBNET working type (Take effect after restart)
-
-> **USBNET.get_worktype()**
-
-* Parameter
-
- None
-
-* Return Value
-
- Return the USBNET working type if successful, otherwise return -1.
-
- 1 - ECM type
-
- 3 - RNDIS type
-
-
-
-###### Getting the USBNET status
-
-> **USBNET.get_status()**
-
-* Parameter
-
- None
-
-* Return Value
-
- Return the USBNET status if successful, otherwise return -1.
-
- status:
-
- 0 - Not connected
-
- 1 - connected
-
-
-
###### Open USBNET
> **USBNET.open()**
@@ -5734,7 +5692,7 @@ Row number of the pin map.
##### RTC
-Class function: It provides methods to get and set RTC time.
+Class function: It provides methods to get and set RTC time. For bc25pa platform, it can wake up the module from deep sleep or software shutdown.
###### Create RTC Object
@@ -5786,7 +5744,79 @@ When getting the time, return a tuple containing the date and time in the follow
(2020, 3, 12, 4, 12, 12, 14, 0)
```
+###### Set callback function
+
+> **rtc.register_callback(usrFun)**
+
+When RTC expiration time callback function is set (for BC25PA platform, if it is recovered from deep sleep or software shutdown, calling this function will immediately call usrfun once)
+* Parameter
+
+| Parameter | Type | Description |
+| ------ | -------- | ------------------------------------------ |
+| usrFun | function | Callback function, which is called when the set RTC time arrives. |
+
+Note: usrFun requires parameters
+
+* Return Value
+0 Successful execution.
+-1 Failed execution.
+* Example
+
+```python
+>>> def test(df):
+... print('rtc test...',df)
+...
+...
+...
+>>>
+>>> rtc.register_callback(test)
+0
+```
+###### Set RTC expiration time
+rtc.set_alarm(data_e)
+Set the RTC expiration time. When the expiration time is reached, the registered callback function will be called
+* Parameter
+| Parameter | Type | Description |
+| ----------- | ---- | ------------------------------------------------------------ |
+| year | int | year |
+| month | int | month,Range1 ~ 12 |
+| day | int | day,Range1 ~ 31 |
+| week | int | week,Range0 ~ 6,Where 0 means Sunday and 1 ~ 6 means Monday to Saturday respectively. When setting time,this parameter does not work and is reserved. This parameter is valid when getting time |
+| hour | int | hour,Range0 ~ 23 |
+| minute | int | minute,Range0 ~ 59 |
+| second | int | second,Range0 ~ 59 |
+| microsecond | int | microsecond,The parameter is reserved and not used yet. When setting the time, the parameter can be written as 0 |
+
+* Return Value
+0 Successful execution.
+-1 Failed execution.
+* Example
+```python
+>>> data_e=rtc.datetime()
+>>> data_l=list(data_e)
+>>> data_l[6] +=30
+>>> data_e=tuple(data_l)
+>>> rtc.set_alarm(data_e)
+0
+```
+###### Start / stop RTC timer
+rtc.enable_alarm(on_off)
+The timer can be started only when the callback function is set (bc25pa platform)
+* Parameter
+
+| Parameter | Type | Description |
+| ----------- | ---- | ------------------------------------------------------------ |
+| on_off | int | 0 - Turn off RTC timer. 1 - Start RTC timer. |
+
+* Return Value
+0 Successful execution.
+-1 Failed execution.
+* Example
+```python
+>>> rtc.enable_alarm(1)
+0
+```
##### I2C
@@ -5955,7 +5985,7 @@ Adaptation version: EC100Y (V0009) and above; EC600S (V0002) and above.
| EC600S/EC600N | port0:
CS:Pin number 58
CLK:Pin number 61
MOSI:Pin number 60
MISO:Pin number 59
port1:
CS:Pin number 4
CLK:Pin number 1
MOSI:Pin number 3
MISO:Pin number 2 |
| EC100Y | port0:
CS:Pin number 25
CLK:Pin number 26
MOSI:Pin number 27
MISO:Pin number 28
port1:
CS:Pin number 105
CLK:Pin number 104
MOSI:Pin number 107
MISO:Pin number 106 |
| BC25PA | port0:
CS:Pin number 6
CLK:Pin number 5
MOSI:Pin number 4
MISO:Pin number 3|
-
+* Note:Bc25pa platform does not support 1 and 2 modes.
- Example
```python
@@ -6465,6 +6495,14 @@ Module function: provide matrix keyboard interface and support platform ec600scn
###### Create keypad object
> **keypad=machine.KeyPad()**
+*Parameter
+| Parameter | Type | Description |
+| ------ | -------- | ----------------------------------- |
+|Row | int | row (if it is greater than 0 and less than 8, and neither row nor column is set, the default is 4)|
+|Col | int | column (greater than 0 and less than 8. If the column is not set, the default is 4)|
+Note: if row and col are not set, the default is 4X4..
+
+*Example:
>
> ```python
> >>>import machine
@@ -6495,7 +6533,9 @@ After the key is connected to the module, press and release the key to trigger t
* Parameters
-| Parameter | parameter type | parameter description |
+- Parameter
+
+| Parameter | Type | Description |
| ------ | -------- | ------------------------------------------ |
| usrFun | function | callback function. This function will be triggered when the external keyboard key is pressed and placed |
@@ -6504,35 +6544,17 @@ Note: the usrfun parameter is list.
List contains five parameters. It has the following meanings:
-list[0] - 90 means press and non-90 means lift
+list[0] - 1 means press and 0 means lift
list[1] - row
list[2] - col
-List [3] - reserved, 0 by default, not used for the time being
-
-List [4] - the bottom layer outputs the key value, which is generally not used.
* Return value
0
-###### Set pin reuse
-
-> **keypad.setMuliKeyen(enbale)**
-
-* Parameters
-
-| Parameter | parameter type | parameter description |
-| ------ | -------- | ----------------------------------- |
-| Enbale | int | 1-enable multi-function keys, 0-ignore multi-function keys |
-
-Note: only ec600ncnlc platform needs to call this function.
-
-* Return value
-
-0
###### Uninitialization
@@ -6557,12 +6579,11 @@ keypad=machine.KeyPad()
keypad.init()
def userfun(l_list):
global is_loop
- if l_list[0] != 90 and l_list[1] == 4 and l_list[2] == 4 :
+ if l_list[0] != 1 :
is_loop = 0
print('will exit')
print(l_list)
-keypad.setMuliKeyen(1)
keypad.set_callback(userfun)
loop_num = 0
@@ -6571,7 +6592,6 @@ while is_loop == 1 and loop_num < 10:
loop_num = loop_num +1
print(" running..... ",is_loop,loop_num)
-keypad.setMuliKeyen(0)
keypad.deinit()
print('exit!')
```
@@ -10506,7 +10526,23 @@ None.
>>> aep.connect()
0
```
+###### Query data to be read
+
+> **aep.check()**
+- **Parameter**
+None
+- **Return Value**
+Returns the number of pieces of data to be read distributed by the cloud platform
+
+- Example
+
+```python
+>>> from nb import AEP
+>>> aep=AEP("221.229.214.202","5683")
+>>> aep.check()
+0
+```
###### Receive data
> **aep.recv(data_len,data)**
@@ -10549,8 +10585,7 @@ Failed - not 0
- Note
-The sent data is a hexadecimal string, and the data length is even.
-
+The sending data is a hexadecimal string, the data length is an even number, blocking (timeout 3 minutes), and returning success indicates that the sending instruction is executed successfully.
- **Return Value**
Success - 0
@@ -10621,7 +10656,7 @@ def HexToStr(source, t=None):
def StrToHex(source):
return int(source)
-#对照物模型定义,打包解包根据相应的服务id中的属性进行解析
+#对照物模型定义,打包解包根据相应的服务id中的属性进行解析
serid_dict={'阀门开关控制':8001,
'故障上报':1001,
'设备信息上报':3,
@@ -10639,7 +10674,7 @@ dict_cmd={'数据上报':0x02,
send_type={
'RAI_NONE':0,
'RAI_1':1,
- 'RAI_2':1
+ 'RAI_2':2
}
servcei_info={
'ip':"221.229.214.202",
@@ -10650,14 +10685,14 @@ def aep_pack_cmdtype02(service_id,data_in):
data=HexToStr(dict_cmd['数据上报'],1)
data+=HexToStr(service_id,2) #serviceid转成字符串
if service_id == 1:
- data+=HexToStr(4,2) #发送数据8.14,float类型四个字节长度,此处只举例一个情况
+ data+=HexToStr(4,2) #发送数据8.14,float类型四个字节长度,此处只举例一个情况
data+=HexToStr(aep_htonf(data_in),4) #float数据转成字符串
else:
print('not support') #
return data
def aep_pack(cmdtype,service_id,data):
- if cmdtype == dict_cmd['数据上报']: #数据上报-0x02,此处只举例一个情况
+ if cmdtype == dict_cmd['数据上报']: #数据上报-0x02,此处只举例一个情况
return aep_pack_cmdtype02(service_id,data)
else:
print('not support')
diff --git a/zh-cn/api/QuecPythonClasslib.md b/zh-cn/api/QuecPythonClasslib.md
index 7f62982..9350d7d 100644
--- a/zh-cn/api/QuecPythonClasslib.md
+++ b/zh-cn/api/QuecPythonClasslib.md
@@ -2868,7 +2868,7 @@ LTE list:
模块功能:checkNet模块主要用于【开机自动运行】的用户脚本程序,该模块提供API用来阻塞等待网络就绪,如果超时或者其他异常退出会返回错误码,所以如果用户的程序中有涉及网络相关的操作,那么在用户程序的开始应该调用 checkNet 模块中的方法以等待网络就绪。当然,用户也可以自己实现这个模块的功能。
-注意:当前仅EC600S/EC600N/EC800N/EC200U/EC600U平台支持该功能。
+注意:当前仅EC600S/EC600N/EC800N/EC200U/EC600U/BC25PA平台支持该功能。
##### 创建checkNet对象
@@ -3275,7 +3275,6 @@ if __name__ == '__main__':
模块功能:用户文件升级
-注意:BC25PA平台不支持此模块。
##### 创建app_fota对象
@@ -5647,6 +5646,7 @@ if __name__ == '__main__':
| EC600S/EC600N | uart0:
TX: 引脚号71
RX: 引脚号72
uart1:
TX: 引脚号3
RX: 引脚号2
uart2:
TX:引脚号32
RX:引脚号31 |
| EC100Y | uart0:
TX: 引脚号21
RX: 引脚号20
uart1:
TX: 引脚号27
RX: 引脚号28
uart2:
TX:引脚号50
RX:引脚号49 |
| EC800N | uart0:
TX: 引脚号39
RX: 引脚号38
uart1:
TX: 引脚号50
RX: 引脚号51
uart2:
TX:引脚号18
RX:引脚号17 |
+| BC25PA | uart1:
TX: 引脚号29
RX: 引脚号28
|
* 示例
@@ -6165,7 +6165,7 @@ if __name__ == '__main__':
##### RTC
-类功能:提供获取设置rtc时间方法。
+类功能:提供获取设置rtc时间方法,对于BC25PA平台起到从深休眠或者软件关机状态唤醒模组的功能。
###### 创建RTC对象
@@ -6213,6 +6213,81 @@ if __name__ == '__main__':
0
>>> rtc.datetime()
(2020, 3, 12, 4, 12, 12, 14, 0)
+
+```
+
+###### 设置回调函数
+
+> **rtc.register_callback(usrFun)**
+
+当设置rtc到期时间回调函数(对于BC25PA平台,如果是从深休眠或者软件关机状态中恢复,调用此函数会立刻调用一次usrFun)。
+
+* 参数
+
+| 参数 | 参数类型 | 参数说明 |
+| ------ | -------- | ------------------------------------------ |
+| usrFun | function | 回调函数,当设置的RTC时间到达则调用此函数。 |
+
+注意:usrFun需要参数
+
+* 返回值
+ 成功: 0
+ 失败: -1
+* 示例
+
+```python
+>>> def test(df):
+... print('rtc test...',df)
+...
+...
+...
+>>>
+>>> rtc.register_callback(test)
+0
+```
+###### 设置RTC到期时间
+rtc.set_alarm(data_e)
+设置RTC到期时间,当到了到期时间就会调用注册的回调函数。
+* 参数
+| 参数 | 类型 | 说明 |
+| ----------- | ---- | ------------------------------------------------------------ |
+| year | int | 年 |
+| month | int | 月,范围1 ~ 12 |
+| day | int | 日,范围1 ~ 31 |
+| week | int | 星期,范围0 ~ 6,其中0表示周日,1 ~ 6分别表示周一到周六;设置时间时,该参数不起作用,保留;获取时间时该参数有效 |
+| hour | int | 时,范围0 ~ 23 |
+| minute | int | 分,范围0 ~ 59 |
+| second | int | 秒,范围0 ~ 59 |
+| microsecond | int | 微秒,保留参数,暂未使用,设置时间时该参数写0即可 |
+
+* 返回值
+ 成功: 0
+ 失败: -1
+* 示例
+
+```python
+>>> data_e=rtc.datetime()
+>>> data_l=list(data_e)
+>>> data_l[6] +=30
+>>> data_e=tuple(data_l)
+>>> rtc.set_alarm(data_e)
+0
+```
+###### 启动/停止RTC定时器
+rtc.enable_alarm(on_off)
+只有在设置回调函数时才能启动定时器(BC25PA平台)
+* 参数
+| 参数 | 类型 | 说明 |
+| ----------- | ---- | ------------------------------------------------------------ |
+| on_off | int | 0 - 关闭RTC定时器. 1 - 启动RTC定时器. |
+
+* 返回值
+ 成功: 0
+ 失败: -1
+* 示例
+```python
+>>> rtc.enable_alarm(1)
+0
```
@@ -6466,7 +6541,7 @@ if __name__ == '__main__':
| EC800N | port0:
CS:引脚号31
CLK:引脚号30
MOSI:引脚号32
MISO:引脚号33
port1:
CS:引脚号52
CLK:引脚号53
MOSI:引脚号50
MISO:引脚号51 |
| BC25PA | port0:
CS:引脚号6
CLK:引脚号5
MOSI:引脚号4
MISO:引脚号3|
* 注意
- BC25PA平台仅不支持1、2模式。
+ BC25PA平台不支持1、2模式。
- 示例
```python
@@ -6988,24 +7063,31 @@ if __name__ == '__main__':
###### 创建keypad对象
-> **keypad=machine.KeyPad()**
+> **keypad=machine.KeyPad(row,col)**
>
+* 参数
+| 参数 | 参数类型 | 参数说明 |
+| ------ | -------- | ----------------------------------- |
+| row | int | 行(大于0,小于8,行和列均不设置的情况下,默认为4) |
+| col | int | 列(大于0,小于8,列不设置的情况下,默认4) |
+
+注意:如果row和col均不设置,默认为4X4.
+* 示例:
> ```python
> >>>import machine
-> >>>keypad=machine.KeyPad()
+> >>>keypad=machine.KeyPad(2,3) # 矩阵键盘设置为2行3列矩阵键盘
+> >>>keypad=machine.KeyPad() # 不设置,默认设置为4行4列矩阵键盘
+> >>>keypad=machine.KeyPad(2) # 行值设置为2,不设置列值,列值默认为4,2行4列矩阵键盘
> ```
>
->
###### 初始化keypad
> **keypad.init()**
初始化keypad设置。
-
* 参数
-
-无
+> 无
* 返回值
@@ -7025,33 +7107,13 @@ if __name__ == '__main__':
注意:usrFun参数为list。
-list包含五个参数。其含义如下:
-
-list[0] - 90表示按下,非90表示抬起
-
-list[1] - row
-
-list[2] - col
-
-list[3] - 预留,默认0,暂时不用
-
-list[4] - 底层输出按键值,一般不用。
-
-* 返回值
-
-0
-
-###### 设置引脚复用
-
-> **keypad.setMuliKeyen(enbale)**
+list包含三个参数。其含义如下:
-* 参数
+list[0]: 1表示按下,0表示抬起
-| 参数 | 参数类型 | 参数说明 |
-| ------ | -------- | ----------------------------------- |
-| enbale | int | 1-使能多功能按键,0-忽略多功能按键。 |
+list[1] : row
-注意:只有EC600NCNLC平台需要调用此函数。
+list[2] : col
* 返回值
@@ -7081,21 +7143,16 @@ keypad=machine.KeyPad()
keypad.init()
def userfun(l_list):
global is_loop
- if l_list[0] != 90 and l_list[1] == 4 and l_list[2] == 4 :
+ if l_list[0] != 1 :
is_loop = 0
print('will exit')
print(l_list)
-
-keypad.setMuliKeyen(1)
keypad.set_callback(userfun)
loop_num = 0
-
while is_loop == 1 and loop_num < 10:
utime.sleep(5)
loop_num = loop_num +1
print(" running..... ",is_loop,loop_num)
-
-keypad.setMuliKeyen(0)
keypad.deinit()
print('exit!')
```
@@ -10684,7 +10741,8 @@ camCaputre.callback(callback)
模块功能:对L76K GPS型号进行数据获取,可以得到模块定位是否成功,定位的经纬度数据,UTC授时时间,获取GPS模块的定位模式,获取GPS模块定位使用卫星数量,获取GPS模块定位可见卫星数量,获取定位方位角,GPS模块对地速度,模块定位大地高等数据信息。
* 注意
- 当前仅ASR和展锐的EC200U/EC600U系列支持该功能。
+ BC25PA平台不支持模块功能。
+> 暂时只支持EC600U CNLB
##### 打开GNSS串口,读取并解析GNSS数据
@@ -11113,6 +11171,24 @@ True
>>> aep.connect()
0
```
+###### 查询待读取数据
+> **aep.check()**
+
+- 参数
+
+无
+
+- 返回值
+返回云平台下发的待读取数据条数
+
+- 示例
+
+```python
+>>> from nb import AEP
+>>> aep=AEP("221.229.214.202","5683")
+>>> aep.check()
+0
+```
###### 接收数据
@@ -11158,7 +11234,7 @@ True
- 说明
-发送数据为16进制字符串,数据长度为偶数,非阻塞,返回成功表示发送指令执行成功,不表示数据已经发送到云平台。
+发送数据为16进制字符串,数据长度为偶数,阻塞(超时时间3分钟),返回成功表示发送指令执行成功。
- 返回值
@@ -11631,7 +11707,7 @@ dict_cmd={'数据上报':0x02,
send_type={
'RAI_NONE':0,
'RAI_1':1,
- 'RAI_2':1
+ 'RAI_2':2
}
servcei_info={
'ip':"221.229.214.202",