diff --git a/en/peripherals/machine.I2C.md b/en/peripherals/machine.I2C.md
index ecc0ffd0c3b683bd27da135e6457dde76a2ef606..591559e721d8b128342a7d32b76cd23f2dc0066a 100644
--- a/en/peripherals/machine.I2C.md
+++ b/en/peripherals/machine.I2C.md
@@ -78,14 +78,27 @@ This class is designed for the two-wire serial protocol for communication betwee
+
-**Example:**
+
+
Example:
+
+>>> from machine import I2C
+>>> # Creates an I2C object
+>>> i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE) # Returns an I2C object
+
+
-```python
+
+
Example:
+
>>> from machine import I2C
->>># Creates an I2C object
+>>> # Creates an I2C object
>>> i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE,0) # Returns an I2C object
-```
+
+
+
+
**I2C Pin Correspondences:**
diff --git a/en/peripherals/machine.SPI.md b/en/peripherals/machine.SPI.md
index e56269a52b73b56e0e4ca910028e22d1edf520ec..731b4317d4a1e86f03121ce32e819507472c14fd 100644
--- a/en/peripherals/machine.SPI.md
+++ b/en/peripherals/machine.SPI.md
@@ -8,7 +8,7 @@ This class provides bus protocol of serial peripheral interface (SPI) .
-
+
class machine.SPI(spi, mode, clk, [group])
Parameter:
@@ -23,6 +23,21 @@ This class provides bus protocol of serial peripheral interface (SPI) .
+
+
class machine.SPI(spi, mode, clk, [group])
+
+
Parameter:
+
+port
- Integer type. Channel selection: [0,1].
+
+mode
- SPI working mode.
Clock polarity CPOL: The pin level of clock signal SCLK when SPI is idle (0: low level; 1: high level)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+
+clk
- Clock frequency.
0
:100kHz
1
:200MHz
2
:300MHz
3
:400MHz
4
:500MHz
5
:600MHz
6
:700MHz
7
:812.5kHz
8
:1.625MHz
9
:3.25MHz
10
:6.5MHz
11
:13MHz
12
:26MHz
13
:52MHz
+
+The 52MHz clock frequency has high requirements for hardware.
+
+
+
class machine.SPI(spi, mode, clk, [group])
@@ -200,7 +215,7 @@ This class provides bus protocol of serial peripheral interface (SPI) .
-
+
SPI |
@@ -305,7 +320,7 @@ This class provides bus protocol of serial peripheral interface (SPI) .
-
+
SPI |
diff --git a/zh/peripherals/machine.I2C.md b/zh/peripherals/machine.I2C.md
index 0c8e2f6b654ae37838edf784dd56976ea8d695fa..dd563e8cbd6ad5b941e7152b939f324de0590f9c 100644
--- a/zh/peripherals/machine.I2C.md
+++ b/zh/peripherals/machine.I2C.md
@@ -79,14 +79,27 @@
+
-**示例:**
+
+
示例:
+
+>>> from machine import I2C
+>>> # 创建I2C对象
+>>> i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE) # 返回I2C对象
+
+
-```python
+
+
示例:
+
>>> from machine import I2C
>>> # 创建I2C对象
>>> i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE,0) # 返回I2C对象
-```
+
+
+
+
**I2C引脚对应关系:**
diff --git a/zh/peripherals/machine.SPI.md b/zh/peripherals/machine.SPI.md
index f376c0bab4e19cf925c0287dfcf2f1fd0963cecf..247df11c4f95657579f8b39e19ba99955651b389 100644
--- a/zh/peripherals/machine.SPI.md
+++ b/zh/peripherals/machine.SPI.md
@@ -8,14 +8,14 @@
-
+
class machine.SPI(spi, mode, clk, [group])
参数描述:
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:812.5kHz
1
:1.625MHz
2
:3.25MHz
3
:6.5MHz
4
:13MHz
5
:26MHz
6
:52MHz
@@ -23,6 +23,21 @@
+
+
class machine.SPI(spi, mode, clk, [group])
+
+
参数描述:
+
+spi
- 通道选择[0,1],int类型。
+
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+
+clk
- 时钟频率,说明如下:
0
:100kHz
1
:200kHz
2
:300MHz
3
:400MHz
4
:500MHz
5
:600MHz
6
:700MHz
7
:812.5kHz
8
:1.625MHz
9
:3.25MHz
10
:6.5MHz
11
:13MHz
12
:26MHz
13
:52MHz
+
+52MHz时钟频率对硬件要求较高。
+
+
+
class machine.SPI(spi, mode, clk, [group])
@@ -30,7 +45,7 @@
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:812.5kHz
1
:1.625MHz
2
:3.25MHz
3
:6.5MHz
4
:13MHz
@@ -46,7 +61,7 @@
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:812.5kHz
1
:1.625MHz
2
:3.25MHz
3
:6.5MHz
4
:13MHz
@@ -55,14 +70,14 @@
-
+
class machine.SPI(spi, mode, clk, [group])
参数描述:
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:781.25KHz
1
:1.5625MHz
2
:3.125MHz
3
:5MHz
4
:6.25MHz
5
:10MHz
6
:12.5MHz
7
:20MHz
8
:25MHz
9
:33.33MHz
@@ -76,7 +91,7 @@
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:781.25KHz
X
:XMHz (X in [1,39])
@@ -90,7 +105,7 @@
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:97.656kHz
1
:100kHz
2
:812.5kHz
3
:1.3MHz
4
:1.625MHz
5
:2MHz
6
:3.25MHz
7
:4.333MHz
8
:6.6MHz
9
:11.93MHz
10
:13MHz
11
:13.92MHz
12
:16.7MHz
13
:20.875MHz
14
:27.83MHz
@@ -104,7 +119,7 @@
spi
- 通道选择[0,1],int类型。
-mode
- I2C 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
+mode
- SPI 的工作模式,int类型,说明如下:
时钟极性CPOL:即SPI空闲时,时钟信号SCLK的电平(0:空闲时低电平; 1:空闲时高电平)
0
:CPOL=0, CPHA=0
1
:CPOL=0, CPHA=1
2
:CPOL=1, CPHA=0
3
:CPOL=1, CPHA=1
clk
- 时钟频率,说明如下:
0
:500kHz
1
:1MHz
2
:5MHz
3
:10MHz
4
:20MHz
@@ -210,7 +225,7 @@
-
+
SPI通道 |
@@ -315,7 +330,7 @@
-