Skip to content

Commit 534b706

Browse files
committed
update readme of powermcu
Signed-off-by: IotaHydrae <writeforever@foxmail.com>
1 parent 557a426 commit 534b706

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

software/power_mcu/README.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@
33
This project build firmware for "Power" part of Xenia Clock, but it can be also used
44
in other project,
55

6-
<h2>Setup</h2>
6+
<h2 align="center">Setup</h2>
77

8-
Requirements for developing
9-
-------------------------------
8+
<h2>Requirements for developing</h2>
109

1110
- VScode with PlatformIO extension
1211

13-
Building
14-
-------------------------------
12+
<h2 align="center">Building</h2>
1513

1614
1. Run `setup.sh` to prepare develop enviroment
1715
```
@@ -36,17 +34,25 @@ Remember check this target path in you $PATH
3634
| P55 | Power Enable |
3735
| P54 | ADC battery voltage |
3836

39-
<h2>I2C Protocol Command table</h2>
37+
<h2>I2C Protocol</h2>
38+
39+
<h3>Register Table</h3>
40+
41+
| Register | Address | Description |
42+
|----------|---------|------------------------------|
43+
| Clock | 0x00 | The runing clock of powermcu |
44+
45+
<h3>Command Table</h3>
4046

4147
The default i2c address of slave mode `0x49`, it could changed in `i2c-slave.c`
4248

43-
主机一次性发送arg0 ~ arg3 以及 crc8 校验码 一共5个字节,
49+
The host sends ARG0 ~ ARG3 and CRC8 check code a total of 5 bytes.
4450

45-
从机接收后,重新计算arg0 ~ arg3 的 crc8 值,与主机发出的比对,如果不一致,则认为传输过程受干扰,此命令无效。
51+
After receiving the machine, the CRC8 value of the ARG0 ~ ARG3 is re-calculated, and the comparison between the host is not consistent, if it is not consistent, it is considered to be interfered by the transmission process. This command is invalid.
4652

4753
| Command | byte0 : Address | byte1 : ID | byte2 : arg0 | byte3 : arg1 | CRC8 | Description |
4854
|-----------------------|------|------|------|------|------|-----------------------------------------------|
49-
| | | 无参命令 |
55+
| | | Non -parameter command |
5056
| Power OFF | 0x49 | 0x01 | 0x00 | 0x00 | 0x56 | 关闭对外供电 |
5157
| Sleep | 0x49 | 0x03 | 0x00 | 0x00 | 0x80 | 主机休眠,从机接管控制权 |
5258
| | | 带参命令 |
@@ -56,9 +62,21 @@ The default i2c address of slave mode `0x49`, it could changed in `i2c-slave.c`
5662
| Set Time | 0x49 | 0x06 | hour | minute | xxx | 设置从机的时间 |
5763
| Get Time | 0x49 | 0x07 | hour | minute | xxx | 读取从机的时间 |
5864

65+
<h4>0x01 : Power OFF</h4>
66+
67+
关闭对外部供电`VDD_5V` `VDD_3V3`,自身进入掉电模式
68+
69+
<h4>0x02 : Power OFF Alarm</h4>
70+
71+
<h4>0x03 : Sleep</h4>
72+
73+
<h4>0x04 : Sleep Alarm</h4>
74+
75+
5976
<h2>Key Behavior</h2>
6077

6178
| Action | Behavior | Description |
6279
| ---- | --- | --- |
6380
| Fast short press | 切换运行状态 | 在开机状态下
6481
| 2 seconds Long press | 开/关机 | 需在完全关机 或者 开机状态下 |
82+

0 commit comments

Comments
 (0)