From 8cb2f2c84cd27ae6771e24985a1fca1ea6ed2886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhardt=20Peng=28=E5=BD=AD=E6=88=90=E5=90=8D=29?= Date: Mon, 21 Nov 2022 13:06:22 +0800 Subject: [PATCH 1/6] up-to-date EG915U BSP --- en-us/api/QuecPythonClasslib.md | 107 +++++++++++++++-------------- zh-cn/api/QuecPythonClasslib.md | 117 ++++++++++++++++---------------- 2 files changed, 115 insertions(+), 109 deletions(-) diff --git a/en-us/api/QuecPythonClasslib.md b/en-us/api/QuecPythonClasslib.md index 85b2f1d..39ec6e0 100644 --- a/en-us/api/QuecPythonClasslib.md +++ b/en-us/api/QuecPythonClasslib.md @@ -4721,7 +4721,7 @@ Note: The BC25PA platform does not support this module function. | Constent | Description | Usage Platform | | -------- | ----------- | -------------------------------------- | -| PWM.PWM0 | PWM0 | EC600S/EC600N/EC100Y/EC600U/EC200U/EC800N/EC600M | +| PWM.PWM0 | PWM0 | EC600S/EC600N/EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U | | PWM.PWM1 | PWM1 | EC600S/EC600N/EC100Y/EC800N/EC600M | | PWM.PWM2 | PWM2 | EC600S/EC600N/EC100Y/EC800N/EC600M | | PWM.PWM3 | PWM3 | EC600S/EC600N/EC100Y/EC800N/EC600M | @@ -4738,8 +4738,8 @@ Note: The BC25PA platform does not support this module function. | Parameter | Type | Description | | --------- | ---- | ------------------------------------------------------------ | -| PWMn | int | PWM Number
Note: EC100Y-CN module supports PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 19
PWM1 – Pin No. 18
PWM2 – Pin No. 23
PWM3 – Pin No. 22
Note: EC600S-CN/EC600N-CN modules support PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 52
PWM1 –Pin No. 53
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note:EC800N modules support PWM0-PWM3,and the corresponding pins are as follows:
PWM0 – Pin No. 79
PWM1 – Pin No. 78
PWM2 – Pin No. 16
PWM3 – Pin No. 49
Note: EC200U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 135
Note: EC600U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 70
Note: EC600M series module supports PWM0-PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 57
PWM1 – Pin No. 56
PWM2 – Pin No. 70
PWM3 – Pin No. 69 | -| ABOVE_xx | int | EC600SCN/EC600N/EC800N modules:
PWM.ABOVE_MS Range of MS level: (0,1023]
PWM.ABOVE_1US Range of US level: (0,157]
PWM.ABOVE_10US Range of US level: (1,1575]
PWM.ABOVE_BELOW_US Range of NS level: (0,1024]
EC200U/EC600U modules:
PWM.ABOVE_MS Range of MS level: (0,10]
PWM.ABOVE_1US Range of US level: (0,10000]
PWM.ABOVE_10US Range of US level: (1,10000]
PWM.ABOVE_BELOW_US Range of NS level: [100,65535] | +| PWMn | int | PWM Number
Note: EC100Y-CN module supports PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 19
PWM1 – Pin No. 18
PWM2 – Pin No. 23
PWM3 – Pin No. 22
Note: EC600S-CN/EC600N-CN modules support PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 52
PWM1 –Pin No. 53
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note:EC800N modules support PWM0-PWM3,and the corresponding pins are as follows:
PWM0 – Pin No. 79
PWM1 – Pin No. 78
PWM2 – Pin No. 16
PWM3 – Pin No. 49
Note: EC200U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 135
Note: EC600U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 70
Note: EC600M series module supports PWM0-PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 57
PWM1 – Pin No. 56
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note: EG915U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 20 | +| ABOVE_xx | int | EC600SCN/EC600N/EC800N modules:
PWM.ABOVE_MS Range of MS level: (0,1023]
PWM.ABOVE_1US Range of US level: (0,157]
PWM.ABOVE_10US Range of US level: (1,1575]
PWM.ABOVE_BELOW_US Range of NS level: (0,1024]
EC200U/EC600U/EG915U modules:
PWM.ABOVE_MS Range of MS level: (0,10]
PWM.ABOVE_1US Range of US level: (0,10000]
PWM.ABOVE_10US Range of US level: (1,10000]
PWM.ABOVE_BELOW_US Range of NS level: [100,65535] | | highTime | int | In MS level, the unit is ms
In US level, the unit is us
In NS level: it needs to be calculated by the user
Frequency = 13Mhz / cycleTime
Duty cycle = highTime/ cycleTime | | cycleTime | int | In MS level, the unit is ms
In US level, the unit is us
In NS level: it needs to be calculated by the user
Frequency = 13Mhz / cycleTime
Duty cycle = highTime/ cycleTime | @@ -4834,8 +4834,8 @@ if __name__ == '__main__': | Constant | Description | Usage Platform | | -------- | ------------- | ------------------------------------------------------------ | -| ADC.ADC0 | ADC Channel 0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/BG95M3/EC200A/EC600M | -| ADC.ADC1 | ADC Channel 1 | EC600U/EC200U/EC200A/EC600M | +| ADC.ADC0 | ADC Channel 0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/BG95M3/EC200A/EC600M/EG915U | +| ADC.ADC1 | ADC Channel 1 | EC600U/EC200U/EC200A/EC600M/EG915U | | ADC.ADC2 | ADC Channel 2 | EC600U/EC200U | | ADC.ADC3 | ADC Channel 3 | EC600U | @@ -4882,7 +4882,7 @@ It reads the voltage value of the specified channel. Unit: mV. | Parameter | Type | Description | | --------- | ---- | ------------------------------------------------------------ | -| ADCn | int | ADC Channel
The corresponding pins for EC100Y-CN module are as follows:
ADC0 – Pin No. 39
ADC1 – Pin No. 81
The corresponding pins for EC600S-CN/EC600N_CN modules are as follows
ADC0 – Pin No. 19
The corresponding pins for EC600M modules are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
The corresponding pins for EC800N/BC25PA series module are as follows
ADC0 – Pin No. 9
The corresponding pins for EC600U series module are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
ADC2 – Pin No. 113
ADC3 – Pin No. 114
The corresponding pins for EC200U series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
ADC2 – Pin No.43
The corresponding pins for EC200A series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
The corresponding pins for BG95M3 series module are as follows
ADC0 – Pin No. 24 | +| ADCn | int | ADC Channel
The corresponding pins for EC100Y-CN module are as follows:
ADC0 – Pin No. 39
ADC1 – Pin No. 81
The corresponding pins for EC600S-CN/EC600N_CN modules are as follows
ADC0 – Pin No. 19
The corresponding pins for EC600M modules are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
The corresponding pins for EC800N/BC25PA series module are as follows
ADC0 – Pin No. 9
The corresponding pins for EC600U series module are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
ADC2 – Pin No. 113
ADC3 – Pin No. 114
The corresponding pins for EC200U series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
ADC2 – Pin No.43
The corresponding pins for EC200A series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
The corresponding pins for BG95M3 series module are as follows
ADC0 – Pin No. 24
The corresponding pins for EG915U series module are as follows
ADC0 – Pin No. 24
ADC1 – Pin No. 2 | * Return Value @@ -5224,47 +5224,47 @@ Function: GPIO read and write operations. | Constant | Applicable Platform | Description | | ---------------- | ------------------------------------------------------------ | -------------- | -| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO1 | -| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO2 | -| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO3 | -| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO4 | -| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO5 | -| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO6 | -| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO7 | -| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO8 | -| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO9 | -| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO10 | -| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO11 | -| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO12 | -| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO13 | -| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO14 | -| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO15 | -| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO16 | -| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M | GPIO17 | -| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M | GPIO18 | -| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M | GPIO19 | -| Pin.GPIO20 | EC600S / EC600N /EC600U/EC200U/EC200A/ EC800N / BG95M3/EC600M | GPIO20 | -| Pin.GPIO21 | EC600S / EC600N /EC600U/EC200U/ EC800N / BG95M3/EC600M | GPIO21 | -| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO22 | -| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO23 | -| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO24 | -| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO25 | -| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO26 | -| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO27 | -| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO28 | -| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO29 | -| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO30 | -| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO31 | -| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO32 | -| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO33 | -| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO34 | -| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO35 | -| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO36 | -| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO37 | -| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO38 | -| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO39 | -| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO40 | -| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO41 | +| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO1 | +| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO2 | +| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO3 | +| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO4 | +| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO5 | +| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO6 | +| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO7 | +| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO8 | +| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO9 | +| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO10 | +| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO11 | +| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO12 | +| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO13 | +| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO14 | +| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO15 | +| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO16 | +| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO17 | +| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO18 | +| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U | GPIO19 | +| Pin.GPIO20 | EC600S / EC600N /EC600U/EC200U/EC200A/ EC800N / BG95M3/EC600M/EG915U | GPIO20 | +| Pin.GPIO21 | EC600S / EC600N /EC600U/EC200U/ EC800N / BG95M3/EC600M/EG915U | GPIO21 | +| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO22 | +| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO23 | +| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO24 | +| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO25 | +| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO26 | +| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO27 | +| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO28 | +| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO29 | +| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO30 | +| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO31 | +| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO32 | +| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO33 | +| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO34 | +| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO35 | +| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO36 | +| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO37 | +| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO38 | +| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO39 | +| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO40 | +| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO41 | | Pin.GPIO42 | EC600U / EC200U/EC600M | GPIO42 | | Pin.GPIO43 | EC600U / EC200U/EC200A/EC600M | GPIO43 | | Pin.GPIO44 | EC600U / EC200U/EC200A/EC600M | GPIO44 | @@ -5289,7 +5289,7 @@ The GPIO pin numbers provided in this document correspond to the external pin nu | Parameter | Type | Description | | :-------- | :--- | ------------------------------------------------------------ | -| GPIOn | int | Pin Number
The corresponding pins of EC100Y-CN module are as follows (pin number is external pin number):
GPIO1 – Pin No. 22
GPIO2 – Pin No. 23
GPIO3 – Pin No. 38
GPIO4 – Pin No. 53
GPIO5 – Pin No. 54
GPIO6 – Pin No. 104
GPIO7 – Pin No. 105
GPIO8 – Pin No. 106
GPIO9 – Pin No. 107
GPIO10 – Pin No. 178
GPIO11 – Pin No. 195
GPIO12 – Pin No. 196
GPIO13 – Pin No. 197
GPIO14 – Pin No. 198
GPIO15 – Pin No. 199
GPIO16 – Pin No. 203
GPIO17 – Pin No. 204
GPIO18 – Pin No. 214
GPIO19 – Pin No. 215
The corresponding pins of EC600S-CN/EC600N-CN modules are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
The corresponding pins of EC600M series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
GPIO42 – Pin No. 109
GPIO43 – Pin No. 110
GPIO44 – Pin No. 112
GPIO45 – Pin No. 111
The corresponding pins of EC600U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 61(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 58(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 34(cannot be gpio function at the same time as GPIO41)
GPIO4 – Pin No. 60(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 69(cannot be gpio function at the same time as GPIO35)
GPIO6 – Pin No. 70(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 123(cannot be gpio function at the same time as GPIO43)
GPIO8 – Pin No. 118
GPIO9 – Pin No. 9
GPIO10 – Pin No. 1(cannot be gpio function at the same time as GPIO37)
GPIO11 – Pin No. 4(cannot be gpio function at the same time as GPIO38)
GPIO12 – Pin No. 3(cannot be gpio function at the same time as GPIO39)
GPIO13 – Pin No. 2(cannot be gpio function at the same time as GPIO40)
GPIO14 – Pin No. 54
GPIO15 – Pin No. 57
GPIO16 – Pin No. 56
GPIO17 – Pin No. 12
GPIO18 – Pin No. 33(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 124(cannot be gpio function at the same time as GPIO44)
GPIO20 – Pin No. 122(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 121(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 48
GPIO23 – Pin No. 39
GPIO24 – Pin No. 40
GPIO25 – Pin No. 49
GPIO26 – Pin No. 50
GPIO27 – Pin No. 53
GPIO28 – Pin No. 52
GPIO29 – Pin No. 51
GPIO30 – Pin No. 59(cannot be gpio function at the same time as GPIO33)
GPIO31 – Pin No. 66(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 63(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 67(cannot be gpio function at the same time as GPIO30)
GPIO34 – Pin No. 65(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 137(cannot be gpio function at the same time as GPIO5)
GPIO36 – Pin No. 62(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 98(cannot be gpio function at the same time as GPIO10)
GPIO38 – Pin No. 95(cannot be gpio function at the same time as GPIO11)
GPIO39 – Pin No. 119(cannot be gpio function at the same time as GPIO12)
GPIO40 – Pin No. 100(cannot be gpio function at the same time as GPIO13)
GPIO41 – Pin No. 120(cannot be gpio function at the same time as GPIO3)
GPIO42 – Pin No. 16(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 10(cannot be gpio function at the same time as GPIO7)
GPIO44 – Pin No. 14(cannot be gpio function at the same time as GPIO19)
GPIO45 – Pin No. 15(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 13(cannot be gpio function at the same time as GPIO21)
The corresponding pins of EC200U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 26(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 24(cannot be gpio function at the same time as GPIO33)
GPIO4 – Pin No. 25(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 13(cannot be gpio function at the same time as GPIO17)
GPIO6 – Pin No. 135(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 136(cannot be gpio function at the same time as GPIO44)
GPIO8 – Pin No. 133
GPIO9 – Pin No. 3(cannot be gpio function at the same time as GPIO37)
GPIO10 – Pin No. 40(cannot be gpio function at the same time as GPIO38)
GPIO11 – Pin No. 37(cannot be gpio function at the same time as GPIO39)
GPIO12 – Pin No. 38(cannot be gpio function at the same time as GPIO40)
GPIO13 – Pin No. 39(cannot be gpio function at the same time as GPIO41)
GPIO14 – Pin No. 5
GPIO15 – Pin No. 141
GPIO16 – Pin No. 142
GPIO17 – Pin No. 121(cannot be gpio function at the same time as GPIO5)
GPIO18 – Pin No. 65(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 64(cannot be gpio function at the same time as GPIO43)
GPIO20 – Pin No. 139(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 126(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 127(cannot be gpio function at the same time as GPIO47)
GPIO23 – Pin No. 33
GPIO24 – Pin No. 31
GPIO25 – Pin No. 30
GPIO26 – Pin No. 29
GPIO27 – Pin No. 28
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO31 – Pin No. 125(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 124(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 123(cannot be gpio function at the same time as GPIO3)
GPIO34 – Pin No. 122(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 134(cannot be gpio function at the same time as GPIO9)
GPIO38 – Pin No. 132(cannot be gpio function at the same time as GPIO10)
GPIO39 – Pin No. 131(cannot be gpio function at the same time as GPIO11)
GPIO40 – Pin No. 130(cannot be gpio function at the same time as GPIO12)
GPIO41 – Pin No. 129(cannot be gpio function at the same time as GPIO13)
GPIO42 – Pin No. 61(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 62(cannot be gpio function at the same time as GPIO19)
GPIO44 – Pin No. 63(cannot be gpio function at the same time as GPIO7)
GPIO45 – Pin No. 66(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 6(cannot be gpio function at the same time as GPIO21)
GPIO47 – Pin No. 23(cannot be gpio function at the same time as GPIO22)
The corresponding pins of EC200A series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27
GPIO2 – Pin No. 26
GPIO3 – Pin No.24
GPIO4 – Pin No.25
GPIO5 – Pin No.5
GPIO6 – Pin No.135
GPIO7 – Pin No.136
GPIO9 – Pin No. 3
GPIO10 – Pin No. 40
GPIO11 – Pin No. 37
GPIO12 – Pin No. 38
GPIO13 – Pin No. 39
GPIO18 – Pin No. 65
GPIO19 – Pin No. 64
GPIO20 – Pin No. 139
GPIO22 – Pin No. 127
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119
GPIO43 – Pin No. 62
GPIO44 – Pin No. 63
GPIO45 – Pin No. 66
GPIO46 – Pin No. 6
GPIO47 – Pin No. 23
The corresponding pins of EC800NCN series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 30
GPIO2 – Pin No. 31
GPIO3 – Pin No. 32
GPIO4 – Pin No. 33
GPIO5 – Pin No. 49
GPIO6 – Pin No. 50
GPIO7 – Pin No. 51
GPIO8 – Pin No. 52
GPIO9 – Pin No. 53
GPIO10 – Pin No. 54
GPIO11 – Pin No. 55
GPIO12 – Pin No. 56
GPIO13 – Pin No. 57
GPIO14 – Pin No. 58
GPIO15 – Pin No. 80
GPIO16 – Pin No. 81
GPIO17 – Pin No. 76
GPIO18 – Pin No. 77
GPIO19 – Pin No. 82
GPIO20 – Pin No. 83
GPIO21 – Pin No. 86
GPIO22 – Pin No. 87
GPIO23 – Pin No. 66
GPIO24 – Pin No. 67
GPIO25 – Pin No. 17
GPIO26 – Pin No. 18
GPIO27 – Pin No. 19
GPIO28 – Pin No. 20
GPIO29 – Pin No. 21
GPIO30 – Pin No. 22
GPIO31 – Pin No. 23
GPIO32 – Pin No. 28
GPIO33 – Pin No. 29
GPIO34 – Pin No. 38
GPIO35 – Pin No. 39
GPIO36 – Pin No. 16
GPIO37 – Pin No. 78
The pin correspondence of BC25PA platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 3
GPIO2 – Pin No. 4
GPIO3 – Pin No. 5
GPIO4 – Pin No. 6
GPIO5 – Pin No. 16
GPIO6 – Pin No. 20
GPIO7 – Pin No. 21
GPIO8 – Pin No. 22
GPIO9 – Pin No. 23
GPIO10 – Pin No. 25
GPIO11 – Pin No. 28
GPIO12 – Pin No. 29
GPIO13 – Pin No. 30
GPIO14 – Pin No. 31
GPIO15 – Pin No. 32
GPIO16 – Pin No. 33
GPIO17 – Pin No. 2
GPIO18 – Pin No. 8
The pin correspondence of BG95M3 platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 4
GPIO2 – Pin No. 5
GPIO3 – Pin No. 6
GPIO4 – Pin No. 7
GPIO5 – Pin No. 18
GPIO6 – Pin No. 19
GPIO7 – Pin No. 22
GPIO8 – Pin No. 23
GPIO9 – Pin No. 25
GPIO10 – Pin No. 26
GPIO11 – Pin No. 27
GPIO12 – Pin No. 28
GPIO13 – Pin No. 40
GPIO14 – Pin No. 41
GPIO15 – Pin No. 64
GPIO16 – Pin No. 65
GPIO17 – Pin No. 66
GPIO18 – Pin No. 85
GPIO19 – Pin No. 86
GPIO20 – Pin No. 87
GPIO21 – Pin No. 88 | +| GPIOn | int | Pin Number
The corresponding pins of EC100Y-CN module are as follows (pin number is external pin number):
GPIO1 – Pin No. 22
GPIO2 – Pin No. 23
GPIO3 – Pin No. 38
GPIO4 – Pin No. 53
GPIO5 – Pin No. 54
GPIO6 – Pin No. 104
GPIO7 – Pin No. 105
GPIO8 – Pin No. 106
GPIO9 – Pin No. 107
GPIO10 – Pin No. 178
GPIO11 – Pin No. 195
GPIO12 – Pin No. 196
GPIO13 – Pin No. 197
GPIO14 – Pin No. 198
GPIO15 – Pin No. 199
GPIO16 – Pin No. 203
GPIO17 – Pin No. 204
GPIO18 – Pin No. 214
GPIO19 – Pin No. 215
The corresponding pins of EC600S-CN/EC600N-CN modules are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
The corresponding pins of EC600M series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
GPIO42 – Pin No. 109
GPIO43 – Pin No. 110
GPIO44 – Pin No. 112
GPIO45 – Pin No. 111
The corresponding pins of EC600U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 61(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 58(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 34(cannot be gpio function at the same time as GPIO41)
GPIO4 – Pin No. 60(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 69(cannot be gpio function at the same time as GPIO35)
GPIO6 – Pin No. 70(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 123(cannot be gpio function at the same time as GPIO43)
GPIO8 – Pin No. 118
GPIO9 – Pin No. 9
GPIO10 – Pin No. 1(cannot be gpio function at the same time as GPIO37)
GPIO11 – Pin No. 4(cannot be gpio function at the same time as GPIO38)
GPIO12 – Pin No. 3(cannot be gpio function at the same time as GPIO39)
GPIO13 – Pin No. 2(cannot be gpio function at the same time as GPIO40)
GPIO14 – Pin No. 54
GPIO15 – Pin No. 57
GPIO16 – Pin No. 56
GPIO17 – Pin No. 12
GPIO18 – Pin No. 33(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 124(cannot be gpio function at the same time as GPIO44)
GPIO20 – Pin No. 122(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 121(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 48
GPIO23 – Pin No. 39
GPIO24 – Pin No. 40
GPIO25 – Pin No. 49
GPIO26 – Pin No. 50
GPIO27 – Pin No. 53
GPIO28 – Pin No. 52
GPIO29 – Pin No. 51
GPIO30 – Pin No. 59(cannot be gpio function at the same time as GPIO33)
GPIO31 – Pin No. 66(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 63(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 67(cannot be gpio function at the same time as GPIO30)
GPIO34 – Pin No. 65(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 137(cannot be gpio function at the same time as GPIO5)
GPIO36 – Pin No. 62(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 98(cannot be gpio function at the same time as GPIO10)
GPIO38 – Pin No. 95(cannot be gpio function at the same time as GPIO11)
GPIO39 – Pin No. 119(cannot be gpio function at the same time as GPIO12)
GPIO40 – Pin No. 100(cannot be gpio function at the same time as GPIO13)
GPIO41 – Pin No. 120(cannot be gpio function at the same time as GPIO3)
GPIO42 – Pin No. 16(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 10(cannot be gpio function at the same time as GPIO7)
GPIO44 – Pin No. 14(cannot be gpio function at the same time as GPIO19)
GPIO45 – Pin No. 15(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 13(cannot be gpio function at the same time as GPIO21)
The corresponding pins of EC200U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 26(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 24(cannot be gpio function at the same time as GPIO33)
GPIO4 – Pin No. 25(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 13(cannot be gpio function at the same time as GPIO17)
GPIO6 – Pin No. 135(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 136(cannot be gpio function at the same time as GPIO44)
GPIO8 – Pin No. 133
GPIO9 – Pin No. 3(cannot be gpio function at the same time as GPIO37)
GPIO10 – Pin No. 40(cannot be gpio function at the same time as GPIO38)
GPIO11 – Pin No. 37(cannot be gpio function at the same time as GPIO39)
GPIO12 – Pin No. 38(cannot be gpio function at the same time as GPIO40)
GPIO13 – Pin No. 39(cannot be gpio function at the same time as GPIO41)
GPIO14 – Pin No. 5
GPIO15 – Pin No. 141
GPIO16 – Pin No. 142
GPIO17 – Pin No. 121(cannot be gpio function at the same time as GPIO5)
GPIO18 – Pin No. 65(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 64(cannot be gpio function at the same time as GPIO43)
GPIO20 – Pin No. 139(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 126(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 127(cannot be gpio function at the same time as GPIO47)
GPIO23 – Pin No. 33
GPIO24 – Pin No. 31
GPIO25 – Pin No. 30
GPIO26 – Pin No. 29
GPIO27 – Pin No. 28
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO31 – Pin No. 125(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 124(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 123(cannot be gpio function at the same time as GPIO3)
GPIO34 – Pin No. 122(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 134(cannot be gpio function at the same time as GPIO9)
GPIO38 – Pin No. 132(cannot be gpio function at the same time as GPIO10)
GPIO39 – Pin No. 131(cannot be gpio function at the same time as GPIO11)
GPIO40 – Pin No. 130(cannot be gpio function at the same time as GPIO12)
GPIO41 – Pin No. 129(cannot be gpio function at the same time as GPIO13)
GPIO42 – Pin No. 61(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 62(cannot be gpio function at the same time as GPIO19)
GPIO44 – Pin No. 63(cannot be gpio function at the same time as GPIO7)
GPIO45 – Pin No. 66(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 6(cannot be gpio function at the same time as GPIO21)
GPIO47 – Pin No. 23(cannot be gpio function at the same time as GPIO22)
The corresponding pins of EC200A series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27
GPIO2 – Pin No. 26
GPIO3 – Pin No.24
GPIO4 – Pin No.25
GPIO5 – Pin No.5
GPIO6 – Pin No.135
GPIO7 – Pin No.136
GPIO9 – Pin No. 3
GPIO10 – Pin No. 40
GPIO11 – Pin No. 37
GPIO12 – Pin No. 38
GPIO13 – Pin No. 39
GPIO18 – Pin No. 65
GPIO19 – Pin No. 64
GPIO20 – Pin No. 139
GPIO22 – Pin No. 127
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119
GPIO43 – Pin No. 62
GPIO44 – Pin No. 63
GPIO45 – Pin No. 66
GPIO46 – Pin No. 6
GPIO47 – Pin No. 23
The corresponding pins of EC800NCN series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 30
GPIO2 – Pin No. 31
GPIO3 – Pin No. 32
GPIO4 – Pin No. 33
GPIO5 – Pin No. 49
GPIO6 – Pin No. 50
GPIO7 – Pin No. 51
GPIO8 – Pin No. 52
GPIO9 – Pin No. 53
GPIO10 – Pin No. 54
GPIO11 – Pin No. 55
GPIO12 – Pin No. 56
GPIO13 – Pin No. 57
GPIO14 – Pin No. 58
GPIO15 – Pin No. 80
GPIO16 – Pin No. 81
GPIO17 – Pin No. 76
GPIO18 – Pin No. 77
GPIO19 – Pin No. 82
GPIO20 – Pin No. 83
GPIO21 – Pin No. 86
GPIO22 – Pin No. 87
GPIO23 – Pin No. 66
GPIO24 – Pin No. 67
GPIO25 – Pin No. 17
GPIO26 – Pin No. 18
GPIO27 – Pin No. 19
GPIO28 – Pin No. 20
GPIO29 – Pin No. 21
GPIO30 – Pin No. 22
GPIO31 – Pin No. 23
GPIO32 – Pin No. 28
GPIO33 – Pin No. 29
GPIO34 – Pin No. 38
GPIO35 – Pin No. 39
GPIO36 – Pin No. 16
GPIO37 – Pin No. 78
The pin correspondence of BC25PA platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 3
GPIO2 – Pin No. 4
GPIO3 – Pin No. 5
GPIO4 – Pin No. 6
GPIO5 – Pin No. 16
GPIO6 – Pin No. 20
GPIO7 – Pin No. 21
GPIO8 – Pin No. 22
GPIO9 – Pin No. 23
GPIO10 – Pin No. 25
GPIO11 – Pin No. 28
GPIO12 – Pin No. 29
GPIO13 – Pin No. 30
GPIO14 – Pin No. 31
GPIO15 – Pin No. 32
GPIO16 – Pin No. 33
GPIO17 – Pin No. 2
GPIO18 – Pin No. 8
The pin correspondence of BG95M3 platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 4
GPIO2 – Pin No. 5
GPIO3 – Pin No. 6
GPIO4 – Pin No. 7
GPIO5 – Pin No. 18
GPIO6 – Pin No. 19
GPIO7 – Pin No. 22
GPIO8 – Pin No. 23
GPIO9 – Pin No. 25
GPIO10 – Pin No. 26
GPIO11 – Pin No. 27
GPIO12 – Pin No. 28
GPIO13 – Pin No. 40
GPIO14 – Pin No. 41
GPIO15 – Pin No. 64
GPIO16 – Pin No. 65
GPIO17 – Pin No. 66
GPIO18 – Pin No. 85
GPIO19 – Pin No. 86
GPIO20 – Pin No. 87
GPIO21 – Pin No. 88
The pin correspondence of EG915U platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No.4(cannot be gpio function at the same time as GPIO41)
GPIO2 – Pin No.5(cannot be gpio function at the same time as GPIO36)
GPIO3 – Pin No.6(cannot be gpio function at the same time as GPIO35)
GPIO4 – Pin No.7(cannot be gpio function at the same time as GPIO24)
GPIO5 – Pin No.18
GPIO6 – Pin No.19
GPIO7 – Pin No.1(cannot be gpio function at the same time as GPIO37)
GPIO8 – Pin No.38
GPIO9 – Pin No.25
GPIO10 – Pin No.26
GPIO11 – Pin No.27(cannot be gpio function at the same time as GPIO32)
GPIO12 – Pin No.28(cannot be gpio function at the same time as GPIO31)
GPIO13 – Pin No.40
GPIO14 – Pin No.41
GPIO15 – Pin No.64
GPIO16 – Pin No.20(cannot be gpio function at the same time as GPIO30)
GPIO17 – Pin No.21
GPIO18 – Pin No.85
GPIO19 – Pin No.86
GPIO20 – Pin No.30
GPIO21 – Pin No.88
GPIO22 – Pin No.36(cannot be gpio function at the same time as GPIO40)
GPIO23 – Pin No.37(cannot be gpio function at the same time as GPIO38)
GPIO24 – Pin No.16(cannot be gpio function at the same time as GPIO4)
GPIO25 – Pin No.39
GPIO26 – Pin No.42(cannot be gpio function at the same time as GPIO27)
GPIO27 – Pin No.78(cannot be gpio function at the same time as GPIO26)
GPIO28 – Pin No.83(cannot be gpio function at the same time as GPIO33)
GPIO29 – Pin No.84
GPIO30 – Pin No.92(cannot be gpio function at the same time as GPIO16)
GPIO31 – Pin No.95(cannot be gpio function at the same time as GPIO12)
GPIO32 – Pin No.97(cannot be gpio function at the same time as GPIO11)
GPIO33 – Pin No.98(cannot be gpio function at the same time as GPIO28)
GPIO34 – Pin No.104
GPIO35 – Pin No.105(cannot be gpio function at the same time as GPIO3)
GPIO36 – Pin No.106(cannot be gpio function at the same time as GPIO2)
GPIO37 – Pin No.108(cannot be gpio function at the same time as GPIO4)
GPIO38 – Pin No.111(cannot be gpio function at the same time as GPIO23)
GPIO39 – Pin No.114
GPIO40 – Pin No.115(cannot be gpio function at the same time as GPIO22)
GPIO41 – Pin No.116(cannot be gpio function at the same time as GPIO1) | | direction | int | IN – input mode; OUT – output mode | | pullMode | int | PULL_DISABLE – floating mode
PULL_PU – pull-up mode
PULL_PD – pull-down mode | | level | int | 0 - Set the pin to low level; 1- Set the pin to high level | @@ -5511,7 +5511,7 @@ Function: UART serial data transmission | Parameter | Type | Description | | :-------- | :--- | ------------------------------------------------------------ | -| UARTn | int | Functions of UARTn are as follows:
UART0 - DEBUG PORT
UART1 – BT PORT
UART2 – MAIN PORT
UART3 – USB CDC PORT(BG95M3 platform not supported)
UART4 – STDOUT PORT(only supports EC200U/EC600U) | +| UARTn | int | Functions of UARTn are as follows:
UART0 - DEBUG PORT
UART1 – BT PORT
UART2 – MAIN PORT
UART3 – USB CDC PORT(BG95M3 platform not supported)
UART4 – STDOUT PORT(only supports EC200U/EC600U/EG915U) | | buadrate | int | Baud rate, common baud rates are supported, such as 4800, 9600, 19200, 38400, 57600, 115200, 230400, etc. | | databits | int | Data bit (5–8) | | parity | int | Parity check (0 – NONE,1 – EVEN,2 - ODD) | @@ -5531,6 +5531,7 @@ Function: UART serial data transmission | BC25PA | uart1:
TX: Pin number 29
RX: Pin number 28 | | BG95M3 | uart0:
TX: Pin number 23
RX: Pin number 22
uart1:
TX:Pin number 27
RX:Pin number 28
uart2:
TX: Pin number 64
RX: Pin number 65 | | EC600M | uart1:
TX: Pin number 3
RX: Pin number 2
uart2:
TX:Pin number 32
RX:Pin number 31 | +| EG915U | uart1:
TX: Pin number 27
RX: Pin number 28
uart2:
TX:Pin number 35
RX:Pin number 34
uart4:
TX:Pin number 19
RX:Pin number 18 | * Example @@ -6208,8 +6209,8 @@ Class function: A two-wire protocol used for communication between devices. | Constant | | Applicable Platform | | ----------------- | --------------------------- | --------------------------- | -| I2C.I2C0 | I2C channel index number: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | -| I2C.I2C1 | I2C channel index number: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M | +| I2C.I2C0 | I2C channel index number: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | +| I2C.I2C1 | I2C channel index number: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M/EG915U | | I2C.I2C2 | I2C channel index number: 2 | BG95M3/EC600M | | I2C.STANDARD_MODE | Standard mode | | | I2C.FAST_MODE | Fast mode | | @@ -6242,6 +6243,7 @@ Class function: A two-wire protocol used for communication between devices. | EC800N | I2C0:
SCL:Pin number 67
SDA:Pin number 66 | | BG95M3 | I2C0:
SCL: Pin number 18
SDA: Pin number 19
I2C1:
SCL:Pin number 40
SDA:Pin number 41
I2C2:
SCL:Pin number 26
SDA:Pin number 25 | | EC600M | I2C0:
SCL: Pin number 9
SDA: Pin number 64
I2C1:
SCL:Pin number 57
SDA:Pin number 56
I2C2:
SCL:Pin number 67
SDA:Pin number 65 | +| EG915U | I2C0:
SCL: Pin number 103
SDA: Pin number 104
I2C1:
SCL:Pin number 40
SDA:Pin number 41 | - Exmaple @@ -6550,7 +6552,7 @@ Class function: Serial peripheral interface bus protocol. | --------- | ---- | ------------------------------------------------------------ | | port | int | Channel selection[0,1] | | mode | int | SPI working mode (ususally mode 0):
Clock polarity CPOL: When SPI is idle, the level of the clock signal SCLK (0: Low level when idle; 1: High level when idle)
0 : CPOL=0, CPHA=0
1 : CPOL=0, CPHA=1
2: CPOL=1, CPHA=0
3: CPOL=1, CPHA=1 | -| clk | int | volume_up clock frequency
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | +| clk | int | volume_up clock frequency
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN/EG915U:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | - Pin Description @@ -6564,6 +6566,7 @@ Class function: Serial peripheral interface bus protocol. | BC25PA | port0:
CS:Pin number 6
CLK:Pin number 5
MOSI:Pin number 4
MISO:Pin number 3 | | BG95M3 | port0:
CS:Pin number 25
CLK:Pin number 26
MOSI:Pin number 27
MISO:Pin number 28
port1:
CS:Pin number 41
CLK:Pin number 40
MOSI:Pin number 64
MISO:Pin number 65 | | EC600M | port0:
CS:Pin number 58
CLK:Pin number 61
MOSI:Pin number 59
MISO:Pin number 60
port1:
CS:Pin number 4
CLK:Pin number 1
MOSI:Pin number 3
MISO:Pin number 2 | +| EG915U | port0:
CS:Pin number 25
CLK:Pin number 26
MOSI:Pin number 64
MISO:Pin number 88 | * Note: diff --git a/zh-cn/api/QuecPythonClasslib.md b/zh-cn/api/QuecPythonClasslib.md index 63b2095..d473ad7 100644 --- a/zh-cn/api/QuecPythonClasslib.md +++ b/zh-cn/api/QuecPythonClasslib.md @@ -5255,12 +5255,12 @@ pk.powerKeyEventRegister(pwk_callback) ###### 常量说明 -| 常量 | 说明 | 使用平台 | -| -------- | ---- | ---------------------------------------------------- | -| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M | -| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M | -| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M | -| PWM.PWM3 | PWM3 | EC600S / EC600N / EC100Y/EC800N/EC600M | +| 常量 | 说明 | 使用平台 | +| -------- | ---- | ----------------------------------------------------------- | +| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U | +| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M | +| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M | +| PWM.PWM3 | PWM3 | EC600S / EC600N / EC100Y/EC800N/EC600M | @@ -5274,8 +5274,8 @@ pk.powerKeyEventRegister(pwk_callback) | 参数 | 参数类型 | 参数说明 | | --------- | -------- | ------------------------------------------------------------ | -| PWMn | int | PWM号
注:EC100YCN平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号19
PWM1 – 引脚号18
PWM2 – 引脚号23
PWM3 – 引脚号22
注:EC600SCN/EC600N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号52
PWM1 – 引脚号53
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EC800N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号79
PWM1 – 引脚号78
PWM2 – 引脚号16
PWM3 – 引脚号49
注:EC200UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号135
注:EC600UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号70
注:EC600M平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号57
PWM1 – 引脚号56
PWM2 – 引脚号70
PWM3 – 引脚号69 | -| ABOVE_xx | int | EC600SCN/EC600N/EC800N平台:
PWM.ABOVE_MS ms级取值范围:(0,1023]
PWM.ABOVE_1US us级取值范围:(0,157]
PWM.ABOVE_10US us级取值范围:(1,1575]
PWM.ABOVE_BELOW_US ns级 取值(0,1024]
EC200U/EC600U平台:
PWM.ABOVE_MS ms级取值范围:(0,10]
PWM.ABOVE_1US us级取值范围:(0,10000]
PWM.ABOVE_10US us级取值范围:(1,10000]
PWM.ABOVE_BELOW_US ns级 取值[100,65535] | +| PWMn | int | PWM号
注:EC100YCN平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号19
PWM1 – 引脚号18
PWM2 – 引脚号23
PWM3 – 引脚号22
注:EC600SCN/EC600N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号52
PWM1 – 引脚号53
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EC800N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号79
PWM1 – 引脚号78
PWM2 – 引脚号16
PWM3 – 引脚号49
注:EC200UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号135
注:EC600UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号70
注:EC600M平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号57
PWM1 – 引脚号56
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EG915U平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号20 | +| ABOVE_xx | int | EC600SCN/EC600N/EC800N平台:
PWM.ABOVE_MS ms级取值范围:(0,1023]
PWM.ABOVE_1US us级取值范围:(0,157]
PWM.ABOVE_10US us级取值范围:(1,1575]
PWM.ABOVE_BELOW_US ns级 取值(0,1024]
EC200U/EC600U/EG915U平台:
PWM.ABOVE_MS ms级取值范围:(0,10]
PWM.ABOVE_1US us级取值范围:(0,10000]
PWM.ABOVE_10US us级取值范围:(1,10000]
PWM.ABOVE_BELOW_US ns级 取值[100,65535] | | highTime | int | ms级时,单位为ms
us级时,单位为us
ns级别:需要使用者计算
频率 = 13Mhz / cycleTime
占空比 = highTime/ cycleTime | | cycleTime | int | ms级时,单位为ms
us级时,单位为us
ns级别:需要使用者计算
频率 = 13Mhz / cycleTime
占空比 = highTime/ cycleTime | @@ -5370,8 +5370,8 @@ if __name__ == '__main__': | 常量 | 说明 | 适用平台 | | -------- | -------- | ------------------------------------------------------------ | -| ADC.ADC0 | ADC通道0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC200A/EC600M | -| ADC.ADC1 | ADC通道1 | EC600U/EC200U/EC200A/EC600M | +| ADC.ADC0 | ADC通道0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC200A/EC600M/EG915U | +| ADC.ADC1 | ADC通道1 | EC600U/EC200U/EC200A/EC600M/EG915U | | ADC.ADC2 | ADC通道2 | EC600U/EC200U | | ADC.ADC3 | ADC通道3 | EC600U | @@ -5418,7 +5418,7 @@ ADC功能初始化。 | 参数 | 参数类型 | 参数说明 | | ---- | -------- | ------------------------------------------------------------ | -| ADCn | int | ADC通道
EC100Y平台对应引脚如下
ADC0 – 引脚号39
ADC1 – 引脚号81
EC600S/EC600N平台对应引脚如下
ADC0 – 引脚号19
EC600M平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
EC800N平台对应引脚如下
ADC0 – 引脚号9
EC600U平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
ADC2 – 引脚号113
ADC3 – 引脚号114
EC200U平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
ADC2 – 引脚号43
EC200A平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
BG95M3平台对应引脚如下
ADC0 – 引脚号24 | +| ADCn | int | ADC通道
EC100Y平台对应引脚如下
ADC0 – 引脚号39
ADC1 – 引脚号81
EC600S/EC600N平台对应引脚如下
ADC0 – 引脚号19
EC600M平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
EC800N平台对应引脚如下
ADC0 – 引脚号9
EC600U平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
ADC2 – 引脚号113
ADC3 – 引脚号114
EC200U平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
ADC2 – 引脚号43
EC200A平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
BG95M3平台对应引脚如下
ADC0 – 引脚号24
EG915U平台对应引脚如下
ADC0 – 引脚号24
ADC1 – 引脚号2 | * 返回值 @@ -5767,47 +5767,47 @@ USBNET.open() | 常量 | 适配平台 | 说明 | | ---------------- | ------------------------ | -------- | -| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO1 | -| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO2 | -| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO3 | -| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO4 | -| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO5 | -| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO6 | -| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO7 | -| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO8 | -| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO9 | -| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO10 | -| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO11 | -| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO12 | -| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | GPIO13 | -| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO14 | -| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO15 | -| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M | GPIO16 | -| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M | GPIO17 | -| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M | GPIO18 | -| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M | GPIO19 | -| Pin.GPIO20 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M | GPIO20 | -| Pin.GPIO21 | EC600S / EC600N/EC600U/EC200U/EC800N/BG95M3/EC600M | GPIO21 | -| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO22 | -| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO23 | -| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO24 | -| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO25 | -| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO26 | -| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO27 | -| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO28 | -| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO29 | -| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO30 | -| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO31 | -| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO32 | -| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO33 | -| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO34 | -| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO35 | -| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M | GPIO36 | -| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M | GPIO37 | -| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO38 | -| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO39 | -| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO40 | -| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M | GPIO41 | +| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO1 | +| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO2 | +| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO3 | +| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO4 | +| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO5 | +| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO6 | +| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO7 | +| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO8 | +| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO9 | +| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO10 | +| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO11 | +| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO12 | +| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO13 | +| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO14 | +| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO15 | +| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO16 | +| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO17 | +| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO18 | +| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U | GPIO19 | +| Pin.GPIO20 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U | GPIO20 | +| Pin.GPIO21 | EC600S / EC600N/EC600U/EC200U/EC800N/BG95M3/EC600M/EG915U | GPIO21 | +| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO22 | +| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO23 | +| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO24 | +| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO25 | +| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO26 | +| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO27 | +| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO28 | +| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO29 | +| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO30 | +| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO31 | +| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO32 | +| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO33 | +| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO34 | +| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO35 | +| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO36 | +| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO37 | +| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO38 | +| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO39 | +| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO40 | +| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO41 | | Pin.GPIO42 | EC600U/EC200U/EC600M | GPIO42 | | Pin.GPIO43 | EC600U/EC200U/EC200A/EC600M | GPIO43 | | Pin.GPIO44 | EC600U/EC200U/EC200A/EC600M | GPIO44 | @@ -5834,7 +5834,7 @@ USBNET.open() | 参数 | 类型 | 说明 | | :-------- | :--- | ------------------------------------------------------------ | -| GPIOn | int | 引脚号
EC100YCN平台引脚对应关系如下(引脚号为外部引脚编号):
GPIO1 – 引脚号22
GPIO2 – 引脚号23
GPIO3 – 引脚号38
GPIO4 – 引脚号53
GPIO5 – 引脚号54
GPIO6 – 引脚号104
GPIO7 – 引脚号105
GPIO8 – 引脚号106
GPIO9 – 引脚号107
GPIO10 – 引脚号178
GPIO11 – 引脚号195
GPIO12 – 引脚号196
GPIO13 – 引脚号197
GPIO14 – 引脚号198
GPIO15 – 引脚号199
GPIO16 – 引脚号203
GPIO17 – 引脚号204
GPIO18 – 引脚号214
GPIO19 – 引脚号215
EC600SCN/EC600NCN平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
EC600M平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
GPIO42 – 引脚号109
GPIO43 – 引脚号110
GPIO44 – 引脚号112
GPIO45 – 引脚号111
EC600UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号61(不可与GPIO31同时为gpio)
GPIO2 – 引脚号58(不可与GPIO32同时为gpio)
GPIO3 – 引脚号34(不可与GPIO41同时为gpio)
GPIO4 – 引脚号60(不可与GPIO34同时为gpio)
GPIO5 – 引脚号69(不可与GPIO35同时为gpio)
GPIO6 – 引脚号70(不可与GPIO36同时为gpio)
GPIO7 – 引脚号123(不可与GPIO43同时为gpio)
GPIO8 – 引脚号118
GPIO9 – 引脚号9
GPIO10 – 引脚号1(不可与GPIO37同时为gpio)
GPIO11 – 引脚号4(不可与GPIO38同时为gpio)
GPIO12 – 引脚号3(不可与GPIO39同时为gpio)
GPIO13 – 引脚号2(不可与GPIO40同时为gpio)
GPIO14 – 引脚号54
GPIO15 – 引脚号57
GPIO16 – 引脚号56
GPIO17 – 引脚号12
GPIO18 – 引脚号33(不可与GPIO42同时为gpio)
GPIO19 – 引脚号124(不可与GPIO44同时为gpio)
GPIO20 – 引脚号122(不可与GPIO45同时为gpio)
GPIO21 – 引脚号121(不可与GPIO46同时为gpio)
GPIO22 – 引脚号48
GPIO23 – 引脚号39
GPIO24 – 引脚号40
GPIO25 – 引脚号49
GPIO26 – 引脚号50
GPIO27 – 引脚号53
GPIO28 – 引脚号52
GPIO29 – 引脚号51
GPIO30 – 引脚号59(不可与GPIO33同时为gpio)
GPIO31 – 引脚号66(不可与GPIO1同时为gpio)
GPIO32 – 引脚号63(不可与GPIO2同时为gpio)
GPIO33 – 引脚号67(不可与GPIO30同时为gpio)
GPIO34 – 引脚号65(不可与GPIO4同时为gpio)
GPIO35 – 引脚号137(不可与GPIO5同时为gpio)
GPIO36 – 引脚号62(不可与GPIO6同时为gpio)
GPIO37 – 引脚号98(不可与GPIO10同时为gpio)
GPIO38 – 引脚号95(不可与GPIO11同时为gpio)
GPIO39 – 引脚号119(不可与GPIO12同时为gpio)
GPIO40 – 引脚号100(不可与GPIO13同时为gpio)
GPIO41 – 引脚号120(不可与GPIO3同时为gpio)
GPIO42 – 引脚号16(不可与GPIO18同时为gpio)
GPIO43 – 引脚号10(不可与GPIO7同时为gpio)
GPIO44 – 引脚号14(不可与GPIO19同时为gpio)
GPIO45 – 引脚号15(不可与GPIO20同时为gpio)
GPIO46 – 引脚号13(不可与GPIO21同时为gpio)
EC200UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27(不可与GPIO31同时为gpio)
GPIO2 – 引脚号26(不可与GPIO32同时为gpio)
GPIO3 – 引脚号24(不可与GPIO33同时为gpio)
GPIO4 – 引脚号25(不可与GPIO34同时为gpio)
GPIO5 – 引脚号13(不可与GPIO17同时为gpio)
GPIO6 – 引脚号135(不可与GPIO36同时为gpio)
GPIO7 – 引脚号136(不可与GPIO44同时为gpio)
GPIO8 – 引脚号133
GPIO9 – 引脚号3(不可与GPIO37同时为gpio)
GPIO10 – 引脚号40(不可与GPIO38同时为gpio)
GPIO11 – 引脚号37(不可与GPIO39同时为gpio)
GPIO12 – 引脚号38(不可与GPIO40同时为gpio)
GPIO13 – 引脚号39(不可与GPIO41同时为gpio)
GPIO14 – 引脚号5
GPIO15 – 引脚号141
GPIO16 – 引脚号142
GPIO17 – 引脚号121(不可与GPIO5同时为gpio)
GPIO18 – 引脚号65(不可与GPIO42同时为gpio)
GPIO19 – 引脚号64(不可与GPIO43同时为gpio)
GPIO20 – 引脚号139(不可与GPIO45同时为gpio)
GPIO21 – 引脚号126(不可与GPIO46同时为gpio)
GPIO22 – 引脚号127(不可与GPIO47同时为gpio)
GPIO23 – 引脚号33
GPIO24– 引脚号31
GPIO25 – 引脚号30
GPIO26 – 引脚号29
GPIO27 – 引脚号28
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO31 – 引脚号125(不可与GPIO1同时为gpio)
GPIO32 – 引脚号124(不可与GPIO2同时为gpio)
GPIO33 – 引脚号123(不可与GPIO3同时为gpio)
GPIO34 – 引脚号122(不可与GPIO4同时为gpio)
GPIO35 – 引脚号42
GPIO36 – 引脚号119(不可与GPIO6同时为gpio)
GPIO37 – 引脚号134(不可与GPIO9同时为gpio)
GPIO38– 引脚号132(不可与GPIO10同时为gpio)
GPIO39 – 引脚号131(不可与GPIO11同时为gpio)
GPIO40 – 引脚号130(不可与GPIO12同时为gpio)
GPIO41 – 引脚号129(不可与GPIO13同时为gpio)
GPIO42 – 引脚号61(不可与GPIO18同时为gpio)
GPIO43 – 引脚号62(不可与GPIO19同时为gpio)
GPIO44 – 引脚号63(不可与GPIO7同时为gpio)
GPIO45 – 引脚号66(不可与GPIO20同时为gpio)
GPIO46 – 引脚号6(不可与GPIO21同时为gpio)
GPIO47 – 引脚号23(不可与GPIO22同时为gpio)
EC200A平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27
GPIO2 – 引脚号26
GPIO3 – 引脚号24
GPIO4 – 引脚号25
GPIO5 – 引脚号5
GPIO6 – 引脚号135
GPIO7 – 引脚号136
GPIO9 – 引脚号3
GPIO10 – 引脚号40
GPIO11 – 引脚号37
GPIO12 – 引脚号38
GPIO13 – 引脚号39
GPIO18 – 引脚号65
GPIO19 – 引脚号64
GPIO20 – 引脚号139
GPIO22 – 引脚号127
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO35 – 引脚号42
GPIO36 – 引脚号119
GPIO43 – 引脚号62
GPIO44 – 引脚号63
GPIO45 – 引脚号66
GPIO46 – 引脚号6
GPIO47 – 引脚号23
EC800NCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号30
GPIO2 – 引脚号31
GPIO3 – 引脚号32
GPIO4 – 引脚号33
GPIO5 – 引脚号49
GPIO6 – 引脚号50
GPIO7 – 引脚号51
GPIO8 – 引脚号52
GPIO9 – 引脚号53
GPIO10 – 引脚号54
GPIO11 – 引脚号55
GPIO12 – 引脚号56
GPIO13 – 引脚号57
GPIO14 – 引脚号58
GPIO15 – 引脚号80
GPIO16 – 引脚号81
GPIO17 – 引脚号76
GPIO18 – 引脚号77
GPIO19 – 引脚号82
GPIO20 – 引脚号83
GPIO21 – 引脚号86
GPIO22 – 引脚号87
GPIO23 – 引脚号66
GPIO24 – 引脚号67
GPIO25 – 引脚号17
GPIO26 – 引脚号18
GPIO27 – 引脚号19
GPIO28 – 引脚号20
GPIO29 – 引脚号21
GPIO30 – 引脚号22
GPIO31 – 引脚号23
GPIO32 – 引脚号28
GPIO33 – 引脚号29
GPIO34 – 引脚号38
GPIO35 – 引脚号39
GPIO36 – 引脚号16
GPIO37 – 引脚号78
BC25PA平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号3
GPIO2 – 引脚号4
GPIO3 – 引脚号5
GPIO4 – 引脚号6
GPIO5 – 引脚号16
GPIO6 – 引脚号20
GPIO7 – 引脚号21
GPIO8 – 引脚号22
GPIO9 – 引脚号23
GPIO10 – 引脚号25
GPIO11 – 引脚号28
GPIO12 – 引脚号29
GPIO13 – 引脚号30
GPIO14 – 引脚号31
GPIO15 – 引脚号32
GPIO16 – 引脚号33
GPIO17 – 引脚号2
GPIO18 – 引脚号8
BG95M3平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号4
GPIO2 – 引脚号5
GPIO3 – 引脚号6
GPIO4 – 引脚号7
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号22
GPIO8 – 引脚号23
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27
GPIO12 – 引脚号28
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号65
GPIO17 – 引脚号66
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号87
GPIO21 – 引脚号88 | +| GPIOn | int | 引脚号
EC100YCN平台引脚对应关系如下(引脚号为外部引脚编号):
GPIO1 – 引脚号22
GPIO2 – 引脚号23
GPIO3 – 引脚号38
GPIO4 – 引脚号53
GPIO5 – 引脚号54
GPIO6 – 引脚号104
GPIO7 – 引脚号105
GPIO8 – 引脚号106
GPIO9 – 引脚号107
GPIO10 – 引脚号178
GPIO11 – 引脚号195
GPIO12 – 引脚号196
GPIO13 – 引脚号197
GPIO14 – 引脚号198
GPIO15 – 引脚号199
GPIO16 – 引脚号203
GPIO17 – 引脚号204
GPIO18 – 引脚号214
GPIO19 – 引脚号215
EC600SCN/EC600NCN平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
EC600M平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
GPIO42 – 引脚号109
GPIO43 – 引脚号110
GPIO44 – 引脚号112
GPIO45 – 引脚号111
EC600UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号61(不可与GPIO31同时为gpio)
GPIO2 – 引脚号58(不可与GPIO32同时为gpio)
GPIO3 – 引脚号34(不可与GPIO41同时为gpio)
GPIO4 – 引脚号60(不可与GPIO34同时为gpio)
GPIO5 – 引脚号69(不可与GPIO35同时为gpio)
GPIO6 – 引脚号70(不可与GPIO36同时为gpio)
GPIO7 – 引脚号123(不可与GPIO43同时为gpio)
GPIO8 – 引脚号118
GPIO9 – 引脚号9
GPIO10 – 引脚号1(不可与GPIO37同时为gpio)
GPIO11 – 引脚号4(不可与GPIO38同时为gpio)
GPIO12 – 引脚号3(不可与GPIO39同时为gpio)
GPIO13 – 引脚号2(不可与GPIO40同时为gpio)
GPIO14 – 引脚号54
GPIO15 – 引脚号57
GPIO16 – 引脚号56
GPIO17 – 引脚号12
GPIO18 – 引脚号33(不可与GPIO42同时为gpio)
GPIO19 – 引脚号124(不可与GPIO44同时为gpio)
GPIO20 – 引脚号122(不可与GPIO45同时为gpio)
GPIO21 – 引脚号121(不可与GPIO46同时为gpio)
GPIO22 – 引脚号48
GPIO23 – 引脚号39
GPIO24 – 引脚号40
GPIO25 – 引脚号49
GPIO26 – 引脚号50
GPIO27 – 引脚号53
GPIO28 – 引脚号52
GPIO29 – 引脚号51
GPIO30 – 引脚号59(不可与GPIO33同时为gpio)
GPIO31 – 引脚号66(不可与GPIO1同时为gpio)
GPIO32 – 引脚号63(不可与GPIO2同时为gpio)
GPIO33 – 引脚号67(不可与GPIO30同时为gpio)
GPIO34 – 引脚号65(不可与GPIO4同时为gpio)
GPIO35 – 引脚号137(不可与GPIO5同时为gpio)
GPIO36 – 引脚号62(不可与GPIO6同时为gpio)
GPIO37 – 引脚号98(不可与GPIO10同时为gpio)
GPIO38 – 引脚号95(不可与GPIO11同时为gpio)
GPIO39 – 引脚号119(不可与GPIO12同时为gpio)
GPIO40 – 引脚号100(不可与GPIO13同时为gpio)
GPIO41 – 引脚号120(不可与GPIO3同时为gpio)
GPIO42 – 引脚号16(不可与GPIO18同时为gpio)
GPIO43 – 引脚号10(不可与GPIO7同时为gpio)
GPIO44 – 引脚号14(不可与GPIO19同时为gpio)
GPIO45 – 引脚号15(不可与GPIO20同时为gpio)
GPIO46 – 引脚号13(不可与GPIO21同时为gpio)
EC200UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27(不可与GPIO31同时为gpio)
GPIO2 – 引脚号26(不可与GPIO32同时为gpio)
GPIO3 – 引脚号24(不可与GPIO33同时为gpio)
GPIO4 – 引脚号25(不可与GPIO34同时为gpio)
GPIO5 – 引脚号13(不可与GPIO17同时为gpio)
GPIO6 – 引脚号135(不可与GPIO36同时为gpio)
GPIO7 – 引脚号136(不可与GPIO44同时为gpio)
GPIO8 – 引脚号133
GPIO9 – 引脚号3(不可与GPIO37同时为gpio)
GPIO10 – 引脚号40(不可与GPIO38同时为gpio)
GPIO11 – 引脚号37(不可与GPIO39同时为gpio)
GPIO12 – 引脚号38(不可与GPIO40同时为gpio)
GPIO13 – 引脚号39(不可与GPIO41同时为gpio)
GPIO14 – 引脚号5
GPIO15 – 引脚号141
GPIO16 – 引脚号142
GPIO17 – 引脚号121(不可与GPIO5同时为gpio)
GPIO18 – 引脚号65(不可与GPIO42同时为gpio)
GPIO19 – 引脚号64(不可与GPIO43同时为gpio)
GPIO20 – 引脚号139(不可与GPIO45同时为gpio)
GPIO21 – 引脚号126(不可与GPIO46同时为gpio)
GPIO22 – 引脚号127(不可与GPIO47同时为gpio)
GPIO23 – 引脚号33
GPIO24– 引脚号31
GPIO25 – 引脚号30
GPIO26 – 引脚号29
GPIO27 – 引脚号28
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO31 – 引脚号125(不可与GPIO1同时为gpio)
GPIO32 – 引脚号124(不可与GPIO2同时为gpio)
GPIO33 – 引脚号123(不可与GPIO3同时为gpio)
GPIO34 – 引脚号122(不可与GPIO4同时为gpio)
GPIO35 – 引脚号42
GPIO36 – 引脚号119(不可与GPIO6同时为gpio)
GPIO37 – 引脚号134(不可与GPIO9同时为gpio)
GPIO38– 引脚号132(不可与GPIO10同时为gpio)
GPIO39 – 引脚号131(不可与GPIO11同时为gpio)
GPIO40 – 引脚号130(不可与GPIO12同时为gpio)
GPIO41 – 引脚号129(不可与GPIO13同时为gpio)
GPIO42 – 引脚号61(不可与GPIO18同时为gpio)
GPIO43 – 引脚号62(不可与GPIO19同时为gpio)
GPIO44 – 引脚号63(不可与GPIO7同时为gpio)
GPIO45 – 引脚号66(不可与GPIO20同时为gpio)
GPIO46 – 引脚号6(不可与GPIO21同时为gpio)
GPIO47 – 引脚号23(不可与GPIO22同时为gpio)
EC200A平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27
GPIO2 – 引脚号26
GPIO3 – 引脚号24
GPIO4 – 引脚号25
GPIO5 – 引脚号5
GPIO6 – 引脚号135
GPIO7 – 引脚号136
GPIO9 – 引脚号3
GPIO10 – 引脚号40
GPIO11 – 引脚号37
GPIO12 – 引脚号38
GPIO13 – 引脚号39
GPIO18 – 引脚号65
GPIO19 – 引脚号64
GPIO20 – 引脚号139
GPIO22 – 引脚号127
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO35 – 引脚号42
GPIO36 – 引脚号119
GPIO43 – 引脚号62
GPIO44 – 引脚号63
GPIO45 – 引脚号66
GPIO46 – 引脚号6
GPIO47 – 引脚号23
EC800NCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号30
GPIO2 – 引脚号31
GPIO3 – 引脚号32
GPIO4 – 引脚号33
GPIO5 – 引脚号49
GPIO6 – 引脚号50
GPIO7 – 引脚号51
GPIO8 – 引脚号52
GPIO9 – 引脚号53
GPIO10 – 引脚号54
GPIO11 – 引脚号55
GPIO12 – 引脚号56
GPIO13 – 引脚号57
GPIO14 – 引脚号58
GPIO15 – 引脚号80
GPIO16 – 引脚号81
GPIO17 – 引脚号76
GPIO18 – 引脚号77
GPIO19 – 引脚号82
GPIO20 – 引脚号83
GPIO21 – 引脚号86
GPIO22 – 引脚号87
GPIO23 – 引脚号66
GPIO24 – 引脚号67
GPIO25 – 引脚号17
GPIO26 – 引脚号18
GPIO27 – 引脚号19
GPIO28 – 引脚号20
GPIO29 – 引脚号21
GPIO30 – 引脚号22
GPIO31 – 引脚号23
GPIO32 – 引脚号28
GPIO33 – 引脚号29
GPIO34 – 引脚号38
GPIO35 – 引脚号39
GPIO36 – 引脚号16
GPIO37 – 引脚号78
BC25PA平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号3
GPIO2 – 引脚号4
GPIO3 – 引脚号5
GPIO4 – 引脚号6
GPIO5 – 引脚号16
GPIO6 – 引脚号20
GPIO7 – 引脚号21
GPIO8 – 引脚号22
GPIO9 – 引脚号23
GPIO10 – 引脚号25
GPIO11 – 引脚号28
GPIO12 – 引脚号29
GPIO13 – 引脚号30
GPIO14 – 引脚号31
GPIO15 – 引脚号32
GPIO16 – 引脚号33
GPIO17 – 引脚号2
GPIO18 – 引脚号8
BG95M3平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号4
GPIO2 – 引脚号5
GPIO3 – 引脚号6
GPIO4 – 引脚号7
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号22
GPIO8 – 引脚号23
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27
GPIO12 – 引脚号28
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号65
GPIO17 – 引脚号66
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号87
GPIO21 – 引脚号88
EG915U平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号4(不可与GPIO41同时为gpio)
GPIO2 – 引脚号5(不可与GPIO36同时为gpio)
GPIO3 – 引脚号6(不可与GPIO35同时为gpio)
GPIO4 – 引脚号7(不可与GPIO24同时为gpio)
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号1(不可与GPIO37同时为gpio)
GPIO8 – 引脚号38
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27(不可与GPIO32同时为gpio)
GPIO12 – 引脚号28(不可与GPIO31同时为gpio)
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号20(不可与GPIO30同时为gpio)
GPIO17 – 引脚号21
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号30
GPIO21 – 引脚号88
GPIO22 – 引脚号36(不可与GPIO40同时为gpio)
GPIO23 – 引脚号37(不可与GPIO38同时为gpio)
GPIO24 – 引脚号16(不可与GPIO4同时为gpio)
GPIO25 – 引脚号39
GPIO26 – 引脚号42(不可与GPIO27同时为gpio)
GPIO27 – 引脚号78(不可与GPIO26同时为gpio)
GPIO28 – 引脚号83(不可与GPIO33同时为gpio)
GPIO29 – 引脚号84
GPIO30 – 引脚号92(不可与GPIO16同时为gpio)
GPIO31 – 引脚号95(不可与GPIO12同时为gpio)
GPIO32 – 引脚号97(不可与GPIO11同时为gpio)
GPIO33 – 引脚号98(不可与GPIO28同时为gpio)
GPIO34 – 引脚号104
GPIO35 – 引脚号105(不可与GPIO3同时为gpio)
GPIO36 – 引脚号106(不可与GPIO2同时为gpio)
GPIO37 – 引脚号108(不可与GPIO4同时为gpio)
GPIO38 – 引脚号111(不可与GPIO23同时为gpio)
GPIO39 – 引脚号114
GPIO40 – 引脚号115(不可与GPIO22同时为gpio)
GPIO41 – 引脚号116(不可与GPIO1同时为gpio) | | direction | int | IN – 输入模式,OUT – 输出模式 | | pullMode | int | PULL_DISABLE – 浮空模式
PULL_PU – 上拉模式
PULL_PD – 下拉模式 | | level | int | 0 - 设置引脚为低电平, 1- 设置引脚为高电平 | @@ -5986,7 +5986,7 @@ if __name__ == '__main__': | 参数 | 类型 | 说明 | | :------- | :--- | ------------------------------------------------------------ | -| UARTn | int | UARTn作用如下:
UART0 - DEBUG PORT
UART1 – BT PORT
UART2 – MAIN PORT
UART3 – USB CDC PORT (BG95M3 不支持)
UART4 – STDOUT PORT (仅支持EC200U/EC600U) | +| UARTn | int | UARTn作用如下:
UART0 - DEBUG PORT
UART1 – BT PORT
UART2 – MAIN PORT
UART3 – USB CDC PORT (BG95M3 不支持)
UART4 – STDOUT PORT (仅支持EC200U/EC600U/EG915U) | | buadrate | int | 波特率,常用波特率都支持,如4800、9600、19200、38400、57600、115200、230400等 | | databits | int | 数据位(5 ~ 8),展锐平台当前仅支持8位 | | parity | int | 奇偶校验(0 – NONE,1 – EVEN,2 - ODD) | @@ -6006,6 +6006,7 @@ if __name__ == '__main__': | BC25PA | uart1:
TX: 引脚号29
RX: 引脚号28 | | BG95M3 | uart0:
TX: 引脚号23
RX: 引脚号22
uart1:
TX:引脚号27
RX:引脚号28
uart2:
TX: 引脚号64
RX: 引脚号65 | | EC600M | uart1:
TX: 引脚号3
RX: 引脚号2
uart2:
TX:引脚号32
RX:引脚号31 | +| EG915U | uart1:
TX: 引脚号27
RX: 引脚号28
uart2:
TX:引脚号35
RX:引脚号34
uart4:
TX:引脚号19
RX:引脚号18 | * 示例 @@ -6671,8 +6672,8 @@ rtc.enable_alarm(1) | 常量 | | 适用平台 | | ----------------- | ----------------- | ----------------------------- | -| I2C.I2C0 | i2c 通路索引号: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M | -| I2C.I2C1 | i2c 通路索引号: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M | +| I2C.I2C0 | i2c 通路索引号: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | +| I2C.I2C1 | i2c 通路索引号: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M/EG915U | | I2C.I2C2 | i2c 通路索引号: 2 | BG95M3/EC600M | | I2C.STANDARD_MODE | 标准模式 | | | I2C.FAST_MODE | 快速模式 | | @@ -6705,6 +6706,7 @@ rtc.enable_alarm(1) | EC800N | I2C0:
SCL:引脚号67
SDA:引脚号66 | | BG95M3 | I2C0:
SCL: 引脚号18
SDA: 引脚号19
I2C1:
SCL:引脚号40
SDA:引脚号41
I2C2:
SCL:引脚号26
SDA:引脚号25 | | EC600M | I2C0:
SCL: 引脚号9
SDA: 引脚号64
I2C1:
SCL:引脚号57
SDA:引脚号56
I2C2:
SCL:引脚号67
SDA:引脚号65 | +| EG915U | I2C0:
SCL: 引脚号103
SDA: 引脚号114
I2C1:
SCL:引脚号40
SDA:引脚号41 | - 示例 @@ -7010,7 +7012,7 @@ if __name__ == "__main__": | ---- | ---- | ------------------------------------------------------------ | | port | int | 通道选择[0,1] | | mode | int | SPI 的工作模式(模式0最常用):
时钟极性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 | int | 时钟频率
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | +| clk | int | 时钟频率
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN/EG915U:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | - 引脚说明 @@ -7024,6 +7026,7 @@ if __name__ == "__main__": | BC25PA | port0:
CS:引脚号6
CLK:引脚号5
MOSI:引脚号4
MISO:引脚号3 | | BG95M3 | port0:
CS:引脚号25
CLK:引脚号26
MOSI:引脚号27
MISO:引脚号28
port1:
CS:引脚号41
CLK:引脚号40
MOSI:引脚号64
MISO:引脚号65 | | EC600M | port0:
CS:引脚号58
CLK:引脚号61
MOSI:引脚号59
MISO:引脚号60
port1:
CS:引脚号4
CLK:引脚号1
MOSI:引脚号3
MISO:引脚号2 | +| EG915U | port0:
CS:引脚号25
CLK:引脚号26
MOSI:引脚号64
MISO:引脚号88 | * 注意 BC25PA平台不支持1、2模式。 - 示例 From b630050a6f43a0232fdcc0f28512abce7a1ff0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhardt=20Peng=28=E5=BD=AD=E6=88=90=E5=90=8D=29?= Date: Mon, 21 Nov 2022 13:21:10 +0800 Subject: [PATCH 2/6] up-to-date EG915U BSP --- en-us/api/QuecPythonClasslib.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en-us/api/QuecPythonClasslib.md b/en-us/api/QuecPythonClasslib.md index 39ec6e0..277059a 100644 --- a/en-us/api/QuecPythonClasslib.md +++ b/en-us/api/QuecPythonClasslib.md @@ -6243,7 +6243,7 @@ Class function: A two-wire protocol used for communication between devices. | EC800N | I2C0:
SCL:Pin number 67
SDA:Pin number 66 | | BG95M3 | I2C0:
SCL: Pin number 18
SDA: Pin number 19
I2C1:
SCL:Pin number 40
SDA:Pin number 41
I2C2:
SCL:Pin number 26
SDA:Pin number 25 | | EC600M | I2C0:
SCL: Pin number 9
SDA: Pin number 64
I2C1:
SCL:Pin number 57
SDA:Pin number 56
I2C2:
SCL:Pin number 67
SDA:Pin number 65 | -| EG915U | I2C0:
SCL: Pin number 103
SDA: Pin number 104
I2C1:
SCL:Pin number 40
SDA:Pin number 41 | +| EG915U | I2C0:
SCL: Pin number 103
SDA: Pin number 114
I2C1:
SCL:Pin number 40
SDA:Pin number 41 | - Exmaple From 050ff7839d735a7d7da1ea127954088825ebb2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhardt=20Peng=28=E5=BD=AD=E6=88=90=E5=90=8D=29?= Date: Tue, 22 Nov 2022 10:05:29 +0800 Subject: [PATCH 3/6] up-to-date EG915U spi nor flash &EG915UEUABR01A01V02M08_OCPU_QPY --- en-us/api/pythonStdlib.md | 137 +++++++++++++++++++++++++------------- zh-cn/api/pythonStdlib.md | 137 +++++++++++++++++++++++++------------- 2 files changed, 182 insertions(+), 92 deletions(-) diff --git a/en-us/api/pythonStdlib.md b/en-us/api/pythonStdlib.md index 985afe3..3aa0428 100644 --- a/en-us/api/pythonStdlib.md +++ b/en-us/api/pythonStdlib.md @@ -204,7 +204,7 @@ b'\xb3\xc9Y\x1b\xe9' -##### Initialize SD card driver(SPI mode) +##### Register storage device - SPI - SD card At present, it is only supported by ec600n / ec800n platforms. @@ -233,49 +233,7 @@ Initialize SD card and communicate with SD card. Use SPI communication mode. -##### Mount file system - -> **uos.mount(vfs_obj, path)** - -Mount the underlying file system to VFS. - -* Parameters - -|Parameter | parameter type | parameter description| -| ------- | ---------- | ---------------- | -| vfs_ Obj | VFS object | file system object| -|Path | str | root directory of file system| - -* Return Value - - * None - -* Example - -```python ->>> cdev = uos.VfsFat(1, 0, 4, 1) ->>> uos.mount(cdev, '/sd') -``` - --SD card usage example(SPI mode) - - At present, it is only supported by ec600n / ec800n platforms. - -```python ->>> cdev = uos.VfsFat(1, 0, 4, 1) ->>> uos.mount(cdev, '/sd') ->>> f = open('/sd/test.txt','w+') ->>> f.write('0123456') ->>> f.close() ->>> uos.listdir('/sd') ->>> f = open('/sd/test.txt','r') ->>> f.read() ->>> f.close() -``` - - - -##### Initialize SD card driver(SDIO mode) +##### Register storage device - SDIO - SD card At present,it is only supported by EC600U/EC200U platforms. @@ -306,7 +264,7 @@ Return vfs object if the execution is successful, otherwise report error. >>> udev = VfsSd("sd_fs") ``` -##### Set detection pin +###### Set detection pin > **set_det(vfs_obj.GPIOn,mode)** @@ -332,7 +290,7 @@ Return 0 if the execution is successful, otherwise return -1. >>> udev.set_det(udev.GPIO10,0)#Use gpio10 as the card detection pin, insert the SD card, the detection port is low level, plug out the SD card, the detection port is high level(the actual use depends on the hardware). ``` -##### Setting the card insertion and removal callback function +###### Setting the card insertion and removal callback function > **set_callback(fun)** @@ -380,6 +338,93 @@ def call_back(para): udev.set_callback(call_back) ``` + + +##### **Register storage device - SPI NOR FLASH** + +At present,it is only supported by EG915U platforms. + +> uos.VfsLfs1(readsize,progsize,lookahead,pname,spi_port,spi_clk) + +Initialize spi nor flash and Plug-in nor flash communication. Use SPI communication mode. + +* Parameter + +| Parameter | Type | Description | +| --------- | ---- | ------------------------------------------------------------ | +| readsize | int | Reserved, not used yet | +| progsize | int | Reserved, not used yet | +| lookahead | int | Reserved, not used yet | +| pname | str | Fixed to "ext_fs". Subsequent expansion | +| spi_port | int | Supported ports refer to the SPI chapter description | +| spi_clk | int | clock frequency:
EG915U:0:6.25M 1:12.5M 2:25M 3:50M 4:3.125M 5:1.5625M 6:781.25K | + +* Return value + + VfsLfs1 object will be returned if successful, and OSError 19 will be returned if failed. + +* Example + + ```python + >>>ldev = uos.VfsLfs1(32, 32, 32, "ext_fs",1,0) + >>>uos.mount(ldev,'/ext') + >>>f = open('/ext/test.txt','w+') + >>>f.write('hello world!!!') + >>>f.close() + + >>>uos.listdir('ext') + + >>>f = open('/ext/test.txt','r') + >>>f.read() + >>>f.close() + + ``` + + + + +##### Mount file system + +> **uos.mount(vfs_obj, path)** + +Mount the underlying file system to VFS. + +* Parameters + +| Parameter | parameter type | parameter description | +| --------- | -------------- | ----------------------------- | +| vfs_ Obj | VFS object | file system object | +| Path | str | root directory of file system | + +* Return Value + + * None + +* Example + +```python +>>> cdev = uos.VfsFat(1, 0, 4, 1) +>>> uos.mount(cdev, '/sd') +``` + +-SD card usage example(SPI mode) + + At present, it is only supported by ec600n / ec800n platforms. + +```python +>>> cdev = uos.VfsFat(1, 0, 4, 1) +>>> uos.mount(cdev, '/sd') +>>> f = open('/sd/test.txt','w+') +>>> f.write('0123456') +>>> f.close() +>>> uos.listdir('/sd') +>>> f = open('/sd/test.txt','r') +>>> f.read() +>>> f.close() +``` + + + #### gc - Control the Garbage Collector This module provides an interface to the optional garbage collector. This module implements a subset of the corresponding [CPython](https://docs.micropython.org/en/latest/reference/glossary.html#term-CPython) module, as described below. For more information, refer to the original CPython documentation: [gc](https://docs.python.org/3.5/library/gc.html#module-gc) diff --git a/zh-cn/api/pythonStdlib.md b/zh-cn/api/pythonStdlib.md index 1cce5a4..5052c45 100644 --- a/zh-cn/api/pythonStdlib.md +++ b/zh-cn/api/pythonStdlib.md @@ -201,7 +201,7 @@ b'\xb3\xc9Y\x1b\xe9' -##### 初始化SD卡驱动(SPI接口) +##### 注册存储设备 - SPI - SD卡 目前仅EC600N/EC800N平台支持。 @@ -230,49 +230,7 @@ b'\xb3\xc9Y\x1b\xe9' -##### 挂载文件系统 - -> **uos.mount(vfs_obj, path)** - -挂载底层文件系统到VFS。 - -* 参数 - -| 参数 | 参数类型 | 参数说明 | -| ------- | ---------- | ---------------- | -| vfs_obj | vfs object | 文件系统对象 | -| path | str | 文件系统的根目录 | - -* 返回值 - -无。 - -* 示例 - -```python ->>> cdev = uos.VfsFat(1, 0, 4, 1) ->>> uos.mount(cdev, '/sd') -``` - -- SD卡(SPI接口)使用示例 - - 目前仅EC600N/EC800N平台支持。 - -```python ->>> cdev = uos.VfsFat(1, 0, 4, 1) ->>> uos.mount(cdev, '/sd') ->>> f = open('/sd/test.txt','w+') ->>> f.write('0123456') ->>> f.close() ->>> uos.listdir('/sd') ->>> f = open('/sd/test.txt','r') ->>> f.read() ->>> f.close() -``` - - - -##### 初始化SD卡驱动(SDIO接口) +##### 注册存储设备 - SDIO - SD卡 目前仅EC600U/EC200U平台支持。 @@ -304,7 +262,7 @@ b'\xb3\xc9Y\x1b\xe9' >>> udev = VfsSd("sd_fs") ``` -##### 设置检测管脚 +###### 设置检测管脚 > **set_det(vfs_obj.GPIOn,mode)** @@ -330,7 +288,7 @@ b'\xb3\xc9Y\x1b\xe9' >>> udev.set_det(udev.GPIO10,0)#使用GPIO10作为卡检测管脚,sd卡插上,检测口为低电平,sd卡取出,检测口为高电平(实际使用根据硬件) ``` -##### 设置插拔卡回调函数 +###### 设置插拔卡回调函数 > **set_callback(fun)** @@ -378,6 +336,93 @@ def call_back(para): udev.set_callback(call_back) ``` + + +##### **注册存储设备 - SPI NOR FLASH** + +目前仅EG915U支持 + +> uos.VfsLfs1(readsize,progsize,lookahead,pname,spi_port,spi_clk) + +初始化spi nor flash,和外挂nor flash通信。使用SPI通信方式。 + +* 参数 + +| 参数 | 参数类型 | 参数说明 | +| --------- | -------- | ------------------------------------------------------------ | +| readsize | int | 预留,暂未使用 | +| progsize | int | 预留,暂未使用 | +| lookahead | int | 预留,暂未使用 | +| pname | str | 固定为“ext_fs”。后续扩展 | +| spi_port | int | 支持的端口参照SPI章节说明 | +| spi_clk | int | 时钟频率:
EG915U:0:6.25M 1:12.5M 2:25M 3:50M 4:3.125M 5:1.5625M 6:781.25K | + +* 返回值 + + 成功则返回VfsLfs1 object,失败则 OSError 19。 + +* 示例 + + ```python + >>>ldev = uos.VfsLfs1(32, 32, 32, "ext_fs",1,0) + >>>uos.mount(ldev,'/ext') + >>>f = open('/ext/test.txt','w+') + >>>f.write('hello world!!!') + >>>f.close() + + >>>uos.listdir('ext') + + >>>f = open('/ext/test.txt','r') + >>>f.read() + >>>f.close() + + ``` + + + + +##### 挂载文件系统 + +> **uos.mount(vfs_obj, path)** + +挂载底层文件系统到VFS。 + +* 参数 + +| 参数 | 参数类型 | 参数说明 | +| ------- | ---------- | ---------------- | +| vfs_obj | vfs object | 文件系统对象 | +| path | str | 文件系统的根目录 | + +* 返回值 + +无。 + +* 示例 + +```python +>>> cdev = uos.VfsFat(1, 0, 4, 1) +>>> uos.mount(cdev, '/sd') +``` + +- SD卡(SPI接口)使用示例 + + 目前仅EC600N/EC800N平台支持。 + +```python +>>> cdev = uos.VfsFat(1, 0, 4, 1) +>>> uos.mount(cdev, '/sd') +>>> f = open('/sd/test.txt','w+') +>>> f.write('0123456') +>>> f.close() +>>> uos.listdir('/sd') +>>> f = open('/sd/test.txt','r') +>>> f.read() +>>> f.close() +``` + + + #### gc - 内存碎片回收 gc 模块实现内存垃圾回收机制,该模块实现了CPython模块相应模块的子集。更多信息请参阅阅CPython文档:[gc](https://docs.python.org/3.5/library/gc.html#module-gc) From 5b1470c6de0bc497680ba4ae1f1c4216758eca5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jayceon=20Fu=28=E4=BB=98=E4=BF=8A=E8=87=A3=29?= Date: Thu, 24 Nov 2022 13:32:35 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E7=BB=8F=E5=85=B8=E8=93=9D=E7=89=99API?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E8=AF=B4=E6=98=8E=E4=B8=AD=E8=8B=B1=E6=96=87?= =?UTF-8?q?wiki=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- en-us/api/QuecPythonClasslib.md | 1984 ++++++++++++++++++++++++++++++- zh-cn/api/QuecPythonClasslib.md | 1923 +++++++++++++++++++++++++++++- 2 files changed, 3903 insertions(+), 4 deletions(-) diff --git a/en-us/api/QuecPythonClasslib.md b/en-us/api/QuecPythonClasslib.md index 71b446b..35efc71 100644 --- a/en-us/api/QuecPythonClasslib.md +++ b/en-us/api/QuecPythonClasslib.md @@ -2170,7 +2170,7 @@ This function sets APN. After setting, you need to restart or switch to mode 0 a >>> net.setApn(1,1,'3gnet','mia','123',2,0) 0 ``` - + ##### Obtain the Current APN @@ -2210,7 +2210,7 @@ This function obtains the current APN. '3gnet' >>> net.getApn(1,0) (1, '3gnet', 'mia', '123', 2) -``` +``` @@ -10307,6 +10307,1986 @@ if __name__ == '__main__': +#### BT - Classic Bluetooth + +Features: The module provides the related features of classic Bluetooth, and supports HFP, A2DP, AVRCP and SPP. + +##### Initialize Bluetooth + +> **bt.init(user_cb)** + +* Feature + +This function initializes Bluetooth and registers callback function. + +* Parameter + +| Parameter | Type | Description | +| --------- | -------- | ----------------- | +| user_cb | function | Callback function | + +* Return Value + +​ 0 Successful execution. + +​ -1 Failed execution. + +Description: + +a) The form of the callback function + +```python +def bt_callback(args): + event_id = args[0] # The first parameter is fixed at event_id + status = args[1] # The second parameter is fixed at status, indicating whether the execution result of an operation is successful or not. + ...... +``` + +b) The description of callback function parameters + +args[0] is fixed at event_id, args[1] is fixed at status, 0 indicates success, other values indicate failure. The number of parameters of the callback function is not fixed at 2, but is determined by the first parameter args[0]. The following table lists the number of parameters and descriptions corresponding to different event IDs. + +| event_id | Number of Parameters | Description of Parameters | +| :------: | :------------------: | ------------------------------------------------------------ | +| 0 | 2 | args[0]: event_id, indicating BT/BLE start event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure. | +| 1 | 2 | args[0]: event_id, indicating BT/BLE stop event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure. | +| 6 | 6 | args[0]: event_id, indicating BT inquiry event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: rssi, indicating the signal strength of the searched device.
args[3]: device_class
args[4]: device_name, string type, indicating the device name.
args[5]: addr, indicating the MAC address of searched Bluetooth device. | +| 7 | 3 | args[0]: event_id, indicating BT inquiry end event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: end_status, 0 indicates ending the search normally, 8 indicates ending the search forcefully. | +| 14 | 4 | args[0]: event_id, indicating BT SPP receiving event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: data_len, indicating the length of received data.
args[3]: data, bytearray type, indicating the received data. | +| 40 | 4 | args[0]: event_id, indicating BT HFP connection event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_connect_status, indicating the connection status of HFP.
0 - Disconnected
1 - Connecting
2 - Connected
3 - Disconnecting
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 41 | 4 | args[0]: event_id, indicating BT HFP disconnection event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_connect_status, indicating the connection status of HFP.
0 - Disconnected
1 - Connecting
2 - Connected
3 - Disconnecting
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 42 | 4 | args[0]: event_id, indicating BT HFP call status event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_call_status. Indicates the call status of HFP.
0 - No calls (held or active)
1 - Call is present (active or held)
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 43 | 4 | args[0]: event_id, indicating BT HFP call setup status event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_call_setup_status, indicating the call setup status of HFP.
0 - No call setup in progress
1 - Incoming call setup in progress
2 - Outgoing call setup in dialing state
3 - Outgoing call setup in alerting state
T args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 44 | 4 | args[0]: event_id, indicating BT HFP network status event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_network_status, indicating the network status of AG.
0 - Network is unavailable
1 - Network is normal
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 45 | 4 | args[0]: event_id, indicating BT HFP network signal event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_network_signal, indicating the signal of AG. Range: 0–5.
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 46 | 4 | args[0]: event_id, indicating BT HFP battery level event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_battery_level, indicating the battery level of AG. Range: 0–5.
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 47 | 4 | args[0]: event_id, indicating BT HFP call held status event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_call_held_status, indicating the call held status of HFP.
0 - No calls held
1 - Call is placed on hold or active/held calls swapped
2 - Call on hold, no active call
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 48 | 4 | args[0]: event_id, indicating BT HFP audio status event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_audio_status, indicating the connection status of audio.
0 - Audio is disconnected
1 - Audio is connecting
2 - Audio is connected
3 - Audio is disconnecting
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 49 | 4 | args[0]: event_id, indicating BT HFP volume type event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_volume_type
0 - The volume type is speaker
1 - The volume type is microphone
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 50 | 4 | args[0]: event_id, indicating BT HFP service type event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_service_type, indicating the network service mode of AG.
0 - AG is currently in normal network mode
1 - AG is currently in roaming mode
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 51 | 4 | args[0]: event_id, indicating the BT HFP ring event, that is, the ring event when there is an incoming call
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: Currently moot, reserved.
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 52 | 4 | args[0]: event_id, indicating the BT HFP codec type event, that is, the codec mode.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: hfp_codec_type, indicating which codec mode is currently used;
1 - CVDS with 8 KHz sampling rate
2 - mSBC with 16 KHz sampling rate
args[3]: addr, bytearray type, indicating the address of Bluetooth master device. | +| 61 | 4 | args[0]: event_id, indicating BT SPP connection event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: spp_connect_status, indicating the connection status of SPP.
0 - Disconnected
1 - Connecting
2 - Connected
3 - Disconnecting
args[3]: addr, bytearray type, indicating the MAC address of the peer device. | +| 62 | 4 | args[0]: event_id, indicating BT SPP disconnection event.
args[1]: status, indicating the status of the operation. 0 indicates success, other values indicate failure.
args[2]: spp_connect_status, indicating the connection status of SPP.
0 - Disconnected
1 - Connecting
2 - Connected
3 - Disconnecting
args[3]: addr, bytearray type, indicating the MAC address of the peer device. | + +* Example + +```python + +``` + + + +##### Release Bluetooth Resources + +> **bt.release()** + +* Feature + + This function releases Bluetooth resources. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Enable Bluetooth + +> **bt.start()** + +* Feature + + This function enables Bluetooth. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + + + + +##### Disable Bluetooth + +> **bt.stop()** + +* Feature + + This function disables Bluetooth. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + + + + +##### Get Bluetooth Device Status + +> **bt.getStatus()** + +* Feature + + This function gets Bluetooth device status. + +* Parameter + + None + +* Return Value + + | Return Value | Type | Description | + | ------------ | ---- | ------------------------------------ | + | -1 | int | Fails to get Bluetooth device status | + | 0 | int | Bluetooth device is stopped | + | 1 | int | Bluetooth device is working | + + + +##### Get Bluebooth Device Address + +> **bt.getLocalAddr()** + +* Feature + + This function gets Bluetooth device address. This function can only be called after the Bluetooth is initialized and enabled successfully, for example, after receiving an event whose event_id is 0 in the callback function, that is, after *bt.start()* is successfully executed. + +* Parameter + + None + +* Return Value + + If the execution is successful, it returns a 6-byte Bluetooth device address of bytearray type. If the execution fails, it returns -1. + +* Example + +```python +>>> addr = bt.getLocalAddr() +>>> print(addr) +b'\xc7\xa13\xf8\xbf\x1a' +>>> mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) +>>> print('mac = [{}]'.format(mac)) +mac = [1a:bf:f8:33:a1:c7] +``` + + + +##### Set Bluetooth Device Name + +> **bt.setLocalName(code, name)** + +* Feature + + This function sets Bluetooth device name. + +* Parameter + + | Parameter | Type | Description | + | --------- | ------ | ---------------------------------------------------------- | + | code | int | Coding mode
0 - UTF8
1 - GBK | + | name | string | Bluetooth device name, and the maximum length is 22 bytes. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python +>>> bt.setLocalName(0, 'QuecPython-BT') +0 +``` + + + +##### Get Bluetooth Device Name + +> **bt.getLocalName()** + +* Feature + + This function gets Bluetooth device name. + +* Parameter + + None + +* Return Value + + If the execution is successful, it returns a tuple with the format (code, name) , including the name encoding mode and the Bluetooth device name. If the execution fails, it returns -1. + +* Example + +```python +>>> bt.getLocalName() +(0, 'QuecPython-BT') +``` + + + +##### Set Visibility of Bluetooth Device + +> **bt.setVisibleMode(mode)** + +* Feature + + This function sets the visibility of Bluetooth device, that is, whether the Bluetooth device is visible and connectable when it is scanned and acts as a slave device. + +* Parameter + + | Parameter | Type | Description | + | --------- | ---- | ------------------------------------------------------------ | + | mode | int | 0 - Bluetooth device cannot be searched or connected
1 - Bluetooth device can be searched but cannot be connected
2 - Bluetooth device cannot be searched but can be connected
3 - Bluetooth device can be searched and connected | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python +>>> bt.setVisibleMode(3) +0 +``` + + + +##### Get Visibility of Bluetooth Device + +> **bt.getVisibleMode()** + +* Feature + + This function sets the visibility of Bluetooth device. + +* Parameter + + None + +* Return Value + + If the execution is successful, it returns the visibility value of Bluetooth device. If the execution fails, it returns -1. + +* Example + +```python +>>> bt.getVisibleMode() +3 +``` + + + +##### Start Searching for Bluebooth Device + +> **bt.startInquiry(mode)** + +* Feature + + This function starts searching for nearby Bluetooth devices. + +* Parameter + + | Parameter | Type | Description | + | --------- | ---- | ------------------------------------------------------------ | + | mode | int | Indicates the Bluetooth device type to be queried. Currently it is set to 15 which means searching all Bluetooth devices.
| + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python +bt.startInquiry(15) +``` + + + +##### Stop Searching for Bluebooth Device + +> **bt.cancelInquiry()** + +* Feature + + This function stops searching for Bluetooth devices. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Set Audio Output Channel + +> **bt.setChannel(channel)** + +* Feature + + This function sets audio output channel when answering a call or playing audio through Bluetooth. + +* Parameter + + | Parameter | Type | Description | + | --------- | ---- | ----------------------------------------- | + | channel | int | 0 - Handset
1 - Headset
2 - Speaker | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Initialize HFP + +> **bt.hfpInit()** + +* Feature + +​ This function initializes HFP. + +* Parameter + + None + +* Return Value + +​ 0 Successful execution. + +​ -1 Failed execution. + +* Example + +```python + +``` + + + +##### Release HFP Resources + +> **bt.hfpRelease()** + +* Feature + + This function releases HFP resources. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Establish HFP Connection + +> **bt.hfpConnect(addr)** + +* Feature + + This function establishes an HFP connection and connects to AG. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Disconnect HFP Connection + +> **bt.hfpDisonnect(addr)** + +* Feature + + This function disconnects the HFP connection. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Set In-call Volume + +> **bt.hfpSetVolume(addr, vol)** + +* Feature + + This function sets in-call volume through Bluetooth. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + | vol | Int | In-call volume. Range: 1–15. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Hang Up the Phone + +> **bt.hfpRejectAfterAnswer(addr)** + +* Feature + + This function hangs up the connected phone. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Reject the Call + +> **bt.hfpRejectCall(addr)** + +* Feature + + This function rejects the call. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Answer the Call + +> **bt.hfpAnswerCall(addr)** + +* Feature + + This function answers the call. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Enable Voice Assistant + +> **bt.hfpEnableVR(addr)** + +* Feature + + This function enables voice assistant. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Disable Voice Assistant + +> **bt.hfpDisableVR(addr)** + +* Feature + + This function disables voice assistant. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Control Three-way Calling + +> **bt.hfpDisableVR(addr, cmd)** + +* Feature + + This function controls three-way calling. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | -------------------------------------- | + | addr | array | 6-byte Bluetooth device address of AG. | + | cmd | int | Control command | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### HFP Demo + +```python +# -*- coding: UTF-8 -*- + +""" +Description: This demo describes answering calls automatically through HFP. +Platform: EC600UCN_LB Uranium EVB +After running this demo, search for the Bluetooth device name and connect it on the phone A , then make a call from phone B to phone A. When phone A starts ringing and vibrating, the Bluetooth device automatically answers the call. +""" +import bt +import utime +import _thread +from queue import Queue +from machine import Pin + +# If the corresponding playback channel has an external PA, and PA needs to be enabled by the pin, the following steps are required. +# The GPIO to be used depends on the actual pin used. +gpio11 = Pin(Pin.GPIO11, Pin.OUT, Pin.PULL_DISABLE, 0) +gpio11.write(1) + +BT_NAME = 'QuecPython-hfp' + +BT_EVENT = { + 'BT_START_STATUS_IND': 0, # bt/ble start + 'BT_STOP_STATUS_IND': 1, # bt/ble stop + 'BT_HFP_CONNECT_IND': 40, # bt hfp connected + 'BT_HFP_DISCONNECT_IND': 41, # bt hfp disconnected + 'BT_HFP_CALL_IND': 42, # bt hfp call state + 'BT_HFP_CALL_SETUP_IND': 43, # bt hfp call setup state + 'BT_HFP_NETWORK_IND': 44, # bt hfp network state + 'BT_HFP_NETWORK_SIGNAL_IND': 45, # bt hfp network signal + 'BT_HFP_BATTERY_IND': 46, # bt hfp battery level + 'BT_HFP_CALLHELD_IND': 47, # bt hfp callheld state + 'BT_HFP_AUDIO_IND': 48, # bt hfp audio state + 'BT_HFP_VOLUME_IND': 49, # bt hfp volume type + 'BT_HFP_NETWORK_TYPE': 50, # bt hfp network type + 'BT_HFP_RING_IND': 51, # bt hfp ring indication + 'BT_HFP_CODEC_IND': 52, # bt hfp codec type +} + +HFP_CONN_STATUS = 0 +HFP_CONN_STATUS_DICT = { + 'HFP_DISCONNECTED': 0, + 'HFP_CONNECTING': 1, + 'HFP_CONNECTED': 2, + 'HFP_DISCONNECTING': 3, +} +HFP_CALL_STATUS = 0 +HFP_CALL_STATUS_DICT = { + 'HFP_NO_CALL_IN_PROGRESS': 0, + 'HFP_CALL_IN_PROGRESS': 1, +} + +BT_IS_RUN = 0 + +msg_queue = Queue(30) + + +def get_key_by_value(val, d): + for key, value in d.items(): + if val == value: + return key + return None + +def bt_callback(args): + global msg_queue + msg_queue.put(args) + +def bt_event_proc_task(): + global msg_queue + global BT_IS_RUN + global BT_EVENT + global HFP_CONN_STATUS + global HFP_CONN_STATUS_DICT + global HFP_CALL_STATUS + global HFP_CALL_STATUS_DICT + + while True: + print('wait msg...') + msg = msg_queue.get() # Blocks here when there is no message + event_id = msg[0] + status = msg[1] + + if event_id == BT_EVENT['BT_START_STATUS_IND']: + print('event: BT_START_STATUS_IND') + if status == 0: + print('BT start successfully.') + BT_IS_RUN = 1 + bt_status = bt.getStatus() + if bt_status == 1: + print('BT status is 1, normal status.') + else: + print('BT status is {}, abnormal status.'.format(bt_status)) + bt.stop() + break + + retval = bt.getLocalName() + if retval != -1: + print('The current BT name is : {}'.format(retval[1])) + else: + print('Failed to get BT name.') + bt.stop() + break + + print('Set BT name to {}'.format(BT_NAME)) + retval = bt.setLocalName(0, BT_NAME) + if retval != -1: + print('BT name set successfully.') + else: + print('BT name set failed.') + bt.stop() + break + + retval = bt.getLocalName() + if retval != -1: + print('The new BT name is : {}'.format(retval[1])) + else: + print('Failed to get new BT name.') + bt.stop() + break + + # Set the visibility of Bluetooth device to searchable and connectable. + retval = bt.setVisibleMode(3) + if retval == 0: + mode = bt.getVisibleMode() + if mode == 3: + print('BT visible mode set successfully.') + else: + print('BT visible mode set failed.') + bt.stop() + break + else: + print('BT visible mode set failed.') + bt.stop() + break + else: + print('BT start failed.') + bt.stop() + break + elif event_id == BT_EVENT['BT_STOP_STATUS_IND']: + print('event: BT_STOP_STATUS_IND') + if status == 0: + BT_IS_RUN = 0 + print('BT stop successfully.') + else: + print('BT stop failed.') + break + elif event_id == BT_EVENT['BT_HFP_CONNECT_IND']: + HFP_CONN_STATUS = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CONNECT_IND, {}, hfp_conn_status:{}, mac:{}'.format(status, get_key_by_value(msg[2], HFP_CONN_STATUS_DICT), mac)) + if status != 0: + print('BT HFP connect failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_DISCONNECT_IND']: + HFP_CONN_STATUS = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_DISCONNECT_IND, {}, hfp_conn_status:{}, mac:{}'.format(status, get_key_by_value(msg[2], HFP_CONN_STATUS_DICT), mac)) + if status != 0: + print('BT HFP disconnect failed.') + bt.stop() + elif event_id == BT_EVENT['BT_HFP_CALL_IND']: + call_sta = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CALL_IND, {}, hfp_call_status:{}, mac:{}'.format(status, get_key_by_value(msg[2], HFP_CALL_STATUS_DICT), mac)) + if status != 0: + print('BT HFP call failed.') + bt.stop() + continue + + if call_sta == HFP_CALL_STATUS_DICT['HFP_NO_CALL_IN_PROGRESS']: + if HFP_CALL_STATUS == HFP_CALL_STATUS_DICT['HFP_CALL_IN_PROGRESS']: + HFP_CALL_STATUS = call_sta + if HFP_CONN_STATUS == HFP_CONN_STATUS_DICT['HFP_CONNECTED']: + print('call ended, ready to disconnect hfp.') + retval = bt.hfpDisconnect(addr) + if retval == 0: + HFP_CONN_STATUS = HFP_CONN_STATUS_DICT['HFP_DISCONNECTING'] + else: + print('Failed to disconnect hfp connection.') + bt.stop() + continue + else: + if HFP_CALL_STATUS == HFP_CALL_STATUS_DICT['HFP_NO_CALL_IN_PROGRESS']: + HFP_CALL_STATUS = call_sta + print('set audio output channel to 2.') + bt.setChannel(2) + print('set volume to 7.') + retval = bt.hfpSetVolume(addr, 7) + if retval != 0: + print('set volume failed.') + elif event_id == BT_EVENT['BT_HFP_CALL_SETUP_IND']: + call_setup_status = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CALL_SETUP_IND, {}, hfp_call_setup_status:{}, mac:{}'.format(status, call_setup_status, mac)) + if status != 0: + print('BT HFP call setup failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_CALLHELD_IND']: + callheld_status = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CALLHELD_IND, {}, callheld_status:{}, mac:{}'.format(status, callheld_status, mac)) + if status != 0: + print('BT HFP callheld failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_NETWORK_IND']: + network_status = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_NETWORK_IND, {}, network_status:{}, mac:{}'.format(status, network_status, mac)) + if status != 0: + print('BT HFP network status failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_NETWORK_SIGNAL_IND']: + network_signal = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_NETWORK_SIGNAL_IND, {}, signal:{}, mac:{}'.format(status, network_signal, mac)) + if status != 0: + print('BT HFP network signal failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_BATTERY_IND']: + battery_level = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_BATTERY_IND, {}, battery_level:{}, mac:{}'.format(status, battery_level, mac)) + if status != 0: + print('BT HFP battery level failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_AUDIO_IND']: + audio_status = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_AUDIO_IND, {}, audio_status:{}, mac:{}'.format(status, audio_status, mac)) + if status != 0: + print('BT HFP audio failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_VOLUME_IND']: + volume_type = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_VOLUME_IND, {}, volume_type:{}, mac:{}'.format(status, volume_type, mac)) + if status != 0: + print('BT HFP volume failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_NETWORK_TYPE']: + service_type = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_NETWORK_TYPE, {}, service_type:{}, mac:{}'.format(status, service_type, mac)) + if status != 0: + print('BT HFP network service type failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_RING_IND']: + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_RING_IND, {}, mac:{}'.format(status, mac)) + if status != 0: + print('BT HFP ring failed.') + bt.stop() + continue + retval = bt.hfpAnswerCall(addr) + if retval == 0: + print('The call was answered successfully.') + else: + print('Failed to answer the call.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_CODEC_IND']: + codec_type = msg[2] + addr = msg[3] # MAC address of Bluetooth master device + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CODEC_IND, {}, codec_type:{}, mac:{}'.format(status, codec_type, mac)) + if status != 0: + print('BT HFP codec failed.') + bt.stop() + continue + print('Ready to release hfp.') + bt.hfpRelease() + bt.release() + + +def main(): + global BT_IS_RUN + + _thread.start_new_thread(bt_event_proc_task, ()) + + retval = bt.init(bt_callback) + if retval == 0: + print('BT init successful.') + else: + print('BT init failed.') + return -1 + retval = bt.hfpInit() + if retval == 0: + print('HFP init successful.') + else: + print('HFP init failed.') + return -1 + retval = bt.start() + if retval == 0: + print('BT start successful.') + else: + print('BT start failed.') + retval = bt.hfpRelease() + if retval == 0: + print('HFP release successful.') + else: + print('HFP release failed.') + retval = bt.release() + if retval == 0: + print('BT release successful.') + else: + print('BT release failed.') + return -1 + + count = 0 + while True: + utime.sleep(1) + count += 1 + cur_time = utime.localtime() + timestamp = "{:02d}:{:02d}:{:02d}".format(cur_time[3], cur_time[4], cur_time[5]) + + if count % 5 == 0: + if BT_IS_RUN == 1: + print('[{}] BT HFP is running, count = {}......'.format(timestamp, count)) + print('') + else: + print('BT HFP has stopped running, ready to exit.') + break + + +if __name__ == '__main__': + main() + +``` + + + +##### Initialize A2DP/AVRCP + +> **bt.a2dpavrcpInit()** + +* Feature + + This function initializes A2DP and AVRCP. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Release A2DP/AVRCP Resources + +> **bt.a2dpavrcpRelease()** + +* Feature + + This function releases A2DP and AVRCP resources. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Disconnect A2DP Connection + +> **bt.a2dpDisconnect(addr)** + +* Feature + + This function disconnects A2DP connection. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | ---------------------------------------------- | + | addr | array | 6-byte address of A2DP Bluetooth master device | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Get Address of A2DP Bluetooth Master Device + +> **bt.a2dpGetAddr()** + +* Feature + + This function gets address of A2DP Bluetooth master device. + +* Parameter + + None + +* Return Value + + If the execution is successful, it returns a 6-byte address of A2DP Bluetooth master device in bytearray type. If the execution fails, it returns -1. + +* Example + +```python + +``` + + + +##### Get A2DP Connection Status + +> **bt.a2dpGetConnStatus()** + +* Feature + + This function gets A2DP connection status. + +* Parameter + + None + +* Return Value + + | Return Value | Type | Description | + | ------------ | ---- | ----------------------------------- | + | -1 | int | Fails to get A2DP connection status | + | 0 | int | Disconnected | + | 1 | int | Connecting | + | 2 | int | Connected | + | 3 | int | Disconnecting | + +* Example + +```python +1 +``` + + + +##### AVRCP Set Bluetooth Master Device to Start Playing + +> **bt.avrcpStart()** + +* Feature + + This function sets Bluetooth master device to start playing. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### AVRCP Set Bluetooth Master Device to Stop Playing + +> **bt.avrcpPause()** + +* Feature + + This function sets Bluetooth master device to stop playing. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### AVRCP Set Bluetooth Master Device to Play the Previous Track + +> **bt.avrcpPrev()** + +* Feature + + This function sets Bluetooth master device to play the previous track. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### AVRCP Set Bluetooth Master Device to Play the Next Track + +> **bt.avrcpNext()** + +* Feature + + This function sets Bluetooth master device to play the next track. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### AVRCP Set Volume of Bluetooth Master Device + +> **bt.avrcpSetVolume(vol)** + +* Feature + + This function sets the volume of Bluetooth master device. + +* Parameter + + | Parameter | Type | Description | + | --------- | ---- | -------------------- | + | vol | int | Volume. Range: 0–11. | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### AVRCP Get Volume of Bluetooth Master Device + +> **bt.avrcpGetVolume()** + +* Feature + + This function gets the volume of Bluetooth master device. + +* Parameter + + None + +* Return Value + + An integer volume value Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### AVRCP Get Play Status of Bluetooth Master Device + +> **bt.avrcpGetPlayStatus()** + +* Feature + + This function gets play status of Bluetooth master device. + +* Parameter + + None + +* Return Value + + | Return Value | Type | Description | + | ------------ | ---- | ------------------------------- | + | -1 | int | Fails to get play status | + | 0 | int | Not play | + | 1 | int | playing | + | 2 | int | Play paused | + | 3 | int | Switching to the previous track | + | 4 | int | Switching to the next track | + +* Example + +```python + +``` + + + +##### AVRCP Get Connection Status of Bluetooth Master Device + +> **bt.avrcpGetConnStatus()** + +* Feature + + This function gets connection status of Bluetooth master device through AVRCP protocol. + +* Parameter + + None + +* Return Value + + | Return Value | Type | Description | + | ------------ | ---- | ------------------------------ | + | -1 | int | Fails to get connection status | + | 0 | int | Disconnected | + | 1 | int | Connecting | + | 2 | int | Connected | + | 3 | int | Disconnecting | + +* Example + +```python + +``` + + + +##### A2DP/AVRCP Demo + +```python +# -*- coding: UTF-8 -*- + +""" +Description: This demo describes a simple Bluetooth music playback operation through A2DP/AVRCP. +After running this demo, search for Bluetooth device name and connect it on the mobile phone, then open the music player on the mobile phone. Then return to the demo running interface, and call the corresponding functions according to the prompt menu to perform the music playback, pause, previous track, next track and the volume setting. +""" +import bt +import utime +import _thread +from queue import Queue +from machine import Pin + +BT_STATUS_DICT = { + 'BT_NOT_RUNNING': 0, + 'BT_IS_RUNNING': 1 +} + +A2DP_AVRCP_CONNECT_STATUS = { + 'DISCONNECTED': 0, + 'CONNECTING': 1, + 'CONNECTED': 2, + 'DISCONNECTING': 3 +} + +host_addr = 0 +msg_queue = Queue(10) + +# If the corresponding playback channel has an external PA, and PA needs to be enabled by the pin, the following steps are required. +# Which GPIO to be used depends on the actual pin used. +gpio11 = Pin(Pin.GPIO11, Pin.OUT, Pin.PULL_DISABLE, 0) +gpio11.write(1) + + +def cmd_proc(cmd): + cmds = ('1', '2', '3', '4', '5') + vols = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11') + + if cmd in cmds: + if cmd == '5': + while True: + tmp = input('Please input volume: ') + if len(tmp) != 1: + vol = tmp.split('Please input volume: ')[1] + else: + vol = tmp + if vol in vols: + return cmd, int(vol) + else: + print('Volume should be in [0,11], try again.') + else: + return cmd, 0 + else: + print('Command {} is not supported!'.format(cmd)) + return -1 + +def avrcp_play(args): + return bt.avrcpStart() + +def avrcp_pause(args): + return bt.avrcpPause() + +def avrcp_prev(args): + return bt.avrcpPrev() + +def avrcp_next(args): + return bt.avrcpNext() + +def avrcp_set_volume(vol): + return bt.avrcpSetVolume(vol) + +def bt_callback(args): + pass + +def bt_a2dp_avrcp_proc_task(): + global msg_queue + + cmd_handler = { + '1': avrcp_play, + '2': avrcp_pause, + '3': avrcp_prev, + '4': avrcp_next, + '5': avrcp_set_volume, + } + while True: + # print('wait msg...') + msg = msg_queue.get() + print('recv msg: {}'.format(msg)) + cmd_handler.get(msg[0])(msg[1]) + + +def main(): + global host_addr + global msg_queue + + _thread.start_new_thread(bt_a2dp_avrcp_proc_task, ()) + bt.init(bt_callback) + bt.setChannel(2) + retval = bt.a2dpavrcpInit() + if retval == 0: + print('BT A2DP/AVRCP initialization succeeded.') + else: + print('BT A2DP/AVRCP initialization failed.') + return -1 + + retval = bt.start() + if retval != 0: + print('BT start failed.') + return -1 + + utime.sleep_ms(1500) + + old_name = bt.getLocalName() + if old_name == -1: + print('Get BT name error.') + return -1 + print('The current BT name is {}'.format(old_name[1])) + new_name = 'QuecPython-a2dp' + print('Set new BT name to {}'.format(new_name)) + retval = bt.setLocalName(0, new_name) + if retval == -1: + print('Set BT name failed.') + return -1 + cur_name = bt.getLocalName() + if cur_name == -1: + print('Get new BT name error.') + return -1 + else: + if cur_name[1] == new_name: + print('BT name changed successfully.') + else: + print('BT name changed failed.') + + visible_mode = bt.getVisibleMode() + if visible_mode != -1: + print('The current BT visible mode is {}'.format(visible_mode)) + else: + print('Get BT visible mode error.') + return -1 + + print('Set BT visible mode to 3.') + retval = bt.setVisibleMode(3) + if retval == -1: + print('Set BT visible mode error.') + return -1 + count = 0 + while True: + count += 1 + if count % 5 == 0: + print('waiting to be connected...') + if count >= 10000: + count = 0 + a2dp_status = bt.a2dpGetConnStatus() + avrcp_status = bt.avrcpGetConnStatus() + if a2dp_status == A2DP_AVRCP_CONNECT_STATUS['CONNECTED'] and avrcp_status == A2DP_AVRCP_CONNECT_STATUS['CONNECTED']: + print('========== BT connected! =========') + addr = bt.a2dpGetAddr() + if addr != -1: + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('The BT address on the host side: {}'.format(mac)) + host_addr = addr + else: + print('Get BT addr error.') + return -1 + print('Please open the music player software on your phone first.') + print('Please enter the following options to select a function:') + print('========================================================') + print('1 : play') + print('2 : pause') + print('3 : prev') + print('4 : next') + print('5 : set volume') + print('6 : exit') + print('========================================================') + while True: + tmp = input('> ') + if len(tmp) != 1: + cmd = tmp.split('> ')[1] + else: + cmd = tmp + if cmd == '6': + break + retval = cmd_proc(cmd) + if retval != -1: + msg_queue.put(retval) + break + else: + utime.sleep_ms(1000) + print('Ready to disconnect a2dp.') + retval = bt.a2dpDisconnect(host_addr) + if retval == 0: + print('a2dp connection disconnected successfully') + else: + print('Disconnect a2dp error.') + print('Ready to stop BT.') + retval = bt.stop() + if retval == 0: + print('BT has stopped.') + else: + print('BT stop error.') + bt.a2dpavrcpRelease() + bt.release() + + +if __name__ == '__main__': + main() +``` + + + +##### Initialize SPP + +> **bt.sppInit()** + +* Feature + + This function initializes SPP. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Release SPP Resources + +> **bt.sppRelease()** + +* Feature + + This function releases SPP resources. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Establish SPP Connection + +> **bt.sppConnect(addr)** + +* Feature + + This function established an SPP connection. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | ------------------------------- | + | addr | array | 6-byte Bluetooth device address | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### Disconnect SPP Connection + +> **bt.sppDisconnect()** + +* Feature + + This function disconnects SPP connection. + +* Parameter + + None + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### SPP Send Data + +> **bt.sppSend(data)** + +* Feature + + This function sends data through SPP. + +* Parameter + + | Parameter | Type | Description | + | --------- | ----- | --------------- | + | data | array | Data to be sent | + +* Return Value + + 0 Successful execution. + + -1 Failed execution. + +* Example + +```python + +``` + + + +##### SPP Demo + +```python +# -*- coding: UTF-8 -*- + +""" +Description: This demo describes the data transmission with the mobile phone through SPP. +1) Before running the demo, you need to install a Bluetooth serial port application on the mobile phone (Android), such as BlueSPP, and then open this application; +2) Change the Bluetooth name of the target device in this demo, that is, change the value of DST_DEVICE_INFO['dev_name'] to the Bluetooth name of the mobile phone that the user wants to connect to; +3) When running the demo, first search for nearby Bluetooth devices. If the target device is found, the search will end, and then an SPP connection request will be sent to the target device; +4) The user should check whether the interface of the Bluetooth pairing request pops up on the mobile phone. When it appears, click to pair; +5) After the Bluetooth devices are successfully paired, the user can enter the Bluetooth serial port interface and send data to the device. After receiving the data, the device will reply "I have received the data you sent." +6) Click to disconnect in the application of the mobile phone to end the demo. +""" +import bt +import utime +import _thread +from queue import Queue + + +BT_NAME = 'QuecPython-SPP' + +BT_EVENT = { + 'BT_START_STATUS_IND': 0, # bt/ble start + 'BT_STOP_STATUS_IND': 1, # bt/ble stop + 'BT_SPP_INQUIRY_IND': 6, # bt spp inquiry ind + 'BT_SPP_INQUIRY_END_IND': 7, # bt spp inquiry end ind + 'BT_SPP_RECV_DATA_IND': 14, # bt spp recv data ind + 'BT_SPP_CONNECT_IND': 61, # bt spp connect ind + 'BT_SPP_DISCONNECT_IND': 62, # bt spp disconnect ind +} + +DST_DEVICE_INFO = { + 'dev_name': 'HUAWEI Mate40 Pro', # The name of the Bluetooth device to be connected + 'bt_addr': None +} + +BT_IS_RUN = 0 +msg_queue = Queue(30) + + +def bt_callback(args): + global msg_queue + msg_queue.put(args) + + +def bt_event_proc_task(): + global msg_queue + global BT_IS_RUN + global DST_DEVICE_INFO + + while True: + print('wait msg...') + msg = msg_queue.get() # Blocks here when there is no message + event_id = msg[0] + status = msg[1] + + if event_id == BT_EVENT['BT_START_STATUS_IND']: + print('event: BT_START_STATUS_IND') + if status == 0: + print('BT start successfully.') + BT_IS_RUN = 1 + + print('Set BT name to {}'.format(BT_NAME)) + retval = bt.setLocalName(0, BT_NAME) + if retval != -1: + print('BT name set successfully.') + else: + print('BT name set failed.') + bt.stop() + continue + + retval = bt.setVisibleMode(3) + if retval == 0: + mode = bt.getVisibleMode() + if mode == 3: + print('BT visible mode set successfully.') + else: + print('BT visible mode set failed.') + bt.stop() + continue + else: + print('BT visible mode set failed.') + bt.stop() + continue + + retval = bt.startInquiry(15) + if retval != 0: + print('Inquiry error.') + bt.stop() + continue + else: + print('BT start failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_STOP_STATUS_IND']: + print('event: BT_STOP_STATUS_IND') + if status == 0: + BT_IS_RUN = 0 + print('BT stop successfully.') + else: + print('BT stop failed.') + + retval = bt.sppRelease() + if retval == 0: + print('SPP release successfully.') + else: + print('SPP release failed.') + retval = bt.release() + if retval == 0: + print('BT release successfully.') + else: + print('BT release failed.') + break + elif event_id == BT_EVENT['BT_SPP_INQUIRY_IND']: + print('event: BT_SPP_INQUIRY_IND') + if status == 0: + rssi = msg[2] + name = msg[4] + addr = msg[5] + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('name: {}, addr: {}, rssi: {}'.format(name, mac, rssi)) + + if name == DST_DEVICE_INFO['dev_name']: + print('The target device is found, device name {}'.format(name)) + DST_DEVICE_INFO['bt_addr'] = addr + retval = bt.cancelInquiry() + if retval != 0: + print('cancel inquiry failed.') + continue + else: + print('BT inquiry failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_INQUIRY_END_IND']: + print('event: BT_SPP_INQUIRY_END_IND') + if status == 0: + print('BT inquiry has ended.') + inquiry_sta = msg[2] + if inquiry_sta == 0: + if DST_DEVICE_INFO['bt_addr'] is not None: + print('Ready to connect to the target device : {}'.format(DST_DEVICE_INFO['dev_name'])) + retval = bt.sppConnect(DST_DEVICE_INFO['bt_addr']) + if retval != 0: + print('SPP connect failed.') + bt.stop() + continue + else: + print('Not found device [{}], continue to inquiry.'.format(DST_DEVICE_INFO['dev_name'])) + bt.cancelInquiry() + bt.startInquiry(15) + else: + print('Inquiry end failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_RECV_DATA_IND']: + print('event: BT_SPP_RECV_DATA_IND') + if status == 0: + datalen = msg[2] + data = msg[3] + print('recv {} bytes data: {}'.format(datalen, data)) + send_data = 'I have received the data you sent.' + print('send data: {}'.format(send_data)) + retval = bt.sppSend(send_data) + if retval != 0: + print('send data faied.') + else: + print('Recv data failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_CONNECT_IND']: + print('event: BT_SPP_CONNECT_IND') + if status == 0: + conn_sta = msg[2] + addr = msg[3] + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('SPP connect successful, conn_sta = {}, addr {}'.format(conn_sta, mac)) + else: + print('Connect failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_DISCONNECT_IND']: + print('event: BT_SPP_DISCONNECT_IND') + conn_sta = msg[2] + addr = msg[3] + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('SPP disconnect successful, conn_sta = {}, addr {}'.format(conn_sta, mac)) + bt.stop() + continue + + +def main(): + global BT_IS_RUN + + _thread.start_new_thread(bt_event_proc_task, ()) + retval = bt.init(bt_callback) + if retval == 0: + print('BT init successful.') + else: + print('BT init failed.') + return -1 + retval = bt.sppInit() + if retval == 0: + print('SPP init successful.') + else: + print('SPP init failed.') + return -1 + retval = bt.start() + if retval == 0: + print('BT start successful.') + else: + print('BT start failed.') + retval = bt.sppRelease() + if retval == 0: + print('SPP release successful.') + else: + print('SPP release failed.') + return -1 + + count = 0 + while True: + utime.sleep(1) + count += 1 + cur_time = utime.localtime() + timestamp = "{:02d}:{:02d}:{:02d}".format(cur_time[3], cur_time[4], cur_time[5]) + + if count % 5 == 0: + if BT_IS_RUN == 1: + print('[{}] BT SPP is running, count = {}......'.format(timestamp, count)) + print('') + else: + print('BT SPP has stopped running, ready to exit.') + break + + +if __name__ == '__main__': + main() +``` + + + #### camera - Camera and Code Scan Module function: Preview, camera, video recorder, code scan (currently only preview and code scan are supported.) diff --git a/zh-cn/api/QuecPythonClasslib.md b/zh-cn/api/QuecPythonClasslib.md index 1c90327..ff277de 100644 --- a/zh-cn/api/QuecPythonClasslib.md +++ b/zh-cn/api/QuecPythonClasslib.md @@ -2177,7 +2177,7 @@ sms.setCallback(cb) > **net.setApn(\*args)** 设置APN,设置后需要重启或者通过 net.setModemFun(mode) 接口先切换到模式0,再切换到模式1才能生效。 - + * 参数 该接口在Qualcomm/ASR_1803s/Unisoc(不包括EG915)平台为可变参函数,参数个数为2或7, 其他平台参数个数固定为2: @@ -2252,7 +2252,7 @@ sms.setCallback(cb) '3gnet' >>> net.getApn(1,0) (1, '3gnet', 'mia', '123', 2) -``` +``` @@ -10726,6 +10726,1925 @@ if __name__ == '__main__': +#### bt - 经典蓝牙 + +模块功能:提供经典蓝牙的相关功能,支持HFP、A2DP、AVRCP、SPP。 + +##### 蓝牙初始化 + +> **bt.init(user_cb)** + +* 功能 + +蓝牙初始化并注册回调函数。 + +* 参数 + +| 参数 | 类型 | 说明 | +| ------- | -------- | -------- | +| user_cb | function | 回调函数 | + +* 返回值 + +执行成功返回整型0,失败返回整型-1。 + +说明: + +(1)回调函数的形式 + +```python +def bt_callback(args): + event_id = args[0] # 第一个参数固定是 event_id + status = args[1] # 第二个参数固定是状态,表示某个操作的执行结果是成功还是失败 + ...... +``` + +(2)回调函数参数说明 + +​ args[0] 固定表示event_id,args[1] 固定表示状态,0表示成功,非0表示失败。回调函数的参数个数并不是固定2个,而是根据第一个参数args[0]来决定的,下表中列出了不同事件ID对应的参数个数及说明。 + +| event_id | 参数个数 | 参数说明 | +| :------: | :------: | ------------------------------------------------------------ | +| 0 | 2 | args[0] :event_id,表示 BT/BLE start 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败 | +| 1 | 2 | args[0] :event_id,表示 BT/BLE stop
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败 | +| 6 | 6 | args[0] :event_id,表示 BT inquiry 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :rssi,搜索到的设备的信号强度;
args[3] :device_class
args[4] :device_name,设备名称,字符串类型
args[5] :addr,搜到的蓝牙设备的mac地址 | +| 7 | 3 | args[0] :event_id,表示 BT inquiry end 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :end_status,0 - 正常结束搜索,8 - 强制结束搜索 | +| 14 | 4 | args[0] :event_id,表示 BT spp recv 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :data_len,收到的数据长度
args[3] :data,收到的数据,bytearray类型数据 | +| 40 | 4 | args[0] :event_id,表示 BT HFP connect 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_connect_status,表示hfp的连接状态;
0 - 已经断开连接
1 - 连接中
2 - 已经连接
3 - 断开连接中
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 41 | 4 | args[0] :event_id,表示 BT HFP disconnect 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_connect_status,表示hfp的连接状态;
0 - 已经断开连接
1 - 连接中
2 - 已经连接
3 - 断开连接中
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 42 | 4 | args[0] :event_id,表示 BT HFP call status 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_call_status,表示hfp的通话状态;
0 - 当前没有正在进行的通话
1 - 当前至少有一个正在进行的通话
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 43 | 4 | args[0] :event_id,表示 BT HFP call setup status 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_call_setup_status,表示hfp的call setup状态;
0 - 表示没有电话需要接通
1 - 表示有一个拨进来的电话还未接通
2 - 表示有一个拨出去的电话还没有接通
3 - 表示拨出电话的蓝牙连接的另一方正在响铃
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 44 | 4 | args[0] :event_id,表示 BT HFP network status 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_network_status,表示AG的网络状态;
0 - 表示网络不可用
1 - 表示网络正常
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 45 | 4 | args[0] :event_id,表示 BT HFP network signal 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_network_signal,表示AG的信号,范围 0~5
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 46 | 4 | args[0] :event_id,表示 BT HFP battery level 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_battery_level,表示AG端的电池电量,范围 0~5
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 47 | 4 | args[0] :event_id,表示 BT HFP call held status 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_call_held_status,表示hfp的call held状态;
0 - 表示没有保持呼叫
1 - 表示呼叫被暂停或活动/保持呼叫交换
2 - 表示呼叫暂停,没有活动呼叫
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 48 | 4 | args[0] :event_id,表示 BT HFP audio status 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_audio_status,表示audio连接状态;
0 - 表示audio已经断开连接
1 - 表示audio正在连接中
2 - 表示audio已经连接成功
3 - 表示audio正在断开连接
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 49 | 4 | args[0] :event_id,表示 BT HFP volume type 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_volume_type
0 - 表示volume type为speaker
1 - 表示volume type为microphone
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 50 | 4 | args[0] :event_id,表示 BT HFP service type 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_service_type,表示当前AG的网络服务模式;
0 - 表示AG当前为正常网络模式
1 - 表示AG当前处于漫游模式
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 51 | 4 | args[0] :event_id,表示 BT HFP ring 事件,即来电时响铃事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :当前无实际意义,保留
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 52 | 4 | args[0] :event_id,表示 BT HFP codec type 事件,即编解码模式
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :hfp_codec_type,表示当前使用哪个编解码模式;
1 - 表示 CVDS,采用8kHz采样率
2 - 表示mSBC,采用16kHz采样率
args[3] :addr,BT 主设备的地址,bytearray类型数据 | +| 61 | 4 | args[0] :event_id,表示 BT SPP connect 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :spp_connect_status,表示spp的连接状态;
0 - 已经断开连接
1 - 连接中
2 - 已经连接
3 - 断开连接中
args[3] :addr,对端设备的mac地址,bytearray类型数据 | +| 62 | 4 | args[0] :event_id,表示 BT SPP disconnect 事件
args[1] :status,表示操作的状态,0 - 成功,非0 - 失败
args[2] :spp_connect_status,表示spp的连接状态;
0 - 已经断开连接
1 - 连接中
2 - 已经连接
3 - 断开连接中
args[3] :addr,对端设备的mac地址,bytearray类型数据 | + +* 示例 + +```python + +``` + + + +##### 蓝牙资源释放 + +> **bt.release()** + +* 功能 + + 蓝牙资源释放。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### 开启蓝牙功能 + +> **bt.start()** + +* 功能 + + 开启蓝牙功能。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + + + + +##### 关闭蓝牙功能 + +> **bt.stop()** + +* 功能 + + 关闭蓝牙功能。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + + + + +##### 获取蓝牙状态 + +> **bt.getStatus()** + +* 功能 + + 获取蓝牙的状态。 + +* 参数 + + 无 + +* 返回值 + + | 返回值 | 类型 | 说明 | + | ------ | ---- | ---------------- | + | -1 | int | 获取状态失败 | + | 0 | int | 蓝牙处于停止状态 | + | 1 | int | 蓝牙正常运行中 | + + + +##### 获取蓝牙地址 + +> **bt.getLocalAddr()** + +* 功能 + + 获取蓝牙地址。该接口需要在蓝牙已经初始化完成并启动成功后才能调用,比如在回调中收到 event_id 为0的事件之后,即 start 成功后,去调用。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回bytearray类型的蓝牙地址,6字节,失败返回整型-1。 + +* 示例 + +```python +>>> addr = bt.getLocalAddr() +>>> print(addr) +b'\xc7\xa13\xf8\xbf\x1a' +>>> mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) +>>> print('mac = [{}]'.format(mac)) +mac = [1a:bf:f8:33:a1:c7] +``` + + + +##### 设置蓝牙名称 + +> **bt.setLocalName(code, name)** + +* 功能 + + 设置蓝牙名称。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ------ | --------------------------------- | + | code | int | 编码模式
0 - UTF8
1 - GBK | + | name | string | 蓝牙名称,最大长度22字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python +>>> bt.setLocalName(0, 'QuecPython-BT') +0 +``` + + + +##### 获取蓝牙名称 + +> **bt.getLocalName()** + +* 功能 + + 获取蓝牙名称。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回一个元组,包含名称编码模式和蓝牙名称,失败返回整型-1。 + + 成功返回格式:`(code, name)` + +* 示例 + +```python +>>> bt.getLocalName() +(0, 'QuecPython-BT') +``` + + + +##### 设置蓝牙可见模式 + +> **bt.setVisibleMode(mode)** + +* 功能 + + 设置蓝牙可见模式,即做从机时,被扫描时,是否可见以及可连接。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | ------------------------------------------------------------ | + | mode | int | 0 - 不可被发现,不可被连接
1 - 可以被发现,但不可被连接
2 - 不可被发现,但可被连接
3 - 可以被发现,可被连接 | + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python +>>> bt.setVisibleMode(3) +0 +``` + + + +##### 获取蓝牙可见模式 + +> **bt.getVisibleMode()** + +* 功能 + + 获取蓝牙可见模式。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回蓝牙当前的可见模式值,失败返回整型-1。 + +* 示例 + +```python +>>> bt.getVisibleMode() +3 +``` + + + +##### 开始搜索设备 + +> **bt.startInquiry(mode)** + +* 功能 + + 开始搜索周边的蓝牙设备。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | ---------------------------------------------- | + | mode | int | 表示查询哪一类设备;当前直接写15,表示搜索所有 | + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python +bt.startInquiry(15) +``` + + + +##### 取消搜索设备 + +> **bt.cancelInquiry()** + +* 功能 + + 取消搜索操作。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### 设置音频输出通道 + +> **bt.setChannel(channel)** + +* 功能 + + 通过蓝牙接听电话或者播放音频时,通过该接口来设置音频输出通道。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ------- | ---- | -------------------------------- | + | channel | int | 0 - 听筒
1 - 耳机
2 - 喇叭 | + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 功能初始化 + +> **bt.hfpInit()** + +* 功能 + +HFP 功能初始化 。 + +* 参数 + + 无 + +* 返回值 + +执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 资源释放 + +> **bt.hfpRelease()** + +* 功能 + + HFP 资源释放。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 建立连接 + +> **bt.hfpConnect(addr)** + +* 功能 + + 连接AG,建立HFP连接。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 断开连接 + +> **bt.hfpDisonnect(addr)** + +* 功能 + + 断开HFP连接。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 设置通话音量 + +> **bt.hfpSetVolume(addr, vol)** + +* 功能 + + 设置蓝牙通话时的音量。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + | vol | int | 通话音量,范围 1-15 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 挂断电话 + +> **bt.hfpRejectAfterAnswer(addr)** + +* 功能 + + 挂断接通的电话。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 拒接电话 + +> **bt.hfpRejectCall(addr)** + +* 功能 + + 拒接电话。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 接听电话 + +> **bt.hfpAnswerCall(addr)** + +* 功能 + + 接听电话。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 开启语音助手 + +> **bt.hfpEnableVR(addr)** + +* 功能 + + 开启语音助手。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 关闭语音助手 + +> **bt.hfpDisableVR(addr)** + +* 功能 + + 关闭语音助手。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 三方通话控制 + +> **bt.hfpDisableVR(addr, cmd)** + +* 功能 + + 三方通话控制。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | addr | 数组 | AG端蓝牙地址,6个字节 | + | cmd | int | 控制命令 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### HFP 示例程序 + +```python +# -*- coding: UTF-8 -*- + +""" +示例说明:本例程提供一个通过HFP自动接听电话的功能 +运行平台:EC600UCN_LB 铀开发板 +运行本例程后,通过手机A搜索到设备名并点击连接;然后通过手机B拨打电话给手机A, +当手机A开始响铃震动时,设备会自动接听电话 +""" +import bt +import utime +import _thread +from queue import Queue +from machine import Pin + +# 如果对应播放通道外置了PA,且需要引脚控制PA开启,则需要下面步骤 +# 具体使用哪个GPIO取决于实际使用的引脚 +gpio11 = Pin(Pin.GPIO11, Pin.OUT, Pin.PULL_DISABLE, 0) +gpio11.write(1) + +BT_NAME = 'QuecPython-hfp' + +BT_EVENT = { + 'BT_START_STATUS_IND': 0, # bt/ble start + 'BT_STOP_STATUS_IND': 1, # bt/ble stop + 'BT_HFP_CONNECT_IND': 40, # bt hfp connected + 'BT_HFP_DISCONNECT_IND': 41, # bt hfp disconnected + 'BT_HFP_CALL_IND': 42, # bt hfp call state + 'BT_HFP_CALL_SETUP_IND': 43, # bt hfp call setup state + 'BT_HFP_NETWORK_IND': 44, # bt hfp network state + 'BT_HFP_NETWORK_SIGNAL_IND': 45, # bt hfp network signal + 'BT_HFP_BATTERY_IND': 46, # bt hfp battery level + 'BT_HFP_CALLHELD_IND': 47, # bt hfp callheld state + 'BT_HFP_AUDIO_IND': 48, # bt hfp audio state + 'BT_HFP_VOLUME_IND': 49, # bt hfp volume type + 'BT_HFP_NETWORK_TYPE': 50, # bt hfp network type + 'BT_HFP_RING_IND': 51, # bt hfp ring indication + 'BT_HFP_CODEC_IND': 52, # bt hfp codec type +} + +HFP_CONN_STATUS = 0 +HFP_CONN_STATUS_DICT = { + 'HFP_DISCONNECTED': 0, + 'HFP_CONNECTING': 1, + 'HFP_CONNECTED': 2, + 'HFP_DISCONNECTING': 3, +} +HFP_CALL_STATUS = 0 +HFP_CALL_STATUS_DICT = { + 'HFP_NO_CALL_IN_PROGRESS': 0, + 'HFP_CALL_IN_PROGRESS': 1, +} + +BT_IS_RUN = 0 + +msg_queue = Queue(30) + + +def get_key_by_value(val, d): + for key, value in d.items(): + if val == value: + return key + return None + +def bt_callback(args): + global msg_queue + msg_queue.put(args) + +def bt_event_proc_task(): + global msg_queue + global BT_IS_RUN + global BT_EVENT + global HFP_CONN_STATUS + global HFP_CONN_STATUS_DICT + global HFP_CALL_STATUS + global HFP_CALL_STATUS_DICT + + while True: + print('wait msg...') + msg = msg_queue.get() # 没有消息时会阻塞在这 + event_id = msg[0] + status = msg[1] + + if event_id == BT_EVENT['BT_START_STATUS_IND']: + print('event: BT_START_STATUS_IND') + if status == 0: + print('BT start successfully.') + BT_IS_RUN = 1 + bt_status = bt.getStatus() + if bt_status == 1: + print('BT status is 1, normal status.') + else: + print('BT status is {}, abnormal status.'.format(bt_status)) + bt.stop() + break + + retval = bt.getLocalName() + if retval != -1: + print('The current BT name is : {}'.format(retval[1])) + else: + print('Failed to get BT name.') + bt.stop() + break + + print('Set BT name to {}'.format(BT_NAME)) + retval = bt.setLocalName(0, BT_NAME) + if retval != -1: + print('BT name set successfully.') + else: + print('BT name set failed.') + bt.stop() + break + + retval = bt.getLocalName() + if retval != -1: + print('The new BT name is : {}'.format(retval[1])) + else: + print('Failed to get new BT name.') + bt.stop() + break + + # 设置蓝牙可见模式为:可以被发现并且可以被连接 + retval = bt.setVisibleMode(3) + if retval == 0: + mode = bt.getVisibleMode() + if mode == 3: + print('BT visible mode set successfully.') + else: + print('BT visible mode set failed.') + bt.stop() + break + else: + print('BT visible mode set failed.') + bt.stop() + break + else: + print('BT start failed.') + bt.stop() + break + elif event_id == BT_EVENT['BT_STOP_STATUS_IND']: + print('event: BT_STOP_STATUS_IND') + if status == 0: + BT_IS_RUN = 0 + print('BT stop successfully.') + else: + print('BT stop failed.') + break + elif event_id == BT_EVENT['BT_HFP_CONNECT_IND']: + HFP_CONN_STATUS = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CONNECT_IND, {}, hfp_conn_status:{}, mac:{}'.format(status, get_key_by_value(msg[2], HFP_CONN_STATUS_DICT), mac)) + if status != 0: + print('BT HFP connect failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_DISCONNECT_IND']: + HFP_CONN_STATUS = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_DISCONNECT_IND, {}, hfp_conn_status:{}, mac:{}'.format(status, get_key_by_value(msg[2], HFP_CONN_STATUS_DICT), mac)) + if status != 0: + print('BT HFP disconnect failed.') + bt.stop() + elif event_id == BT_EVENT['BT_HFP_CALL_IND']: + call_sta = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CALL_IND, {}, hfp_call_status:{}, mac:{}'.format(status, get_key_by_value(msg[2], HFP_CALL_STATUS_DICT), mac)) + if status != 0: + print('BT HFP call failed.') + bt.stop() + continue + + if call_sta == HFP_CALL_STATUS_DICT['HFP_NO_CALL_IN_PROGRESS']: + if HFP_CALL_STATUS == HFP_CALL_STATUS_DICT['HFP_CALL_IN_PROGRESS']: + HFP_CALL_STATUS = call_sta + if HFP_CONN_STATUS == HFP_CONN_STATUS_DICT['HFP_CONNECTED']: + print('call ended, ready to disconnect hfp.') + retval = bt.hfpDisconnect(addr) + if retval == 0: + HFP_CONN_STATUS = HFP_CONN_STATUS_DICT['HFP_DISCONNECTING'] + else: + print('Failed to disconnect hfp connection.') + bt.stop() + continue + else: + if HFP_CALL_STATUS == HFP_CALL_STATUS_DICT['HFP_NO_CALL_IN_PROGRESS']: + HFP_CALL_STATUS = call_sta + print('set audio output channel to 2.') + bt.setChannel(2) + print('set volume to 7.') + retval = bt.hfpSetVolume(addr, 7) + if retval != 0: + print('set volume failed.') + elif event_id == BT_EVENT['BT_HFP_CALL_SETUP_IND']: + call_setup_status = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CALL_SETUP_IND, {}, hfp_call_setup_status:{}, mac:{}'.format(status, call_setup_status, mac)) + if status != 0: + print('BT HFP call setup failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_CALLHELD_IND']: + callheld_status = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CALLHELD_IND, {}, callheld_status:{}, mac:{}'.format(status, callheld_status, mac)) + if status != 0: + print('BT HFP callheld failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_NETWORK_IND']: + network_status = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_NETWORK_IND, {}, network_status:{}, mac:{}'.format(status, network_status, mac)) + if status != 0: + print('BT HFP network status failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_NETWORK_SIGNAL_IND']: + network_signal = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_NETWORK_SIGNAL_IND, {}, signal:{}, mac:{}'.format(status, network_signal, mac)) + if status != 0: + print('BT HFP network signal failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_BATTERY_IND']: + battery_level = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_BATTERY_IND, {}, battery_level:{}, mac:{}'.format(status, battery_level, mac)) + if status != 0: + print('BT HFP battery level failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_AUDIO_IND']: + audio_status = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_AUDIO_IND, {}, audio_status:{}, mac:{}'.format(status, audio_status, mac)) + if status != 0: + print('BT HFP audio failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_VOLUME_IND']: + volume_type = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_VOLUME_IND, {}, volume_type:{}, mac:{}'.format(status, volume_type, mac)) + if status != 0: + print('BT HFP volume failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_NETWORK_TYPE']: + service_type = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_NETWORK_TYPE, {}, service_type:{}, mac:{}'.format(status, service_type, mac)) + if status != 0: + print('BT HFP network service type failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_RING_IND']: + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_RING_IND, {}, mac:{}'.format(status, mac)) + if status != 0: + print('BT HFP ring failed.') + bt.stop() + continue + retval = bt.hfpAnswerCall(addr) + if retval == 0: + print('The call was answered successfully.') + else: + print('Failed to answer the call.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_HFP_CODEC_IND']: + codec_type = msg[2] + addr = msg[3] # BT 主机端mac地址 + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('BT_HFP_CODEC_IND, {}, codec_type:{}, mac:{}'.format(status, codec_type, mac)) + if status != 0: + print('BT HFP codec failed.') + bt.stop() + continue + print('Ready to release hfp.') + bt.hfpRelease() + bt.release() + + +def main(): + global BT_IS_RUN + + _thread.start_new_thread(bt_event_proc_task, ()) + + retval = bt.init(bt_callback) + if retval == 0: + print('BT init successful.') + else: + print('BT init failed.') + return -1 + retval = bt.hfpInit() + if retval == 0: + print('HFP init successful.') + else: + print('HFP init failed.') + return -1 + retval = bt.start() + if retval == 0: + print('BT start successful.') + else: + print('BT start failed.') + retval = bt.hfpRelease() + if retval == 0: + print('HFP release successful.') + else: + print('HFP release failed.') + retval = bt.release() + if retval == 0: + print('BT release successful.') + else: + print('BT release failed.') + return -1 + + count = 0 + while True: + utime.sleep(1) + count += 1 + cur_time = utime.localtime() + timestamp = "{:02d}:{:02d}:{:02d}".format(cur_time[3], cur_time[4], cur_time[5]) + + if count % 5 == 0: + if BT_IS_RUN == 1: + print('[{}] BT HFP is running, count = {}......'.format(timestamp, count)) + print('') + else: + print('BT HFP has stopped running, ready to exit.') + break + + +if __name__ == '__main__': + main() + +``` + + + +##### A2DP/AVRCP 功能初始化 + +> **bt.a2dpavrcpInit()** + +* 功能 + + A2DP和AVRCP功能初始化。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### A2DP/AVRCP 资源释放 + +> **bt.a2dpavrcpRelease()** + +* 功能 + + A2DP和AVRCP 资源释放。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### A2DP 断开连接 + +> **bt.a2dpDisconnect(addr)** + +* 功能 + + 断开A2DP连接。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | ------------------------- | + | addr | 数组 | A2DP主机蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### A2DP 获取主机蓝牙地址 + +> **bt.a2dpGetAddr()** + +* 功能 + + 获取A2DP主机蓝牙地址。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回bytearray类型的A2DP主机蓝牙地址,6字节,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### A2DP 获取A2DP连接状态 + +> **bt.a2dpGetConnStatus()** + +* 功能 + + 获取A2DP连接状态。 + +* 参数 + + 无 + +* 返回值 + + | 返回值 | 类型 | 说明 | + | ------ | ---- | ------------ | + | -1 | int | 获取失败 | + | 0 | int | 连接已断开 | + | 1 | int | 正在连接中 | + | 2 | int | 已连接 | + | 3 | int | 正在断开连接 | + +* 示例 + +```python +1 +``` + + + +##### AVRCP 控制主机开始播放 + +> **bt.avrcpStart()** + +* 功能 + + 控制主机开始播放。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### AVRCP 控制主机停止播放 + +> **bt.avrcpPause()** + +* 功能 + + 控制主机停止播放。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### AVRCP 控制主机播放上一首 + +> **bt.avrcpPrev()** + +* 功能 + + 控制主机播放上一首。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### AVRCP 控制主机播放下一首 + +> **bt.avrcpNext()** + +* 功能 + + 控制主机播放下一首。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### AVRCP 设置主机播放音量 + +> **bt.avrcpSetVolume(vol)** + +* 功能 + + 设置主机播放音量。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | --------------------- | + | vol | int | 播放音量,范围 0 - 11 | + +* 返回值 + + 执行成功返回整形0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### AVRCP 获取主机播放音量 + +> **bt.avrcpGetVolume()** + +* 功能 + + 获取主机播放音量。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整形音量值,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### AVRCP 获取主机播放状态 + +> **bt.avrcpGetPlayStatus()** + +* 功能 + + 获取主机播放状态。 + +* 参数 + + 无 + +* 返回值 + + | 返回值 | 类型 | 说明 | + | ------ | ---- | -------------- | + | -1 | int | 获取失败 | + | 0 | int | 没有播放 | + | 1 | int | 正在播放 | + | 2 | int | 暂停播放 | + | 3 | int | 正在切换下一首 | + | 4 | int | 正在切换下一首 | + +* 示例 + +```python + +``` + + + +##### AVRCP 获取与主机连接状态 + +> **bt.avrcpGetConnStatus()** + +* 功能 + + 通过AVRCP协议获取主机连接状态。 + +* 参数 + + 无 + +* 返回值 + + | 返回值 | 类型 | 说明 | + | ------ | ---- | ------------ | + | -1 | int | 获取失败 | + | 0 | int | 连接已断开 | + | 1 | int | 正在连接中 | + | 2 | int | 已连接 | + | 3 | int | 正在断开连接 | + +* 示例 + +```python + +``` + + + +##### A2DP/AVRCP 示例程序 + +```python +# -*- coding: UTF-8 -*- + +""" +示例说明:本例程提供一个通过A2DP/AVRCP实现的简易蓝牙音乐播放控制功能 +运行本例程后,通过手机搜索到设备名并点击连接;然后打开手机上的音乐播放软件, +回到例程运行界面,根据提示菜单输入对应的控制命令来实现音乐的播放、暂停、上一首、 +下一首以及设置音量的功能 +""" +import bt +import utime +import _thread +from queue import Queue +from machine import Pin + +BT_STATUS_DICT = { + 'BT_NOT_RUNNING': 0, + 'BT_IS_RUNNING': 1 +} + +A2DP_AVRCP_CONNECT_STATUS = { + 'DISCONNECTED': 0, + 'CONNECTING': 1, + 'CONNECTED': 2, + 'DISCONNECTING': 3 +} + +host_addr = 0 +msg_queue = Queue(10) + +# 如果对应播放通道外置了PA,且需要引脚控制PA开启,则需要下面步骤 +# 具体使用哪个GPIO取决于实际使用的引脚 +gpio11 = Pin(Pin.GPIO11, Pin.OUT, Pin.PULL_DISABLE, 0) +gpio11.write(1) + + +def cmd_proc(cmd): + cmds = ('1', '2', '3', '4', '5') + vols = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11') + + if cmd in cmds: + if cmd == '5': + while True: + tmp = input('Please input volume: ') + if len(tmp) != 1: + vol = tmp.split('Please input volume: ')[1] + else: + vol = tmp + if vol in vols: + return cmd, int(vol) + else: + print('Volume should be in [0,11], try again.') + else: + return cmd, 0 + else: + print('Command {} is not supported!'.format(cmd)) + return -1 + +def avrcp_play(args): + return bt.avrcpStart() + +def avrcp_pause(args): + return bt.avrcpPause() + +def avrcp_prev(args): + return bt.avrcpPrev() + +def avrcp_next(args): + return bt.avrcpNext() + +def avrcp_set_volume(vol): + return bt.avrcpSetVolume(vol) + +def bt_callback(args): + pass + +def bt_a2dp_avrcp_proc_task(): + global msg_queue + + cmd_handler = { + '1': avrcp_play, + '2': avrcp_pause, + '3': avrcp_prev, + '4': avrcp_next, + '5': avrcp_set_volume, + } + while True: + # print('wait msg...') + msg = msg_queue.get() + print('recv msg: {}'.format(msg)) + cmd_handler.get(msg[0])(msg[1]) + + +def main(): + global host_addr + global msg_queue + + _thread.start_new_thread(bt_a2dp_avrcp_proc_task, ()) + bt.init(bt_callback) + bt.setChannel(2) + retval = bt.a2dpavrcpInit() + if retval == 0: + print('BT A2DP/AVRCP initialization succeeded.') + else: + print('BT A2DP/AVRCP initialization failed.') + return -1 + + retval = bt.start() + if retval != 0: + print('BT start failed.') + return -1 + + utime.sleep_ms(1500) + + old_name = bt.getLocalName() + if old_name == -1: + print('Get BT name error.') + return -1 + print('The current BT name is {}'.format(old_name[1])) + new_name = 'QuecPython-a2dp' + print('Set new BT name to {}'.format(new_name)) + retval = bt.setLocalName(0, new_name) + if retval == -1: + print('Set BT name failed.') + return -1 + cur_name = bt.getLocalName() + if cur_name == -1: + print('Get new BT name error.') + return -1 + else: + if cur_name[1] == new_name: + print('BT name changed successfully.') + else: + print('BT name changed failed.') + + visible_mode = bt.getVisibleMode() + if visible_mode != -1: + print('The current BT visible mode is {}'.format(visible_mode)) + else: + print('Get BT visible mode error.') + return -1 + + print('Set BT visible mode to 3.') + retval = bt.setVisibleMode(3) + if retval == -1: + print('Set BT visible mode error.') + return -1 + count = 0 + while True: + count += 1 + if count % 5 == 0: + print('waiting to be connected...') + if count >= 10000: + count = 0 + a2dp_status = bt.a2dpGetConnStatus() + avrcp_status = bt.avrcpGetConnStatus() + if a2dp_status == A2DP_AVRCP_CONNECT_STATUS['CONNECTED'] and avrcp_status == A2DP_AVRCP_CONNECT_STATUS['CONNECTED']: + print('========== BT connected! =========') + addr = bt.a2dpGetAddr() + if addr != -1: + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('The BT address on the host side: {}'.format(mac)) + host_addr = addr + else: + print('Get BT addr error.') + return -1 + print('Please open the music player software on your phone first.') + print('Please enter the following options to select a function:') + print('========================================================') + print('1 : play') + print('2 : pause') + print('3 : prev') + print('4 : next') + print('5 : set volume') + print('6 : exit') + print('========================================================') + while True: + tmp = input('> ') + if len(tmp) != 1: + cmd = tmp.split('> ')[1] + else: + cmd = tmp + if cmd == '6': + break + retval = cmd_proc(cmd) + if retval != -1: + msg_queue.put(retval) + break + else: + utime.sleep_ms(1000) + print('Ready to disconnect a2dp.') + retval = bt.a2dpDisconnect(host_addr) + if retval == 0: + print('a2dp connection disconnected successfully') + else: + print('Disconnect a2dp error.') + print('Ready to stop BT.') + retval = bt.stop() + if retval == 0: + print('BT has stopped.') + else: + print('BT stop error.') + bt.a2dpavrcpRelease() + bt.release() + + +if __name__ == '__main__': + main() +``` + + + +##### SPP 功能初始化 + +> **bt.sppInit()** + +* 功能 + + SPP 功能初始化。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### SPP 资源释放 + +> **bt.sppRelease()** + +* 功能 + + SPP 资源释放。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### SPP 建立连接 + +> **bt.sppConnect(addr)** + +* 功能 + + 建立SPP连接。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | ----------------- | + | addr | 数组 | 蓝牙地址,6个字节 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### SPP 断开连接 + +> **bt.sppDisconnect()** + +* 功能 + + 断开SPP连接。 + +* 参数 + + 无 + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### SPP 数据发送 + +> **bt.sppSend(data)** + +* 功能 + + 通过SPP发送数据。 + +* 参数 + + | 参数 | 类型 | 说明 | + | ---- | ---- | ------------ | + | data | 数组 | 待发送的数据 | + +* 返回值 + + 执行成功返回整型0,失败返回整型-1。 + +* 示例 + +```python + +``` + + + +##### SPP 示例程序 + +```python +# -*- coding: UTF-8 -*- + +""" +示例说明:本例程提供一个通过SPP实现与手机端进行数据传输的功能 +(1)运行之前,需要先在手机端(安卓)安装蓝牙串口APP,如BlueSPP,然后打开该软件; +(2)修改本例程中的目标设备的蓝牙名称,即 DST_DEVICE_INFO['dev_name'] 的值改为用户准备连接的手机的蓝牙名称; +(3)运行本例程,例程中会先发起搜索周边设备的操作,直到搜索到目标设备,就会结束搜索,然后向目标设备发起SPP连接请求; +(4)用户注意查看手机界面是否弹出蓝牙配对请求的界面,当出现时,点击配对; +(5)配对成功后,用户即可进入到蓝牙串口界面,发送数据给设备,设备在收到数据后会回复“I have received the data you sent.” +(6)手机端APP中点击断开连接,即可结束例程; +""" +import bt +import utime +import _thread +from queue import Queue + + +BT_NAME = 'QuecPython-SPP' + +BT_EVENT = { + 'BT_START_STATUS_IND': 0, # bt/ble start + 'BT_STOP_STATUS_IND': 1, # bt/ble stop + 'BT_SPP_INQUIRY_IND': 6, # bt spp inquiry ind + 'BT_SPP_INQUIRY_END_IND': 7, # bt spp inquiry end ind + 'BT_SPP_RECV_DATA_IND': 14, # bt spp recv data ind + 'BT_SPP_CONNECT_IND': 61, # bt spp connect ind + 'BT_SPP_DISCONNECT_IND': 62, # bt spp disconnect ind +} + +DST_DEVICE_INFO = { + 'dev_name': 'HUAWEI Mate40 Pro', # 要连接设备的蓝牙名称 + 'bt_addr': None +} + +BT_IS_RUN = 0 +msg_queue = Queue(30) + + +def bt_callback(args): + global msg_queue + msg_queue.put(args) + + +def bt_event_proc_task(): + global msg_queue + global BT_IS_RUN + global DST_DEVICE_INFO + + while True: + print('wait msg...') + msg = msg_queue.get() # 没有消息时会阻塞在这 + event_id = msg[0] + status = msg[1] + + if event_id == BT_EVENT['BT_START_STATUS_IND']: + print('event: BT_START_STATUS_IND') + if status == 0: + print('BT start successfully.') + BT_IS_RUN = 1 + + print('Set BT name to {}'.format(BT_NAME)) + retval = bt.setLocalName(0, BT_NAME) + if retval != -1: + print('BT name set successfully.') + else: + print('BT name set failed.') + bt.stop() + continue + + retval = bt.setVisibleMode(3) + if retval == 0: + mode = bt.getVisibleMode() + if mode == 3: + print('BT visible mode set successfully.') + else: + print('BT visible mode set failed.') + bt.stop() + continue + else: + print('BT visible mode set failed.') + bt.stop() + continue + + retval = bt.startInquiry(15) + if retval != 0: + print('Inquiry error.') + bt.stop() + continue + else: + print('BT start failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_STOP_STATUS_IND']: + print('event: BT_STOP_STATUS_IND') + if status == 0: + BT_IS_RUN = 0 + print('BT stop successfully.') + else: + print('BT stop failed.') + + retval = bt.sppRelease() + if retval == 0: + print('SPP release successfully.') + else: + print('SPP release failed.') + retval = bt.release() + if retval == 0: + print('BT release successfully.') + else: + print('BT release failed.') + break + elif event_id == BT_EVENT['BT_SPP_INQUIRY_IND']: + print('event: BT_SPP_INQUIRY_IND') + if status == 0: + rssi = msg[2] + name = msg[4] + addr = msg[5] + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('name: {}, addr: {}, rssi: {}'.format(name, mac, rssi)) + + if name == DST_DEVICE_INFO['dev_name']: + print('The target device is found, device name {}'.format(name)) + DST_DEVICE_INFO['bt_addr'] = addr + retval = bt.cancelInquiry() + if retval != 0: + print('cancel inquiry failed.') + continue + else: + print('BT inquiry failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_INQUIRY_END_IND']: + print('event: BT_SPP_INQUIRY_END_IND') + if status == 0: + print('BT inquiry has ended.') + inquiry_sta = msg[2] + if inquiry_sta == 0: + if DST_DEVICE_INFO['bt_addr'] is not None: + print('Ready to connect to the target device : {}'.format(DST_DEVICE_INFO['dev_name'])) + retval = bt.sppConnect(DST_DEVICE_INFO['bt_addr']) + if retval != 0: + print('SPP connect failed.') + bt.stop() + continue + else: + print('Not found device [{}], continue to inquiry.'.format(DST_DEVICE_INFO['dev_name'])) + bt.cancelInquiry() + bt.startInquiry(15) + else: + print('Inquiry end failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_RECV_DATA_IND']: + print('event: BT_SPP_RECV_DATA_IND') + if status == 0: + datalen = msg[2] + data = msg[3] + print('recv {} bytes data: {}'.format(datalen, data)) + send_data = 'I have received the data you sent.' + print('send data: {}'.format(send_data)) + retval = bt.sppSend(send_data) + if retval != 0: + print('send data faied.') + else: + print('Recv data failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_CONNECT_IND']: + print('event: BT_SPP_CONNECT_IND') + if status == 0: + conn_sta = msg[2] + addr = msg[3] + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('SPP connect successful, conn_sta = {}, addr {}'.format(conn_sta, mac)) + else: + print('Connect failed.') + bt.stop() + continue + elif event_id == BT_EVENT['BT_SPP_DISCONNECT_IND']: + print('event: BT_SPP_DISCONNECT_IND') + conn_sta = msg[2] + addr = msg[3] + mac = '{:02x}:{:02x}:{:02x}:{:02x}:{:02x}:{:02x}'.format(addr[5], addr[4], addr[3], addr[2], addr[1], addr[0]) + print('SPP disconnect successful, conn_sta = {}, addr {}'.format(conn_sta, mac)) + bt.stop() + continue + + +def main(): + global BT_IS_RUN + + _thread.start_new_thread(bt_event_proc_task, ()) + retval = bt.init(bt_callback) + if retval == 0: + print('BT init successful.') + else: + print('BT init failed.') + return -1 + retval = bt.sppInit() + if retval == 0: + print('SPP init successful.') + else: + print('SPP init failed.') + return -1 + retval = bt.start() + if retval == 0: + print('BT start successful.') + else: + print('BT start failed.') + retval = bt.sppRelease() + if retval == 0: + print('SPP release successful.') + else: + print('SPP release failed.') + return -1 + + count = 0 + while True: + utime.sleep(1) + count += 1 + cur_time = utime.localtime() + timestamp = "{:02d}:{:02d}:{:02d}".format(cur_time[3], cur_time[4], cur_time[5]) + + if count % 5 == 0: + if BT_IS_RUN == 1: + print('[{}] BT SPP is running, count = {}......'.format(timestamp, count)) + print('') + else: + print('BT SPP has stopped running, ready to exit.') + break + + +if __name__ == '__main__': + main() +``` + + + + + #### camera - 摄像扫码 模块功能:实现摄像头预览,照相机,录像机,扫码功能(目前仅支持预览和扫码功能) From f5e3409cf947e690f7e3bf2bda13cd5ca2702a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zhen=20Guo=28=E9=83=AD=E8=87=BB=29?= Date: Thu, 24 Nov 2022 14:49:34 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=8F=E5=85=B8?= =?UTF-8?q?=E8=93=9D=E9=A2=9C=E4=B8=AD=E6=96=87wiki=E4=B8=AD=E9=83=A8?= =?UTF-8?q?=E5=88=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh-cn/api/QuecPythonClasslib.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zh-cn/api/QuecPythonClasslib.md b/zh-cn/api/QuecPythonClasslib.md index 8c46e75..279dc1e 100644 --- a/zh-cn/api/QuecPythonClasslib.md +++ b/zh-cn/api/QuecPythonClasslib.md @@ -12325,7 +12325,6 @@ if __name__ == '__main__': * 示例 ```python -1 ``` @@ -12496,7 +12495,7 @@ if __name__ == '__main__': | 0 | int | 没有播放 | | 1 | int | 正在播放 | | 2 | int | 暂停播放 | - | 3 | int | 正在切换下一首 | + | 3 | int | 正在切换上一首 | | 4 | int | 正在切换下一首 | * 示例 From 0bc39cf5fa8944aa9d055644500d3046f760c0d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhardt=20Peng=28=E5=BD=AD=E6=88=90=E5=90=8D=29?= Date: Mon, 5 Dec 2022 14:15:53 +0800 Subject: [PATCH 6/6] EC600Muart modify & EC800M bsp --- en-us/api/QuecPythonClasslib.md | 120 +++++++++++++++--------------- zh-cn/api/QuecPythonClasslib.md | 125 ++++++++++++++++---------------- 2 files changed, 126 insertions(+), 119 deletions(-) diff --git a/en-us/api/QuecPythonClasslib.md b/en-us/api/QuecPythonClasslib.md index 277059a..4a7b1b6 100644 --- a/en-us/api/QuecPythonClasslib.md +++ b/en-us/api/QuecPythonClasslib.md @@ -4721,10 +4721,10 @@ Note: The BC25PA platform does not support this module function. | Constent | Description | Usage Platform | | -------- | ----------- | -------------------------------------- | -| PWM.PWM0 | PWM0 | EC600S/EC600N/EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U | -| PWM.PWM1 | PWM1 | EC600S/EC600N/EC100Y/EC800N/EC600M | -| PWM.PWM2 | PWM2 | EC600S/EC600N/EC100Y/EC800N/EC600M | -| PWM.PWM3 | PWM3 | EC600S/EC600N/EC100Y/EC800N/EC600M | +| PWM.PWM0 | PWM0 | EC600S/EC600N/EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | +| PWM.PWM1 | PWM1 | EC600S/EC600N/EC100Y/EC800N/EC600M/EC800M | +| PWM.PWM2 | PWM2 | EC600S/EC600N/EC100Y/EC800N/EC600M/EC800M | +| PWM.PWM3 | PWM3 | EC600S/EC600N/EC100Y/EC800N/EC600M/EC800M | @@ -4738,7 +4738,7 @@ Note: The BC25PA platform does not support this module function. | Parameter | Type | Description | | --------- | ---- | ------------------------------------------------------------ | -| PWMn | int | PWM Number
Note: EC100Y-CN module supports PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 19
PWM1 – Pin No. 18
PWM2 – Pin No. 23
PWM3 – Pin No. 22
Note: EC600S-CN/EC600N-CN modules support PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 52
PWM1 –Pin No. 53
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note:EC800N modules support PWM0-PWM3,and the corresponding pins are as follows:
PWM0 – Pin No. 79
PWM1 – Pin No. 78
PWM2 – Pin No. 16
PWM3 – Pin No. 49
Note: EC200U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 135
Note: EC600U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 70
Note: EC600M series module supports PWM0-PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 57
PWM1 – Pin No. 56
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note: EG915U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 20 | +| PWMn | int | PWM Number
Note: EC100Y-CN module supports PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 19
PWM1 – Pin No. 18
PWM2 – Pin No. 23
PWM3 – Pin No. 22
Note: EC600S-CN/EC600N-CN modules support PWM0–PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 52
PWM1 –Pin No. 53
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note:EC800N modules support PWM0-PWM3,and the corresponding pins are as follows:
PWM0 – Pin No. 79
PWM1 – Pin No. 78
PWM2 – Pin No. 16
PWM3 – Pin No. 49
Note: EC200U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 135
Note: EC600U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 70
Note: EC600M series module supports PWM0-PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 57
PWM1 – Pin No. 56
PWM2 – Pin No. 70
PWM3 – Pin No. 69
Note: EG915U series module supports PWM0, and the corresponding pins are as follows:
PWM0 – Pin No. 20
Note: EC800M series module supports PWM0-PWM3, and the corresponding pins are as follows:
PWM0 – Pin No. 83
PWM1 – Pin No. 78
PWM2 – Pin No. 16
PWM3 – Pin No. 49 | | ABOVE_xx | int | EC600SCN/EC600N/EC800N modules:
PWM.ABOVE_MS Range of MS level: (0,1023]
PWM.ABOVE_1US Range of US level: (0,157]
PWM.ABOVE_10US Range of US level: (1,1575]
PWM.ABOVE_BELOW_US Range of NS level: (0,1024]
EC200U/EC600U/EG915U modules:
PWM.ABOVE_MS Range of MS level: (0,10]
PWM.ABOVE_1US Range of US level: (0,10000]
PWM.ABOVE_10US Range of US level: (1,10000]
PWM.ABOVE_BELOW_US Range of NS level: [100,65535] | | highTime | int | In MS level, the unit is ms
In US level, the unit is us
In NS level: it needs to be calculated by the user
Frequency = 13Mhz / cycleTime
Duty cycle = highTime/ cycleTime | | cycleTime | int | In MS level, the unit is ms
In US level, the unit is us
In NS level: it needs to be calculated by the user
Frequency = 13Mhz / cycleTime
Duty cycle = highTime/ cycleTime | @@ -4834,8 +4834,8 @@ if __name__ == '__main__': | Constant | Description | Usage Platform | | -------- | ------------- | ------------------------------------------------------------ | -| ADC.ADC0 | ADC Channel 0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/BG95M3/EC200A/EC600M/EG915U | -| ADC.ADC1 | ADC Channel 1 | EC600U/EC200U/EC200A/EC600M/EG915U | +| ADC.ADC0 | ADC Channel 0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/BG95M3/EC200A/EC600M/EG915U/EC800M | +| ADC.ADC1 | ADC Channel 1 | EC600U/EC200U/EC200A/EC600M/EG915U/EC800M | | ADC.ADC2 | ADC Channel 2 | EC600U/EC200U | | ADC.ADC3 | ADC Channel 3 | EC600U | @@ -4882,7 +4882,7 @@ It reads the voltage value of the specified channel. Unit: mV. | Parameter | Type | Description | | --------- | ---- | ------------------------------------------------------------ | -| ADCn | int | ADC Channel
The corresponding pins for EC100Y-CN module are as follows:
ADC0 – Pin No. 39
ADC1 – Pin No. 81
The corresponding pins for EC600S-CN/EC600N_CN modules are as follows
ADC0 – Pin No. 19
The corresponding pins for EC600M modules are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
The corresponding pins for EC800N/BC25PA series module are as follows
ADC0 – Pin No. 9
The corresponding pins for EC600U series module are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
ADC2 – Pin No. 113
ADC3 – Pin No. 114
The corresponding pins for EC200U series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
ADC2 – Pin No.43
The corresponding pins for EC200A series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
The corresponding pins for BG95M3 series module are as follows
ADC0 – Pin No. 24
The corresponding pins for EG915U series module are as follows
ADC0 – Pin No. 24
ADC1 – Pin No. 2 | +| ADCn | int | ADC Channel
The corresponding pins for EC100Y-CN module are as follows:
ADC0 – Pin No. 39
ADC1 – Pin No. 81
The corresponding pins for EC600S-CN/EC600N_CN modules are as follows
ADC0 – Pin No. 19
The corresponding pins for EC600M modules are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
The corresponding pins for EC800N/BC25PA series module are as follows
ADC0 – Pin No. 9
The corresponding pins for EC600U series module are as follows
ADC0 – Pin No. 19
ADC1 – Pin No. 20
ADC2 – Pin No. 113
ADC3 – Pin No. 114
The corresponding pins for EC200U series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
ADC2 – Pin No.43
The corresponding pins for EC200A series module are as follows
ADC0 – Pin No. 45
ADC1 – Pin No. 44
The corresponding pins for BG95M3 series module are as follows
ADC0 – Pin No. 24
The corresponding pins for EG915U series module are as follows
ADC0 – Pin No. 24
ADC1 – Pin No. 2
The corresponding pins for EC800M series module are as follows
ADC0 – Pin No. 9
ADC1 – Pin No. 96 | * Return Value @@ -5224,50 +5224,50 @@ Function: GPIO read and write operations. | Constant | Applicable Platform | Description | | ---------------- | ------------------------------------------------------------ | -------------- | -| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO1 | -| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO2 | -| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO3 | -| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO4 | -| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO5 | -| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO6 | -| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO7 | -| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO8 | -| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO9 | -| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO10 | -| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO11 | -| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO12 | -| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO13 | -| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO14 | -| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO15 | -| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO16 | -| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO17 | -| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO18 | -| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U | GPIO19 | -| Pin.GPIO20 | EC600S / EC600N /EC600U/EC200U/EC200A/ EC800N / BG95M3/EC600M/EG915U | GPIO20 | -| Pin.GPIO21 | EC600S / EC600N /EC600U/EC200U/ EC800N / BG95M3/EC600M/EG915U | GPIO21 | -| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO22 | -| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO23 | -| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO24 | -| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO25 | -| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U | GPIO26 | -| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO27 | -| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO28 | -| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO29 | -| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO30 | -| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO31 | -| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO32 | -| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO33 | -| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO34 | -| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO35 | -| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO36 | -| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO37 | -| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO38 | -| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO39 | -| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO40 | -| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO41 | -| Pin.GPIO42 | EC600U / EC200U/EC600M | GPIO42 | -| Pin.GPIO43 | EC600U / EC200U/EC200A/EC600M | GPIO43 | -| Pin.GPIO44 | EC600U / EC200U/EC200A/EC600M | GPIO44 | +| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO1 | +| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO2 | +| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO3 | +| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO4 | +| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO5 | +| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO6 | +| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO7 | +| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO8 | +| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO9 | +| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO10 | +| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO11 | +| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO12 | +| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO13 | +| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO14 | +| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO15 | +| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO16 | +| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M/EG915U/EC800M | GPIO17 | +| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M/EG915U/EC800M | GPIO18 | +| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO19 | +| Pin.GPIO20 | EC600S / EC600N /EC600U/EC200U/EC200A/ EC800N / BG95M3/EC600M/EG915U/EC800M | GPIO20 | +| Pin.GPIO21 | EC600S / EC600N /EC600U/EC200U/ EC800N / BG95M3/EC600M/EG915U/EC800M | GPIO21 | +| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO22 | +| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U/EC800M | GPIO23 | +| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U/EC800M | GPIO24 | +| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U/EC800M | GPIO25 | +| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EG915U/EC800M | GPIO26 | +| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO27 | +| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO28 | +| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO29 | +| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO30 | +| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO31 | +| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO32 | +| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO33 | +| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO34 | +| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO35 | +| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO36 | +| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO37 | +| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO38 | +| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO39 | +| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO40 | +| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO41 | +| Pin.GPIO42 | EC600U / EC200U/EC600M/EC800M | GPIO42 | +| Pin.GPIO43 | EC600U / EC200U/EC200A/EC600M/EC800M | GPIO43 | +| Pin.GPIO44 | EC600U / EC200U/EC200A/EC600M/EC800M | GPIO44 | | Pin.GPIO45 | EC600U / EC200U/EC200A/EC600M | GPIO45 | | Pin.GPIO46 | EC600U / EC200U/EC200A | GPIO46 | | Pin.GPIO47 | EC200U/EC200A | GPIO47 | @@ -5289,7 +5289,7 @@ The GPIO pin numbers provided in this document correspond to the external pin nu | Parameter | Type | Description | | :-------- | :--- | ------------------------------------------------------------ | -| GPIOn | int | Pin Number
The corresponding pins of EC100Y-CN module are as follows (pin number is external pin number):
GPIO1 – Pin No. 22
GPIO2 – Pin No. 23
GPIO3 – Pin No. 38
GPIO4 – Pin No. 53
GPIO5 – Pin No. 54
GPIO6 – Pin No. 104
GPIO7 – Pin No. 105
GPIO8 – Pin No. 106
GPIO9 – Pin No. 107
GPIO10 – Pin No. 178
GPIO11 – Pin No. 195
GPIO12 – Pin No. 196
GPIO13 – Pin No. 197
GPIO14 – Pin No. 198
GPIO15 – Pin No. 199
GPIO16 – Pin No. 203
GPIO17 – Pin No. 204
GPIO18 – Pin No. 214
GPIO19 – Pin No. 215
The corresponding pins of EC600S-CN/EC600N-CN modules are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
The corresponding pins of EC600M series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
GPIO42 – Pin No. 109
GPIO43 – Pin No. 110
GPIO44 – Pin No. 112
GPIO45 – Pin No. 111
The corresponding pins of EC600U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 61(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 58(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 34(cannot be gpio function at the same time as GPIO41)
GPIO4 – Pin No. 60(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 69(cannot be gpio function at the same time as GPIO35)
GPIO6 – Pin No. 70(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 123(cannot be gpio function at the same time as GPIO43)
GPIO8 – Pin No. 118
GPIO9 – Pin No. 9
GPIO10 – Pin No. 1(cannot be gpio function at the same time as GPIO37)
GPIO11 – Pin No. 4(cannot be gpio function at the same time as GPIO38)
GPIO12 – Pin No. 3(cannot be gpio function at the same time as GPIO39)
GPIO13 – Pin No. 2(cannot be gpio function at the same time as GPIO40)
GPIO14 – Pin No. 54
GPIO15 – Pin No. 57
GPIO16 – Pin No. 56
GPIO17 – Pin No. 12
GPIO18 – Pin No. 33(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 124(cannot be gpio function at the same time as GPIO44)
GPIO20 – Pin No. 122(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 121(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 48
GPIO23 – Pin No. 39
GPIO24 – Pin No. 40
GPIO25 – Pin No. 49
GPIO26 – Pin No. 50
GPIO27 – Pin No. 53
GPIO28 – Pin No. 52
GPIO29 – Pin No. 51
GPIO30 – Pin No. 59(cannot be gpio function at the same time as GPIO33)
GPIO31 – Pin No. 66(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 63(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 67(cannot be gpio function at the same time as GPIO30)
GPIO34 – Pin No. 65(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 137(cannot be gpio function at the same time as GPIO5)
GPIO36 – Pin No. 62(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 98(cannot be gpio function at the same time as GPIO10)
GPIO38 – Pin No. 95(cannot be gpio function at the same time as GPIO11)
GPIO39 – Pin No. 119(cannot be gpio function at the same time as GPIO12)
GPIO40 – Pin No. 100(cannot be gpio function at the same time as GPIO13)
GPIO41 – Pin No. 120(cannot be gpio function at the same time as GPIO3)
GPIO42 – Pin No. 16(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 10(cannot be gpio function at the same time as GPIO7)
GPIO44 – Pin No. 14(cannot be gpio function at the same time as GPIO19)
GPIO45 – Pin No. 15(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 13(cannot be gpio function at the same time as GPIO21)
The corresponding pins of EC200U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 26(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 24(cannot be gpio function at the same time as GPIO33)
GPIO4 – Pin No. 25(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 13(cannot be gpio function at the same time as GPIO17)
GPIO6 – Pin No. 135(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 136(cannot be gpio function at the same time as GPIO44)
GPIO8 – Pin No. 133
GPIO9 – Pin No. 3(cannot be gpio function at the same time as GPIO37)
GPIO10 – Pin No. 40(cannot be gpio function at the same time as GPIO38)
GPIO11 – Pin No. 37(cannot be gpio function at the same time as GPIO39)
GPIO12 – Pin No. 38(cannot be gpio function at the same time as GPIO40)
GPIO13 – Pin No. 39(cannot be gpio function at the same time as GPIO41)
GPIO14 – Pin No. 5
GPIO15 – Pin No. 141
GPIO16 – Pin No. 142
GPIO17 – Pin No. 121(cannot be gpio function at the same time as GPIO5)
GPIO18 – Pin No. 65(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 64(cannot be gpio function at the same time as GPIO43)
GPIO20 – Pin No. 139(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 126(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 127(cannot be gpio function at the same time as GPIO47)
GPIO23 – Pin No. 33
GPIO24 – Pin No. 31
GPIO25 – Pin No. 30
GPIO26 – Pin No. 29
GPIO27 – Pin No. 28
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO31 – Pin No. 125(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 124(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 123(cannot be gpio function at the same time as GPIO3)
GPIO34 – Pin No. 122(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 134(cannot be gpio function at the same time as GPIO9)
GPIO38 – Pin No. 132(cannot be gpio function at the same time as GPIO10)
GPIO39 – Pin No. 131(cannot be gpio function at the same time as GPIO11)
GPIO40 – Pin No. 130(cannot be gpio function at the same time as GPIO12)
GPIO41 – Pin No. 129(cannot be gpio function at the same time as GPIO13)
GPIO42 – Pin No. 61(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 62(cannot be gpio function at the same time as GPIO19)
GPIO44 – Pin No. 63(cannot be gpio function at the same time as GPIO7)
GPIO45 – Pin No. 66(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 6(cannot be gpio function at the same time as GPIO21)
GPIO47 – Pin No. 23(cannot be gpio function at the same time as GPIO22)
The corresponding pins of EC200A series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27
GPIO2 – Pin No. 26
GPIO3 – Pin No.24
GPIO4 – Pin No.25
GPIO5 – Pin No.5
GPIO6 – Pin No.135
GPIO7 – Pin No.136
GPIO9 – Pin No. 3
GPIO10 – Pin No. 40
GPIO11 – Pin No. 37
GPIO12 – Pin No. 38
GPIO13 – Pin No. 39
GPIO18 – Pin No. 65
GPIO19 – Pin No. 64
GPIO20 – Pin No. 139
GPIO22 – Pin No. 127
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119
GPIO43 – Pin No. 62
GPIO44 – Pin No. 63
GPIO45 – Pin No. 66
GPIO46 – Pin No. 6
GPIO47 – Pin No. 23
The corresponding pins of EC800NCN series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 30
GPIO2 – Pin No. 31
GPIO3 – Pin No. 32
GPIO4 – Pin No. 33
GPIO5 – Pin No. 49
GPIO6 – Pin No. 50
GPIO7 – Pin No. 51
GPIO8 – Pin No. 52
GPIO9 – Pin No. 53
GPIO10 – Pin No. 54
GPIO11 – Pin No. 55
GPIO12 – Pin No. 56
GPIO13 – Pin No. 57
GPIO14 – Pin No. 58
GPIO15 – Pin No. 80
GPIO16 – Pin No. 81
GPIO17 – Pin No. 76
GPIO18 – Pin No. 77
GPIO19 – Pin No. 82
GPIO20 – Pin No. 83
GPIO21 – Pin No. 86
GPIO22 – Pin No. 87
GPIO23 – Pin No. 66
GPIO24 – Pin No. 67
GPIO25 – Pin No. 17
GPIO26 – Pin No. 18
GPIO27 – Pin No. 19
GPIO28 – Pin No. 20
GPIO29 – Pin No. 21
GPIO30 – Pin No. 22
GPIO31 – Pin No. 23
GPIO32 – Pin No. 28
GPIO33 – Pin No. 29
GPIO34 – Pin No. 38
GPIO35 – Pin No. 39
GPIO36 – Pin No. 16
GPIO37 – Pin No. 78
The pin correspondence of BC25PA platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 3
GPIO2 – Pin No. 4
GPIO3 – Pin No. 5
GPIO4 – Pin No. 6
GPIO5 – Pin No. 16
GPIO6 – Pin No. 20
GPIO7 – Pin No. 21
GPIO8 – Pin No. 22
GPIO9 – Pin No. 23
GPIO10 – Pin No. 25
GPIO11 – Pin No. 28
GPIO12 – Pin No. 29
GPIO13 – Pin No. 30
GPIO14 – Pin No. 31
GPIO15 – Pin No. 32
GPIO16 – Pin No. 33
GPIO17 – Pin No. 2
GPIO18 – Pin No. 8
The pin correspondence of BG95M3 platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 4
GPIO2 – Pin No. 5
GPIO3 – Pin No. 6
GPIO4 – Pin No. 7
GPIO5 – Pin No. 18
GPIO6 – Pin No. 19
GPIO7 – Pin No. 22
GPIO8 – Pin No. 23
GPIO9 – Pin No. 25
GPIO10 – Pin No. 26
GPIO11 – Pin No. 27
GPIO12 – Pin No. 28
GPIO13 – Pin No. 40
GPIO14 – Pin No. 41
GPIO15 – Pin No. 64
GPIO16 – Pin No. 65
GPIO17 – Pin No. 66
GPIO18 – Pin No. 85
GPIO19 – Pin No. 86
GPIO20 – Pin No. 87
GPIO21 – Pin No. 88
The pin correspondence of EG915U platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No.4(cannot be gpio function at the same time as GPIO41)
GPIO2 – Pin No.5(cannot be gpio function at the same time as GPIO36)
GPIO3 – Pin No.6(cannot be gpio function at the same time as GPIO35)
GPIO4 – Pin No.7(cannot be gpio function at the same time as GPIO24)
GPIO5 – Pin No.18
GPIO6 – Pin No.19
GPIO7 – Pin No.1(cannot be gpio function at the same time as GPIO37)
GPIO8 – Pin No.38
GPIO9 – Pin No.25
GPIO10 – Pin No.26
GPIO11 – Pin No.27(cannot be gpio function at the same time as GPIO32)
GPIO12 – Pin No.28(cannot be gpio function at the same time as GPIO31)
GPIO13 – Pin No.40
GPIO14 – Pin No.41
GPIO15 – Pin No.64
GPIO16 – Pin No.20(cannot be gpio function at the same time as GPIO30)
GPIO17 – Pin No.21
GPIO18 – Pin No.85
GPIO19 – Pin No.86
GPIO20 – Pin No.30
GPIO21 – Pin No.88
GPIO22 – Pin No.36(cannot be gpio function at the same time as GPIO40)
GPIO23 – Pin No.37(cannot be gpio function at the same time as GPIO38)
GPIO24 – Pin No.16(cannot be gpio function at the same time as GPIO4)
GPIO25 – Pin No.39
GPIO26 – Pin No.42(cannot be gpio function at the same time as GPIO27)
GPIO27 – Pin No.78(cannot be gpio function at the same time as GPIO26)
GPIO28 – Pin No.83(cannot be gpio function at the same time as GPIO33)
GPIO29 – Pin No.84
GPIO30 – Pin No.92(cannot be gpio function at the same time as GPIO16)
GPIO31 – Pin No.95(cannot be gpio function at the same time as GPIO12)
GPIO32 – Pin No.97(cannot be gpio function at the same time as GPIO11)
GPIO33 – Pin No.98(cannot be gpio function at the same time as GPIO28)
GPIO34 – Pin No.104
GPIO35 – Pin No.105(cannot be gpio function at the same time as GPIO3)
GPIO36 – Pin No.106(cannot be gpio function at the same time as GPIO2)
GPIO37 – Pin No.108(cannot be gpio function at the same time as GPIO4)
GPIO38 – Pin No.111(cannot be gpio function at the same time as GPIO23)
GPIO39 – Pin No.114
GPIO40 – Pin No.115(cannot be gpio function at the same time as GPIO22)
GPIO41 – Pin No.116(cannot be gpio function at the same time as GPIO1) | +| GPIOn | int | Pin Number
The corresponding pins of EC100Y-CN module are as follows (pin number is external pin number):
GPIO1 – Pin No. 22
GPIO2 – Pin No. 23
GPIO3 – Pin No. 38
GPIO4 – Pin No. 53
GPIO5 – Pin No. 54
GPIO6 – Pin No. 104
GPIO7 – Pin No. 105
GPIO8 – Pin No. 106
GPIO9 – Pin No. 107
GPIO10 – Pin No. 178
GPIO11 – Pin No. 195
GPIO12 – Pin No. 196
GPIO13 – Pin No. 197
GPIO14 – Pin No. 198
GPIO15 – Pin No. 199
GPIO16 – Pin No. 203
GPIO17 – Pin No. 204
GPIO18 – Pin No. 214
GPIO19 – Pin No. 215
The corresponding pins of EC600S-CN/EC600N-CN modules are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
The corresponding pins of EC600M series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 10
GPIO2 – Pin No. 11
GPIO3 – Pin No. 12
GPIO4 – Pin No. 13
GPIO5 – Pin No. 14
GPIO6 – Pin No. 15
GPIO7 – Pin No. 16
GPIO8 – Pin No. 39
GPIO9 – Pin No. 40
GPIO10 – Pin No. 48
GPIO11 – Pin No. 58
GPIO12 – Pin No. 59
GPIO13 – Pin No. 60
GPIO14 – Pin No. 61
GPIO15 – Pin No. 62
GPIO16 – Pin No. 63
GPIO17 – Pin No. 69
GPIO18 – Pin No. 70
GPIO19 – Pin No. 1
GPIO20 – Pin No. 3
GPIO21 – Pin No. 49
GPIO22 – Pin No. 50
GPIO23 – Pin No. 51
GPIO24 – Pin No. 52
GPIO25 – Pin No. 53
GPIO26 – Pin No. 54
GPIO27 – Pin No. 55
GPIO28 – Pin No. 56
GPIO29 – Pin No. 57
GPIO30 – Pin No. 2
GPIO31 – Pin No. 66
GPIO32 – Pin No. 65
GPIO33 – Pin No. 67
GPIO34 – Pin No. 64
GPIO35 – Pin No. 4
GPIO36 – Pin No. 31
GPIO37 – Pin No. 32
GPIO38 – Pin No. 33
GPIO39 – Pin No. 34
GPIO40 – Pin No. 71
GPIO41 – Pin No. 72
GPIO42 – Pin No. 109
GPIO43 – Pin No. 110
GPIO44 – Pin No. 112
GPIO45 – Pin No. 111
The corresponding pins of EC600U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 61(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 58(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 34(cannot be gpio function at the same time as GPIO41)
GPIO4 – Pin No. 60(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 69(cannot be gpio function at the same time as GPIO35)
GPIO6 – Pin No. 70(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 123(cannot be gpio function at the same time as GPIO43)
GPIO8 – Pin No. 118
GPIO9 – Pin No. 9
GPIO10 – Pin No. 1(cannot be gpio function at the same time as GPIO37)
GPIO11 – Pin No. 4(cannot be gpio function at the same time as GPIO38)
GPIO12 – Pin No. 3(cannot be gpio function at the same time as GPIO39)
GPIO13 – Pin No. 2(cannot be gpio function at the same time as GPIO40)
GPIO14 – Pin No. 54
GPIO15 – Pin No. 57
GPIO16 – Pin No. 56
GPIO17 – Pin No. 12
GPIO18 – Pin No. 33(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 124(cannot be gpio function at the same time as GPIO44)
GPIO20 – Pin No. 122(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 121(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 48
GPIO23 – Pin No. 39
GPIO24 – Pin No. 40
GPIO25 – Pin No. 49
GPIO26 – Pin No. 50
GPIO27 – Pin No. 53
GPIO28 – Pin No. 52
GPIO29 – Pin No. 51
GPIO30 – Pin No. 59(cannot be gpio function at the same time as GPIO33)
GPIO31 – Pin No. 66(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 63(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 67(cannot be gpio function at the same time as GPIO30)
GPIO34 – Pin No. 65(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 137(cannot be gpio function at the same time as GPIO5)
GPIO36 – Pin No. 62(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 98(cannot be gpio function at the same time as GPIO10)
GPIO38 – Pin No. 95(cannot be gpio function at the same time as GPIO11)
GPIO39 – Pin No. 119(cannot be gpio function at the same time as GPIO12)
GPIO40 – Pin No. 100(cannot be gpio function at the same time as GPIO13)
GPIO41 – Pin No. 120(cannot be gpio function at the same time as GPIO3)
GPIO42 – Pin No. 16(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 10(cannot be gpio function at the same time as GPIO7)
GPIO44 – Pin No. 14(cannot be gpio function at the same time as GPIO19)
GPIO45 – Pin No. 15(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 13(cannot be gpio function at the same time as GPIO21)
The corresponding pins of EC200U series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27(cannot be gpio function at the same time as GPIO31)
GPIO2 – Pin No. 26(cannot be gpio function at the same time as GPIO32)
GPIO3 – Pin No. 24(cannot be gpio function at the same time as GPIO33)
GPIO4 – Pin No. 25(cannot be gpio function at the same time as GPIO34)
GPIO5 – Pin No. 13(cannot be gpio function at the same time as GPIO17)
GPIO6 – Pin No. 135(cannot be gpio function at the same time as GPIO36)
GPIO7 – Pin No. 136(cannot be gpio function at the same time as GPIO44)
GPIO8 – Pin No. 133
GPIO9 – Pin No. 3(cannot be gpio function at the same time as GPIO37)
GPIO10 – Pin No. 40(cannot be gpio function at the same time as GPIO38)
GPIO11 – Pin No. 37(cannot be gpio function at the same time as GPIO39)
GPIO12 – Pin No. 38(cannot be gpio function at the same time as GPIO40)
GPIO13 – Pin No. 39(cannot be gpio function at the same time as GPIO41)
GPIO14 – Pin No. 5
GPIO15 – Pin No. 141
GPIO16 – Pin No. 142
GPIO17 – Pin No. 121(cannot be gpio function at the same time as GPIO5)
GPIO18 – Pin No. 65(cannot be gpio function at the same time as GPIO42)
GPIO19 – Pin No. 64(cannot be gpio function at the same time as GPIO43)
GPIO20 – Pin No. 139(cannot be gpio function at the same time as GPIO45)
GPIO21 – Pin No. 126(cannot be gpio function at the same time as GPIO46)
GPIO22 – Pin No. 127(cannot be gpio function at the same time as GPIO47)
GPIO23 – Pin No. 33
GPIO24 – Pin No. 31
GPIO25 – Pin No. 30
GPIO26 – Pin No. 29
GPIO27 – Pin No. 28
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO31 – Pin No. 125(cannot be gpio function at the same time as GPIO1)
GPIO32 – Pin No. 124(cannot be gpio function at the same time as GPIO2)
GPIO33 – Pin No. 123(cannot be gpio function at the same time as GPIO3)
GPIO34 – Pin No. 122(cannot be gpio function at the same time as GPIO4)
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119(cannot be gpio function at the same time as GPIO6)
GPIO37 – Pin No. 134(cannot be gpio function at the same time as GPIO9)
GPIO38 – Pin No. 132(cannot be gpio function at the same time as GPIO10)
GPIO39 – Pin No. 131(cannot be gpio function at the same time as GPIO11)
GPIO40 – Pin No. 130(cannot be gpio function at the same time as GPIO12)
GPIO41 – Pin No. 129(cannot be gpio function at the same time as GPIO13)
GPIO42 – Pin No. 61(cannot be gpio function at the same time as GPIO18)
GPIO43 – Pin No. 62(cannot be gpio function at the same time as GPIO19)
GPIO44 – Pin No. 63(cannot be gpio function at the same time as GPIO7)
GPIO45 – Pin No. 66(cannot be gpio function at the same time as GPIO20)
GPIO46 – Pin No. 6(cannot be gpio function at the same time as GPIO21)
GPIO47 – Pin No. 23(cannot be gpio function at the same time as GPIO22)
The corresponding pins of EC200A series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 27
GPIO2 – Pin No. 26
GPIO3 – Pin No.24
GPIO4 – Pin No.25
GPIO5 – Pin No.5
GPIO6 – Pin No.135
GPIO7 – Pin No.136
GPIO9 – Pin No. 3
GPIO10 – Pin No. 40
GPIO11 – Pin No. 37
GPIO12 – Pin No. 38
GPIO13 – Pin No. 39
GPIO18 – Pin No. 65
GPIO19 – Pin No. 64
GPIO20 – Pin No. 139
GPIO22 – Pin No. 127
GPIO28 – Pin No. 1
GPIO29 – Pin No. 2
GPIO30 – Pin No. 4
GPIO35 – Pin No. 42
GPIO36 – Pin No. 119
GPIO43 – Pin No. 62
GPIO44 – Pin No. 63
GPIO45 – Pin No. 66
GPIO46 – Pin No. 6
GPIO47 – Pin No. 23
The corresponding pins of EC800NCN series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 30
GPIO2 – Pin No. 31
GPIO3 – Pin No. 32
GPIO4 – Pin No. 33
GPIO5 – Pin No. 49
GPIO6 – Pin No. 50
GPIO7 – Pin No. 51
GPIO8 – Pin No. 52
GPIO9 – Pin No. 53
GPIO10 – Pin No. 54
GPIO11 – Pin No. 55
GPIO12 – Pin No. 56
GPIO13 – Pin No. 57
GPIO14 – Pin No. 58
GPIO15 – Pin No. 80
GPIO16 – Pin No. 81
GPIO17 – Pin No. 76
GPIO18 – Pin No. 77
GPIO19 – Pin No. 82
GPIO20 – Pin No. 83
GPIO21 – Pin No. 86
GPIO22 – Pin No. 87
GPIO23 – Pin No. 66
GPIO24 – Pin No. 67
GPIO25 – Pin No. 17
GPIO26 – Pin No. 18
GPIO27 – Pin No. 19
GPIO28 – Pin No. 20
GPIO29 – Pin No. 21
GPIO30 – Pin No. 22
GPIO31 – Pin No. 23
GPIO32 – Pin No. 28
GPIO33 – Pin No. 29
GPIO34 – Pin No. 38
GPIO35 – Pin No. 39
GPIO36 – Pin No. 16
GPIO37 – Pin No. 78
The pin correspondence of BC25PA platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 3
GPIO2 – Pin No. 4
GPIO3 – Pin No. 5
GPIO4 – Pin No. 6
GPIO5 – Pin No. 16
GPIO6 – Pin No. 20
GPIO7 – Pin No. 21
GPIO8 – Pin No. 22
GPIO9 – Pin No. 23
GPIO10 – Pin No. 25
GPIO11 – Pin No. 28
GPIO12 – Pin No. 29
GPIO13 – Pin No. 30
GPIO14 – Pin No. 31
GPIO15 – Pin No. 32
GPIO16 – Pin No. 33
GPIO17 – Pin No. 2
GPIO18 – Pin No. 8
The pin correspondence of BG95M3 platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No. 4
GPIO2 – Pin No. 5
GPIO3 – Pin No. 6
GPIO4 – Pin No. 7
GPIO5 – Pin No. 18
GPIO6 – Pin No. 19
GPIO7 – Pin No. 22
GPIO8 – Pin No. 23
GPIO9 – Pin No. 25
GPIO10 – Pin No. 26
GPIO11 – Pin No. 27
GPIO12 – Pin No. 28
GPIO13 – Pin No. 40
GPIO14 – Pin No. 41
GPIO15 – Pin No. 64
GPIO16 – Pin No. 65
GPIO17 – Pin No. 66
GPIO18 – Pin No. 85
GPIO19 – Pin No. 86
GPIO20 – Pin No. 87
GPIO21 – Pin No. 88
The pin correspondence of EG915U platform is as follows (pin numbers are external pin numbers):
GPIO1 – Pin No.4(cannot be gpio function at the same time as GPIO41)
GPIO2 – Pin No.5(cannot be gpio function at the same time as GPIO36)
GPIO3 – Pin No.6(cannot be gpio function at the same time as GPIO35)
GPIO4 – Pin No.7(cannot be gpio function at the same time as GPIO24)
GPIO5 – Pin No.18
GPIO6 – Pin No.19
GPIO7 – Pin No.1(cannot be gpio function at the same time as GPIO37)
GPIO8 – Pin No.38
GPIO9 – Pin No.25
GPIO10 – Pin No.26
GPIO11 – Pin No.27(cannot be gpio function at the same time as GPIO32)
GPIO12 – Pin No.28(cannot be gpio function at the same time as GPIO31)
GPIO13 – Pin No.40
GPIO14 – Pin No.41
GPIO15 – Pin No.64
GPIO16 – Pin No.20(cannot be gpio function at the same time as GPIO30)
GPIO17 – Pin No.21
GPIO18 – Pin No.85
GPIO19 – Pin No.86
GPIO20 – Pin No.30
GPIO21 – Pin No.88
GPIO22 – Pin No.36(cannot be gpio function at the same time as GPIO40)
GPIO23 – Pin No.37(cannot be gpio function at the same time as GPIO38)
GPIO24 – Pin No.16(cannot be gpio function at the same time as GPIO4)
GPIO25 – Pin No.39
GPIO26 – Pin No.42(cannot be gpio function at the same time as GPIO27)
GPIO27 – Pin No.78(cannot be gpio function at the same time as GPIO26)
GPIO28 – Pin No.83(cannot be gpio function at the same time as GPIO33)
GPIO29 – Pin No.84
GPIO30 – Pin No.92(cannot be gpio function at the same time as GPIO16)
GPIO31 – Pin No.95(cannot be gpio function at the same time as GPIO12)
GPIO32 – Pin No.97(cannot be gpio function at the same time as GPIO11)
GPIO33 – Pin No.98(cannot be gpio function at the same time as GPIO28)
GPIO34 – Pin No.104
GPIO35 – Pin No.105(cannot be gpio function at the same time as GPIO3)
GPIO36 – Pin No.106(cannot be gpio function at the same time as GPIO2)
GPIO37 – Pin No.108(cannot be gpio function at the same time as GPIO4)
GPIO38 – Pin No.111(cannot be gpio function at the same time as GPIO23)
GPIO39 – Pin No.114
GPIO40 – Pin No.115(cannot be gpio function at the same time as GPIO22)
GPIO41 – Pin No.116(cannot be gpio function at the same time as GPIO1)
The corresponding pins of EC800M series module are as follows (pin number is external pin number):
GPIO1 – Pin No. 30
GPIO2 – Pin No. 31
GPIO3 – Pin No. 32
GPIO4 – Pin No. 33
GPIO5 – Pin No. 49
GPIO6 – Pin No. 50
GPIO7 – Pin No. 51
GPIO8 – Pin No. 52
GPIO9 – Pin No. 53
GPIO10 – Pin No. 54
GPIO11 – Pin No. 55
GPIO12 – Pin No. 56
GPIO13 – Pin No. 57
GPIO14 – Pin No. 58
GPIO15 – Pin No. 80
GPIO16 – Pin No. 81
GPIO17 – Pin No. 76
GPIO18 – Pin No. 77
GPIO19 – Pin No. 82
GPIO20 – Pin No. 83
GPIO21 – Pin No. 86
GPIO22 – Pin No. 87
GPIO23 – Pin No. 66
GPIO24 – Pin No. 67
GPIO25 – Pin No. 17
GPIO26 – Pin No. 18
GPIO27 – Pin No. 19
GPIO28 – Pin No. 20
GPIO29 – Pin No. 21
GPIO30 – Pin No. 22
GPIO31 – Pin No. 23
GPIO32 – Pin No. 28
GPIO33 – Pin No. 29
GPIO34 – Pin No. 38
GPIO35 – Pin No. 39
GPIO36 – Pin No. 16
GPIO37 – Pin No. 78
GPIO38 – Pin No. 68
GPIO39 – Pin No. 39
GPIO40 – Pin No. 74
GPIO41 – Pin No. 75
GPIO42 – Pin No. 84
GPIO43 – Pin No. 85
GPIO44 – Pin No. 25 | | direction | int | IN – input mode; OUT – output mode | | pullMode | int | PULL_DISABLE – floating mode
PULL_PU – pull-up mode
PULL_PD – pull-down mode | | level | int | 0 - Set the pin to low level; 1- Set the pin to high level | @@ -5530,8 +5530,9 @@ Function: UART serial data transmission | EC800N | uart0:
TX: Pin number 39
RX: Pin number 38
uart1:
TX: Pin number 50
RX: Pin number 51
uart2:
TX:Pin number 18
RX:Pin number 17 | | BC25PA | uart1:
TX: Pin number 29
RX: Pin number 28 | | BG95M3 | uart0:
TX: Pin number 23
RX: Pin number 22
uart1:
TX:Pin number 27
RX:Pin number 28
uart2:
TX: Pin number 64
RX: Pin number 65 | -| EC600M | uart1:
TX: Pin number 3
RX: Pin number 2
uart2:
TX:Pin number 32
RX:Pin number 31 | +| EC600M | uart0:
TX: Pin number 71
RX: Pin number 72
uart1(Turn off flow control):
TX: Pin number 3
RX: Pin number 2
uart1(Turn on flow control):
TX: Pin number 33
RX: Pin number 34
uart2:
TX:Pin number 32
RX:Pin number 31 | | EG915U | uart1:
TX: Pin number 27
RX: Pin number 28
uart2:
TX:Pin number 35
RX:Pin number 34
uart4:
TX:Pin number 19
RX:Pin number 18 | +| EC800M | uart0:
TX: Pin number 39
RX: Pin number 38
uart1(Turn off flow control):
TX: Pin number 50
RX: Pin number 51
uart1(Turn on flow control):
TX: Pin number 22
RX: Pin number 23
Note: EC800MCN_GA uart1 is not available
uart2:
TX:Pin number 18
RX:Pin number 17 | * Example @@ -6209,8 +6210,8 @@ Class function: A two-wire protocol used for communication between devices. | Constant | | Applicable Platform | | ----------------- | --------------------------- | --------------------------- | -| I2C.I2C0 | I2C channel index number: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | -| I2C.I2C1 | I2C channel index number: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M/EG915U | +| I2C.I2C0 | I2C channel index number: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | +| I2C.I2C1 | I2C channel index number: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M/EG915U/EC800M | | I2C.I2C2 | I2C channel index number: 2 | BG95M3/EC600M | | I2C.STANDARD_MODE | Standard mode | | | I2C.FAST_MODE | Fast mode | | @@ -6244,6 +6245,7 @@ Class function: A two-wire protocol used for communication between devices. | BG95M3 | I2C0:
SCL: Pin number 18
SDA: Pin number 19
I2C1:
SCL:Pin number 40
SDA:Pin number 41
I2C2:
SCL:Pin number 26
SDA:Pin number 25 | | EC600M | I2C0:
SCL: Pin number 9
SDA: Pin number 64
I2C1:
SCL:Pin number 57
SDA:Pin number 56
I2C2:
SCL:Pin number 67
SDA:Pin number 65 | | EG915U | I2C0:
SCL: Pin number 103
SDA: Pin number 114
I2C1:
SCL:Pin number 40
SDA:Pin number 41 | +| EC800M | I2C0:
SCL: Pin number 67
SDA: Pin number 66
I2C1:
SCL:Pin number 68
SDA:Pin number 69 | - Exmaple @@ -6552,7 +6554,7 @@ Class function: Serial peripheral interface bus protocol. | --------- | ---- | ------------------------------------------------------------ | | port | int | Channel selection[0,1] | | mode | int | SPI working mode (ususally mode 0):
Clock polarity CPOL: When SPI is idle, the level of the clock signal SCLK (0: Low level when idle; 1: High level when idle)
0 : CPOL=0, CPHA=0
1 : CPOL=0, CPHA=1
2: CPOL=1, CPHA=0
3: CPOL=1, CPHA=1 | -| clk | int | volume_up clock frequency
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN/EG915U:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | +| clk | int | volume_up clock frequency
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M/EC800M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN/EG915U:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | - Pin Description @@ -6567,6 +6569,7 @@ Class function: Serial peripheral interface bus protocol. | BG95M3 | port0:
CS:Pin number 25
CLK:Pin number 26
MOSI:Pin number 27
MISO:Pin number 28
port1:
CS:Pin number 41
CLK:Pin number 40
MOSI:Pin number 64
MISO:Pin number 65 | | EC600M | port0:
CS:Pin number 58
CLK:Pin number 61
MOSI:Pin number 59
MISO:Pin number 60
port1:
CS:Pin number 4
CLK:Pin number 1
MOSI:Pin number 3
MISO:Pin number 2 | | EG915U | port0:
CS:Pin number 25
CLK:Pin number 26
MOSI:Pin number 64
MISO:Pin number 88 | +| EC800M | port0:
CS:Pin number 31
CLK:Pin number 30
MOSI:Pin number 32
MISO:Pin number 33
port1:
CS:Pin number 52
CLK:Pin number 53
MOSI:Pin number 50
MISO:Pin number 51 | * Note: @@ -7120,7 +7123,7 @@ if __name__ == '__main__': ``` ##### KeyPad -Module function: provide matrix keyboard interface and support platform EC600SCN_LB/EC800N_CN_LA/EC600NCN_LC +Module function: provide matrix keyboard interface and support platform EC600SCN_LB/EC800N_CN_LA/EC600NCN_LC/EC200U_CN_LB/EC600U_CN_LB/EC800M_CN_LA/EC800M_CN_GA EC200U supports 4x3 at most and EC600U supports 6x6 at most. ###### Create keypad object @@ -7144,6 +7147,7 @@ EC200U supports 4x3 at most and EC600U supports 6x6 at most. | EC600S | 5 | 5 | | EC200U | 4 | 3 | | EC600U | 6 | 6 | +| EC800M | 5 | 5 | * Example: > diff --git a/zh-cn/api/QuecPythonClasslib.md b/zh-cn/api/QuecPythonClasslib.md index d473ad7..6b061f0 100644 --- a/zh-cn/api/QuecPythonClasslib.md +++ b/zh-cn/api/QuecPythonClasslib.md @@ -5255,12 +5255,12 @@ pk.powerKeyEventRegister(pwk_callback) ###### 常量说明 -| 常量 | 说明 | 使用平台 | -| -------- | ---- | ----------------------------------------------------------- | -| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U | -| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M | -| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M | -| PWM.PWM3 | PWM3 | EC600S / EC600N / EC100Y/EC800N/EC600M | +| 常量 | 说明 | 使用平台 | +| -------- | ---- | ------------------------------------------------------------ | +| PWM.PWM0 | PWM0 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | +| PWM.PWM1 | PWM1 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M | +| PWM.PWM2 | PWM2 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M | +| PWM.PWM3 | PWM3 | EC600S / EC600N / EC100Y/EC800N/EC600M/EC800M | @@ -5274,7 +5274,7 @@ pk.powerKeyEventRegister(pwk_callback) | 参数 | 参数类型 | 参数说明 | | --------- | -------- | ------------------------------------------------------------ | -| PWMn | int | PWM号
注:EC100YCN平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号19
PWM1 – 引脚号18
PWM2 – 引脚号23
PWM3 – 引脚号22
注:EC600SCN/EC600N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号52
PWM1 – 引脚号53
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EC800N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号79
PWM1 – 引脚号78
PWM2 – 引脚号16
PWM3 – 引脚号49
注:EC200UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号135
注:EC600UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号70
注:EC600M平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号57
PWM1 – 引脚号56
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EG915U平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号20 | +| PWMn | int | PWM号
注:EC100YCN平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号19
PWM1 – 引脚号18
PWM2 – 引脚号23
PWM3 – 引脚号22
注:EC600SCN/EC600N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号52
PWM1 – 引脚号53
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EC800N平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号79
PWM1 – 引脚号78
PWM2 – 引脚号16
PWM3 – 引脚号49
注:EC200UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号135
注:EC600UCN平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号70
注:EC600M平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号57
PWM1 – 引脚号56
PWM2 – 引脚号70
PWM3 – 引脚号69
注:EG915U平台,支持PWM0,对应引脚如下:
PWM0 – 引脚号20
注:EC800M平台,支持PWM0-PWM3,对应引脚如下:
PWM0 – 引脚号83
PWM1 – 引脚号78
PWM2 – 引脚号16
PWM3 – 引脚号49 | | ABOVE_xx | int | EC600SCN/EC600N/EC800N平台:
PWM.ABOVE_MS ms级取值范围:(0,1023]
PWM.ABOVE_1US us级取值范围:(0,157]
PWM.ABOVE_10US us级取值范围:(1,1575]
PWM.ABOVE_BELOW_US ns级 取值(0,1024]
EC200U/EC600U/EG915U平台:
PWM.ABOVE_MS ms级取值范围:(0,10]
PWM.ABOVE_1US us级取值范围:(0,10000]
PWM.ABOVE_10US us级取值范围:(1,10000]
PWM.ABOVE_BELOW_US ns级 取值[100,65535] | | highTime | int | ms级时,单位为ms
us级时,单位为us
ns级别:需要使用者计算
频率 = 13Mhz / cycleTime
占空比 = highTime/ cycleTime | | cycleTime | int | ms级时,单位为ms
us级时,单位为us
ns级别:需要使用者计算
频率 = 13Mhz / cycleTime
占空比 = highTime/ cycleTime | @@ -5370,8 +5370,8 @@ if __name__ == '__main__': | 常量 | 说明 | 适用平台 | | -------- | -------- | ------------------------------------------------------------ | -| ADC.ADC0 | ADC通道0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC200A/EC600M/EG915U | -| ADC.ADC1 | ADC通道1 | EC600U/EC200U/EC200A/EC600M/EG915U | +| ADC.ADC0 | ADC通道0 | EC600S/EC600N/EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC200A/EC600M/EG915U/EC800M | +| ADC.ADC1 | ADC通道1 | EC600U/EC200U/EC200A/EC600M/EG915U/EC800M | | ADC.ADC2 | ADC通道2 | EC600U/EC200U | | ADC.ADC3 | ADC通道3 | EC600U | @@ -5418,7 +5418,7 @@ ADC功能初始化。 | 参数 | 参数类型 | 参数说明 | | ---- | -------- | ------------------------------------------------------------ | -| ADCn | int | ADC通道
EC100Y平台对应引脚如下
ADC0 – 引脚号39
ADC1 – 引脚号81
EC600S/EC600N平台对应引脚如下
ADC0 – 引脚号19
EC600M平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
EC800N平台对应引脚如下
ADC0 – 引脚号9
EC600U平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
ADC2 – 引脚号113
ADC3 – 引脚号114
EC200U平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
ADC2 – 引脚号43
EC200A平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
BG95M3平台对应引脚如下
ADC0 – 引脚号24
EG915U平台对应引脚如下
ADC0 – 引脚号24
ADC1 – 引脚号2 | +| ADCn | int | ADC通道
EC100Y平台对应引脚如下
ADC0 – 引脚号39
ADC1 – 引脚号81
EC600S/EC600N平台对应引脚如下
ADC0 – 引脚号19
EC600M平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
EC800N平台对应引脚如下
ADC0 – 引脚号9
EC600U平台对应引脚如下
ADC0 – 引脚号19
ADC1 – 引脚号20
ADC2 – 引脚号113
ADC3 – 引脚号114
EC200U平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
ADC2 – 引脚号43
EC200A平台对应引脚如下
ADC0 – 引脚号45
ADC1 – 引脚号44
BG95M3平台对应引脚如下
ADC0 – 引脚号24
EG915U平台对应引脚如下
ADC0 – 引脚号24
ADC1 – 引脚号2
EC800M平台对应引脚如下
ADC0 – 引脚号9
ADC1 – 引脚号96 | * 返回值 @@ -5767,50 +5767,50 @@ USBNET.open() | 常量 | 适配平台 | 说明 | | ---------------- | ------------------------ | -------- | -| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO1 | -| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO2 | -| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO3 | -| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO4 | -| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO5 | -| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO6 | -| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO7 | -| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO8 | -| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO9 | -| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO10 | -| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO11 | -| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO12 | -| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO13 | -| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO14 | -| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO15 | -| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U | GPIO16 | -| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO17 | -| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M/EG915U | GPIO18 | -| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U | GPIO19 | -| Pin.GPIO20 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U | GPIO20 | -| Pin.GPIO21 | EC600S / EC600N/EC600U/EC200U/EC800N/BG95M3/EC600M/EG915U | GPIO21 | -| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO22 | -| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO23 | -| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO24 | -| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO25 | -| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO26 | -| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO27 | -| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO28 | -| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO29 | -| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO30 | -| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO31 | -| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO32 | -| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO33 | -| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO34 | -| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO35 | -| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U | GPIO36 | -| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U | GPIO37 | -| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO38 | -| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO39 | -| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO40 | -| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U | GPIO41 | -| Pin.GPIO42 | EC600U/EC200U/EC600M | GPIO42 | -| Pin.GPIO43 | EC600U/EC200U/EC200A/EC600M | GPIO43 | -| Pin.GPIO44 | EC600U/EC200U/EC200A/EC600M | GPIO44 | +| Pin.GPIO1 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO1 | +| Pin.GPIO2 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO2 | +| Pin.GPIO3 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO3 | +| Pin.GPIO4 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO4 | +| Pin.GPIO5 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO5 | +| Pin.GPIO6 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO6 | +| Pin.GPIO7 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO7 | +| Pin.GPIO8 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO8 | +| Pin.GPIO9 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO9 | +| Pin.GPIO10 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO10 | +| Pin.GPIO11 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO11 | +| Pin.GPIO12 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO12 | +| Pin.GPIO13 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO13 | +| Pin.GPIO14 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO14 | +| Pin.GPIO15 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO15 | +| Pin.GPIO16 | EC600S / EC600N / EC100Y/EC600U/EC200U/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO16 | +| Pin.GPIO17 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC800N/BC25PA/BG95M3/EC600M/EG915U/EC800M | GPIO17 | +| Pin.GPIO18 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BC25PA/BG95M3/EC600M/EG915U/EC800M | GPIO18 | +| Pin.GPIO19 | EC600S / EC600N / EC100Y/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO19 | +| Pin.GPIO20 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO20 | +| Pin.GPIO21 | EC600S / EC600N/EC600U/EC200U/EC800N/BG95M3/EC600M/EG915U/EC800M | GPIO21 | +| Pin.GPIO22 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO22 | +| Pin.GPIO23 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO23 | +| Pin.GPIO24 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO24 | +| Pin.GPIO25 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO25 | +| Pin.GPIO26 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO26 | +| Pin.GPIO27 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO27 | +| Pin.GPIO28 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO28 | +| Pin.GPIO29 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO29 | +| Pin.GPIO30 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO30 | +| Pin.GPIO31 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO31 | +| Pin.GPIO32 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO32 | +| Pin.GPIO33 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO33 | +| Pin.GPIO34 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO34 | +| Pin.GPIO35 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO35 | +| Pin.GPIO36 | EC600S / EC600N/EC600U/EC200U/EC200A/EC800N/EC600M/EG915U/EC800M | GPIO36 | +| Pin.GPIO37 | EC600S / EC600N/EC600U/EC200U/EC800N/EC600M/EG915U/EC800M | GPIO37 | +| Pin.GPIO38 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO38 | +| Pin.GPIO39 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO39 | +| Pin.GPIO40 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO40 | +| Pin.GPIO41 | EC600S / EC600N/EC600U/EC200U/EC600M/EG915U/EC800M | GPIO41 | +| Pin.GPIO42 | EC600U/EC200U/EC600M/EC800M | GPIO42 | +| Pin.GPIO43 | EC600U/EC200U/EC200A/EC600M/EC800M | GPIO43 | +| Pin.GPIO44 | EC600U/EC200U/EC200A/EC600M/EC800M | GPIO44 | | Pin.GPIO45 | EC600U/EC200U/EC200A/EC600M | GPIO45 | | Pin.GPIO46 | EC600U/EC200U/EC200A | GPIO46 | | Pin.GPIO47 | EC200U/EC200A | GPIO47 | @@ -5834,7 +5834,7 @@ USBNET.open() | 参数 | 类型 | 说明 | | :-------- | :--- | ------------------------------------------------------------ | -| GPIOn | int | 引脚号
EC100YCN平台引脚对应关系如下(引脚号为外部引脚编号):
GPIO1 – 引脚号22
GPIO2 – 引脚号23
GPIO3 – 引脚号38
GPIO4 – 引脚号53
GPIO5 – 引脚号54
GPIO6 – 引脚号104
GPIO7 – 引脚号105
GPIO8 – 引脚号106
GPIO9 – 引脚号107
GPIO10 – 引脚号178
GPIO11 – 引脚号195
GPIO12 – 引脚号196
GPIO13 – 引脚号197
GPIO14 – 引脚号198
GPIO15 – 引脚号199
GPIO16 – 引脚号203
GPIO17 – 引脚号204
GPIO18 – 引脚号214
GPIO19 – 引脚号215
EC600SCN/EC600NCN平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
EC600M平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
GPIO42 – 引脚号109
GPIO43 – 引脚号110
GPIO44 – 引脚号112
GPIO45 – 引脚号111
EC600UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号61(不可与GPIO31同时为gpio)
GPIO2 – 引脚号58(不可与GPIO32同时为gpio)
GPIO3 – 引脚号34(不可与GPIO41同时为gpio)
GPIO4 – 引脚号60(不可与GPIO34同时为gpio)
GPIO5 – 引脚号69(不可与GPIO35同时为gpio)
GPIO6 – 引脚号70(不可与GPIO36同时为gpio)
GPIO7 – 引脚号123(不可与GPIO43同时为gpio)
GPIO8 – 引脚号118
GPIO9 – 引脚号9
GPIO10 – 引脚号1(不可与GPIO37同时为gpio)
GPIO11 – 引脚号4(不可与GPIO38同时为gpio)
GPIO12 – 引脚号3(不可与GPIO39同时为gpio)
GPIO13 – 引脚号2(不可与GPIO40同时为gpio)
GPIO14 – 引脚号54
GPIO15 – 引脚号57
GPIO16 – 引脚号56
GPIO17 – 引脚号12
GPIO18 – 引脚号33(不可与GPIO42同时为gpio)
GPIO19 – 引脚号124(不可与GPIO44同时为gpio)
GPIO20 – 引脚号122(不可与GPIO45同时为gpio)
GPIO21 – 引脚号121(不可与GPIO46同时为gpio)
GPIO22 – 引脚号48
GPIO23 – 引脚号39
GPIO24 – 引脚号40
GPIO25 – 引脚号49
GPIO26 – 引脚号50
GPIO27 – 引脚号53
GPIO28 – 引脚号52
GPIO29 – 引脚号51
GPIO30 – 引脚号59(不可与GPIO33同时为gpio)
GPIO31 – 引脚号66(不可与GPIO1同时为gpio)
GPIO32 – 引脚号63(不可与GPIO2同时为gpio)
GPIO33 – 引脚号67(不可与GPIO30同时为gpio)
GPIO34 – 引脚号65(不可与GPIO4同时为gpio)
GPIO35 – 引脚号137(不可与GPIO5同时为gpio)
GPIO36 – 引脚号62(不可与GPIO6同时为gpio)
GPIO37 – 引脚号98(不可与GPIO10同时为gpio)
GPIO38 – 引脚号95(不可与GPIO11同时为gpio)
GPIO39 – 引脚号119(不可与GPIO12同时为gpio)
GPIO40 – 引脚号100(不可与GPIO13同时为gpio)
GPIO41 – 引脚号120(不可与GPIO3同时为gpio)
GPIO42 – 引脚号16(不可与GPIO18同时为gpio)
GPIO43 – 引脚号10(不可与GPIO7同时为gpio)
GPIO44 – 引脚号14(不可与GPIO19同时为gpio)
GPIO45 – 引脚号15(不可与GPIO20同时为gpio)
GPIO46 – 引脚号13(不可与GPIO21同时为gpio)
EC200UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27(不可与GPIO31同时为gpio)
GPIO2 – 引脚号26(不可与GPIO32同时为gpio)
GPIO3 – 引脚号24(不可与GPIO33同时为gpio)
GPIO4 – 引脚号25(不可与GPIO34同时为gpio)
GPIO5 – 引脚号13(不可与GPIO17同时为gpio)
GPIO6 – 引脚号135(不可与GPIO36同时为gpio)
GPIO7 – 引脚号136(不可与GPIO44同时为gpio)
GPIO8 – 引脚号133
GPIO9 – 引脚号3(不可与GPIO37同时为gpio)
GPIO10 – 引脚号40(不可与GPIO38同时为gpio)
GPIO11 – 引脚号37(不可与GPIO39同时为gpio)
GPIO12 – 引脚号38(不可与GPIO40同时为gpio)
GPIO13 – 引脚号39(不可与GPIO41同时为gpio)
GPIO14 – 引脚号5
GPIO15 – 引脚号141
GPIO16 – 引脚号142
GPIO17 – 引脚号121(不可与GPIO5同时为gpio)
GPIO18 – 引脚号65(不可与GPIO42同时为gpio)
GPIO19 – 引脚号64(不可与GPIO43同时为gpio)
GPIO20 – 引脚号139(不可与GPIO45同时为gpio)
GPIO21 – 引脚号126(不可与GPIO46同时为gpio)
GPIO22 – 引脚号127(不可与GPIO47同时为gpio)
GPIO23 – 引脚号33
GPIO24– 引脚号31
GPIO25 – 引脚号30
GPIO26 – 引脚号29
GPIO27 – 引脚号28
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO31 – 引脚号125(不可与GPIO1同时为gpio)
GPIO32 – 引脚号124(不可与GPIO2同时为gpio)
GPIO33 – 引脚号123(不可与GPIO3同时为gpio)
GPIO34 – 引脚号122(不可与GPIO4同时为gpio)
GPIO35 – 引脚号42
GPIO36 – 引脚号119(不可与GPIO6同时为gpio)
GPIO37 – 引脚号134(不可与GPIO9同时为gpio)
GPIO38– 引脚号132(不可与GPIO10同时为gpio)
GPIO39 – 引脚号131(不可与GPIO11同时为gpio)
GPIO40 – 引脚号130(不可与GPIO12同时为gpio)
GPIO41 – 引脚号129(不可与GPIO13同时为gpio)
GPIO42 – 引脚号61(不可与GPIO18同时为gpio)
GPIO43 – 引脚号62(不可与GPIO19同时为gpio)
GPIO44 – 引脚号63(不可与GPIO7同时为gpio)
GPIO45 – 引脚号66(不可与GPIO20同时为gpio)
GPIO46 – 引脚号6(不可与GPIO21同时为gpio)
GPIO47 – 引脚号23(不可与GPIO22同时为gpio)
EC200A平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27
GPIO2 – 引脚号26
GPIO3 – 引脚号24
GPIO4 – 引脚号25
GPIO5 – 引脚号5
GPIO6 – 引脚号135
GPIO7 – 引脚号136
GPIO9 – 引脚号3
GPIO10 – 引脚号40
GPIO11 – 引脚号37
GPIO12 – 引脚号38
GPIO13 – 引脚号39
GPIO18 – 引脚号65
GPIO19 – 引脚号64
GPIO20 – 引脚号139
GPIO22 – 引脚号127
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO35 – 引脚号42
GPIO36 – 引脚号119
GPIO43 – 引脚号62
GPIO44 – 引脚号63
GPIO45 – 引脚号66
GPIO46 – 引脚号6
GPIO47 – 引脚号23
EC800NCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号30
GPIO2 – 引脚号31
GPIO3 – 引脚号32
GPIO4 – 引脚号33
GPIO5 – 引脚号49
GPIO6 – 引脚号50
GPIO7 – 引脚号51
GPIO8 – 引脚号52
GPIO9 – 引脚号53
GPIO10 – 引脚号54
GPIO11 – 引脚号55
GPIO12 – 引脚号56
GPIO13 – 引脚号57
GPIO14 – 引脚号58
GPIO15 – 引脚号80
GPIO16 – 引脚号81
GPIO17 – 引脚号76
GPIO18 – 引脚号77
GPIO19 – 引脚号82
GPIO20 – 引脚号83
GPIO21 – 引脚号86
GPIO22 – 引脚号87
GPIO23 – 引脚号66
GPIO24 – 引脚号67
GPIO25 – 引脚号17
GPIO26 – 引脚号18
GPIO27 – 引脚号19
GPIO28 – 引脚号20
GPIO29 – 引脚号21
GPIO30 – 引脚号22
GPIO31 – 引脚号23
GPIO32 – 引脚号28
GPIO33 – 引脚号29
GPIO34 – 引脚号38
GPIO35 – 引脚号39
GPIO36 – 引脚号16
GPIO37 – 引脚号78
BC25PA平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号3
GPIO2 – 引脚号4
GPIO3 – 引脚号5
GPIO4 – 引脚号6
GPIO5 – 引脚号16
GPIO6 – 引脚号20
GPIO7 – 引脚号21
GPIO8 – 引脚号22
GPIO9 – 引脚号23
GPIO10 – 引脚号25
GPIO11 – 引脚号28
GPIO12 – 引脚号29
GPIO13 – 引脚号30
GPIO14 – 引脚号31
GPIO15 – 引脚号32
GPIO16 – 引脚号33
GPIO17 – 引脚号2
GPIO18 – 引脚号8
BG95M3平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号4
GPIO2 – 引脚号5
GPIO3 – 引脚号6
GPIO4 – 引脚号7
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号22
GPIO8 – 引脚号23
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27
GPIO12 – 引脚号28
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号65
GPIO17 – 引脚号66
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号87
GPIO21 – 引脚号88
EG915U平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号4(不可与GPIO41同时为gpio)
GPIO2 – 引脚号5(不可与GPIO36同时为gpio)
GPIO3 – 引脚号6(不可与GPIO35同时为gpio)
GPIO4 – 引脚号7(不可与GPIO24同时为gpio)
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号1(不可与GPIO37同时为gpio)
GPIO8 – 引脚号38
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27(不可与GPIO32同时为gpio)
GPIO12 – 引脚号28(不可与GPIO31同时为gpio)
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号20(不可与GPIO30同时为gpio)
GPIO17 – 引脚号21
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号30
GPIO21 – 引脚号88
GPIO22 – 引脚号36(不可与GPIO40同时为gpio)
GPIO23 – 引脚号37(不可与GPIO38同时为gpio)
GPIO24 – 引脚号16(不可与GPIO4同时为gpio)
GPIO25 – 引脚号39
GPIO26 – 引脚号42(不可与GPIO27同时为gpio)
GPIO27 – 引脚号78(不可与GPIO26同时为gpio)
GPIO28 – 引脚号83(不可与GPIO33同时为gpio)
GPIO29 – 引脚号84
GPIO30 – 引脚号92(不可与GPIO16同时为gpio)
GPIO31 – 引脚号95(不可与GPIO12同时为gpio)
GPIO32 – 引脚号97(不可与GPIO11同时为gpio)
GPIO33 – 引脚号98(不可与GPIO28同时为gpio)
GPIO34 – 引脚号104
GPIO35 – 引脚号105(不可与GPIO3同时为gpio)
GPIO36 – 引脚号106(不可与GPIO2同时为gpio)
GPIO37 – 引脚号108(不可与GPIO4同时为gpio)
GPIO38 – 引脚号111(不可与GPIO23同时为gpio)
GPIO39 – 引脚号114
GPIO40 – 引脚号115(不可与GPIO22同时为gpio)
GPIO41 – 引脚号116(不可与GPIO1同时为gpio) | +| GPIOn | int | 引脚号
EC100YCN平台引脚对应关系如下(引脚号为外部引脚编号):
GPIO1 – 引脚号22
GPIO2 – 引脚号23
GPIO3 – 引脚号38
GPIO4 – 引脚号53
GPIO5 – 引脚号54
GPIO6 – 引脚号104
GPIO7 – 引脚号105
GPIO8 – 引脚号106
GPIO9 – 引脚号107
GPIO10 – 引脚号178
GPIO11 – 引脚号195
GPIO12 – 引脚号196
GPIO13 – 引脚号197
GPIO14 – 引脚号198
GPIO15 – 引脚号199
GPIO16 – 引脚号203
GPIO17 – 引脚号204
GPIO18 – 引脚号214
GPIO19 – 引脚号215
EC600SCN/EC600NCN平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
EC600M平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号10
GPIO2 – 引脚号11
GPIO3 – 引脚号12
GPIO4 – 引脚号13
GPIO5 – 引脚号14
GPIO6 – 引脚号15
GPIO7 – 引脚号16
GPIO8 – 引脚号39
GPIO9 – 引脚号40
GPIO10 – 引脚号48
GPIO11 – 引脚号58
GPIO12 – 引脚号59
GPIO13 – 引脚号60
GPIO14 – 引脚号61
GPIO15 – 引脚号62
GPIO16 – 引脚号63
GPIO17 – 引脚号69
GPIO18 – 引脚号70
GPIO19 – 引脚号1
GPIO20 – 引脚号3
GPIO21 – 引脚号49
GPIO22 – 引脚号50
GPIO23 – 引脚号51
GPIO24 – 引脚号52
GPIO25 – 引脚号53
GPIO26 – 引脚号54
GPIO27 – 引脚号55
GPIO28 – 引脚号56
GPIO29 – 引脚号57
GPIO30 – 引脚号2
GPIO31 – 引脚号66
GPIO32 – 引脚号65
GPIO33 – 引脚号67
GPIO34 – 引脚号64
GPIO35 – 引脚号4
GPIO36 – 引脚号31
GPIO37 – 引脚号32
GPIO38 – 引脚号33
GPIO39 – 引脚号34
GPIO40 – 引脚号71
GPIO41 – 引脚号72
GPIO42 – 引脚号109
GPIO43 – 引脚号110
GPIO44 – 引脚号112
GPIO45 – 引脚号111
EC600UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号61(不可与GPIO31同时为gpio)
GPIO2 – 引脚号58(不可与GPIO32同时为gpio)
GPIO3 – 引脚号34(不可与GPIO41同时为gpio)
GPIO4 – 引脚号60(不可与GPIO34同时为gpio)
GPIO5 – 引脚号69(不可与GPIO35同时为gpio)
GPIO6 – 引脚号70(不可与GPIO36同时为gpio)
GPIO7 – 引脚号123(不可与GPIO43同时为gpio)
GPIO8 – 引脚号118
GPIO9 – 引脚号9
GPIO10 – 引脚号1(不可与GPIO37同时为gpio)
GPIO11 – 引脚号4(不可与GPIO38同时为gpio)
GPIO12 – 引脚号3(不可与GPIO39同时为gpio)
GPIO13 – 引脚号2(不可与GPIO40同时为gpio)
GPIO14 – 引脚号54
GPIO15 – 引脚号57
GPIO16 – 引脚号56
GPIO17 – 引脚号12
GPIO18 – 引脚号33(不可与GPIO42同时为gpio)
GPIO19 – 引脚号124(不可与GPIO44同时为gpio)
GPIO20 – 引脚号122(不可与GPIO45同时为gpio)
GPIO21 – 引脚号121(不可与GPIO46同时为gpio)
GPIO22 – 引脚号48
GPIO23 – 引脚号39
GPIO24 – 引脚号40
GPIO25 – 引脚号49
GPIO26 – 引脚号50
GPIO27 – 引脚号53
GPIO28 – 引脚号52
GPIO29 – 引脚号51
GPIO30 – 引脚号59(不可与GPIO33同时为gpio)
GPIO31 – 引脚号66(不可与GPIO1同时为gpio)
GPIO32 – 引脚号63(不可与GPIO2同时为gpio)
GPIO33 – 引脚号67(不可与GPIO30同时为gpio)
GPIO34 – 引脚号65(不可与GPIO4同时为gpio)
GPIO35 – 引脚号137(不可与GPIO5同时为gpio)
GPIO36 – 引脚号62(不可与GPIO6同时为gpio)
GPIO37 – 引脚号98(不可与GPIO10同时为gpio)
GPIO38 – 引脚号95(不可与GPIO11同时为gpio)
GPIO39 – 引脚号119(不可与GPIO12同时为gpio)
GPIO40 – 引脚号100(不可与GPIO13同时为gpio)
GPIO41 – 引脚号120(不可与GPIO3同时为gpio)
GPIO42 – 引脚号16(不可与GPIO18同时为gpio)
GPIO43 – 引脚号10(不可与GPIO7同时为gpio)
GPIO44 – 引脚号14(不可与GPIO19同时为gpio)
GPIO45 – 引脚号15(不可与GPIO20同时为gpio)
GPIO46 – 引脚号13(不可与GPIO21同时为gpio)
EC200UCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27(不可与GPIO31同时为gpio)
GPIO2 – 引脚号26(不可与GPIO32同时为gpio)
GPIO3 – 引脚号24(不可与GPIO33同时为gpio)
GPIO4 – 引脚号25(不可与GPIO34同时为gpio)
GPIO5 – 引脚号13(不可与GPIO17同时为gpio)
GPIO6 – 引脚号135(不可与GPIO36同时为gpio)
GPIO7 – 引脚号136(不可与GPIO44同时为gpio)
GPIO8 – 引脚号133
GPIO9 – 引脚号3(不可与GPIO37同时为gpio)
GPIO10 – 引脚号40(不可与GPIO38同时为gpio)
GPIO11 – 引脚号37(不可与GPIO39同时为gpio)
GPIO12 – 引脚号38(不可与GPIO40同时为gpio)
GPIO13 – 引脚号39(不可与GPIO41同时为gpio)
GPIO14 – 引脚号5
GPIO15 – 引脚号141
GPIO16 – 引脚号142
GPIO17 – 引脚号121(不可与GPIO5同时为gpio)
GPIO18 – 引脚号65(不可与GPIO42同时为gpio)
GPIO19 – 引脚号64(不可与GPIO43同时为gpio)
GPIO20 – 引脚号139(不可与GPIO45同时为gpio)
GPIO21 – 引脚号126(不可与GPIO46同时为gpio)
GPIO22 – 引脚号127(不可与GPIO47同时为gpio)
GPIO23 – 引脚号33
GPIO24– 引脚号31
GPIO25 – 引脚号30
GPIO26 – 引脚号29
GPIO27 – 引脚号28
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO31 – 引脚号125(不可与GPIO1同时为gpio)
GPIO32 – 引脚号124(不可与GPIO2同时为gpio)
GPIO33 – 引脚号123(不可与GPIO3同时为gpio)
GPIO34 – 引脚号122(不可与GPIO4同时为gpio)
GPIO35 – 引脚号42
GPIO36 – 引脚号119(不可与GPIO6同时为gpio)
GPIO37 – 引脚号134(不可与GPIO9同时为gpio)
GPIO38– 引脚号132(不可与GPIO10同时为gpio)
GPIO39 – 引脚号131(不可与GPIO11同时为gpio)
GPIO40 – 引脚号130(不可与GPIO12同时为gpio)
GPIO41 – 引脚号129(不可与GPIO13同时为gpio)
GPIO42 – 引脚号61(不可与GPIO18同时为gpio)
GPIO43 – 引脚号62(不可与GPIO19同时为gpio)
GPIO44 – 引脚号63(不可与GPIO7同时为gpio)
GPIO45 – 引脚号66(不可与GPIO20同时为gpio)
GPIO46 – 引脚号6(不可与GPIO21同时为gpio)
GPIO47 – 引脚号23(不可与GPIO22同时为gpio)
EC200A平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号27
GPIO2 – 引脚号26
GPIO3 – 引脚号24
GPIO4 – 引脚号25
GPIO5 – 引脚号5
GPIO6 – 引脚号135
GPIO7 – 引脚号136
GPIO9 – 引脚号3
GPIO10 – 引脚号40
GPIO11 – 引脚号37
GPIO12 – 引脚号38
GPIO13 – 引脚号39
GPIO18 – 引脚号65
GPIO19 – 引脚号64
GPIO20 – 引脚号139
GPIO22 – 引脚号127
GPIO28 – 引脚号1
GPIO29 – 引脚号2
GPIO30 – 引脚号4
GPIO35 – 引脚号42
GPIO36 – 引脚号119
GPIO43 – 引脚号62
GPIO44 – 引脚号63
GPIO45 – 引脚号66
GPIO46 – 引脚号6
GPIO47 – 引脚号23
EC800NCN平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号30
GPIO2 – 引脚号31
GPIO3 – 引脚号32
GPIO4 – 引脚号33
GPIO5 – 引脚号49
GPIO6 – 引脚号50
GPIO7 – 引脚号51
GPIO8 – 引脚号52
GPIO9 – 引脚号53
GPIO10 – 引脚号54
GPIO11 – 引脚号55
GPIO12 – 引脚号56
GPIO13 – 引脚号57
GPIO14 – 引脚号58
GPIO15 – 引脚号80
GPIO16 – 引脚号81
GPIO17 – 引脚号76
GPIO18 – 引脚号77
GPIO19 – 引脚号82
GPIO20 – 引脚号83
GPIO21 – 引脚号86
GPIO22 – 引脚号87
GPIO23 – 引脚号66
GPIO24 – 引脚号67
GPIO25 – 引脚号17
GPIO26 – 引脚号18
GPIO27 – 引脚号19
GPIO28 – 引脚号20
GPIO29 – 引脚号21
GPIO30 – 引脚号22
GPIO31 – 引脚号23
GPIO32 – 引脚号28
GPIO33 – 引脚号29
GPIO34 – 引脚号38
GPIO35 – 引脚号39
GPIO36 – 引脚号16
GPIO37 – 引脚号78
BC25PA平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号3
GPIO2 – 引脚号4
GPIO3 – 引脚号5
GPIO4 – 引脚号6
GPIO5 – 引脚号16
GPIO6 – 引脚号20
GPIO7 – 引脚号21
GPIO8 – 引脚号22
GPIO9 – 引脚号23
GPIO10 – 引脚号25
GPIO11 – 引脚号28
GPIO12 – 引脚号29
GPIO13 – 引脚号30
GPIO14 – 引脚号31
GPIO15 – 引脚号32
GPIO16 – 引脚号33
GPIO17 – 引脚号2
GPIO18 – 引脚号8
BG95M3平台引脚对应关系如下(引脚号为模块外部引脚编号)
GPIO1 – 引脚号4
GPIO2 – 引脚号5
GPIO3 – 引脚号6
GPIO4 – 引脚号7
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号22
GPIO8 – 引脚号23
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27
GPIO12 – 引脚号28
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号65
GPIO17 – 引脚号66
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号87
GPIO21 – 引脚号88
EG915U平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号4(不可与GPIO41同时为gpio)
GPIO2 – 引脚号5(不可与GPIO36同时为gpio)
GPIO3 – 引脚号6(不可与GPIO35同时为gpio)
GPIO4 – 引脚号7(不可与GPIO24同时为gpio)
GPIO5 – 引脚号18
GPIO6 – 引脚号19
GPIO7 – 引脚号1(不可与GPIO37同时为gpio)
GPIO8 – 引脚号38
GPIO9 – 引脚号25
GPIO10 – 引脚号26
GPIO11 – 引脚号27(不可与GPIO32同时为gpio)
GPIO12 – 引脚号28(不可与GPIO31同时为gpio)
GPIO13 – 引脚号40
GPIO14 – 引脚号41
GPIO15 – 引脚号64
GPIO16 – 引脚号20(不可与GPIO30同时为gpio)
GPIO17 – 引脚号21
GPIO18 – 引脚号85
GPIO19 – 引脚号86
GPIO20 – 引脚号30
GPIO21 – 引脚号88
GPIO22 – 引脚号36(不可与GPIO40同时为gpio)
GPIO23 – 引脚号37(不可与GPIO38同时为gpio)
GPIO24 – 引脚号16(不可与GPIO4同时为gpio)
GPIO25 – 引脚号39
GPIO26 – 引脚号42(不可与GPIO27同时为gpio)
GPIO27 – 引脚号78(不可与GPIO26同时为gpio)
GPIO28 – 引脚号83(不可与GPIO33同时为gpio)
GPIO29 – 引脚号84
GPIO30 – 引脚号92(不可与GPIO16同时为gpio)
GPIO31 – 引脚号95(不可与GPIO12同时为gpio)
GPIO32 – 引脚号97(不可与GPIO11同时为gpio)
GPIO33 – 引脚号98(不可与GPIO28同时为gpio)
GPIO34 – 引脚号104
GPIO35 – 引脚号105(不可与GPIO3同时为gpio)
GPIO36 – 引脚号106(不可与GPIO2同时为gpio)
GPIO37 – 引脚号108(不可与GPIO4同时为gpio)
GPIO38 – 引脚号111(不可与GPIO23同时为gpio)
GPIO39 – 引脚号114
GPIO40 – 引脚号115(不可与GPIO22同时为gpio)
GPIO41 – 引脚号116(不可与GPIO1同时为gpio)
EC800M平台引脚对应关系如下(引脚号为模块外部引脚编号):
GPIO1 – 引脚号30
GPIO2 – 引脚号31
GPIO3 – 引脚号32
GPIO4 – 引脚号33
GPIO5 – 引脚号49
GPIO6 – 引脚号50
GPIO7 – 引脚号51
GPIO8 – 引脚号52
GPIO9 – 引脚号53
GPIO10 – 引脚号54
GPIO11 – 引脚号55
GPIO12 – 引脚号56
GPIO13 – 引脚号57
GPIO14 – 引脚号58
GPIO15 – 引脚号80
GPIO16 – 引脚号81
GPIO17 – 引脚号76
GPIO18 – 引脚号77
GPIO19 – 引脚号82
GPIO20 – 引脚号83
GPIO21 – 引脚号86
GPIO22 – 引脚号87
GPIO23 – 引脚号66
GPIO24 – 引脚号67
GPIO25 – 引脚号17
GPIO26 – 引脚号18
GPIO27 – 引脚号19
GPIO28 – 引脚号20
GPIO29 – 引脚号21
GPIO30 – 引脚号22
GPIO31 – 引脚号23
GPIO32 – 引脚号28
GPIO33 – 引脚号29
GPIO34 – 引脚号38
GPIO35 – 引脚号39
GPIO36 – 引脚号16
GPIO37 – 引脚号78
GPIO38 – 引脚号68
GPIO39 – 引脚号69
GPIO40 – 引脚号74
GPIO41 – 引脚号75
GPIO42 – 引脚号84
GPIO43 – 引脚号85
GPIO44 – 引脚号25 | | direction | int | IN – 输入模式,OUT – 输出模式 | | pullMode | int | PULL_DISABLE – 浮空模式
PULL_PU – 上拉模式
PULL_PD – 下拉模式 | | level | int | 0 - 设置引脚为低电平, 1- 设置引脚为高电平 | @@ -6005,8 +6005,9 @@ if __name__ == '__main__': | EC800N | uart0:
TX: 引脚号39
RX: 引脚号38
uart1:
TX: 引脚号50
RX: 引脚号51
uart2:
TX:引脚号18
RX:引脚号17 | | BC25PA | uart1:
TX: 引脚号29
RX: 引脚号28 | | BG95M3 | uart0:
TX: 引脚号23
RX: 引脚号22
uart1:
TX:引脚号27
RX:引脚号28
uart2:
TX: 引脚号64
RX: 引脚号65 | -| EC600M | uart1:
TX: 引脚号3
RX: 引脚号2
uart2:
TX:引脚号32
RX:引脚号31 | +| EC600M | uart0:
TX: 引脚号71
RX: 引脚号72
uart1(不开启流控):
TX: 引脚号3
RX: 引脚号2
uart1(开启流控):
TX: 引脚号33
RX: 引脚号34
uart2:
TX:引脚号32
RX:引脚号31 | | EG915U | uart1:
TX: 引脚号27
RX: 引脚号28
uart2:
TX:引脚号35
RX:引脚号34
uart4:
TX:引脚号19
RX:引脚号18 | +| EC800M | uart0:
TX: 引脚号39
RX: 引脚号38
uart1(不开启流控):
TX: 引脚号50
RX: 引脚号51
uart1(开启流控):
TX: 引脚号22
RX: 引脚号23
注:EC800MCN_GA uart1不可用
uart2:
TX:引脚号18
RX:引脚号17 | * 示例 @@ -6672,8 +6673,8 @@ rtc.enable_alarm(1) | 常量 | | 适用平台 | | ----------------- | ----------------- | ----------------------------- | -| I2C.I2C0 | i2c 通路索引号: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U | -| I2C.I2C1 | i2c 通路索引号: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M/EG915U | +| I2C.I2C0 | i2c 通路索引号: 0 | EC100Y/EC600U/EC200U/EC200A/BC25PA/EC800N/BG95M3/EC600M/EG915U/EC800M | +| I2C.I2C1 | i2c 通路索引号: 1 | EC600S/EC600N/EC600U/EC200U/BC25PA/BG95M3/EC600M/EG915U/EC800M | | I2C.I2C2 | i2c 通路索引号: 2 | BG95M3/EC600M | | I2C.STANDARD_MODE | 标准模式 | | | I2C.FAST_MODE | 快速模式 | | @@ -6707,6 +6708,7 @@ rtc.enable_alarm(1) | BG95M3 | I2C0:
SCL: 引脚号18
SDA: 引脚号19
I2C1:
SCL:引脚号40
SDA:引脚号41
I2C2:
SCL:引脚号26
SDA:引脚号25 | | EC600M | I2C0:
SCL: 引脚号9
SDA: 引脚号64
I2C1:
SCL:引脚号57
SDA:引脚号56
I2C2:
SCL:引脚号67
SDA:引脚号65 | | EG915U | I2C0:
SCL: 引脚号103
SDA: 引脚号114
I2C1:
SCL:引脚号40
SDA:引脚号41 | +| EC800M | I2C0:
SCL: 引脚号67
SDA: 引脚号66
I2C2:
SCL:引脚号68
SDA:引脚号69 | - 示例 @@ -7012,7 +7014,7 @@ if __name__ == "__main__": | ---- | ---- | ------------------------------------------------------------ | | port | int | 通道选择[0,1] | | mode | int | SPI 的工作模式(模式0最常用):
时钟极性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 | int | 时钟频率
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN/EG915U:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | +| clk | int | 时钟频率
EC600NCN/EC600SCN/EC800NCN/BG95M3/EC600M/EC800M:
0 : 812.5kHz
1 : 1.625MHz
2 : 3.25MHz
3 : 6.5MHz
4 : 13MHz
5 : 26MHz
6:52MHz
EC600UCN/EC200UCN/EG915U:
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
BC25PA:
0 : 5MHz
X : XMHz (X in [1,39]) | - 引脚说明 @@ -7027,6 +7029,7 @@ if __name__ == "__main__": | BG95M3 | port0:
CS:引脚号25
CLK:引脚号26
MOSI:引脚号27
MISO:引脚号28
port1:
CS:引脚号41
CLK:引脚号40
MOSI:引脚号64
MISO:引脚号65 | | EC600M | port0:
CS:引脚号58
CLK:引脚号61
MOSI:引脚号59
MISO:引脚号60
port1:
CS:引脚号4
CLK:引脚号1
MOSI:引脚号3
MISO:引脚号2 | | EG915U | port0:
CS:引脚号25
CLK:引脚号26
MOSI:引脚号64
MISO:引脚号88 | +| EC800M | port0:
CS:引脚号31
CLK:引脚号30
MOSI:引脚号32
MISO:引脚号33
port1:
CS:引脚号52
CLK:引脚号53
MOSI:引脚号50
MISO:引脚号51 | * 注意 BC25PA平台不支持1、2模式。 - 示例 @@ -7589,14 +7592,13 @@ if __name__ == '__main__': ##### KeyPad -模块功能:提供矩阵键盘接口,支持平台EC600SCN_LB/EC800N_CN_LA/EC600NCNLC/EC200U_CN_LB/EC600U_CN_LB +模块功能:提供矩阵键盘接口,支持平台EC600SCN_LB/EC800N_CN_LA/EC600NCNLC/EC200U_CN_LB/EC600U_CN_LB/EC800M_CN_LA/EC800M_CN_GA EC200U最大支持4X3,EC600U最大支持6X6。 ###### 创建keypad对象 > **keypad=machine.KeyPad(row,col)** -> * 参数 | 参数 | 参数类型 | 参数说明 | | ------ | -------- | ----------------------------------- | @@ -7611,6 +7613,7 @@ EC200U最大支持4X3,EC600U最大支持6X6。 | EC600S | 5 | 5 | | EC200U | 4 | 3 | | EC600U | 6 | 6 | +| EC800M | 5 | 5 | * 示例: