From 509080a87d075b909e5b896fbb017eff67c299b8 Mon Sep 17 00:00:00 2001
From: Tangxiulin <11016272+ha-ha-earl@user.noreply.gitee.com>
Date: Tue, 19 Aug 2025 19:17:36 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sony=E7=9A=84bsp=E9=85=8D?=
=?UTF-8?q?=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
en/peripherals/machine.I2C.md | 56 +++++++++++++++++++++++++++++++++-
en/peripherals/machine.Pin.md | 9 ++++++
en/peripherals/machine.SPI.md | 36 ++++++++++++++++++++++
en/peripherals/machine.UART.md | 38 +++++++++++++++++++++++
en/peripherals/misc.ADC.md | 39 +++++++++++++++++++++++
en/peripherals/misc.PWM.md | 8 +++--
zh/peripherals/machine.I2C.md | 53 +++++++++++++++++++++++++++++++-
zh/peripherals/machine.Pin.md | 9 ++++++
zh/peripherals/machine.SPI.md | 35 +++++++++++++++++++++
zh/peripherals/machine.UART.md | 40 +++++++++++++++++++++++-
zh/peripherals/misc.ADC.md | 38 +++++++++++++++++++++++
zh/peripherals/misc.PWM.md | 7 +++--
12 files changed, 359 insertions(+), 9 deletions(-)
diff --git a/en/peripherals/machine.I2C.md b/en/peripherals/machine.I2C.md
index 8df3ab7..a8f404e 100644
--- a/en/peripherals/machine.I2C.md
+++ b/en/peripherals/machine.I2C.md
@@ -89,11 +89,24 @@ This class is designed for the two-wire serial protocol for communication betwee
+
+
+
class machine.I2C(I2Cn, MODE)
+
+
Parameter:
+
+I2Cn
- Integer type. I2C channel index number.
I2C0
: 0
- Channel 0
I2C1
: 1
- Channel 1
I2C2
: 2
- Channel 2
+
+MODE
- Integer type. I2C working mode.
STANDARD_MODE
: 0
- Standard mode
FAST_MODE
:1
- Fast mode
+
+
+
+
-
+
Example:
>>> from machine import I2C
@@ -675,6 +688,23 @@ This class is designed for the two-wire serial protocol for communication betwee
+
+
+
+ I2C |
+ SCL |
+ SDA |
+
+
+
+
+ I2C0 |
+ pin40 |
+ pin41 |
+
+
+
+
## Methods
@@ -1376,4 +1406,28 @@ if __name__ == '__main__':
+
+
+
+
+ Constant |
+ Description |
+
+
+
+
+ I2C.I2C0 |
+ I2C passage index number: 0 |
+
+
+ I2C.STANDARD_MODE |
+ Standard mode |
+
+
+ I2C.FAST_MODE |
+ Fast mode |
+
+
+
+
\ No newline at end of file
diff --git a/en/peripherals/machine.Pin.md b/en/peripherals/machine.Pin.md
index 652f01e..af4e87e 100644
--- a/en/peripherals/machine.Pin.md
+++ b/en/peripherals/machine.Pin.md
@@ -3567,8 +3567,17 @@ class machine.Pin(GPIOn, direction, pullMode, level)
Note:
1.Pin37-GPIO11,Pin38-GPIO12,Pin39-GPIO13,Module that support GNSS function do not enable the multiplexing function of this pin and it need to be left open.
+ 2.When using the (U)SIM2 function, Pin1, Pin2 and Pin4 can no longer be used as GPIOs.
+
+
+
+Note:
+ 1.There is a hardware conflict between GPIO27-Pin53, GPIO28-Pin52, GPIO29-Pin51 and Pin145 to Pin147. If the pins Pin145 to Pin147 of the (U)SIM2 interface are used, then pins Pin51 to Pin53 cannot be used as GPIO.
+
+
+
diff --git a/en/peripherals/machine.SPI.md b/en/peripherals/machine.SPI.md
index 13de26d..ec6d79c 100644
--- a/en/peripherals/machine.SPI.md
+++ b/en/peripherals/machine.SPI.md
@@ -129,9 +129,23 @@ This class provides bus protocol of serial peripheral interface (SPI) .
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
:500kHz
1
:1MHz
2
:5MHz
3
:10MHz
4
:20MHz
+
+
+
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
:500kHz
1~30
:(1~30)*1MHz
+
+
+
@@ -908,6 +922,28 @@ This class provides bus protocol of serial peripheral interface (SPI) .
+
+
+
+
+ SPI |
+ CS |
+ CLK |
+ MOSI |
+ MISO |
+
+
+
+
+ spi0 |
+ pin86 |
+ pin85 |
+ pin88 |
+ pin87 |
+
+
+
+
## Methods
diff --git a/en/peripherals/machine.UART.md b/en/peripherals/machine.UART.md
index bec8ed7..45bbc27 100644
--- a/en/peripherals/machine.UART.md
+++ b/en/peripherals/machine.UART.md
@@ -87,6 +87,23 @@ This class transmits data through the UART.
+
+
+
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
+
+
Parametric Description:
+
+UARTn
- UART number, int type, UARTn description is as follows:
UART0
- DEBUG PORT
UART1
- BT PORT
UART2
- MAIN PORT
UART3
- USB CDC PORT
+
+baudratec
- Baud rate, int type, supports common baud rates such as3600
、7200
、28800
、33600
、1000000
、4468750
.
+databits
- Data bits [5-8], int type.
+parity
- Parity (0-None, 1-even, 2-odd), int type.
+stopbits
- Stop bit [1 ~ 2], int type.
+flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
+
+
+
+
**UART Pin Correspondences:**
@@ -1072,6 +1089,27 @@ This class transmits data through the UART.
+
+
+
+ UART number |
+ TX pin |
+ RX pin |
+ RTS pin |
+ CTS pin |
+
+
+
+
+ UART2 |
+ pin35 |
+ pin34 |
+ NULL |
+ NULL |
+
+
+
+
diff --git a/en/peripherals/misc.ADC.md b/en/peripherals/misc.ADC.md
index 1534d2e..f8cd3b1 100644
--- a/en/peripherals/misc.ADC.md
+++ b/en/peripherals/misc.ADC.md
@@ -530,6 +530,26 @@ If successful, a specified channel voltage value is returned.
+
+
+
+ ADC number |
+ Pin correspondence |
+
+
+
+
+ ADC0 |
+ Pin number24 |
+
+
+ ADC1 |
+ Pin number2 |
+
+
+
+
+
### ADC.close
@@ -1018,4 +1038,23 @@ ADC.close()
+
+
+
+ Constant |
+ Description |
+
+
+
+
+ ADC.ADC0 |
+ ADC channel 0 |
+
+
+ ADC.ADC1 |
+ ADC channel 1 |
+
+
+
+
\ No newline at end of file
diff --git a/en/peripherals/misc.PWM.md b/en/peripherals/misc.PWM.md
index a61f08a..fe74381 100644
--- a/en/peripherals/misc.PWM.md
+++ b/en/peripherals/misc.PWM.md
@@ -74,6 +74,8 @@ The corresponding pins of EG915N module for PWM0-PWM3 are as follow:
PWM0
The corresponding pins of EC800K module for PWM0-PWM3 are as follow:
PWM1 – pin78
PWM2 – pin83
+The corresponding pins of BG950S module for PWM0-PWM2 are as follow:
PWM0 – pin66
PWM1 – pin38
PWM2 – pin30
+
## Methods
### `PWM.open`
@@ -163,7 +165,7 @@ if __name__ == '__main__':
| Constant | Description | Module |
| -------- | ----------- | ------------------------------------------------------------ |
-| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M/EG912N/EG912U/EG915N |
-| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EG915N/EC800K |
-| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EG915N/EC800K |
+| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M/EG912N/EG912U/EG915N/BG950S |
+| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EG915N/EC800K/BG950S |
+| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EG915N/EC800K/BG950S |
| PWM.PWM3 | PWM3 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EG915N |
\ No newline at end of file
diff --git a/zh/peripherals/machine.I2C.md b/zh/peripherals/machine.I2C.md
index 42fa83b..4f75353 100644
--- a/zh/peripherals/machine.I2C.md
+++ b/zh/peripherals/machine.I2C.md
@@ -91,8 +91,20 @@
+
+
class machine.I2C(I2Cn, MODE)
+
+
参数描述:
+
+
+
-
+
示例:
>>> from machine import I2C
>>> # 创建I2C对象
@@ -673,6 +685,23 @@
+
+
+
+ I2C编号 |
+ SCL引脚 |
+ SDA引脚 |
+
+
+
+
+ I2C0 |
+ 引脚40 |
+ 引脚41 |
+
+
+
+
@@ -1361,6 +1390,28 @@ if __name__ == '__main__':
+
+
+
+ 常量 |
+ 说明 |
+
+
+
+
+ I2C.I2C0 |
+ I2C通路索引号: 0 |
+
+
+ I2C.STANDARD_MODE |
+ 标准模式 |
+
+
+ I2C.FAST_MODE |
+ 快速模式 |
+
+
+
\ No newline at end of file
diff --git a/zh/peripherals/machine.Pin.md b/zh/peripherals/machine.Pin.md
index b116aee..754f6ca 100644
--- a/zh/peripherals/machine.Pin.md
+++ b/zh/peripherals/machine.Pin.md
@@ -3567,8 +3567,17 @@ class machine.Pin(GPIOn, direction, pullMode, level)
注:
1.Pin37-GPIO11,Pin38-GPIO12,Pin39-GPIO13,支持GNSS的模块不会启用此引脚的复用功能,因此该引脚需要保持处于断开状态。
+ 2.Pin1、Pin2、Pin4在使用(U)SIM2功能时,不能再作为GPIO使用。
+
+
+
+注:
+ 1.GPIO27-Pin53、GPIO28-Pin52、GPIO29-Pin51与Pin145~Pin147有硬件冲突。如使用(U)SIM2接口的Pin145~Pin147引脚,则引脚Pin51~Pin53不能用作GPIO。
+
+
+
## 方法
diff --git a/zh/peripherals/machine.SPI.md b/zh/peripherals/machine.SPI.md
index e20d303..85b5f20 100644
--- a/zh/peripherals/machine.SPI.md
+++ b/zh/peripherals/machine.SPI.md
@@ -141,6 +141,21 @@
+
+
+
class machine.SPI(spi, mode, clk)
+
+
参数描述:
+
+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
:500kHz
1~30
:(1~30)*1MHz
+
+
+
+
@@ -919,6 +934,26 @@
+
+
+
+ SPI通道 |
+ CS引脚 |
+ CLK引脚 |
+ MOSI引脚 |
+ MISO引脚 |
+
+
+
+
+ spi0 |
+ 引脚86 |
+ 引脚85 |
+ 引脚88 |
+ 引脚87 |
+
+
+
diff --git a/zh/peripherals/machine.UART.md b/zh/peripherals/machine.UART.md
index 44b3034..2745d98 100644
--- a/zh/peripherals/machine.UART.md
+++ b/zh/peripherals/machine.UART.md
@@ -119,6 +119,23 @@
+
+
+
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
+
+
参数描述:
+
+UARTn
- UART编号,int类型,UARTn说明如下:
UART0
- DEBUG PORT
UART1
- BT PORT
UART2
- MAIN PORT
UART3
- USB CDC PORT
+
+baudratec
- 波特率,int类型,支持常用波特率,如3600
、7200
、28800
、33600
、1000000
、4468750
等;
+databits
- 数据位[5 ~ 8],int类型。
+parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
+stopbits
- 停止位[1 ~ 2],int类型。
+flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
+
+
+
+
**UART引脚对应关系 :**
@@ -880,7 +897,7 @@
uart1(group = 2) |
- 引脚号27 |
+ 引脚号29 |
引脚号28 |
NULL |
NULL |
@@ -1104,6 +1121,27 @@
+
+
+
+ uart编号 |
+ TX引脚 |
+ RX引脚 |
+ RTS引脚 |
+ CTS引脚 |
+
+
+
+
+ uart2 |
+ 引脚号35 |
+ 引脚号34 |
+ NULL |
+ NULL |
+
+
+
+
diff --git a/zh/peripherals/misc.ADC.md b/zh/peripherals/misc.ADC.md
index 054772c..beef8f3 100644
--- a/zh/peripherals/misc.ADC.md
+++ b/zh/peripherals/misc.ADC.md
@@ -536,6 +536,25 @@ ADC.close()
+
+
+
+ ADC编号 |
+ 引脚对应 |
+
+
+
+
+ ADC0 |
+ 引脚号24 |
+
+
+ ADC1 |
+ 引脚号2 |
+
+
+
+
## 常量
@@ -1012,4 +1031,23 @@ ADC.close()
+
+
+
+ 常量 |
+ 说明 |
+
+
+
+
+ ADC.ADC0 |
+ ADC通道0 |
+
+
+ ADC.ADC1 |
+ ADC通道1 |
+
+
+
+
\ No newline at end of file
diff --git a/zh/peripherals/misc.PWM.md b/zh/peripherals/misc.PWM.md
index 4f8bf80..bf8a3c2 100644
--- a/zh/peripherals/misc.PWM.md
+++ b/zh/peripherals/misc.PWM.md
@@ -84,6 +84,7 @@ pwm1 = PWM_V2(PWM_V2.PWM1, 100.0, 50)#频率100Hz,占空比50%
| EC800K/EG800K | PWM1 – 引脚号78
PWM2 – 引脚号83 |
| FCM360W | PWM0 – 引脚号13
PWM1 – 引脚号14
PWM2 – 引脚号15
PWM3 – 引脚号16
PWM4 – 引脚号8
PWM5 – 引脚号7 |
| EG915N | PWM0 – 引脚号25
PWM1 – 引脚号26
PWM2 – 引脚号104
PWM3 – 引脚号18 |
+| BG950S | PWM0 – 引脚号66
PWM1 – 引脚号38
PWM2 – 引脚号30 |
## 方法
@@ -177,9 +178,9 @@ if __name__ == '__main__':
| 常量 | 说明 | 使用平台 |
| --------- | ----- | ------------------------------------------------------------ |
-| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M/
EG912N/BG95/EC600E/EC800E/EC600G/EC800G/EC200A/EG912U/EC600K/FCM360W/EG915N |
-| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/BG95/EC600E/EC800E/
EC600G/EC800G/EC200A/EC800K/FCM360W/EG915N/ |
-| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EC600E/EC800E/EC600G/
EC800G/EC200A/EC600K/FCM360W/EG915N/EC800K|
+| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M/
EG912N/BG95/EC600E/EC800E/EC600G/EC800G/EC200A/EG912U/EC600K/FCM360W/EG915N/BG950S |
+| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/BG95/EC600E/EC800E/
EC600G/EC800G/EC200A/EC800K/FCM360W/EG915N/BG950S |
+| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EC600E/EC800E/EC600G/
EC800G/EC200A/EC600K/FCM360W/EG915N/EC800K/BG950S|
| PWM.PWM3 | PWM3 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M/EG912N/EC600E/EC800E/EC600G/
EC800G/EC600K/FCM360W/EG915N |
| PWM.PWM4 | PWM4 | EC600E/EC800E/EC800G/FCM360W |
| PWM.PWM5 | PWM5 | EC600E/EC800E/EC800G/FCM360W |
--
Gitee
From 3d12f172b920e8edf6846be77bf3ee979207b07e Mon Sep 17 00:00:00 2001
From: Tangxiulin <11016272+ha-ha-earl@user.noreply.gitee.com>
Date: Tue, 19 Aug 2025 19:56:24 +0800
Subject: [PATCH 2/2] =?UTF-8?q?4.=E5=88=A0=E9=99=A4ADC=E4=B8=ADEG915N?=
=?UTF-8?q?=E5=A4=9A=E4=BD=99=E7=9A=84=E6=8D=A2=E8=A1=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
en/peripherals/misc.ADC.md | 4 ----
zh/peripherals/misc.ADC.md | 3 ---
2 files changed, 7 deletions(-)
diff --git a/en/peripherals/misc.ADC.md b/en/peripherals/misc.ADC.md
index f8cd3b1..37f20ce 100644
--- a/en/peripherals/misc.ADC.md
+++ b/en/peripherals/misc.ADC.md
@@ -486,7 +486,6 @@ If successful, a specified channel voltage value is returned.
ADC0 |
Pin number2 |
-
@@ -506,7 +505,6 @@ If successful, a specified channel voltage value is returned.
ADC1 |
Pin number2 |
-
@@ -526,7 +524,6 @@ If successful, a specified channel voltage value is returned.
ADC1 |
Pin number96 |
-
@@ -546,7 +543,6 @@ If successful, a specified channel voltage value is returned.
ADC1 |
Pin number2 |
-
diff --git a/zh/peripherals/misc.ADC.md b/zh/peripherals/misc.ADC.md
index beef8f3..910bae0 100644
--- a/zh/peripherals/misc.ADC.md
+++ b/zh/peripherals/misc.ADC.md
@@ -492,7 +492,6 @@ ADC.close()
ADC0 |
引脚号2 |
-
@@ -512,7 +511,6 @@ ADC.close()
ADC1 |
引脚号2 |
-
@@ -532,7 +530,6 @@ ADC.close()
ADC1 |
引脚号96 |
-
--
Gitee