Skip to content

Commit

Permalink
Merge branch 'update' of git@github.com:corumi-os/opendoc.git
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigh committed Jun 14, 2019
2 parents a7a83e4 + 4a24847 commit 12f35a6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 37 deletions.
5 changes: 4 additions & 1 deletion docs/classC/changelog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Changelog


## v1.0.4

### 2019.06.14

- 新增手动调整指针模式

### 2019.05.07

- 新增获取OTA信息接口
Expand Down
80 changes: 52 additions & 28 deletions docs/classC/classC_hand_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ CSW机芯支持两种指针校准方式
| | | | | | 运行模式[`0x03`] | 停针[`0x01`] |
| | | | | | 运行模式[`0x03`] | 快速正转[`0x02`] |
| | | | | | 运行模式[`0x03`] | 快速反转[`0x03`] |
| | | | | | 运行模式[`0x03`] | 手动调整[`0x04`] |

```mermaid
graph LR;
Expand Down Expand Up @@ -59,12 +60,13 @@ subgraph 参数
a53---a62(停针)
a53---a63(快速正转)
a53---a64(快速反转)
a53---a65(手动调整)
end
classDef main fill:#fff,stroke:#f00,stroke-width:4px;
class a0,a1,a2,a3,a4,a5,a51,a52,a53 main;
classDef sub fill:#ccc,stroke:#000
class a31,a32,a41,a42,a43,a44,a60,a61,a62,a63,a64 sub;
class a31,a32,a41,a42,a43,a44,a60,a61,a62,a63,a64,a65 sub;
```


Expand All @@ -73,10 +75,10 @@ class a31,a32,a41,a42,a43,a44,a60,a61,a62,a63,a64 sub;
- **调针接口索引**`02`
- **调针设置操作数**`02`
- **调针的参数**(对象):先获取手表的识别码,例如手表识别码是`0x03`(两针半),则`00`表示(大盘),`01`表示(小盘)。大盘代表手表中间的时分秒区域,小盘代表手表的小指针。
- **调针的参数**(属性):`01`(物理位置)`02`(逻辑位置)`03`(运行模式)。
- **调针的参数**(参数):如属性设置为运行模式,则`00`(正常走针)`01`(停针)`02`(快速正转)`03`(快速反转)`04`(调整指针位置)。
- **调针的参数**(属性):`01`(物理位置)`02`(逻辑位置)`03`(运行模式)。
- **调针的参数**(参数):如属性设置为运行模式,则`00`(正常走针)`01`(停针)`02`(快速正转)`03`(快速反转)`04`(手动调整)。

## 位置式校准指针
## 直接校准方式

基本步骤如下
1. 停针
Expand All @@ -98,7 +100,7 @@ class a31,a32,a41,a42,a43,a44,a60,a61,a62,a63,a64 sub;
2. **输入指针物理位置**`APP->:` `fc` `06` `02` `02` `00` `01` `92` `04`

通过协议文档中查询到识别码为`0x03`的大盘物理位置取值为12小时制秒数除以10。
由此算出取值为:(3x3600+15x60)/10=1170。 将1170换算成16进制为0x0492,按高位在前的规则代入协议中的参数。
由此算出取值为:`(3x3600+15x60)/10=1170`。 将1170换算成16进制为0x0492,按高位在前的规则代入协议中的参数。

> [!NOTE|labelVisibility:hidden|iconVisibility:hidden]
> 此处物理位置的取值请参照协议文档“[**设备信息列表**](docs/classC/devices.md)”进行设置。
Expand Down Expand Up @@ -131,7 +133,7 @@ class a31,a32,a41,a42,a43,a44,a60,a61,a62,a63,a64 sub;
2. **输入指针物理位置**`APP->:` `fc` `06` `02` `02` `00` `01` `24` `66`

通过协议文档中查询到识别码为0x01的大盘物理位置取值为`12`小时制秒数。
由此算出取值为:7x3600+15x60+48=26148。
由此算出取值为:`7x3600+15x60+48=26148`
将26148换算成16进制为0x6624。

> [!NOTE|labelVisibility:hidden|iconVisibility:hidden]
Expand All @@ -145,37 +147,59 @@ class a31,a32,a41,a42,a43,a44,a60,a61,a62,a63,a64 sub;
2. **输入指针物理位置**`APP->:` `fc` `06` `02` `02` `01` `01` `2E` `00` (0x002E=46)
3. **正常走时**`APP->:` `fc` `05` `02` `02` `01` `03` `00`

## 步进式校准指针
基本步骤如下
1. 停针
2. 使用协议接口指令操作使得指针指向`12`点位置
3. 正常走针
## 交互式校准方式
以下,以调整指针指向12点为例。

以手表识别码为`0x08(同轴异步两针带屏)`为例
#### **分针**
1. **停针**`APP->:` `fc` `05` `02` `02` `00` `03` `01`
2. **顺时针快转**`APP->:` `fc` `05` `02` `02` `00` `03` `02`
3. **逆时针快转**`APP->:` `fc` `05` `02` `02` `00` `03` `03`
4. **刻度调整模式**`APP->:` `fc` `05` `02` `02` `00` `03` `04`
#### 基本步骤如下

1. 进入手动调整模式(与其他模式相同,30秒自动回到正常模式,建议每10秒设置一次,以维持在手动调整模式)
2. 使用指令操作使得指针指向`12`点位置
3. 设置物理位置为`0`
4. 正常走针

#### 常用模式

- **顺时针单步**
- **手动调整模式**`APP->:` `fc` `05` `02` `02` `nn` `03` `04`
- **顺时针快转**`APP->:` `fc` `05` `02` `02` `nn` `03` `02`
- **逆时针快转**`APP->:` `fc` `05` `02` `02` `nn` `03` `03`

- **正常走时**`APP->:` `fc` `05` `02` `02` `nn` `03` `00`

1. `APP->:` `fc` `06` `02` `02` `00` `02` `01` `00`(设置逻辑位置为1)
2. `APP->:` `fc` `06` `02` `02` `00` `01` `00` `00`(设置物理位置为0)
3. `APP->:` `fc` `05` `02` `02` `00` `03` `04`


- **逆时针单步**
### 分步步骤

1. 进入并保持在`手动调整模式`
1. 设置物理位置为`0`
- 此步操作设置指针当前位置为0点,便于下一步操作
1. 根据用户输入设置逻辑位置
- 由于上一步设置了0点,指针会以上一步设置的0点运行到设置的逻辑位置
- 例:顺时针步进,设置逻辑位置为 `(x+1)%Max` 其中`x`为上一次设置的逻辑位置,`Max`为指针一圈的格数,`+1`则为步进一步,`+10`则步进十步
- 逆时针步进,同理,设置逻辑位置为 `(x+Max-1)%Max`
1. 用户确认当前位置为0点,则设置物理位置为0,并回到正常模式,指针校准完成

1. `APP->:` `fc` `06` `02` `02` `00` `02` `00` `00`(设置逻辑位置为0)
2. `APP->:` `fc` `06` `02` `02` `00` `01` `01` `00`(设置物理位置为1)
3. `APP->:` `fc` `05` `02` `02` `00` `03` `04`
### 场景模拟

以校准1号指针为例,在本例中,1号指针一圈为60格

- **恢复正常步进**`APP->:` `fc` `05` `02` `02` `00` `03` `00`
1. `APP->:` `fc` `05` `02` `02` `01` `03` `04` (每10秒发送一次)
- 进入并维持手动调整模式
1. `APP->:` `fc` `06` `02` `02` `01` `01` `00` `00`
- 设置物理位置为0
1. `APP->:` `fc` `06` `02` `02` `01` `02` `01` `00`
- [用户操作]顺时针步进1步`x=(x+1)%60`
1. `APP->:` `fc` `06` `02` `02` `01` `02` `02` `00`
- [用户操作]顺时针步进1步`x=(x+1)%60`
1. `APP->:` `fc` `06` `02` `02` `01` `02` `03` `00`
- [用户操作]顺时针步进1步`x=(x+1)%60`
1. `APP->:` `fc` `06` `02` `02` `01` `02` `08` `00`
- [用户操作]顺时针步进5步`x=(x+5)%60`
1. `APP->:` `fc` `06` `02` `02` `01` `02` `0D` `00`
- [用户操作]顺时针步进5步`x=(x+5)%60`
1. `APP->:` `fc` `06` `02` `02` `01` `02` `0C` `00`
- [用户操作]逆时针步进1步`x=(x+60-1)%60`
1. `APP->:` `fc` `06` `02` `02` `01` `01` `00` `00`
- [用户操作]确认当前位置为0点
1. `APP->:` `fc` `05` `02` `02` `01` `03` `00`
- 回到正常模式

#### **时针**
分针的调针和分针一样,只是将”调针的参数(对象)”改为时针
17 changes: 9 additions & 8 deletions docs/classC/hand.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

| 属性(1 byte) | 值(n bytes) |
| -------------------------------------------------------- | ----------- |
| 物理位置[`0x01`]<br>逻辑位置[`0x02`]<br>运行模式[`0x03`] | xxxxx |

| 运行模式 | Hex |
| -------- | ---- |
| 正常 | 0x00 |
| 停针 | 0x01 |
| 快速正转 | 0x02 |
| 快速反转 | 0x03 |
| 物理位置[`0x01`]<br>逻辑位置[`0x02`]<br>运行模式[`0x03`] | xxxxx |

| 运行模式 | Hex |
| ------------------ | ---- |
| 正常 | 0x00 |
| 停针 | 0x01 |
| 快速正转 | 0x02 |
| 快速反转 | 0x03 |
| 手动调整(`+3.5.1`) | 0x04 |



Expand Down

0 comments on commit 12f35a6

Please sign in to comment.