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.
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p111121459194519"><aname="p111121459194519"></a><aname="p111121459194519"></a>SDIO bus number.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p41144595458"><aname="p41144595458"></a><aname="p41144595458"></a>Device handle of an SDIO controller</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p41144595458"><aname="p41144595458"></a><aname="p41144595458"></a>Device handle of an SDIO controller.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1288813411413"><aname="p1288813411413"></a><aname="p1288813411413"></a>Length of the data to write.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p6821875446"><aname="p6821875446"></a><aname="p6821875446"></a>Timeout duration for writing data, in milliseconds. If the value is <strongid="b62393444422"><aname="b62393444422"></a><aname="b62393444422"></a>0</strong>, the default value is used.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p14676163782210"><aname="p14676163782210"></a><aname="p14676163782210"></a>Length of the data to read.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1323351515493"><aname="p1323351515493"></a><aname="p1323351515493"></a>Timeout duration for reading data, in milliseconds. If the value is <strongid="b1042211934510"><aname="b1042211934510"></a><aname="b1042211934510"></a>0</strong>, the default value is used.</p>
**Table 7** Parameters and return values of SdioWriteBytesToFixedAddr
...
...
@@ -391,9 +389,9 @@ if (ret != 0) {
<td class="cellrowborder" valign="top" width="51.57000000000001%" headers="mcps1.2.3.1.2 "><p id="p7578181015113"><a name="p7578181015113"></a><a name="p7578181015113"></a>Length of the data to write.</p>
<td class="cellrowborder" valign="top" width="51.57000000000001%" headers="mcps1.2.3.1.2 "><p id="p17579910915"><a name="p17579910915"></a><a name="p17579910915"></a>Timeout duration for writing data, in milliseconds. If the value is <strong id="b1954414402499"><a name="b1954414402499"></a><a name="b1954414402499"></a>0</strong>, the default value is used.</p>
<td class="cellrowborder" valign="top" width="51.57000000000001%" headers="mcps1.2.3.1.2 "><p id="p17579910915"><a name="p17579910915"></a><a name="p17579910915"></a>Length of the scatter list. If the value is not <strong id="b2073012162455"><a name="b2073012162455"></a><a name="b2073012162455"></a>0</strong>, the data is of the scatter list type.</p>
**Table 8** Parameters and return values of SdioReadBytesFromFixedAddr
...
...
@@ -462,9 +460,9 @@ if (ret != 0) {
<td class="cellrowborder" valign="top" width="51.300000000000004%" headers="mcps1.2.3.1.2 "><p id="p1954165031214"><a name="p1954165031214"></a><a name="p1954165031214"></a>Length of the data to read.</p>
<td class="cellrowborder" valign="top" width="51.300000000000004%" headers="mcps1.2.3.1.2 "><p id="p3541350111218"><a name="p3541350111218"></a><a name="p3541350111218"></a>Timeout duration for reading data, in milliseconds. If the value is <strong id="b1649405802013"><a name="b1649405802013"></a><a name="b1649405802013"></a>0</strong>, the default value is used.</p>
<td class="cellrowborder" valign="top" width="51.300000000000004%" headers="mcps1.2.3.1.2 "><p id="p3541350111218"><a name="p3541350111218"></a><a name="p3541350111218"></a>Length of the scatter list. If the value is not <strong id="b1853656114520"><a name="b1853656114520"></a><a name="b1853656114520"></a>0</strong>, the data is of the scatter list type.</p>
<tdclass="cellrowborder"valign="top"width="50.06%"headers="mcps1.2.3.1.2 "><pid="p71691449141119"><aname="p71691449141119"></a><aname="p71691449141119"></a>Length of the data to write.</p>
<tdclass="cellrowborder"valign="top"width="50.06%"headers="mcps1.2.3.1.2 "><pid="p51701849121115"><aname="p51701849121115"></a><aname="p51701849121115"></a>Timeout duration for writing data, in milliseconds. If the value is <strongid="b845193552314"><aname="b845193552314"></a><aname="b845193552314"></a>0</strong>, the default value is used.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p612921851820"><aname="p612921851820"></a><aname="p612921851820"></a>Length of the data to read.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1513031831816"><aname="p1513031831816"></a><aname="p1513031831816"></a>Timeout duration for reading data, in milliseconds. If the value is <strongid="b38794374242"><aname="b38794374242"></a><aname="b38794374242"></a>0</strong>, the default value is used.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p6502164184816"><aname="p6502164184816"></a><aname="p6502164184816"></a>Device handle of an SDIO controller</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p6502164184816"><aname="p6502164184816"></a><aname="p6502164184816"></a>Device handle of an SDIO controller.</p>
</td>
</tr>
</tbody>
...
...
@@ -785,7 +773,7 @@ This function releases the resources requested.
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p2050274194819"><aname="p2050274194819"></a><aname="p2050274194819"></a>Device handle of an SDIO controller</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p2050274194819"><aname="p2050274194819"></a><aname="p2050274194819"></a>Device handle of an SDIO controller.</p>
-[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<a name="section1643363843714"></a>
## Method 1: Setting up an Ubuntu Build Environment Using a Docker Environment<a name="section1643363843714"></a>
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<a name="section58448331029"></a>
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<a name="section22916211916"></a>
For details, see [Installing and Using Docker](../get-code/tool-acquisition.md).
## Setting up an Ubuntu Build Environment Using an Installation Package<a name="section25961010189"></a>
## Method 2: Setting up an Ubuntu Build Environment Using an Installation Package<a name="section25961010189"></a>
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.
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).
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<a name="section133741330192119"></a>
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.
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**\).
@@ -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<a name="section1715027152617"></a>
### Changing Linux Shell to Bash<a name="section434110241084"></a>
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+\)<a name="section45512412251"></a>
### Installing Basic Software Used for Compilation and Building \(Required Only for Ubuntu 20+\)<a name="section25911132141020"></a>
>- 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
<tdclass="cellrowborder"valign="top"width="20.7020702070207%"headers="mcps1.2.4.1.2 "><pid="p15800428174711"><aname="p15800428174711"></a><aname="p15800428174711"></a>Configures and compiles files.</p>
<trid="row78941113109"><tdclass="cellrowborder"valign="top"headers="mcps1.2.4.1.1 "><pid="p1974322421510"><aname="p1974322421510"></a><aname="p1974322421510"></a>For the OpenHarmony_1.0.1_release, download LLVM from the following link:</p>
...
...
@@ -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.