diff --git a/en/gnsslib/gnss.md b/en/gnsslib/gnss.md index 9ea7f6dac2303be174f1bc52486d2198df993522..5737b0340542851471747fd93675031119775b24 100644 --- a/en/gnsslib/gnss.md +++ b/en/gnsslib/gnss.md @@ -153,7 +153,7 @@ This interface checks the validity of GNGGA, GNRMC and GPGSV sentences in the GN **Return Value** -A list ` (gga_valid, rmc_valid, gsv_valid)`. +A tuple ` (gga_valid, rmc_valid, gsv_valid)`. `gga_valid` - Whether the GNGGA sentence is read and has been analyzed successfully. 0 – The GNGGA sentence is not read or the data is invalid. 1 – The GNGGA sentence is valid. diff --git a/en/medialib/audio.Record.md b/en/medialib/audio.Record.md index 821322f1a5bbe09c2113a97b0d9ef45d6c70e926..2fdc7462986708f903eca48859ae3dc83f207e00 100644 --- a/en/medialib/audio.Record.md +++ b/en/medialib/audio.Record.md @@ -93,7 +93,9 @@ Creates a record object. audio.start(file_name,seconds) ``` -This method starts recording. +This method starts recording, recording data stored as files. + +> When recording files in AMR and WAV formats using this method, default sampling rate 8000. When recording files in MP3 format, default sampling rate 22050. **Parameter:** @@ -296,7 +298,7 @@ This method sets the callback function for the end of the recording. | 0 | Start playback | | 3 | Playback ends | -### Record.gain +### Record.gain_set ```python Record.gain(code_gain,dsp_gain) @@ -304,7 +306,7 @@ Record.gain(code_gain,dsp_gain) This method sets the recording gain. -> Currently, only the EC600N/EC800N series modules support this function. +> Currently, only the EC200N/EC600N/EC800N/EC600S/EG915N/EC600M/EC800M/EG810M/EG800P series modules support this function. **Parameter:** @@ -315,6 +317,27 @@ This method sets the recording gain. `0` - Successful execution; `-1`- Failed execution. +### Record.gain_get + +```python +Record.gain_get() +``` + +This method obtains the set recording gain. + +> Currently, only the EC200N/EC600N/EC800N/EC600S/EG915N/EC600M/EC800M/EG810M/EG800P series modules support this function. + +**Parameter:** + +No parameter. + +**Return Value:** + +The return value is a tuple, with the form of:`(code_gain, dsp_gain)` + +- `code_gain` - Integer type. Uplink codec gain. +- `dsp_gain` - Integer type. Uplink digital gain. + ### Record.amrEncDtx_enable ```python diff --git a/en/medialib/qrcode.md b/en/medialib/qrcode.md index f5d0ae4ce337e133e65a6b6530acb031b6d83ef2..6f036e5e6c7545c188bd2e7f46639eb59bea9817 100644 --- a/en/medialib/qrcode.md +++ b/en/medialib/qrcode.md @@ -7,7 +7,7 @@ Feature introduction: generate a corresponding QR code according to the input co ### `qrcode.show` ```python -qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground_color) +qrcode.show(qrcode_str,magnification,start_x,start_y,Background_color,Foreground_color,Rotate) ``` Displays QR codes to LCD. @@ -20,8 +20,9 @@ Displays QR codes to LCD. - `start_y` - Integer type. The start y coordinate of the displayed QR code. - `Background_color` - Integer type. Background color. Default value: 0xffff. - `Foreground_color` - Integer type. Foreground color. Default value: 0x0000. +- `Rotate` - Integer type. Rotation angle. Reference [Constant](#constant). Default value: 0. -**Return Value** +**Return Value:** `0` - Successful execution @@ -29,4 +30,39 @@ Displays QR codes to LCD. `-2` - Magnification failed -`-3` - Display failed \ No newline at end of file +`-3` - Display failed + +## Generation QR Code Data + +### `qrcode.getQRData` + +```python +qrcode.getQRData(qrcode_str,magnification,Background_color,Foreground_color) +``` + +Generation QR code and retrieve data. + +**Parameter:** + +- `qrcode_str` - String type. QR code content. +- `magnification` - Integer type. Magnification. Range: 1–6. +- `Background_color` - Integer type. Background color. Default value: 0xffff. +- `Foreground_color` - Integer type. Foreground color. Default value: 0x0000. + +**Return Value:** + +`-1` - QR code generation failed + +Return tuple upon success `(side_length, data)` + +- `side_length`: Side length of QR code. +- `data`: Data of QR code. + +## Constant + +| Constant | Value | Description | +| ------------------- | ----- | ------------------------------------------------------ | +| `qrcode.ROTATE_0` | 0 | QR code display without rotation | +| `qrcode.ROTATE_90` | 1 | Rotate the QR code clockwise by 90 degrees to display | +| `qrcode.ROTATE_180` | 2 | Rotate the QR code clockwise by 180 degrees to display | +| `qrcode.ROTATE_270` | 3 | Rotate the QR code clockwise by 270 degrees to display | \ No newline at end of file diff --git a/en/peripherals/ethernet.W5500.md b/en/peripherals/ethernet.W5500.md index 0fd3ec440f92d3c6dfbbfd9d98bbb6d4d70fd00c..b3d41e56f61287e9926732886dd4389dd1257c08 100644 --- a/en/peripherals/ethernet.W5500.md +++ b/en/peripherals/ethernet.W5500.md @@ -27,6 +27,8 @@ Loads W5500 driver, initializes W5500 Ethernet NIC and returns W5500 NIC object. - `reset_pin` - Connect to reset [GPIO pin](./machine.Pin.md) of `W5500`. The default value is `-1`, indicating that the last configured value is used and the default configuration in the program is `Pin.GPIO17`. - `work_mode` - Configure Ethernet working mode. The default mode is terminal mode. `0` and `1` respectively represents terminal mode and gateway mode. Terminal mode indicates that the module is used as a terminal device to connect to a network supply device to access the network. Gateway mode indicates that the module is used as a gateway to provide network access for external devices through LTE network. +> Note: Do not use the hardware CS pin of spi_port. Instead, select another GPIO pin as the CS pin. + ## Methods ### `W5500.set_addr` diff --git a/en/peripherals/machine.Pin.md b/en/peripherals/machine.Pin.md index 966597bd83c991e48be13b2c9eedd55adbdf782e..652f01e3130d17bd59437cc5391eaa8c56698156 100644 --- a/en/peripherals/machine.Pin.md +++ b/en/peripherals/machine.Pin.md @@ -3562,6 +3562,13 @@ class machine.Pin(GPIOn, direction, pullMode, level)
2.GPIO27, GPIO39, and GPIO40 have weak driving capabilities, so it is recommended to use them only as input pins
+ +++Note:
+1.Pin37-GPIO11,Pin38-GPIO12,Pin39-GPIO13,Module that support GNSS function do not enable the multiplexing function of this pin and it need to be left open.
+
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
Parametric Description:
@@ -39,6 +39,22 @@ This class transmits data through the UART.class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
+
+Parametric Description:
+UARTn
- UART number, int type, UARTn description is as follows:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- Baud rate, int type, supports common baud rates such as4800
、9600
、19200
、38400
、57600
、115200
、230400
.
databits
- Data bits [8], int type.
parity
- Parity (0-None, 1-even, 2-odd), int type.
stopbits
- Stop bit [1 ~ 2], int type.
flowctl
- Hardware control flow (0-FC_NONE, 1-FC_HW), int type.
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl, [group])
@@ -1063,7 +1079,7 @@ This class transmits data through the UART.
@@ -1237,15 +1253,16 @@ This method disables the UART. `-1` - Failed execution +### `uart.control_485` +Attention:
Uart0 is not recommended
-EC200ACN_LA module uart1 pin number is different from other models:
+EC200ACN_LA,EC200AEU_V1HA,EC200ACN_V1DA module uart1 pin number is different from other models:
TX: Pin26
RX: Pin27
uart.control_485
uart.control_485(UART.GPIOn, direction)
This method is used to control the 485 communication direction, and the specified GPIO is pulled up and down before and after the serial port sends data to indicate the 485 communication direction.
Parametric Description:
GPIOn
- GPIO Pin number to control, refer to pin definition in [Pin module](machine.Pin.md), int type.
GPIOn
- GPIO Pin number to control, refer to pin definition in Pin module, int type.
direction
- Pin level change, int type, described as follows:1
It indicates that the pin level change is: the serial port is pulled up by low before sending data, and then pulled down by high after sending data0
It indicates that the pin level change is: the serial port is pulled down by high before sending data, and then pulled up by low after sending data
uart.control_485
This API is not supported by this model
示例:
-
->>> from machine import I2C
+>>> from machine import I2C
>>> # 创建I2C对象
>>> i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE) # 返回I2C对象
@@ -104,12 +102,12 @@
示例:
-
->>> from machine import I2C
+>>> from machine import I2C
>>> # 创建I2C对象
>>> i2c_obj = I2C(I2C.I2C0, I2C.STANDARD_MODE,0) # 返回I2C对象
+
2.GPIO27、GPIO39、GPIO40驱动能力较弱,建议仅做输入引脚使用
++注:
+1.Pin37-GPIO11,Pin38-GPIO12,Pin39-GPIO13,支持GNSS的模块不会启用此引脚的复用功能,因此该引脚需要保持处于断开状态。
+
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
参数描述:
@@ -71,6 +71,22 @@class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl)
+
+参数描述:
+UARTn
- UART编号,int类型,UARTn说明如下:UART0
- DEBUG PORT UART1
- BT PORT UART2
- MAIN PORT UART3
- USB CDC PORT
baudratec
- 波特率,int类型,支持常用波特率,如4800
、9600
、19200
、38400
、57600
、115200
、230400
等;
databits
- 数据位[8],int类型。
parity
- 奇偶校验(0 – NONE,1 – EVEN,2 – ODD),int类型。
stopbits
- 停止位[1 ~ 2],int类型。
flowctl
- 硬件控制流(0 – FC_NONE, 1 – FC_HW),int类型。
class machine.UART(UART.UARTn, baudrate, databits, parity, stopbits, flowctl, [group])
@@ -1042,8 +1058,8 @@
@@ -1266,15 +1282,17 @@ uart.close() 成功返回整型值`0`,失败返回整型值`-1`。 +### `uart.control_485` +注意:
uart0不建议使用
-EC200ACN_LA模组uart1引脚号与其他型号不同:
+EC200ACN_LA,EC200AEU_V1HA,EC200ACN_V1DA 模组uart1引脚号与其他型号不同:
TX:引脚号26
RX:引脚号27
uart.control_485
uart.control_485(UART.GPIOn, direction)
该方法用于控制485通信方向,串口发送数据之前和之后进行拉高拉低指定GPIO,用来指示485通信的方向。
参数描述:
GPIOn
- 需要控制的GPIO引脚号,参照[Pin模块](machine.Pin.md)的引脚定义,int类型。
GPIOn
- 需要控制的GPIO引脚号,参照Pin模块的引脚定义,int类型。
direction
- 引脚电平变化,int类型,说明如下:1
表示引脚电平变化为:串口发送数据之前由低拉高、发送数据之后再由高拉低0
表示引脚电平变化为:串口发送数据之前由高拉低、发送数据之后再由低拉高
返回值描述:
成功返回整型值0
,失败返回整型值-1
。
示例:
-from machine import UART
uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
art1.control_485(UART.GPIO24, 1)
+from machine import UART
+uart1 = UART(UART.UART1, 115200, 8, 0, 1, 0)
+art1.control_485(UART.GPIO24, 1)
+
uart.control_485
该型号不支持此API