diff --git a/en/device-dev/driver/driver-development.md b/en/device-dev/driver/driver-development.md index 8cbefc7cbb05c8efbe5a050b3a71078c26a34868..f9c14ec11f06e6f5c5448751c6967e3de0dac1fa 100644 --- a/en/device-dev/driver/driver-development.md +++ b/en/device-dev/driver/driver-development.md @@ -71,7 +71,7 @@ Driver development based on the HDF consists of two parts: driver implementation - Use the **Makefile** template provided by the HDF to compile the driver code. ``` - include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk # (Mandatory) Import the predefined content of the HDF. + include $(LITEOSTOPDIR)/../../drivers/adapter/lite/khdf/lite.mk # (Mandatory) Import the predefined content of the HDF. MODULE_NAME := # Generated result file LOCAL_INCLUDE: = # Header file directory of the driver LOCAL_SRCS : = # Source code file of the driver diff --git a/en/device-dev/driver/sdiousage-example.md b/en/device-dev/driver/sdiousage-example.md index c4d870306bf4fd075d1d8af7df663f87bdce566c..558f4cf191206f4a01f28850d14d667208b592fc 100644 --- a/en/device-dev/driver/sdiousage-example.md +++ b/en/device-dev/driver/sdiousage-example.md @@ -27,12 +27,12 @@ void SdioTestSample(void) int32_t ret; DevHandle handle = NULL; uint8_t data[TEST_DATA_LEN] = {0}; - int16_t busNum = 1; + struct SdioFunctionConfig config = {1, 0x123, 0x456}; uint8_t val; uint32_t addr; /* Open an SDIO controller whose bus number is 1. */ - handle = SdioOpen(busNum); + handle = SdioOpen(1, &config); if (handle == NULL) { HDF_LOGE("SdioOpen: failed!\n"); return; @@ -59,25 +59,25 @@ void SdioTestSample(void) } /* Read 3-byte data from the incremental address of an SDIO device. */ addr = TEST_FBR_BASE_ADDR * TEST_FUNC_NUM + TEST_ADDR_OFFSET; - ret = SdioReadBytes(handle, data, addr, TEST_DATA_LEN, 0); + ret = SdioReadBytes(handle, data, addr, TEST_DATA_LEN); if (ret != 0) { HDF_LOGE("SdioReadBytes: failed, ret %d\n", ret); goto COMM_ERR; } /* Write 3-byte data into the incremental address of an SDIO device. */ - ret = SdioWriteBytes(handle, data, addr, TEST_DATA_LEN, 0); + ret = SdioWriteBytes(handle, data, addr, TEST_DATA_LEN); if (ret != 0) { HDF_LOGE("SdioWriteBytes: failed, ret %d\n", ret); goto COMM_ERR; } /* Read 1-byte data from the SDIO device. */ - ret = SdioReadBytes(handle, &val, addr, 1, 0); + ret = SdioReadBytes(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioReadBytes: failed, ret %d\n", ret); goto COMM_ERR; } /* Write 1-byte data into the SDIO device. */ - ret = SdioWriteBytes(handle, &val, addr, 1, 0); + ret = SdioWriteBytes(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioWriteBytes: failed, ret %d\n", ret); goto COMM_ERR; @@ -96,13 +96,13 @@ void SdioTestSample(void) } /* Read 1-byte data from SDIO function 0. */ addr = 0x02; - ret = SdioReadBytesFromFunc0(handle, &val, addr, 1, 0); + ret = SdioReadBytesFromFunc0(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioReadBytesFromFunc0: failed, ret %d\n", ret); goto COMM_ERR; } /* Write 1-byte data into SDIO function 0. */ - ret = SdioWriteBytesToFunc0(handle, &val, addr, 1, 0); + ret = SdioWriteBytesToFunc0(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioWriteBytesToFunc0: failed, ret %d\n", ret); goto COMM_ERR; diff --git a/en/device-dev/driver/sdiousage-guidelines.md b/en/device-dev/driver/sdiousage-guidelines.md index 43f5b134b512954f56f3636d34691ec5f599cbe8..402cf305ebb98196a477530f749e0bc07f9710bd 100644 --- a/en/device-dev/driver/sdiousage-guidelines.md +++ b/en/device-dev/driver/sdiousage-guidelines.md @@ -24,7 +24,7 @@ Before performing SDIO communication, obtain the device handle of an SDIO controller by calling **SdioOpen**. This function returns the device handle of the SDIO controller with a specified bus number. -DevHandle SdioOpen\(int16\_t busNum\); +DevHandle SdioOpen\(int16\_t mmcBusNum, struct SdioFunctionConfig \*config\); **Table 1** Parameters and return values of SdioOpen @@ -35,9 +35,14 @@ DevHandle SdioOpen\(int16\_t busNum\); -

busNum

+

mmcBusNum

-

SDIO bus number.

+

Bus number.

+ + +

config

+ +

SDIO functionality configurations.

Return Value

@@ -62,9 +67,12 @@ The following example shows how to open an SDIO controller. ``` DevHandle handle = NULL; -int16_t busNum = 1; +struct SdioFunctionConfig config; +config.funcNr = 1; +config.vendorId = 0x123; +config.deviceId = 0x456; /* Open an SDIO controller whose bus number is 1. */ -handle = SdioOpen(busNum); +handle = SdioOpen(1, &config); if (handle == NULL) { HDF_LOGE("SdioOpen: failed!\n"); } @@ -87,7 +95,7 @@ void SdioClaimHost\(DevHandle handle\);

handle

-

Device handle of an SDIO controller

+

Device handle of an SDIO controller.

@@ -218,7 +226,7 @@ if (ret != 0) { The corresponding function is as follows: -int32\_t SdioWriteBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioWriteBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **Table 5** Parameters and return values of SdioWriteBytes @@ -249,11 +257,6 @@ int32\_t SdioWriteBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint

Length of the data to write.

-

timeOut

- -

Timeout duration for writing data, in milliseconds. If the value is 0, the default value is used.

- -

Return Value

Description

@@ -279,7 +282,7 @@ int32_t ret; uint8_t wbuff[] = {1,2,3,4,5}; uint32_t addr = 0x100 + 0x09; /* Incrementally write 5-byte data into the start address 0x109 of the SDIO device. */ -ret = SdioWriteBytes(handle, wbuff, addr, sizeof(wbuff) / sizeof(wbuff[0]), 0); +ret = SdioWriteBytes(handle, wbuff, addr, sizeof(wbuff) / sizeof(wbuff[0])); if (ret != 0) { HDF_LOGE("SdioWriteBytes: failed, ret %d\n", ret); } @@ -289,7 +292,7 @@ if (ret != 0) { The corresponding function is as follows: -int32\_t SdioReadBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioReadBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **Table 6** Parameters and return values of SdioReadBytes @@ -320,11 +323,6 @@ int32\_t SdioReadBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint3

Length of the data to read.

-

timeOut

- -

Timeout duration for reading data, in milliseconds. If the value is 0, the default value is used.

- -

Return Value

Description

@@ -350,7 +348,7 @@ int32_t ret; uint8_t rbuff[5] = {0}; uint32_t addr = 0x100 + 0x09; /* Incrementally read 5-byte data from the start address 0x109 of the SDIO device. */ -ret = SdioReadBytes(handle, rbuff, addr, 5, 0); +ret = SdioReadBytes(handle, rbuff, addr, 5); if (ret != 0) { HDF_LOGE("SdioReadBytes: failed, ret %d\n", ret); } @@ -360,7 +358,7 @@ if (ret != 0) { The corresponding function is as follows: - int32\_t SdioWriteBytesToFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); + int32\_t SdioWriteBytesToFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t scatterLen\); **Table 7** Parameters and return values of SdioWriteBytesToFixedAddr @@ -391,9 +389,9 @@ if (ret != 0) {

Length of the data to write.

-

timeOut

+

scatterLen

-

Timeout duration for writing data, in milliseconds. If the value is 0, the default value is used.

+

Length of the scatter list. If the value is not 0, the data is of the scatter list type.

Return Value

@@ -431,7 +429,7 @@ if (ret != 0) { The corresponding function is as follows: - int32\_t SdioReadBytesFromFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); + int32\_t SdioReadBytesFromFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t scatterLen\); **Table 8** Parameters and return values of SdioReadBytesFromFixedAddr @@ -462,9 +460,9 @@ if (ret != 0) {

Length of the data to read.

-

timeOut

+

scatterLen

-

Timeout duration for reading data, in milliseconds. If the value is 0, the default value is used.

+

Length of the scatter list. If the value is not 0, the data is of the scatter list type.

Return Value

@@ -503,7 +501,7 @@ if (ret != 0) { Currently, only 1-byte data can be written. The corresponding function is as follows: -int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **Table 9** Parameters and return values of SdioWriteBytesToFunc0 @@ -534,11 +532,6 @@ int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t add

Length of the data to write.

-

timeOut

- -

Timeout duration for writing data, in milliseconds. If the value is 0, the default value is used.

- -

Return Value

Description

@@ -563,7 +556,7 @@ The following example shows how to write a given length of data into the address int32_t ret; uint8_t wbuff = 1; /* Write 1-byte data into the address 0x2 of SDIO function 0. */ -ret = SdioWriteBytesToFunc0(handle, &wbuff, 0x2, 1, 0); +ret = SdioWriteBytesToFunc0(handle, &wbuff, 0x2, 1); if (ret != 0) { HDF_LOGE("SdioWriteBytesToFunc0: failed, ret %d\n", ret); } @@ -573,7 +566,7 @@ if (ret != 0) { Currently, only 1-byte data can be read. The corresponding function is as follows: -int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **Table 10** Parameters and return values of SdioReadBytesFromFunc0 @@ -604,11 +597,6 @@ int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t ad

Length of the data to read.

-

timeOut

- -

Timeout duration for reading data, in milliseconds. If the value is 0, the default value is used.

- -

Return Value

Description

@@ -633,7 +621,7 @@ The following example shows how to read a given length of data from the address int32_t ret; uint8_t rbuff; /* Read 1-byte data from the address 0x2 of SDIO function 0. */ -ret = SdioReadBytesFromFunc0(handle, &rbuff, 0x2, 1, 0); +ret = SdioReadBytesFromFunc0(handle, &rbuff, 0x2, 1); if (ret != 0) { HDF_LOGE("SdioReadBytesFromFunc0: failed, ret %d\n", ret); } @@ -754,7 +742,7 @@ void SdioReleaseHost\(DevHandle handle\);

handle

-

Device handle of an SDIO controller

+

Device handle of an SDIO controller.

@@ -785,7 +773,7 @@ This function releases the resources requested.

handle

-

Device handle of an SDIO controller

+

Device handle of an SDIO controller.

diff --git a/en/device-dev/quick-start/preparing-the-ubuntu-build-environment.md b/en/device-dev/quick-start/preparing-the-ubuntu-build-environment.md index a3f62435509c2081c8d9899ee1c08b1c4e8e0f2d..e1f0774daadb6d6f807a95c16affac8e8a630b27 100644 --- a/en/device-dev/quick-start/preparing-the-ubuntu-build-environment.md +++ b/en/device-dev/quick-start/preparing-the-ubuntu-build-environment.md @@ -1,43 +1,39 @@ # Preparing the Ubuntu Build Environment -- [Setting up an Ubuntu Build Environment Using a Docker Environment](#section1643363843714) - - [Obtaining System Source Code](#section58448331029) +- [Method 1: Setting up an Ubuntu Build Environment Using a Docker Environment](#section1643363843714) + - [Obtaining Standard-System Source Code](#section58448331029) - [Installing and Using the Docker Environment](#section22916211916) -- [Setting up an Ubuntu Build Environment Using an Installation Package](#section25961010189) +- [Method 2: Setting up an Ubuntu Build Environment Using an Installation Package](#section25961010189) - [Installing Dependent Tools](#section109262032104819) - [Obtaining Standard-System Source Code](#section6325556113718) - [Obtaining prebuilts](#section16453104219209) - - [Configuring the Node.js Environment and Obtaining the Node\_modules Dependency Package](#section133741330192119) - - [Installing the hc-gen Tool](#section149281248182116) You can use either the Docker environment or installation package provided by OpenHarmony to set up an Ubuntu build environment. This section describes the two methods. -## Setting up an Ubuntu Build Environment Using a Docker Environment +## Method 1: Setting up an Ubuntu Build Environment Using a Docker Environment The standard OpenHarmony system provides a Docker environment which encapsulates build tools. To use the Docker environment, perform the following steps: -1. Obtain the system source code. +1. Obtain the standard-system source code. 2. Install and use the Docker environment. -### Obtaining System Source Code +### Obtaining Standard-System Source Code -For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md). +Obtain the [standard-system source code](https://repo.huaweicloud.com/harmonyos/os/2.0/code-2.0-canary.tar.gz). The obtained source code is the static code. If you want to obtain the latest source code from Gitee, use [repo](../get-code/source-code-acquisition.md). ### Installing and Using the Docker Environment For details, see [Installing and Using Docker](../get-code/tool-acquisition.md). -## Setting up an Ubuntu Build Environment Using an Installation Package +## Method 2: Setting up an Ubuntu Build Environment Using an Installation Package The procedure is as follows: 1. Install dependent tools. -2. Obtain the system source code. +2. Obtain the standard-system source code. 3. Obtain prebuilts. -4. Configure the Node.js environment and obtain the Node\_modules dependency package. -5. Install the hc-gen tool. ### Installing Dependent Tools @@ -52,7 +48,7 @@ sudo apt-get install binutils git-core git-lfs gnupg flex bison gperf build-esse ### Obtaining Standard-System Source Code -For details, see [Source Code Acquisition](../get-code/source-code-acquisition.md). +Obtain the [standard-system source code](https://repo.huaweicloud.com/harmonyos/os/2.0/code-2.0-canary.tar.gz). The obtained source code is the static code. If you want to obtain the latest source code from Gitee, use [repo](../get-code/source-code-acquisition.md). ### Obtaining prebuilts @@ -62,86 +58,12 @@ For details, see [Source Code Acquisition](../get-code/source-code-acquisition. cd OpenHarmony ``` -2. Download the script. +2. Execute the following script: ``` - curl https://gitee.com/landwind/script-tools/raw/master/Shell/OpenHarmony/OpenHarmony_2.0_canary_prebuilts_download.sh >./prebuilts_download.sh + build/prebuilts_download.sh ``` -3. Download and decompress the prebuilts package in a specified directory. - - ``` - bash ./prebuilts_download.sh - ``` - - By default, binary files are stored in the **OpenHarmony\_2.0\_canary\_prebuilts** directory, which is in the same directory as **OpenHarmony**. To change the storage path, change the value of **bin\_dir** in **prebuilts\_download.sh**. - -4. Return to the previous directory. - - ``` - cd - - ``` - - -### Configuring the Node.js Environment and Obtaining the Node\_modules Dependency Package - -To build the JS framework, you need to download and configure Node.js on a Linux server. The procedure is as follows \(the **OpenHarmony** directory in the following steps is the root directory of the current project and is configurable\): - -1. Download Node.js on a Linux server. - - ``` - mkdir -p OpenHarmony/prebuilts/build-tools/common/nodejs # Create the nodejs directory. - cd OpenHarmony/prebuilts/build-tools/common/nodejs # Go to the nodejs directory. - wget --no-check-certificate https://nodejs.org/download/release/v12.18.4/node-v12.18.4-linux-x64.tar.gz # Download the Node.js package. - tar -zxvf node-v12.18.4-linux-x64.tar.gz # Decompress the Node.js package. - cd - # Return to the previous directory. - ``` - -2. Configure the Node.js variable and download the **node\_modules** package. - - ``` - cd OpenHarmony/third_party/jsframework # Go to the jsframework directory. - export PATH=../../prebuilts/build-tools/common/nodejs/node-v12.18.4-linux-x64/bin:${PATH} # Configure the Node.js variable. - npm install # Download the node_modules package. - cd - # Return to the previous directory. - ``` - -3. Store the **node\_modules** package in the **prebuilts/build-tools/common/js-framework** directory of the OpenHarmony code. - - ``` - mkdir -p OpenHarmony/prebuilts/build-tools/common/js-framework # Create the js-framework directory. - cp -rp OpenHarmony/third_party/jsframework/node_modules OpenHarmony/prebuilts/build-tools/common/js-framework/ - ``` - - -### Installing the hc-gen Tool - -hc-gen is used to compile the driver. To install hc-gen, perform the following steps: - -1. Start a Linux server. -2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). -3. Decompress the hc-gen installation package to **\~/hc-gen** on the Linux server. - - ``` - tar -xvf hc-gen-0.65-linux.tar -C ~/ - ``` - -4. Set an environment variable. - - ``` - vim ~/.bashrc - ``` - - Copy the following command to the last line of the **.bashrc** file, save the file, and exit. - - ``` - export PATH=~/hc-gen:$PATH - ``` - -5. Validate the environment variable. - - ``` - source ~/.bashrc - ``` + By default, the downloaded prebuilts binary file is stored in **OpenHarmony\_2.0\_canary\_prebuilts** \(which is in the same directory as **OpenHarmony**\). diff --git a/en/device-dev/quick-start/setting-up-the-environment-2.md b/en/device-dev/quick-start/setting-up-the-environment-2.md index 03af20f97abd65f5147b8688b60cedad15b2c3bd..1c3604b02e1ab335b5ae9d4480b59826bccbe253 100644 --- a/en/device-dev/quick-start/setting-up-the-environment-2.md +++ b/en/device-dev/quick-start/setting-up-the-environment-2.md @@ -7,8 +7,7 @@ - [Installing Linux Build Tools](#section182916865219) - [Changing Linux Shell to Bash](#section1715027152617) - [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251) - - [Installing a File Packing Tool](#section1969111820270) - - [Installing the JVM](#section1692618112713) + - [Installing File Packing Tools and JVM](#section16199102083717) ## Environment Requirements @@ -108,44 +107,16 @@ sudo ln -s /bin/bash /bin/sh Install the software. ``` -sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev +sudo apt-get install build-essential gcc g++ make zlib* libffi-dev ``` -### Installing a File Packing Tool +### Installing File Packing Tools and JVM 1. Start a Linux server. -2. Install **dosfstools**. +2. Install the dosfstools, mtools, mtd-utils, Java Runtime Environment \(JRE\), and Java SDK. ``` - sudo apt-get install dosfstools - ``` - -3. Install **mtools**. - - ``` - sudo apt-get install mtools - ``` - -4. Install **mtd-utils**. - - ``` - sudo apt-get install mtd-utils - ``` - - -### Installing the JVM - -1. Start a Linux server. -2. Install the Java Runtime Environment \(JRE\). - - ``` - sudo apt-get install default-jre - ``` - -3. Install the Java Development Kit \(JDK\). - - ``` - sudo apt-get install default-jdk + sudo apt-get install dosfstools mtools mtd-utils default-jre default-jdk ``` diff --git a/en/device-dev/quick-start/setting-up-the-environment-4.md b/en/device-dev/quick-start/setting-up-the-environment-4.md index ae739691758d246f216824d1848940ad0cec5143..e8938baf915d5fc9fad719a6c46684307c607d56 100644 --- a/en/device-dev/quick-start/setting-up-the-environment-4.md +++ b/en/device-dev/quick-start/setting-up-the-environment-4.md @@ -5,10 +5,9 @@ - [Software Requirements](#section17315193935817) - [Installing Linux Build Tools](#section8831868501) - - [Changing Linux Shell to Bash](#section1715027152617) - - [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section45512412251) - - [Installing a File Packing Tool](#section1686964015274) - - [Installing hc-gen](#section18706403274) + - [Changing Linux Shell to Bash](#section434110241084) + - [Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)](#section25911132141020) + - [Installing File Packing Tools](#section390214473129) ## Environment Requirements @@ -72,7 +71,7 @@ The following table describes the tools required for setting up the general envi >- If you acquire the source code using an HPM component or HPM CLI tool, you do not need to install **hc-gen**. >- \(Recommended\) If you obtain the source code via the mirror site or code repository, install **hc-gen**. When installing the compilation tool, ensure that its environment variable path is unique. -### Changing Linux Shell to Bash +### Changing Linux Shell to Bash Check whether bash is used as the shell. @@ -95,62 +94,21 @@ sudo rm -rf /bin/sh sudo ln -s /bin/bash /bin/sh ``` -### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\) +### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\) Install the software. ``` -sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev +sudo apt-get install build-essential gcc g++ make zlib* libffi-dev ``` -### Installing a File Packing Tool +### Installing File Packing Tools 1. Start a Linux server. -2. Install **dosfstools**. +2. Install dosfstools, mtools, and mtd-utils. ``` - sudo apt-get install dosfstools - ``` - -3. Install **mtools**. - - ``` - sudo apt-get install mtools - ``` - -4. Install **mtd-utils**. - - ``` - sudo apt-get install mtd-utils - ``` - - -### Installing hc-gen - -1. Start a Linux server. -2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). -3. Decompress the hc-gen installation package to **\~/hc-gen** on the Linux server. - - ``` - tar -xvf hc-gen-0.65-linux.tar -C ~/ - ``` - -4. Set an environment variable. - - ``` - vim ~/.bashrc - ``` - - Copy the following command to the last line of the **.bashrc** file, save the file, and exit. - - ``` - export PATH=~/hc-gen:$PATH - ``` - -5. Validate the environment variable. - - ``` - source ~/.bashrc + sudo apt-get install dosfstools mtools mtd-utils ``` diff --git a/en/device-dev/quick-start/setting-up-the-environment.md b/en/device-dev/quick-start/setting-up-the-environment.md index e97949c8b45801dc03a3774e50f03765e139c929..382dc5ac66d2cd78bfb6bd1e307b9a362b1aafee 100644 --- a/en/device-dev/quick-start/setting-up-the-environment.md +++ b/en/device-dev/quick-start/setting-up-the-environment.md @@ -105,7 +105,7 @@ The following table lists the tools required for the Hi3861 development board. Install the software. ``` -sudo apt-get install build-essential && sudo apt-get install gcc && sudo apt-get install g++ && sudo apt-get install make && sudo apt-get install zlib* && sudo apt-get install libffi-dev +sudo apt-get install build-essential gcc g++ make zlib* libffi-dev ``` ### Installing Scons diff --git a/en/device-dev/quick-start/ubuntu-build-environment.md b/en/device-dev/quick-start/ubuntu-build-environment.md index 50505a9c04a17d2af37c9974bd05d46f5dfc69a0..9c141637b5a7efad7834c91138be34c9a648f4f6 100644 --- a/en/device-dev/quick-start/ubuntu-build-environment.md +++ b/en/device-dev/quick-start/ubuntu-build-environment.md @@ -1,11 +1,10 @@ # Ubuntu Build Environment - [Obtaining Source Code and Tools](#section1897711811517) -- [Obtaining OpenHarmony Source Code](#section1545225464016) +- [Obtaining Source Code](#section1545225464016) - [Installing and Configuring Python](#section1238412211211) - [Installing gn](#section29216201423) - [Installing ninja](#section8762358731) -- [Installing hc-gen](#section4924165316437) - [Installing LLVM](#section12202192215415) - [Installing hb](#section15794154618411) - [Prerequisites](#section1083283711515) @@ -21,9 +20,8 @@ Perform the following steps to set up the build environment: 2. Install and configure Python. 3. Install GN. 4. Install Ninja. -5. Installing hc-gen -6. Install LLVM. -7. Install hb. +5. Install LLVM. +6. Install hb. >![](public_sys-resources/icon-notice.gif) **NOTICE:** >- Docker is provided for the Ubuntu build environment, which encapsulates related build tools. If you use Docker to prepare the build environment, you do not need to perform the following steps in this section. Instead, refer to [Using Docker to Prepare the Build Environment](../get-code/tool-acquisition.md). @@ -73,13 +71,6 @@ The following table describes the tools and source code required for setting up

https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar

-

hc-gen

- -

Configures and compiles files.

- -

https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar

- -

LLVM

@@ -88,7 +79,7 @@ The following table describes the tools and source code required for setting up

Functions as the compiler toolchain.

-

https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz

For the OpenHarmony_1.0.1_release, download LLVM from the following link:

@@ -109,7 +100,7 @@ The following table describes the tools and source code required for setting up >- If you acquire the source code using an HPM component or HPM CLI tool, you do not need to install compilation tools like **gn** and **ninja**. >- \(Recommended\) If you obtain the source code via the mirror site or code repository, install compilation tools such as **gn**, **ninja**, and LLVM. When installing these tools, ensure that their environment variable paths are unique. -## Obtaining OpenHarmony Source Code +## Obtaining Source Code You need to acquire [source code](../get-code/source-code-acquisition.md), download it on a Linux server, and decompress it. @@ -247,35 +238,6 @@ You need to acquire [source code](../get-code/source-code-acquisition.md), down ``` -## Installing hc-gen - -1. Start a Linux server. -2. Download [hc-gen](https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar). -3. Decompress the hc-gen installation package to **\~/hc-gen** on the Linux server. - - ``` - tar -xvf hc-gen-0.65-linux.tar -C ~/ - ``` - -4. Set an environment variable. - - ``` - vim ~/.bashrc - ``` - - Copy the following command to the last line of the **.bashrc** file, save the file, and exit. - - ``` - export PATH=~/hc-gen:$PATH - ``` - -5. Validate the environment variable. - - ``` - source ~/.bashrc - ``` - - ## Installing LLVM 1. Start a Linux server. diff --git a/zh-cn/application-dev/application-dev-guide.md b/zh-cn/application-dev/application-dev-guide.md new file mode 100644 index 0000000000000000000000000000000000000000..1f33f72dc0f16c3f6c928b920e27c74139236b8d --- /dev/null +++ b/zh-cn/application-dev/application-dev-guide.md @@ -0,0 +1,10 @@ +# 应用开发导读 + +应用开发文档用于指导开发者通过OpenHarmony提供的接口完成应用开发。当前应用开发文档提供了在标准系统上开发应用的JS接口。 + +在这部分中,开发者可以通过“[入门](quick-start/Readme-CN.md)”来了解应用开发的基本方法。完整的接口清单和参考使用指导可参见“[JS参考规范](js-reference/Readme-CN.md)”。 + +除此之外,为方便开发者对常用功能进行深入理解,还提供了[UI](ui/Readme-CN.md)、[媒体](media/Readme-CN.md)、[网络与连接](connectivity/Readme-CN.md)三个模块的开发指南。 + +如果需要了解各子系统的原理和基本信息,可以参考“docs/zh-cn/readme”目录中各子系统readme的介绍。 + diff --git "a/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\345\256\236\344\276\213.md" "b/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\345\256\236\344\276\213.md" index 570e1706957919cd3b87da3b98c8ac367da4b17c..18ddb74593b5ea69a427ecd03e8a41394daae174 100755 --- "a/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\345\256\236\344\276\213.md" +++ "b/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\345\256\236\344\276\213.md" @@ -27,12 +27,12 @@ void SdioTestSample(void) int32_t ret; DevHandle handle = NULL; uint8_t data[TEST_DATA_LEN] = {0}; - int16_t busNum = 1; + struct SdioFunctionConfig config = {1, 0x123, 0x456}; uint8_t val; uint32_t addr; /* 打开总线号为1的SDIO设备 */ - handle = SdioOpen(busNum); + handle = SdioOpen(1, &config); if (handle == NULL) { HDF_LOGE("SdioOpen: failed!\n"); return; @@ -59,25 +59,25 @@ void SdioTestSample(void) } /* 从SDIO设备增量地址读取3字节的数据 */ addr = TEST_FBR_BASE_ADDR * TEST_FUNC_NUM + TEST_ADDR_OFFSET; - ret = SdioReadBytes(handle, data, addr, TEST_DATA_LEN, 0); + ret = SdioReadBytes(handle, data, addr, TEST_DATA_LEN); if (ret != 0) { HDF_LOGE("SdioReadBytes: failed, ret %d\n", ret); goto COMM_ERR; } /* 向SDIO设备增量地址写入3字节的数据 */ - ret = SdioWriteBytes(handle, data, addr, TEST_DATA_LEN, 0); + ret = SdioWriteBytes(handle, data, addr, TEST_DATA_LEN); if (ret != 0) { HDF_LOGE("SdioWriteBytes: failed, ret %d\n", ret); goto COMM_ERR; } /* 从SDIO设备读取1字节的数据 */ - ret = SdioReadBytes(handle, &val, addr, 1, 0); + ret = SdioReadBytes(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioReadBytes: failed, ret %d\n", ret); goto COMM_ERR; } /* 向SDIO设备写入1字节的数据 */ - ret = SdioWriteBytes(handle, &val, addr, 1, 0); + ret = SdioWriteBytes(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioWriteBytes: failed, ret %d\n", ret); goto COMM_ERR; @@ -96,13 +96,13 @@ void SdioTestSample(void) } /* 从SDIO function 0读取1字节的数据 */ addr = 0x02; - ret = SdioReadBytesFromFunc0(handle, &val, addr, 1, 0); + ret = SdioReadBytesFromFunc0(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioReadBytesFromFunc0: failed, ret %d\n", ret); goto COMM_ERR; } /* 向SDIO function 0写入1字节的数据 */ - ret = SdioWriteBytesToFunc0(handle, &val, addr, 1, 0); + ret = SdioWriteBytesToFunc0(handle, &val, addr, 1); if (ret != 0) { HDF_LOGE("SdioWriteBytesToFunc0: failed, ret %d\n", ret); goto COMM_ERR; diff --git "a/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\346\214\207\345\257\274.md" "b/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\346\214\207\345\257\274.md" index 1f4837d8e77e77395401c3440f7c2f3cbd25db88..fd65e6de6adcef6ef307018c850ca1cb513d3b1f 100755 --- "a/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\346\214\207\345\257\274.md" +++ "b/zh-cn/device-dev/driver/SDIO\344\275\277\347\224\250\346\214\207\345\257\274.md" @@ -24,7 +24,7 @@ 在使用SDIO进行通信前,首先要调用SdioOpen获取SDIO控制器的设备句柄,该函数会返回指定总线号的SDIO控制器的设备句柄。 -DevHandle SdioOpen\(int16\_t busNum\); +DevHandle SdioOpen\(int16\_t mmcBusNum, struct SdioFunctionConfig \*config\); **表 1** SdioOpen函数的参数和返回值描述 @@ -35,9 +35,14 @@ DevHandle SdioOpen\(int16\_t busNum\); -

busNum

+

mmcBusNum

-

SDIO的总线号

+

总线号

+ + +

config

+ +

SDIO功能配置信息

返回值

@@ -62,9 +67,12 @@ DevHandle SdioOpen\(int16\_t busNum\); ``` DevHandle handle = NULL; -int16_t busNum = 1; +struct SdioFunctionConfig config; +config.funcNr = 1; +config.vendorId = 0x123; +config.deviceId = 0x456; /* 打开总线号为1的SDIO控制器 */ -handle = SdioOpen(busNum); +handle = SdioOpen(1, &config); if (handle == NULL) { HDF_LOGE("SdioOpen: failed!\n"); } @@ -218,7 +226,7 @@ if (ret != 0) { 对应的接口函数如下所示: -int32\_t SdioWriteBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioWriteBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **表 5** SdioWriteBytes函数的参数和返回值描述 @@ -249,11 +257,6 @@ int32\_t SdioWriteBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint

待写入数据的长度

-

timeOut

- -

写入数据的最大时间限制,单位毫秒。如果该字段为0,则使用平台对应的默认值。

- -

返回值

返回值描述

@@ -279,7 +282,7 @@ int32_t ret; uint8_t wbuff[] = {1,2,3,4,5}; uint32_t addr = 0x100 + 0x09; /* 向SDIO设备起始地址0x109,增量写入5个字节的数据 */ -ret = SdioWriteBytes(handle, wbuff, addr, sizeof(wbuff) / sizeof(wbuff[0]), 0); +ret = SdioWriteBytes(handle, wbuff, addr, sizeof(wbuff) / sizeof(wbuff[0])); if (ret != 0) { HDF_LOGE("SdioWriteBytes: failed, ret %d\n", ret); } @@ -289,7 +292,7 @@ if (ret != 0) { 对应的接口函数如下所示: -int32\_t SdioReadBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioReadBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **表 6** SdioReadBytes函数的参数和返回值描述 @@ -320,11 +323,6 @@ int32\_t SdioReadBytes\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint3

待读取数据的长度

-

timeOut

- -

读取数据的最大时间限制,单位毫秒。如果该字段为0,则使用平台对应的默认值。

- -

返回值

返回值描述

@@ -350,7 +348,7 @@ int32_t ret; uint8_t rbuff[5] = {0}; uint32_t addr = 0x100 + 0x09; /* 从SDIO设备起始地址0x109,增量读取5个字节的数据 */ -ret = SdioReadBytes(handle, rbuff, addr, 5, 0); +ret = SdioReadBytes(handle, rbuff, addr, 5); if (ret != 0) { HDF_LOGE("SdioReadBytes: failed, ret %d\n", ret); } @@ -360,7 +358,7 @@ if (ret != 0) { 对应的接口函数如下所示: - int32\_t SdioWriteBytesToFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); + int32\_t SdioWriteBytesToFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t scatterLen\); **表 7** SdioWriteBytesToFixedAddr函数的参数和返回值描述 @@ -391,9 +389,9 @@ if (ret != 0) {

待写入数据的长度

-

timeOut

+

scatterLen

-

写入数据的最大时间限制,单位毫秒。如果该字段为0,则使用平台对应的默认值。

+

集散表的长度。如果该字段不为0,则data为集散表类型。

返回值

@@ -431,7 +429,7 @@ if (ret != 0) { 对应的接口函数如下所示: - int32\_t SdioReadBytesFromFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); + int32\_t SdioReadBytesFromFixedAddr\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t scatterLen\); **表 8** SdioReadBytesFromFixedAddr函数的参数和返回值描述 @@ -462,9 +460,9 @@ if (ret != 0) {

待读取数据的长度

-

timeOut

+

scatterLen

-

读取数据的最大时间限制,单位毫秒。如果该字段为0,则使用平台对应的默认值。

+

集散表的长度。如果该字段不为0,则data为集散表类型。

返回值

@@ -503,7 +501,7 @@ if (ret != 0) { 当前只支持写入一个字节的数据,对应的接口函数如下所示: -int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **表 9** SdioWriteBytesToFunc0函数的参数和返回值描述 @@ -534,11 +532,6 @@ int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t add

待写入数据的长度

-

timeOut

- -

写入数据的最大时间限制,单位毫秒。如果该字段为0,则使用平台对应的默认值。

- -

返回值

返回值描述

@@ -563,7 +556,7 @@ int32\_t SdioWriteBytesToFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t add int32_t ret; uint8_t wbuff = 1; /* 向SDIO function 0地址0x2中写入1字节的数据 */ -ret = SdioWriteBytesToFunc0(handle, &wbuff, 0x2, 1, 0); +ret = SdioWriteBytesToFunc0(handle, &wbuff, 0x2, 1); if (ret != 0) { HDF_LOGE("SdioWriteBytesToFunc0: failed, ret %d\n", ret); } @@ -573,7 +566,7 @@ if (ret != 0) { 当前只支持读取一个字节的数据,对应的接口函数如下所示: -int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size, uint32\_t timeOut\); +int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t addr, uint32\_t size\); **表 10** SdioReadBytesFromFunc0函数的参数和返回值描述 @@ -604,11 +597,6 @@ int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t ad

待读取数据的长度

-

timeOut

- -

读取数据的最大时间限制,单位毫秒。如果该字段为0,则使用平台对应的默认值。

- -

返回值

返回值描述

@@ -633,7 +621,7 @@ int32\_t SdioReadBytesFromFunc0\(DevHandle handle, uint8\_t \*data, uint32\_t ad int32_t ret; uint8_t rbuff; /* 从SDIO function 0设备地址0x2中读取1字节的数据 */ -ret = SdioReadBytesFromFunc0(handle, &rbuff, 0x2, 1, 0); +ret = SdioReadBytesFromFunc0(handle, &rbuff, 0x2, 1); if (ret != 0) { HDF_LOGE("SdioReadBytesFromFunc0: failed, ret %d\n", ret); } diff --git "a/zh-cn/device-dev/driver/UART\344\275\277\347\224\250\346\214\207\345\257\274.md" "b/zh-cn/device-dev/driver/UART\344\275\277\347\224\250\346\214\207\345\257\274.md" index 16305dfa3da702602ee73d2a0cc99ca75460db41..1d1ee50a8c13e37c506350820c71a5a7b4893d7f 100755 --- "a/zh-cn/device-dev/driver/UART\344\275\277\347\224\250\346\214\207\345\257\274.md" +++ "b/zh-cn/device-dev/driver/UART\344\275\277\347\224\250\346\214\207\345\257\274.md" @@ -13,7 +13,7 @@ ## 使用流程 -使用UART的一般流程如下图所示。 +使用UART的一般流程如[图1](#p58686354483)所示。 **图 1** UART使用流程图 diff --git "a/zh-cn/device-dev/driver/\351\251\261\345\212\250\345\274\200\345\217\221.md" "b/zh-cn/device-dev/driver/\351\251\261\345\212\250\345\274\200\345\217\221.md" index b05a39a8718cf01918096e1c65c0201d1ae1d46e..e35139db59ca7df253ee0134e5afb379d596e300 100755 --- "a/zh-cn/device-dev/driver/\351\251\261\345\212\250\345\274\200\345\217\221.md" +++ "b/zh-cn/device-dev/driver/\351\251\261\345\212\250\345\274\200\345\217\221.md" @@ -71,7 +71,7 @@ HDF框架以组件化的驱动模型作为核心设计思路,为开发者提 - 驱动代码的编译必须要使用HDF框架提供的Makefile模板进行编译。 ``` - include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk #导入hdf预定义内容,必需 + include $(LITEOSTOPDIR)/../../drivers/adapter/lite/khdf/lite.mk #导入hdf预定义内容,必需 MODULE_NAME := #生成的结果文件 LOCAL_INCLUDE := #本驱动的头文件目录 LOCAL_SRCS := #本驱动的源代码文件 diff --git "a/zh-cn/device-dev/quick-start/Ubuntu\347\274\226\350\257\221\347\216\257\345\242\203\345\207\206\345\244\207.md" "b/zh-cn/device-dev/quick-start/Ubuntu\347\274\226\350\257\221\347\216\257\345\242\203\345\207\206\345\244\207.md" index 42cb2c61519ba87139c084eac4ba7a84bccf7b0e..073e04bbc4b85187ff76c587eff29ede9b72e41d 100755 --- "a/zh-cn/device-dev/quick-start/Ubuntu\347\274\226\350\257\221\347\216\257\345\242\203\345\207\206\345\244\207.md" +++ "b/zh-cn/device-dev/quick-start/Ubuntu\347\274\226\350\257\221\347\216\257\345\242\203\345\207\206\345\244\207.md" @@ -79,7 +79,7 @@ Linux服务器通用环境配置需要的工具及其获取途径如下表所示

编译工具链

-

https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz

+

https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-62608/linux/llvm.tar.gz

针对OpenHarmony_1.0.1_release分支使用以下链接下载:

diff --git "a/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207-9.md" "b/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207-9.md" index b2830340c58b305413650332a0338abb0897cc6c..1922601478a44f30abab394ab7dde6fca921fea3 100644 --- "a/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207-9.md" +++ "b/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207-9.md" @@ -43,9 +43,9 @@ DevEco Device Tool以插件方式提供,基于Visual Studio Code进行扩展

编译构建工具

-

3.7.4-3.8.x 64位版本

+

V3.7.4~V3.8.x 64位版本

-

https://www.python.org/downloads/

+

推荐下载:https://www.python.org/downloads/release/python-388/

Node.js

@@ -93,9 +93,9 @@ DevEco Device Tool以插件方式提供,基于Visual Studio Code进行扩展 ## 安装Python -1. 双击Python安装包进行安装,勾选“**Add Python xx to PATH**”,然后点击**Install Now**开始安装。 +1. 双击Python安装包进行安装,勾选“**Add Python 3.8 to PATH**”,然后点击**Install Now**开始安装。 - ![](figures/zh-cn_image_0000001096154076.png) + ![](figures/zh-cn_image_0000001168817327.png) 2. 等待安装完成后,点击**Close**。 @@ -103,7 +103,7 @@ DevEco Device Tool以插件方式提供,基于Visual Studio Code进行扩展 3. 打开命令行工具,输入python --version,检查安装结果。 - ![](figures/zh-cn_image_0000001143154485.png) + ![](figures/zh-cn_image_0000001122419072.png) 4. 在命令行工具中,分别执行如下命令设置pip源,用于后续安装DevEco Device Tool过程中下载依赖的组件包。 diff --git "a/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md" "b/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md" index 55970ca67aa696dfcf62c512273367775a7cf5ee..f70d3cce73f8f5939597d71c7d341d08a2f2a505 100755 --- "a/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md" +++ "b/zh-cn/device-dev/quick-start/Windows\345\274\200\345\217\221\347\216\257\345\242\203\345\207\206\345\244\207.md" @@ -43,9 +43,9 @@ DevEco Device Tool以插件方式提供,基于Visual Studio Code进行扩展

编译构建工具

-

3.7.4-3.8.x 64位版本

+

V3.7.4~V3.8.x 64位版本

-

https://www.python.org/downloads/

+

推荐下载:https://www.python.org/downloads/release/python-388/

Node.js

@@ -93,9 +93,9 @@ DevEco Device Tool以插件方式提供,基于Visual Studio Code进行扩展 ## 安装Python -1. 双击Python安装包进行安装,勾选“**Add Python xx to PATH**”,然后点击**Install Now**开始安装。 +1. 双击Python安装包进行安装,勾选“**Add Python 3.8 to PATH**”,然后点击**Install Now**开始安装。 - ![](figures/zh-cn_image_0000001096154076.png) + ![](figures/zh-cn_image_0000001168817327.png) 2. 等待安装完成后,点击**Close**。 @@ -103,7 +103,7 @@ DevEco Device Tool以插件方式提供,基于Visual Studio Code进行扩展 3. 打开命令行工具,输入python --version,检查安装结果。 - ![](figures/zh-cn_image_0000001143154485.png) + ![](figures/zh-cn_image_0000001122419072.png) 4. 在命令行工具中,分别执行如下命令设置pip源,用于后续安装DevEco Device Tool过程中下载依赖的组件包。 diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001122419072.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001122419072.png new file mode 100644 index 0000000000000000000000000000000000000000..2f6e93e40bf4abee3c83aebf0c5f3299e51dc630 Binary files /dev/null and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001122419072.png differ diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001168817327.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001168817327.png new file mode 100644 index 0000000000000000000000000000000000000000..8aa65e82be8db2e7de62fca8980d00ae42215d96 Binary files /dev/null and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001168817327.png differ diff --git "a/zh-cn/device-dev/quick-start/\345\256\211\350\243\205\345\274\200\345\217\221\346\235\277\347\216\257\345\242\203.md" "b/zh-cn/device-dev/quick-start/\345\256\211\350\243\205\345\274\200\345\217\221\346\235\277\347\216\257\345\242\203.md" index 77252869a96c5cc09da2d1377da1b4271805e66d..7bc6e67829cceedac9c8991f9ebfbba0ec0c608e 100644 --- "a/zh-cn/device-dev/quick-start/\345\256\211\350\243\205\345\274\200\345\217\221\346\235\277\347\216\257\345\242\203.md" +++ "b/zh-cn/device-dev/quick-start/\345\256\211\350\243\205\345\274\200\345\217\221\346\235\277\347\216\257\345\242\203.md" @@ -358,7 +358,7 @@ sudo apt-get install build-essential gcc g++ make zlib* libffi-dev 相关步骤在Windows工作台操作。 -1. 点击链接[下载CH341SER USB转串口](http://www.wch.cn/search?q=ch340g&t=downloads)驱动程序。 +1. 点击链接[下载CH341SER USB转串口](http://www.hihope.org/download/download.aspx?mtt=8)驱动程序。 2. 点击安装包,安装驱动程序。 3. 驱动安装完成后,重新插拔USB接口,串口信息显示如下图所示。 diff --git "a/zh-cn/device-dev/quick-start/\345\257\274\350\257\273.md" "b/zh-cn/device-dev/quick-start/\345\257\274\350\257\273.md" index fc7a62eb0250d1ce0e51c4eadce1ea1f8436eaa1..0f31f568ca14a6aeeec18a0f83b7d0c750ea867a 100755 --- "a/zh-cn/device-dev/quick-start/\345\257\274\350\257\273.md" +++ "b/zh-cn/device-dev/quick-start/\345\257\274\350\257\273.md" @@ -30,71 +30,141 @@ OpenHarmony也提供了一系列可选的系统组件,方便设备开发者按 ## 文档导读 -**表 1** 文档资源导读 +**表 1** 轻量和小型系统开发指导(参考内存<128MB) - -

学习路径

+ + - - - - - - - - - - - - - - - - - - - - - - - - - - + + +

学习路径

开发者业务

+

开发者业务

相关文档

+

相关文档

了解OpenHarmony

+

了解OpenHarmony

整体认知OpenHarmony

+

整体认知OpenHarmony

+

获取开发资源

+

获取开发资源

准备开发前相关资源

+

准备开发前相关资源

+

快速入门

+

快速入门

快速熟悉OpenHarmony环境搭建、编译、烧录、调测、运行。

+

快速熟悉OpenHarmony环境搭建、编译、烧录、调测、运行。

+

轻量和小型系统快速入门

基础能力使用

+

基础能力使用

使用OpenHarmony提供的基础能力

+

使用OpenHarmony提供的基础能力

+

进阶开发

+

进阶开发

结合系统能力开发智能设备

+

结合系统能力开发智能设备

+

移植适配

+

移植适配

  • 针对特定芯片做移植适配
  • 对三方库进行移植适配
+
  • 针对特定芯片做移植适配
  • 对三方库进行移植适配
+

贡献组件

+

贡献组件

OpenHarmony贡献功能组件

+

OpenHarmony贡献功能组件

+

参考

+

参考

开发参考

+

开发参考

+ +
+ +**表 2** 标准系统开发指导(参考内存≥128MB) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/zh-cn/readme.md b/zh-cn/readme.md index ac08ec8d4823d75b7dda8224a26d9789552cfa58..7a117bfee0f57b10c494e9c9369cb818313e5aae 100644 --- a/zh-cn/readme.md +++ b/zh-cn/readme.md @@ -1,88 +1,77 @@ -# OpenHarmony开发者文档 +# OpenHarmony开发者文档 此工程存放OpenHarmony提供的快速入门、开发指南、API参考等开发者文档,欢迎参与OpenHarmony开发者文档开源项目,与我们一起完善开发者文档。 - -## 设备开发-文档目录结构 - -- overview:[导读](device-dev/quick-start/导读.md) - -- quick-start:[快速入门](device-dev/quick-start/Readme-CN.md) - -- get-code:[获取源码/获取工具](device-dev/get-code/Readme-CN.md) - -- docker:[标准系统Docker镜像构建](../docker/standard/Readme.md)、[轻量和小型系统Docker镜像构建](../docker/README.md) - -- kernel:[内核](device-dev/kernel/Readme-CN.md) - -- driver:[驱动](device-dev/driver/Readme-CN.md) - -- subsystems:[子系统](device-dev/subsystems/Readme-CN.md) - - - [编译构建](device-dev/subsystems/编译构建.md) - - - [分布式远程启动](device-dev/subsystems/分布式远程启动.md) - - - [图形图像](device-dev/subsystems/图形图像.md) - - - [媒体](device-dev/subsystems/媒体.md) - - - [公共基础](device-dev/subsystems/公共基础.md) - - - [AI框架](device-dev/subsystems/AI框架.md) - - - [Sensor服务](device-dev/subsystems/Sensor服务.md) - - - [用户程序框架](device-dev/subsystems/用户程序框架.md) - - - [OTA升级](device-dev/subsystems/OTA升级.md) - - - [安全](device-dev/subsystems/安全.md) - - - [启动恢复](device-dev/subsystems/启动恢复.md) - - - [测试](device-dev/subsystems/测试.md) - - - [DFX](device-dev/subsystems/DFX.md) - - - [研发工具链](device-dev/subsystems/研发工具链.md) - - - [XTS认证](device-dev/subsystems/XTS认证子系统开发指南.md) - -- bundles:[组件开发](device-dev/bundles/Readme-CN.md) - -- porting:[三方库移植/三方芯片移植](device-dev/porting/Readme-CN.md) - -- guide:[开发示例](device-dev/guide/Readme-CN.md) - - - [WLAN连接类产品](device-dev/guide/WLAN连接类产品.md) - - [无屏摄像头类产品](device-dev/guide/无屏摄像头类产品.md) - - [带屏摄像头类产品](device-dev/guide/带屏摄像头类产品.md) - - [时钟应用开发示例](device-dev/guide/时钟应用开发示例.md) - - [平台驱动开发示例](device-dev/guide/平台驱动开发示例.md) - - [外设驱动开发示例](device-dev/guide/外设驱动开发示例.md) - -- security:[隐私与安全](device-dev/security/Readme-CN.md) - -- glossary:[术语](device-dev/glossary/术语.md) - -## 应用开发-文档目录结构 - -- quick-start:[入门](application-dev/quick-start/Readme-CN.md) -- ui:[UI](application-dev/ui/Readme-CN.md) -- media:[媒体](application-dev/media/Readme-CN.md) -- connectivity:[网络与连接](application-dev/connectivity/Readme-CN.md) -- js-reference:[JS参考规范](application-dev/js-reference/Readme-CN.md) - -## 版本更新 - -参考[Release Notes](release-notes/OpenHarmony-Release-Notes.md) - -## 第三方开源软件及许可说明 +## 文档目录结构 + +- [Openharmony概述](OpenHarmony-Overview_zh.md) +- 轻量和小型系统开发指导(参考内存<128MB) + - 设备开发 + - overview:[设备开发导读](device-dev/quick-start/导读.md) + - quick-start:[快速入门](device-dev/quick-start/Readme-CN.md)(搭建环境、获取源码、编译、烧录等) + - 开发基础能力 + - Kernel:[轻内核](device-dev/kernel/轻内核.md) + - Drivers:[驱动](device-dev/driver/Readme-CN.md) + - Subsystems:[子系统](device-dev/subsystems/Readme-CN.md)(编译构建、图形图像、DFX、XTS等子系统) + - Security:[隐私与安全](device-dev/security/Readme-CN.md) + + - guide:[开发示例](device-dev/guide/Readme-CN.md) + - [WLAN连接类产品](device-dev/guide/WLAN连接类产品.md)(LED外设控制、集成三方SDK) + - [无屏摄像头类产品](device-dev/guide/无屏摄像头类产品.md)(摄像头控制) + - [带屏摄像头类产品](device-dev/guide/带屏摄像头类产品.md)(屏幕和摄像头控制、视觉应用开发) + + - porting:[移植适配](device-dev/porting/Readme-CN.md) + - [三方芯片移植指导](device-dev/porting/三方芯片移植指导.md) + - [三方库移植指导](device-dev/porting/三方库移植指导.md) + + - bundles:[组件开发](device-dev/bundles/Readme-CN.md) + - [组件开发规范](device-dev/bundles/组件开发规范.md) + - [组件开发指南](device-dev/bundles/组件开发指南.md) + - [组件开发示例](device-dev/bundles/组件开发示例.md) + +- 标准系统开发指导(参考内存≥128MB) + - 设备开发 + - overview:[设备开发导读](device-dev/quick-start/导读.md) + - quick-start:[快速入门](device-dev/quick-start/Readme-CN.md)(搭建环境、获取源码、编译、烧录等) + - 开发基础能力 + - Kernel:[Linux内核](device-dev/kernel/Linux内核.md) + - Drivers:[驱动](device-dev/driver/Readme-CN.md) + - Subsystems:[子系统](device-dev/subsystems/Readme-CN.md)(编译构建、图形图像、DFX、XTS等子系统) + - Security:[隐私与安全](device-dev/security/Readme-CN.md) + + - guide:[开发示例](device-dev/guide/Readme-CN.md) + - [时钟应用](device-dev/guide/时钟应用开发示例.md) + - [平台驱动](device-dev/guide/平台驱动开发示例.md) + - [外设驱动](device-dev/guide/外设驱动开发示例.md) + + - porting:[移植适配](device-dev/porting/Readme-CN.md) + - [三方芯片移植指导](device-dev/porting/三方芯片移植指导.md) + - [三方库移植指导](device-dev/porting/三方库移植指导.md) + + - bundles:[组件开发](device-dev/bundles/Readme-CN.md) + - [组件开发规范](device-dev/bundles/组件开发规范.md) + - [组件开发指南](device-dev/bundles/组件开发指南.md) + - [组件开发示例](device-dev/bundles/组件开发示例.md) + + +- 应用开发 + - overview:[应用开发导读](application-dev/application-dev-guide.md) + - quick-start:[入门](application-dev/quick-start/Readme-CN.md) + - ui:[UI](application-dev/ui/Readme-CN.md) + - media:[媒体](application-dev/media/Readme-CN.md) + - connectivity:[网络与连接](application-dev/connectivity/Readme-CN.md) + - js-reference:[JS参考规范](application-dev/js-reference/Readme-CN.md) +- glossary:[术语](device-dev/glossary/术语.md) + +## 版本更新 + +参考[Release Notes](release-notes/OpenHarmony-Release-Notes.md)。 + +## 第三方开源软件及许可说明 3rd-Party-License:[第三方开源软件及许可证说明](contribute/第三方开源软件及许可证说明.md) -## 贡献 +## 贡献 非常欢迎您参与[贡献](contribute/参与贡献.md),我们鼓励开发者以各种方式参与文档反馈和贡献。

学习路径

+

开发者业务

+

相关文档

+

了解OpenHarmony

+

整体认知OpenHarmony

+
+

获取开发资源

+

准备开发前相关资源

+
+

快速入门

+

快速熟悉OpenHarmony环境搭建、编译、烧录、调测、运行。

+

标准系统快速入门

+

基础能力使用

+

使用OpenHarmony提供的基础能力

+
+

进阶开发

+

结合系统能力开发智能设备

+
+

移植适配

+
    对三方库进行移植适配
+

三方库移植指导

+

贡献组件

+

OpenHarmony贡献功能组件

+
+

参考

+

开发参考

+