Skip to content

Commit 1c096c3

Browse files
authored
Merge pull request #94 from Fire-boy/main
删除RTC中重复描述
2 parents fc07a16 + 59dd32f commit 1c096c3

File tree

2 files changed

+7
-156
lines changed

2 files changed

+7
-156
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 4 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -5935,41 +5935,10 @@ It sets and gets RTC time. When there is no parameter, it gets the time, it sets
59355935
(2020, 3, 12, 4, 12, 12, 14, 0)
59365936
```
59375937

5938-
###### Set callback function
5939-
5940-
> **rtc.register_callback(usrFun)**
5941-
5942-
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)
5943-
5944-
* Parameter
5945-
5946-
| Parameter | Type | Description |
5947-
| ------ | -------- | ------------------------------------------ |
5948-
| usrFun | function | Callback function, which is called when the set RTC time arrives. |
5949-
5950-
* Note
5951-
5952-
* usrFun requires parameters
5953-
5954-
* Return Value
5955-
5956-
* 0 Successful execution.
5957-
* -1 Failed execution.
5958-
5959-
* Example
5960-
5961-
```python
5962-
>>> def test(df):
5963-
... print('rtc test...',df)
5964-
...
5965-
...
5966-
...
5967-
>>>
5968-
>>> rtc.register_callback(test)
5969-
0
5970-
```
59715938
###### Set RTC expiration time
59725939

5940+
Support platform ec600u/ec200u/ec600n/ec800n/bc25
5941+
59735942
rtc.set_alarm(data_e)
59745943

59755944
Set the RTC expiration time. When the expiration time is reached, the registered callback function will be called
@@ -6001,61 +5970,12 @@ Set the RTC expiration time. When the expiration time is reached, the registered
60015970
>>> rtc.set_alarm(data_e)
60025971
0
60035972
```
6004-
###### Start / stop RTC timer
6005-
6006-
rtc.enable_alarm(on_off)
6007-
6008-
The timer can be started only when the callback function is set (bc25pa platform)
6009-
6010-
* Parameter
6011-
6012-
| Parameter | Type | Description |
6013-
| ----------- | ---- | ------------------------------------------------------------ |
6014-
| on_off | int | 0 - Turn off RTC timer. 1 - Start RTC timer. |
6015-
6016-
* Return Value
6017-
6018-
* 0 Successful execution.
6019-
* -1 Failed execution.
6020-
6021-
* Example
6022-
```python
6023-
>>> rtc.enable_alarm(1)
6024-
0
6025-
```
6026-
6027-
6028-
6029-
###### Set RTC alarm time
6030-
6031-
Support platform ec600u/ec200u/ec600n/ec800n/bc25
6032-
6033-
> rtc.set_alarm([year, month, day, week, hour, minute, second, microsecond])
6034-
6035-
Set the RTC alarm time. The parameter week is not involved in the setting. The microsecond parameter is reserved and not used yet. The default is 0.
6036-
6037-
* Parameter
6038-
6039-
|Parameter | type | description|
6040-
| ----------- | ---- | ------------------------------------- |
6041-
|Year | int ||
6042-
|Month | int | month, range 1 ~ 12|
6043-
|Day | int | day, range 1 ~ 31|
6044-
|Week | int | week, range 0 ~ 6, this parameter does not work, reserved|
6045-
|When hour | int | the range is 0 ~ 23|
6046-
|Minute | int | min, range 0 ~ 59|
6047-
|Second | int | second, range 0 ~ 59|
6048-
|Microsecond | int | microseconds, reserved parameters, unused temporarily, write 0|
6049-
6050-
* Return Value
6051-
6052-
* The integer value 0 is returned after setting successfully, and the integer value - 1 is returned after setting fails.
6053-
60545973

60555974

60565975
###### Register RTC alarm callback
60575976

60585977
Support platform ec600u/ec200u/ec600n/ec800n/bc25
5978+
Note: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)
60595979

60605980
> rtc.register_callback(fun)
60615981

@@ -6076,6 +5996,7 @@ Register RTC alarm callback handler
60765996
###### Switch RTC alarm function
60775997

60785998
Support platform ec600u/ec200u/ec600n/ec800n/bc25
5999+
Note:The timer can be started only when the callback function is set (bc25pa platform)
60796000

60806001
> rtc.enable_alarm(on_off)
60816002

zh-cn/api/QuecPythonClasslib.md

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -6403,36 +6403,10 @@ if __name__ == '__main__':
64036403

64046404
```
64056405

6406-
###### 设置回调函数
6407-
6408-
> **rtc.register_callback(usrFun)**
6409-
6410-
当设置rtc到期时间回调函数(对于BC25PA平台,如果是从深休眠或者软件关机状态中恢复,调用此函数会立刻调用一次usrFun)。
6411-
6412-
* 参数
6413-
6414-
| 参数 | 参数类型 | 参数说明 |
6415-
| ------ | -------- | ------------------------------------------ |
6416-
| usrFun | function | 回调函数,当设置的RTC时间到达则调用此函数。 |
6417-
6418-
注意:usrFun需要参数
6406+
###### 设置RTC到期时间
64196407

6420-
* 返回值
6421-
成功: 0
6422-
失败: -1
6423-
* 示例
6408+
支持平台EC600U/EC200U/EC600N/EC800N/BC25
64246409

6425-
```python
6426-
>>> def test(df):
6427-
... print('rtc test...',df)
6428-
...
6429-
...
6430-
...
6431-
>>>
6432-
>>> rtc.register_callback(test)
6433-
0
6434-
```
6435-
###### 设置RTC到期时间
64366410
rtc.set_alarm(data_e)
64376411
设置RTC到期时间,当到了到期时间就会调用注册的回调函数。
64386412
* 参数
@@ -6460,51 +6434,6 @@ rtc.set_alarm(data_e)
64606434
>>> rtc.set_alarm(data_e)
64616435
0
64626436
```
6463-
###### 启动/停止RTC定时器
6464-
rtc.enable_alarm(on_off)
6465-
只有在设置回调函数时才能启动定时器(BC25PA平台)
6466-
* 参数
6467-
| 参数 | 类型 | 说明 |
6468-
| ----------- | ---- | ------------------------------------------------------------ |
6469-
| on_off | int | 0 - 关闭RTC定时器. 1 - 启动RTC定时器. |
6470-
6471-
* 返回值
6472-
成功: 0
6473-
失败: -1
6474-
* 示例
6475-
```python
6476-
>>> rtc.enable_alarm(1)
6477-
0
6478-
```
6479-
6480-
6481-
6482-
###### 设置RTC alarm时间
6483-
6484-
支持平台EC600U/EC200U/EC600N/EC800N/BC25
6485-
6486-
> rtc.set_alarm([year, month, day, week, hour, minute, second, microsecond])
6487-
6488-
设置RTC alarm时间,参数week不参于设置,microsecond参数保留,暂未使用,默认是0
6489-
6490-
* 参数
6491-
6492-
| 参数 | 类型 | 说明 |
6493-
| ----------- | ---- | ------------------------------------- |
6494-
| year | int ||
6495-
| month | int | 月,范围1 ~ 12 |
6496-
| day | int | 日,范围1 ~ 31 |
6497-
| week | int | 星期,范围0 ~ 6,该参数不起作用,保留 |
6498-
| hour | int | 时,范围0 ~ 23 |
6499-
| minute | int | 分,范围0 ~ 59 |
6500-
| second | int | 秒,范围0 ~ 59 |
6501-
| microsecond | int | 微秒,保留参数,暂未使用,写0即可 |
6502-
6503-
* 返回值
6504-
6505-
设置成功返回整型值0,设置失败返回整型值-1
6506-
6507-
65086437

65096438
###### 注册RTC alarm回调
65106439

@@ -6529,6 +6458,7 @@ rtc.enable_alarm(on_off)
65296458
###### 开关RTC alarm功能
65306459

65316460
支持平台EC600U/EC200U/EC600N/EC800N/BC25
6461+
注意:BC25PA平台只有设置回调函数,才能启动定时器.
65326462

65336463
> rtc.enable_alarm(on_off)
65346464

0 commit comments

Comments
 (0)