提交 8ad9737b 编写于 作者: O openharmony_ci 提交者: Gitee

!556 文档更新

Merge pull request !556 from duangavin123/master
# Overview<a name="EN-US_TOPIC_0000001152533331"></a> # Overview<a name="EN-US_TOPIC_0000001191785779"></a>
- [System Types](#section767218232110) - [System Types](#section767218232110)
- [Document Outline](#section19810171681218) - [Document Outline](#section19810171681218)
...@@ -69,21 +69,21 @@ In addition, OpenHarmony provides a series of optional system components that ca ...@@ -69,21 +69,21 @@ In addition, OpenHarmony provides a series of optional system components that ca
</td> </td>
<td class="cellrowborder" valign="top" width="35.61356135613561%" headers="mcps1.2.4.1.2 "><p id="p857711379158"><a name="p857711379158"></a><a name="p857711379158"></a>Using basic capabilities of <span id="text8928941123820"><a name="text8928941123820"></a><a name="text8928941123820"></a>OpenHarmony</span></p> <td class="cellrowborder" valign="top" width="35.61356135613561%" headers="mcps1.2.4.1.2 "><p id="p857711379158"><a name="p857711379158"></a><a name="p857711379158"></a>Using basic capabilities of <span id="text8928941123820"><a name="text8928941123820"></a><a name="text8928941123820"></a>OpenHarmony</span></p>
</td> </td>
<td class="cellrowborder" valign="top" width="35.91359135913591%" headers="mcps1.2.4.1.3 "><a name="ul1577103716159"></a><a name="ul1577103716159"></a><ul id="ul1577103716159"><li><a href="kernel/kernel-lite.md">Kernel</a></li><li><a href="driver/Readme-EN.md">HDF</a></li><li><a href="subsystems/Readme-EN.md">Subsystems</a></li><li><a href="security/safety-safeguide-security.md">Security Guidelines</a></li><li><a href="security/oem_security_privacy.md">Privacy Protection</a></li></ul> <td class="cellrowborder" valign="top" width="35.91359135913591%" headers="mcps1.2.4.1.3 "><a name="ul1577103716159"></a><a name="ul1577103716159"></a><ul id="ul1577103716159"><li><a href="kernel/kernel-lite.md">Kernel</a></li><li><a href="driver/Readme-EN.md">HDF</a></li><li><a href="subsystems/Readme-EN.md">Subsystems</a></li><li><a href="security/security-guidelines-overall.md">Security Guidelines</a></li><li><a href="security/security-privacy-protection.md">Privacy Protection</a></li></ul>
</td> </td>
</tr> </tr>
<tr id="row10602193719152"><td class="cellrowborder" valign="top" width="28.472847284728473%" headers="mcps1.2.4.1.1 "><p id="p857873713152"><a name="p857873713152"></a><a name="p857873713152"></a>Advanced development</p> <tr id="row10602193719152"><td class="cellrowborder" valign="top" width="28.472847284728473%" headers="mcps1.2.4.1.1 "><p id="p857873713152"><a name="p857873713152"></a><a name="p857873713152"></a>Advanced development</p>
</td> </td>
<td class="cellrowborder" valign="top" width="35.61356135613561%" headers="mcps1.2.4.1.2 "><p id="p155782037201518"><a name="p155782037201518"></a><a name="p155782037201518"></a>Developing smart devices based on system capabilities</p> <td class="cellrowborder" valign="top" width="35.61356135613561%" headers="mcps1.2.4.1.2 "><p id="p155782037201518"><a name="p155782037201518"></a><a name="p155782037201518"></a>Developing smart devices based on system capabilities</p>
</td> </td>
<td class="cellrowborder" valign="top" width="35.91359135913591%" headers="mcps1.2.4.1.3 "><a name="ul257883731519"></a><a name="ul257883731519"></a><ul id="ul257883731519"><li><a href="guide/device-wifi.md">WLAN-connected products</a></li><li><a href="guide/device-iotcamera-control.md">Screenless camera products</a></li><li><a href="guide/device-camera.md">Products with a camera and a screen</a></li></ul> <td class="cellrowborder" valign="top" width="35.91359135913591%" headers="mcps1.2.4.1.3 "><a name="ul257883731519"></a><a name="ul257883731519"></a><ul id="ul257883731519"><li><a href="guide/device-wifi.md">WLAN-connected Products</a></li><li><a href="guide/device-iotcamera-control.md">Cameras Without a Screen</a></li><li><a href="guide/device-camera.md">Cameras with a Screen</a></li></ul>
</td> </td>
</tr> </tr>
<tr id="row360273716155"><td class="cellrowborder" valign="top" width="28.472847284728473%" headers="mcps1.2.4.1.1 "><p id="p12579163711513"><a name="p12579163711513"></a><a name="p12579163711513"></a>Porting and adaptation</p> <tr id="row360273716155"><td class="cellrowborder" valign="top" width="28.472847284728473%" headers="mcps1.2.4.1.1 "><p id="p12579163711513"><a name="p12579163711513"></a><a name="p12579163711513"></a>Porting and adaptation</p>
</td> </td>
<td class="cellrowborder" valign="top" width="35.61356135613561%" headers="mcps1.2.4.1.2 "><a name="ul12579137121512"></a><a name="ul12579137121512"></a><ul id="ul12579137121512"><li>Porting and adapting the <span id="text1415622205014"><a name="text1415622205014"></a><a name="text1415622205014"></a>OpenHarmony</span> to an SoC</li><li>Porting and adapting the <span id="text82061719165013"><a name="text82061719165013"></a><a name="text82061719165013"></a>OpenHarmony</span> to a third-party library</li></ul> <td class="cellrowborder" valign="top" width="35.61356135613561%" headers="mcps1.2.4.1.2 "><a name="ul12579137121512"></a><a name="ul12579137121512"></a><ul id="ul12579137121512"><li>Porting and adapting the <span id="text1415622205014"><a name="text1415622205014"></a><a name="text1415622205014"></a>OpenHarmony</span> to an SoC</li><li>Porting and adapting the <span id="text82061719165013"><a name="text82061719165013"></a><a name="text82061719165013"></a>OpenHarmony</span> to a third-party library</li></ul>
</td> </td>
<td class="cellrowborder" valign="top" width="35.91359135913591%" headers="mcps1.2.4.1.3 "><a name="ul157903731520"></a><a name="ul157903731520"></a><ul id="ul157903731520"><li><a href="porting/transplant-minichip.md">Mini System SoC Porting Guide</a></li><li><a href="porting/transplant-smallchip.md">Small System SoC Porting Guide</a></li><li><a href="porting/transplant-thirdparty.md">Third-Party Library Porting Guide</a></li></ul> <td class="cellrowborder" valign="top" width="35.91359135913591%" headers="mcps1.2.4.1.3 "><a name="ul157903731520"></a><a name="ul157903731520"></a><ul id="ul157903731520"><li><a href="porting/porting-minichip.md">Mini System SoC Porting Guide</a></li><li><a href="porting/porting-smallchip.md">Small System SoC Porting Guide</a></li><li><a href="porting/porting-thirdparty.md">Third-Party Library Porting Guide</a></li></ul>
</td> </td>
</tr> </tr>
<tr id="row9601737181517"><td class="cellrowborder" valign="top" width="28.472847284728473%" headers="mcps1.2.4.1.1 "><p id="p25791037131519"><a name="p25791037131519"></a><a name="p25791037131519"></a>Contributing components</p> <tr id="row9601737181517"><td class="cellrowborder" valign="top" width="28.472847284728473%" headers="mcps1.2.4.1.1 "><p id="p25791037131519"><a name="p25791037131519"></a><a name="p25791037131519"></a>Contributing components</p>
...@@ -114,9 +114,9 @@ In addition, OpenHarmony provides a series of optional system components that ca ...@@ -114,9 +114,9 @@ In addition, OpenHarmony provides a series of optional system components that ca
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody><tr id="row9662532514"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p066105317513"><a name="p066105317513"></a><a name="p066105317513"></a>About <span id="text1545619991"><a name="text1545619991"></a><a name="text1545619991"></a>OpenHarmony</span></p> <tbody><tr id="row9662532514"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p066105317513"><a name="p066105317513"></a><a name="p066105317513"></a>About <span id="text1523091643"><a name="text1523091643"></a><a name="text1523091643"></a>OpenHarmony</span></p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p16673531512"><a name="p16673531512"></a><a name="p16673531512"></a>Getting familiar with <span id="text1309556605"><a name="text1309556605"></a><a name="text1309556605"></a>OpenHarmony</span></p> <td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p16673531512"><a name="p16673531512"></a><a name="p16673531512"></a>Getting familiar with <span id="text280142300"><a name="text280142300"></a><a name="text280142300"></a>OpenHarmony</span></p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul10673531517"></a><a name="ul10673531517"></a><ul id="ul10673531517"><li><a href="https://gitee.com/openharmony" target="_blank" rel="noopener noreferrer">About OpenHarmony</a></li><li><a href="glossary/glossary.md">Glossary</a></li></ul> <td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul10673531517"></a><a name="ul10673531517"></a><ul id="ul10673531517"><li><a href="https://gitee.com/openharmony" target="_blank" rel="noopener noreferrer">About OpenHarmony</a></li><li><a href="glossary/glossary.md">Glossary</a></li></ul>
</td> </td>
...@@ -137,28 +137,29 @@ In addition, OpenHarmony provides a series of optional system components that ca ...@@ -137,28 +137,29 @@ In addition, OpenHarmony provides a series of optional system components that ca
</tr> </tr>
<tr id="row1168155365119"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p96810536514"><a name="p96810536514"></a><a name="p96810536514"></a>Basic capabilities</p> <tr id="row1168155365119"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p96810536514"><a name="p96810536514"></a><a name="p96810536514"></a>Basic capabilities</p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p136812535511"><a name="p136812535511"></a><a name="p136812535511"></a>Using basic capabilities of <span id="text1378072723"><a name="text1378072723"></a><a name="text1378072723"></a>OpenHarmony</span></p> <td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p136812535511"><a name="p136812535511"></a><a name="p136812535511"></a>Using basic capabilities of <span id="text2027331797"><a name="text2027331797"></a><a name="text2027331797"></a>OpenHarmony</span></p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul1954915235272"></a><a name="ul1954915235272"></a><ul id="ul1954915235272"><li><a href="kernel/kernel-lite.md">Kernel</a></li><li><a href="driver/Readme-EN.md">HDF</a></li><li><a href="subsystems/Readme-EN.md">Subsystems</a></li><li><a href="security/safety-safeguide-security.md">Security Guidelines</a></li><li><a href="security/oem_security_privacy.md">Privacy Protection</a></li></ul> <td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul1954915235272"></a><a name="ul1954915235272"></a><ul id="ul1954915235272"><li><a href="kernel/kernel-standard.md">Kernel</a></li><li><a href="driver/Readme-EN.md">HDF</a></li><li><a href="subsystems/Readme-EN.md">Subsystems</a></li><li><a href="security/security-privacy-protection.md">Security Guidelines</a></li><li><a href="security/security-privacy-protection.md">Privacy Protection</a></li></ul>
</td> </td>
</tr> </tr>
<tr id="row1368195345111"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p16681853145115"><a name="p16681853145115"></a><a name="p16681853145115"></a>Advanced development</p> <tr id="row1368195345111"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p16681853145115"><a name="p16681853145115"></a><a name="p16681853145115"></a>Advanced development</p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p1568753135116"><a name="p1568753135116"></a><a name="p1568753135116"></a>Developing smart devices based on system capabilities</p> <td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p1568753135116"><a name="p1568753135116"></a><a name="p1568753135116"></a>Developing smart devices based on system capabilities</p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul136895314518"></a><a name="ul136895314518"></a><ul id="ul136895314518"><li><a href="guide/oem_device_clockapp_des.md">Development Example for Clock Apps</a></li><li><a href="guide/device-driver-demo.md">Development Example for Platform Drivers</a></li><li><a href="guide/device-outerdriver-demo.md">Development Example for Peripheral Drivers</a></li></ul> <td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul136895314518"></a><a name="ul136895314518"></a><ul id="ul136895314518"><li><a href="guide/device-clock-guide.md">Development Example for Clock Apps</a></li><li><a href="guide/device-driver-demo.md">Development Example for Platform Drivers</a></li><li><a href="guide/device-outerdriver-demo.md">Development Example for Peripheral Drivers</a></li></ul>
</td> </td>
</tr> </tr>
<tr id="row66915375119"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p4696535512"><a name="p4696535512"></a><a name="p4696535512"></a>Porting and adaptation</p> <tr id="row66915375119"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p4696535512"><a name="p4696535512"></a><a name="p4696535512"></a>Porting and adaptation</p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p185185615284"><a name="p185185615284"></a><a name="p185185615284"></a>Porting and adapting the <span id="text1434016533511"><a name="text1434016533511"></a><a name="text1434016533511"></a>OpenHarmony</span> to a third-party library</p> <td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p185185615284"><a name="p185185615284"></a><a name="p185185615284"></a>Porting and adapting the <span id="text1434016533511"><a name="text1434016533511"></a><a name="text1434016533511"></a>OpenHarmony</span> to a third-party library</p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><p id="p10262183114555"><a name="p10262183114555"></a><a name="p10262183114555"></a><a href="porting/transplant-thirdparty.md">Third-Party Library Porting Guide</a></p> <td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><p id="p10262183114555"><a name="p10262183114555"></a><a name="p10262183114555"></a><a href="porting/porting-thirdparty.md">Third-Party Library Porting Guide</a></p>
<p id="p123471211096"><a name="p123471211096"></a><a name="p123471211096"></a><a href="porting/standard-system-porting-guide">Standard System SoC Porting Guide</a></p>
</td> </td>
</tr> </tr>
<tr id="row869853125119"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p3691530511"><a name="p3691530511"></a><a name="p3691530511"></a>Contributing components</p> <tr id="row869853125119"><td class="cellrowborder" valign="top" width="27.872787278727873%" headers="mcps1.2.4.1.1 "><p id="p3691530511"><a name="p3691530511"></a><a name="p3691530511"></a>Contributing components</p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p1469115335113"><a name="p1469115335113"></a><a name="p1469115335113"></a>Contributing components to <span id="text1209814279"><a name="text1209814279"></a><a name="text1209814279"></a>OpenHarmony</span></p> <td class="cellrowborder" valign="top" width="36.053605360536054%" headers="mcps1.2.4.1.2 "><p id="p1469115335113"><a name="p1469115335113"></a><a name="p1469115335113"></a>Contributing components to <span id="text262674084"><a name="text262674084"></a><a name="text262674084"></a>OpenHarmony</span></p>
</td> </td>
<td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul87045395116"></a><a name="ul87045395116"></a><ul id="ul87045395116"><li><a href="bundles/bundles-standard-rules.md">Component Development Specifications</a></li><li><a href="bundles/bundles-guide.md">Component Development Guidelines</a></li><li><a href="bundles/bundles-demo.md">HPM User Guide</a></li></ul> <td class="cellrowborder" valign="top" width="36.07360736073608%" headers="mcps1.2.4.1.3 "><a name="ul87045395116"></a><a name="ul87045395116"></a><ul id="ul87045395116"><li><a href="bundles/bundles-standard-rules.md">Component Development Specifications</a></li><li><a href="bundles/bundles-guide.md">Component Development Guidelines</a></li><li><a href="bundles/bundles-demo.md">HPM User Guide</a></li></ul>
</td> </td>
......
# Development Example<a name="EN-US_TOPIC_0000001072143838"></a> # Development Example<a name="EN-US_TOPIC_0000001072143838"></a>
This following uses the Hi3861 platform as an example to describe how to install, compile, and package components by using HPM. The following uses the Hi3861 platform as an example to describe how to install and build bundles by using the hpm.
1. Run the following commands to initialize the installation directory \(whose name can be customized\): 1. Run the following commands to create a directory \(its name can be customized\) and create a default project based on the dist template:
``` ```
mkdir test3861 mkdir test3861
cd test3861 cd test3861
hpm init -t dist hpm init -t dist myproduct
``` ```
If the following information is displayed, the initialization is successful: If the following information is displayed, the project is created:
``` ```
Initialization finished. Initialization finished.
``` ```
2. Run the following command to install the **wifi\_iot** distribution: 2. Run the following command to install the **hispark\_pegasus** distribution:
``` ```
hpm install @ohos/wifi_iot hpm install @ohos/hispark_pegasus
``` ```
If the following information is displayed, the installation is successful: If the following information is displayed, the installation is successful:
...@@ -29,16 +29,16 @@ This following uses the Hi3861 platform as an example to describe how to install ...@@ -29,16 +29,16 @@ This following uses the Hi3861 platform as an example to describe how to install
``` ```
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE:**
>Run the following command for the Hi3516 platform: >If you are using the Hi3516 platform, run the following command:
>``` >```
>hpm install @ohos/ip_camera_hi3516dv300 >hpm install @ohos/hispark_taurus
>``` >```
>Run the following command for the Hi3518 platform: >If you are using the Hi3518 platform, run the following command:
>``` >```
>hpm install @ohos/ip_camera_hi3518ev300 >hpm install @ohos/hispark_aries
>``` >```
3. Run the following command to build and package components: 3. Run the following command to build and package bundles:
``` ```
hpm dist hpm dist
......
# Preparations<a name="EN-US_TOPIC_0000001071315859"></a> # Configuring the Compilation Environment<a name="EN-US_TOPIC_0000001071315859"></a>
- [Linux Server](#section20979554791) - [Linux Server](#section20979554791)
- [Node.js](#section9954105413153) - [Node.js](#section9954105413153)
- [HPM](#section15937194904819) - [Installing hpm-cli Tool](#section15937194904819)
- [Python Environment](#section1621819180417) - [Python Environment](#section1621819180417)
- [File Packaging Tool](#section77617165913) - [File Packaging Tool](#section77617165913)
- [SCons](#section20558439191516) - [SCons](#section20558439191516)
![](figure/3516dv300.png)
## Linux Server<a name="section20979554791"></a> ## Linux Server<a name="section20979554791"></a>
Prepare a 64-bit Linux server running Ubuntu 16.04 or later. HPM supports Windows Server, but the open-source Hi3861, Hi3516, and Hi3518 solutions support only Ubuntu. Prepare a 64-bit Linux server running Ubuntu 16.04 or later. \(Currently, the compilation in the Windows environment is not fully supported.\)
Configure Ubuntu to use bash as the Linux system shell, by performing the following: Configure Ubuntu to use bash as the Linux system shell, by performing the following:
...@@ -26,7 +28,7 @@ ln -s bash /bin/sh ...@@ -26,7 +28,7 @@ ln -s bash /bin/sh
## Node.js<a name="section9954105413153"></a> ## Node.js<a name="section9954105413153"></a>
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE:**
>If the Node.js version of the source is outdated, run the following command before running **apt-get install**: >If the **Node.js** version of the source is outdated, run the following command before running **apt-get install**:
>``` >```
>curl -L https://deb.nodesource.com/setup_12.x | bash >curl -L https://deb.nodesource.com/setup_12.x | bash
>``` >```
...@@ -38,31 +40,31 @@ sudo apt-get install nodejs ...@@ -38,31 +40,31 @@ sudo apt-get install nodejs
sudo apt-get install npm sudo apt-get install npm
``` ```
Run the following commands to view Node.js and NPM versions: Run the following commands to view **Node.js** and npm versions:
``` ```
node --version # Check the Node.js version. node --version # Check the Node.js version.
npm --version # Check the NPM version. npm --version # Check the npm version.
``` ```
## HPM<a name="section15937194904819"></a> ## Installing hpm-cli Tool<a name="section15937194904819"></a>
Install the **hpm-cli** command line tool by using the NPM \(default source: https://registry.npmjs.org/\) provided by the Node.js. Install the **hpm-cli** command line tool by using the npm \(default source: https://registry.npmjs.org/\) provided by **Node.js**.
``` ```
npm install -g @ohos/hpm-cli npm install -g @ohos/hpm-cli
``` ```
After **hpm-cli** is installed, run the following command to view default HPM configurations: After **hpm-cli** is installed, run the following command to view the default hpm configurations:
``` ```
hpm config hpm config
``` ```
You can modify the default configurations as required. The following lists common HPM configurations: You can modify the default configurations as required. The following lists common hpm configurations:
``` ```
registry = https://hpm.harmonyos.com # Register with the HPM registration center. This is mandatory for downloading components. registry = https://hpm.harmonyos.com # Address of the hpm registry. This is mandatory for downloading bundles.
strictSsl = true # Enable strict SSL verification as HTTPS is used for connection. strictSsl = true # Enable strict SSL verification as HTTPS is used for connection.
http_proxy = http://your-proxy-server:port # Configure the HTTP proxy. http_proxy = http://your-proxy-server:port # Configure the HTTP proxy.
https_proxy = http://your-proxy-server:port # Configure the HTTPS proxy. https_proxy = http://your-proxy-server:port # Configure the HTTPS proxy.
...@@ -124,14 +126,14 @@ sudo apt-get install mtools ...@@ -124,14 +126,14 @@ sudo apt-get install mtools
python3 -m pip install scons python3 -m pip install scons
``` ```
3. Run the following command to check whether SCons is successfully installed. If the installation is successful, the query result as shown in [Figure 1](#fig235815252492) is displayed. 3. Run the following command to check whether SCons is successfully installed. If the installation is successful, the query result shown in [Figure 1](#fig235815252492) is displayed.
``` ```
scons -v scons -v
``` ```
**Figure 1** Successful installation \(SCons version requirement: 3.0.4 or later\)<a name="fig235815252492"></a> **Figure 1** Successful installation \(SCons version requirement: 3.0.4 or later\)<a name="fig235815252492"></a>
![](figure/successful-installation-(scons-version-requirement-3-0-4-or-later)-25.png "successful-installation-(scons-version-requirement-3-0-4-or-later)-25") ![](figure/successful-installation-(scons-version-requirement-3-0-4-or-later)-28.png "successful-installation-(scons-version-requirement-3-0-4-or-later)-28")
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE:**
......
# Introduction<a name="EN-US_TOPIC_0000001071487274"></a> # Introduction<a name="EN-US_TOPIC_0000001071487274"></a>
HarmonyOS Package Manager \(HPM\) manages and distributes OpenHarmony component packages. It offers you a tool set to obtain and customize OpenHarmony source code and perform operations such as installation, compilation, packaging, and upgrade. HarmonyOS package manager \(hpm\) manages and distributes OpenHarmony bundles. It offers you a tool set to obtain and customize OpenHarmony source code and perform operations such as installation, building, packaging, and upgrade.
This document describes how to use HPM to install, compile, and package OpenHarmony components. This document describes how to use the hpm to install, build, and package OpenHarmony bundles.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
- **[Introduction](bundles-demo-hpmdescription.md)** - **[Introduction](bundles-demo-hpmdescription.md)**
- **[Preparations](bundles-demo-environment.md)** - **[Configuring the Compilation Environment](bundles-demo-environment.md)**
- **[Development Example](bundles-demo-devsample.md)** - **[Development Example](bundles-demo-devsample.md)**
......
# Bundle Development<a name="EN-US_TOPIC_0000001051690861"></a> # Developing Bundles<a name="EN-US_TOPIC_0000001051690861"></a>
- [Developing OpenHarmony Bundles](#section1976410130540)
- [Creating a Bundle](#section717481119145) - [Creating a Bundle](#section717481119145)
- [Modifying a Bundle](#section102861955201410) - [Defining an Existing Project as a Bundle](#section102861955201410)
- [Using HPM-provided Template to Create a Bundle](#section15882846181510) - [Releasing the Bundle on the HPM Platform](#section1318574233211)
- [Building a Bundle](#section136732148541) - [Referencing a Bundle](#section19311124115315)
- [Defining the Building Script](#section10274147111610) - [Installing a Bundle Globally](#section165131927192120)
- [Executing the Building Script](#section879301916172) - [Compiling a Bundle](#section136732148541)
- [Defining the Build Script](#section10274147111610)
- [Executing the Build Script](#section879301916172)
- [Defining a Distribution](#section413216495619) - [Defining a Distribution](#section413216495619)
- [Defining Scripts](#section11503171219190) - [Defining Scripts](#section11503171219190)
- [Distributing](#section4694125521912) - [Building a Distribution](#section4694125521912)
- [Burning](#section1746331545413)
- [Debugging](#section6742131615549)
## Developing OpenHarmony Bundles<a name="section1976410130540"></a> You can use any of the following methods to develop OpenHarmony bundles:
You have an option to use any of the following methods to develop OpenHarmony bundles: - Create a new bundle from scratch.
- Define an existing source code project as a bundle.
- Develop a brand new bundle from scratch.
- Rewrite code of an existing non-bundle to develop a bundle.
- Use HPM-provided bundle templates to quickly develop a bundle.
## Creating a Bundle<a name="section717481119145"></a> ## Creating a Bundle<a name="section717481119145"></a>
Generally, you can find commonly used bundles on the [HPM](https://hpm.harmonyos.com/#/en/home) website. If they cannot meet your requirements, you can develop your own bundles. Generally, you can find commonly used bundles on the [HPM](https://hpm.harmonyos.com/#/en/home) website. If they cannot meet your requirements, you can develop a bundle on your own.
You can publish bundles in the HPM repository if you like, so that your peers have an option to use them. Assume that you want to create a bundle named **my-bundle** in the **D:/source** directory: You can publish bundles in the HPM repository if you like, so that your peers have an option to use them.
Run the **hpm init** command to create the scaffold code for this bundle. For example, you can go to the **D:/source** directory and run the following command: Assume that you are planning to create a new bundle **my-bundle** in **D:/source**. Run the **hpm init** command to create the scaffold code for this bundle. For example, you can go to **D:/source** and run the following command:
``` ```
hpm init -t default -d demo my-bundle hpm init -t default -d demo mybundle
``` ```
The following files are generated in the **source** directory: The **'default'** template will be used to create a bundle named **mybundle** in the **demo** directory in **D:/source**.
``` ```
mybundle demo
├── bundle.json # Metadata description file of the bundle ├── headers # Header file (example)
├── example # Example of testing bundle functions │ └── main.h
│ └── main.c └── src # Source code (example)
├── include # Internal header files of the bundle │ └─ main.c
│ └── mybundle.h ├── bundle.json # Metadata declaration file
├── README.md # Brief description of the bundle └── LICENSE # License agreement
└── src # Source code of the bundle └── Makefile # Compilation description file (example)
└─ mybundle.c └── README.md # Readme file
``` ```
Then, complete your coding based on service requirements. Finally, use **git** to commit your code \(including the **bundle.json** file\) to the code hosting repository, such as gitee. Then, complete your coding based on service requirements and generate the build script. Finally, use **git** to commit your code \(including the **bundle.json** file\) to the code hosting repository, such as gitee.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>```
>hpm init -t {templatename} -d {dir} {name}
>```
>- **-t \{templatename\}** indicates the template name.
>- **-d \{dir\}** indicates the path for storing the bundle to be created.
>- **name** indicates the name of the bundle to be created.
The hpm provides a few default templates. More templates are available on the HPM server. You can run the **hpm search -t template** command to search for a template stored on the server.
![](figure/en-us_image_0000001134127844.png)
## Modifying a Bundle<a name="section102861955201410"></a> ## Defining an Existing Project as a Bundle<a name="section102861955201410"></a>
If you have code unqualified for the OpenHarmony bundle structure, modify your code to match an HPM bundle. In the code directory \(for example, **mybundle2**\) storing your code, run the following command with the bundle name and version specified: If you have a code project and need to distribute it on the HPM platform, run the following command in the current project directory, for example, **mybundle2**:
``` ```
hpm init hpm init
``` ```
1. Enter a bundle name \(**mybundle2** as an example\) and press **Enter**. 1. Enter a bundle name \(**mybundle2** as an example\) and press **Enter**.
2. Enter the bundle version \(**1.0.0** as an example\) and press **Enter**. A **bundle.json** file is generated in the current bundle directory. 2. Enter the version and description. A **bundle.json** file will be generated in the current directory.
3. Add other descriptions in **bundle.json**, which is publishable. 3. Open the** bundle.json** file as you like.
``` ```
$ hpm init $ hpm init
Your bundle will be created in dirname E:\demo\mybundle2 Your bundle will be created in directory ~\demo\mybundle2
? bundle name mybundel2 ? bundle name mybundel2
? version 1.0.0 ? version 1.0.0
Init finished! ...
Initialization finished.
``` ```
1. Modify other information \(such as the author, code repository, code directory, command script, and dependent bundles\) in **bundle.json**. 1. Modify other information \(such as the author, code repository, code directory, command script, and dependent bundles\) in **bundle.json**. An example is shown below:
``` ```
{ {
"name": "mybundle2", "name": "mybundle2",
"version": "1.0.0", "version": "1.0.0",
"publishAs": "source", "publishAs": "code-segment",
"dirs":{ "dirs":{
".":[ ".":["README.md"],
"README.md" "src":["test.c"],
], "header":["header/test.h" ],
"src":[ "src/common":["src/common/foobar.txt"]
"test.c"
],
"header":[
"header/test.h"
],
"src/common":[
"src/common/foobar.txt"
]
}, },
"scripts": { "scripts": {
"build": "make -${args}" "build": "make -${args}"
}, },
"dependencies": { "dependencies": {
"@ohos/cjson": "^1.0.0", "@ohos/cjson": "^1.0.0",
"@ohos/": "^1.2.0" "@ohos/foobar": "^1.2.0"
} }
} }
``` ```
## Using HPM-provided Template to Create a Bundle<a name="section15882846181510"></a> ## Releasing the Bundle on the HPM Platform<a name="section1318574233211"></a>
To release a bundle on the HPM platform, you need to obtain an account and create an organization \(or join an existing organization\). For details, see the online help on the [HPM](https://hpm.harmonyos.com/#/en/home) website.
After that, generate a public key on the local PC based on your invitation code \(which can be obtained on the **My profile** page on the HPM website\), and configure the public key on the **My profile** page.
```
hpm config set loginUser {your-invitation-code}
hpm gen-keys
```
The generated file will be stored in **\~\\Users\\yourname\\.hpm\\key**. Copy the content in the public key file **publicKey\_your-account.pem** to the SSH public key on your **My profile** page.
After finishing the preceding operations, you then have the permission to release bundles in your organization.
In the directory where the bundle is located, run the following command to package and release the bundle:
```
hpm publish
```
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>- To avoid bundle name conflicts, name a released bundle in the format of **@org\_name/bundle\_name**.
>- Your account must also be a member of **org\_name** so that you can release or update bundles in the organization.
>- The released bundles take effect only after security and content reviews.
## Referencing a Bundle<a name="section19311124115315"></a>
Generally, when developing a project, you may need to reference other bundles in order to accelerate development of specific functions. Installing dependencies could be a good way.
Go to the HPM website, search for bundles that meet your service requirements by keywords, and then introduce the bundles to your project.
The HPM provides **default** and **simple** templates as well as other templates that are stored on the server. Run the following command in your bundle project. Make sure that the project directory contains the **bundle.json** file.
You can run the **hpm search -t template** command to search for a template stored on the server. ```
$ hpm install @scope/the_bundle
```
The referenced bundle will be installed under **ohos\_bundle** in the directory where your project is located. The directory structure is as follows:
```
project
├── ohos_bundle
│ └── scope
│ └─ the_bundle # <--- Referenced bundle
└── src
│ └─ main.c
├── bundle.json # Metadata declaration file
└── LICENSE
└── Makefile
└── README.md
```
![](figure/en-us_image_0000001051452177.png) Open the **bundle.json** file. You will see that the bundle has been introduced to the dependencies of your project.
```
{
"dependencies": {
"@scope/the_bundle": "^1.0.0"
}
}
```
Then, select your desired template based on the information below **description**, use the selected template to quickly create the bundle scaffold, and run the following command with the **-t** and **-d** parameters specified: You can also edit the dependencies of multiple bundles in this file at a time.
``` ```
hpm init -t {templatename} -d dir name {
"dependencies": {
"@scope/the_bundle1": "^1.0.0",
"@scope/the_bundle2": "^2.0.0",
"@scope/the_bundle3": "^3.0.0",
"@scope/the_bundle4": "^1.1.0"
}
}
``` ```
- **\{templatename\}** indicates the template name. Run the **hpm install** command again to download and install all bundles that have not been installed.
- **dir** indicates the path for storing the bundle to be created.
- **name** indicates the name of the bundle to be created. ## Installing a Bundle Globally<a name="section165131927192120"></a>
## Building a Bundle<a name="section136732148541"></a> If the referenced bundle is one shared by multiple projects, for example, the compiler toolchain, you can install it globally.
After completing code development, you need to build the bundle. The HPM supports command integration so that you can select any build tool \(such as **make**, **gcc**, and **gn**\) suitable for your project. You only need to define the **build** command in the **scripts** in the **bundle.json** file of your project, and then you run the hpm command **build** to perform building. Run the following command in your bundle project. Make sure that the project directory contains the **bundle.json** file.
## Defining the Building Script<a name="section10274147111610"></a> ```
$ hpm install -g @scope/the_tool
```
The referenced bundle will be installed in the directory specified by the **globalRepo** parameter of the **hpm config** command.
```
~\.hpm\global
│ └── scope
│ └─ the_tool # <--- Referenced bundle
```
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>- For a bundle installed in a project, you can reference it using the environment variable **DEP\_SCOPE\_bundle\_name** when running the hpm compilation command.
>For example, after you run **hpm i @opensource/gn** to install a bundle, you can edit the build script in the **bundle.json** file as follows:
>```
>"scripts": {
> "build": "${DEP_OPENSOURCE_gn}/gn --version"
> },
>```
>Then, you can run the **hpm build** command to call GN functions.
>- For a globally installed bundle, you can directly call the bundle using an environment variable or reference the bundle using the **$\{key\}/tool\_name** parameter when running the **hpm config set key value** command. For example:
>```
>hpm i -g @ohos/opensource/gn
>hpm config BUILD_SYS_GN ~/.hpm/global/ohos_bundles/opensource/gn
>```
>You can edit the build script in the **bundle.json** file as follows:
>```
>"scripts": {
> "build": "${BUILD_SYS_GN}/gn --version"
> },
>```
>Then, you can run the **hpm build** command to call GN functions.
## Compiling a Bundle<a name="section136732148541"></a>
If the bundle code can be independently compiled once you finish coding, you can configure build tools and scripts to generate binary files.
The hpm supports command integration so that you can select any build tool \(such as **make**, **gcc**, and **gn**\) suitable for your project. You only need to define the **build** command in the **scripts** in the **bundle.json** file of your project, and then you run the hpm command **build** to perform building.
## Defining the Build Script<a name="section10274147111610"></a>
This section uses how to build an executable file **helloworld** in the **app** directory as an example. This section uses how to build an executable file **helloworld** in the **app** directory as an example.
...@@ -162,7 +266,7 @@ executable("hello_world") { ...@@ -162,7 +266,7 @@ executable("hello_world") {
>- **executable** is a built-in template of **gn**. You can run the **gn help executable** command to view how to use this template. >- **executable** is a built-in template of **gn**. You can run the **gn help executable** command to view how to use this template.
>- **sources** represents the source code path, and **include\_dirs** represents the header file path. >- **sources** represents the source code path, and **include\_dirs** represents the header file path.
## Executing the Building Script<a name="section879301916172"></a> ## Executing the Build Script<a name="section879301916172"></a>
Run the following command: Run the following command:
...@@ -176,41 +280,87 @@ After all building operations are complete, the message "build succeed" is displ ...@@ -176,41 +280,87 @@ After all building operations are complete, the message "build succeed" is displ
## Defining a Distribution<a name="section413216495619"></a> ## Defining a Distribution<a name="section413216495619"></a>
A distribution refers to an image file of an executable OpenHarmony solution composed of a group of bundles. It contains many dependent bundles and provides scripts to illustrate how to compile and link these bundles. This process states the dependent bundles and how to compile and link the bundles to generate image files.
This section uses the hb compilation framework as an example.
## Defining Scripts<a name="section11503171219190"></a> ## Defining Scripts<a name="section11503171219190"></a>
Define scripts in **bundle.json** as follows: An example definition in the **bundle.json** file is as follows:
\{
"name": "@your/dist\_name",
"version": "2.2.0",
```
{
"name": "my_dist",
"version": "1.0.0",
"publishAs": "distribution", "publishAs": "distribution",
"scripts": {
"dist": "make -${args}"
},
"base": {
"name": "dist-bundle",
"version": "1.0.0"
},
"envs": {
"args": "x86"
},
"dependencies": {
}
}
```
## Distributing<a name="section4694125521912"></a> "description": "describe it",
"scripts": \{
"config\_hb": "hb set -root $DEP\_BUNDLE\_BASE",
"dist": "PATH=/root/.local/bin:$\{DEP\_OHOS\_gn\}:$\{DEP\_OHOS\_ninja\}/ninja:$\{DEP\_OHOS\_llvm\}/llvm/bin:$\{DEP\_OHOS\_hc\_gen\}/hc-gen:$\{PATH\} && ./scripts/dist.sh"
\},
"envs": \{
"debug": false
\},
"dirs": \{
"scripts": "scripts/\*"
Run the following command in the current distribution directory: \},
"dependencies": \{
"@ohos/build\_lite": "2.2.0",
"@ohos/gn": "1.1.1",
"@ohos/llvm": "1.1.1",
"@ohos/hc\_gen": "1.1.0",
"@ohos/ninja": "1.1.0",
...
\},
"ohos": \{
"os": "2.2-Beta",
"board": "hi3516",
"kernel": "liteos-a"
\},
"keywords": \[ "hispark", "hi3516" \],
"repository": "https://gitee.com/openharmony/your-project",
"license": "Apache V2"
\}
## Building a Distribution<a name="section4694125521912"></a>
Run the following command in the root directory of the current distribution:
``` ```
hpm dist hpm dist
``` ```
The **hpm-cli** tool automatically performs compiling and packing, and generates an image file of the **dist** script defined based on **scripts**. The following is an example: The **hpm-cli** tool automatically starts compilation. After the compilation is complete, an image file will be generated, as shown below:
``` ```
out out
...@@ -218,23 +368,23 @@ out ...@@ -218,23 +368,23 @@ out
|-xx.file |-xx.file
``` ```
## Burning<a name="section1746331545413"></a> Burning
The building result of the distribution can be burnt into devices, for example, by using the **hiburn** tool. You need to configure burning parameters in the **bundle.json** file of the distribution. The build result of the distribution can be burnt into devices, for example, by using the **hiburn** tool. You need to configure burning parameters in the **bundle.json** file of the distribution.
``` ```
"scripts": { "scripts": {
"flash": "{$DEP_HIBURN}/hiburn" "flash": "{$DEP_HIBURN}/hiburn"
}, },
``` ```
You should set burning parameters by referring to the specific guide on the burning tool you use. Set the path of the **hiburn** tool and set burning parameters. For details, see the **hiburn** tool guide.
``` ```
hpm config set DEP_HIBURN {hiburn_path}
hpm run flash hpm run flash
``` ```
## Debugging<a name="section6742131615549"></a> >![](../public_sys-resources/icon-note.gif) **NOTE:**
>The preceding example describes only how to define the **bundle.json** file. The burning tool is subject to the actual development board.
Start debugging after you have burnt the image file of the distribution into devices. The debugging process varies according to specific development boards and IDE debugging tools.
# Bundle Development<a name="EN-US_TOPIC_0000001051452100"></a> # Overview<a name="EN-US_TOPIC_0000001051452100"></a>
- [Overview](#section112136415486)
- [Preparations](#section12731192104816)
- [Hardware Requirements](#section71851750144814)
- [Installing Node.js and the hpm-cli Tool](#section675199493)
- [\(Optional\) Modifying HPM Configurations](#section1940205015499)
- [Downloading OpenHarmony Code](#section42591118155217)
- [Installing Dependent Bundles](#section644212530524)
- [Bundle Development](#section15640113715318) - [Bundle](#section196713235514)
- [Distribution](#section155387501033)
## Overview<a name="section112136415486"></a> This section describes the bundle-specific concepts in HarmonyOS. It uses an example to step you through how to create, develop, build, release, and install a bundle using the **hpm-cli** tool.
This document describes how to develop OpenHarmony bundles and distributions, and how to create, develop, and build code, as well as burn and debug devices by using a command line tool. ## Bundle<a name="section196713235514"></a>
- A bundle usually maps onto a code repository, which is a code archive with the **bundle.json**, **README**, and **LICENSE** files. A bundle is a term used in HarmonyOS to indicate a distribution. A bundle is equivalent to a package and it usually contains the following contents:
- A distribution consists of multiple bundles. Each distribution integrates various bundles of a comprehensive system, such as the driver, kernel, framework, and applications. These bundles can be used for device burning.
**Table 1** Differences between a bundle and a distribution - Distributed binary file \(binary type\)
- Distributed source code file \(source code/code snippet type\)
- Build script \(distribution type\)
- Bundle description files:
- **bundle.json**: metadata declaration \(name, version, dependency, etc.\)
- **LICENSE**: license agreement
- **README.md**: readme file
- **CHANGELOG.md**: change log \(optional\)
<a name="table6287133615412"></a>
<table><thead align="left"><tr id="row17288183614415"><th class="cellrowborder" valign="top" width="16.24162416241624%" id="mcps1.2.4.1.1"><p id="p528818361545"><a name="p528818361545"></a><a name="p528818361545"></a>Aspect</p>
</th>
<th class="cellrowborder" valign="top" width="33.31333133313331%" id="mcps1.2.4.1.2"><p id="p1288836247"><a name="p1288836247"></a><a name="p1288836247"></a>Bundle</p>
</th>
<th class="cellrowborder" valign="top" width="50.44504450445044%" id="mcps1.2.4.1.3"><p id="p112885362418"><a name="p112885362418"></a><a name="p112885362418"></a>Distribution</p>
</th>
</tr>
</thead>
<tbody><tr id="row1728813361848"><td class="cellrowborder" valign="top" width="16.24162416241624%" headers="mcps1.2.4.1.1 "><p id="p2010613564815"><a name="p2010613564815"></a><a name="p2010613564815"></a>Application scenario</p>
</td>
<td class="cellrowborder" valign="top" width="33.31333133313331%" headers="mcps1.2.4.1.2 "><p id="p1910555184818"><a name="p1910555184818"></a><a name="p1910555184818"></a>Feature-oriented</p>
</td>
<td class="cellrowborder" valign="top" width="50.44504450445044%" headers="mcps1.2.4.1.3 "><p id="p13871955484"><a name="p13871955484"></a><a name="p13871955484"></a>System-oriented</p>
</td>
</tr>
<tr id="row676745614472"><td class="cellrowborder" valign="top" width="16.24162416241624%" headers="mcps1.2.4.1.1 "><p id="p1028816365414"><a name="p1028816365414"></a><a name="p1028816365414"></a>Content</p>
</td>
<td class="cellrowborder" valign="top" width="33.31333133313331%" headers="mcps1.2.4.1.2 "><p id="p428812361042"><a name="p428812361042"></a><a name="p428812361042"></a>Codes or a binary library for implementing features</p>
</td>
<td class="cellrowborder" valign="top" width="50.44504450445044%" headers="mcps1.2.4.1.3 "><p id="p328817366417"><a name="p328817366417"></a><a name="p328817366417"></a>List of dependent bundles as well as their compiling and building scripts</p>
</td>
</tr>
<tr id="row95114356"><td class="cellrowborder" valign="top" width="16.24162416241624%" headers="mcps1.2.4.1.1 "><p id="p184894513517"><a name="p184894513517"></a><a name="p184894513517"></a>Integrity</p>
</td>
<td class="cellrowborder" valign="top" width="33.31333133313331%" headers="mcps1.2.4.1.2 "><p id="p1951741155"><a name="p1951741155"></a><a name="p1951741155"></a>A part of the operating system</p>
</td>
<td class="cellrowborder" valign="top" width="50.44504450445044%" headers="mcps1.2.4.1.3 "><p id="p20521542512"><a name="p20521542512"></a><a name="p20521542512"></a>An entire operating system</p>
</td>
</tr>
<tr id="row13581419518"><td class="cellrowborder" valign="top" width="16.24162416241624%" headers="mcps1.2.4.1.1 "><p id="p859171059"><a name="p859171059"></a><a name="p859171059"></a>Compilation result</p>
</td>
<td class="cellrowborder" valign="top" width="33.31333133313331%" headers="mcps1.2.4.1.2 "><p id="p259201355"><a name="p259201355"></a><a name="p259201355"></a>Bundles</p>
</td>
<td class="cellrowborder" valign="top" width="50.44504450445044%" headers="mcps1.2.4.1.3 "><p id="p459414519"><a name="p459414519"></a><a name="p459414519"></a>System image</p>
</td>
</tr>
</tbody>
</table>
**Figure 1** Composition of bundles and distributions<a name="fig85033524124"></a> >![](../public_sys-resources/icon-note.gif) **NOTE:**
>Bundles can be classified into the following types: binary, source code, code snippet, template, plug-in, distribution, and so on. A bundle can depend on other bundles. The dependency relationship can be represented by a directed acyclic graph \(DAG\).
After you release a bundle on the [HPM](https://hpm.harmonyos.com/#/en/home) platform, other developers can download, install, and use the bundle through the HarmonyOS Package Manager \(hpm\).
![](figure/组件0924.png) A bundle must be uniquely named in the format **@scope/name** in the namespace. Independent evolution is supported for each bundle.
## Preparations<a name="section12731192104816"></a> ## Distribution<a name="section155387501033"></a>
### Hardware Requirements<a name="section71851750144814"></a> A distribution is a complete HarmonyOS release that integrates various bundles, including drivers, kernels, frameworks, and applications. A distribution can also be distributed on the [HPM](https://hpm.harmonyos.com/#/en/home) platform through bundles.
- Development boards \(examples: Hi3861, Hi3516D V300, and Hi3518E V300\) >![](../public_sys-resources/icon-note.gif) **NOTE:**
- Host computer \(Windows workstation\) >The metadata of a distribution describes only the dependent bundles and build script compilation methods. It does not cover binary images of the distribution. When downloading a distribution, you also need to download the dependent bundles. You can obtain the system image file for burning only after finishing installation and compilation.
- Linux server >A distribution is inheritable. Specifically, you can add bundles to or delete bundles from an existing distribution to create your own distribution.
**Figure 2** Hardware connections<a name="fig113816181847"></a> **Figure 1** Relationship between bundles and a distribution<a name="fig85033524124"></a>
![](figure/hardware-connections-23.png "hardware-connections-23")
### Installing **Node.js** and the **hpm-cli** Tool<a name="section675199493"></a>
1. Install **Node.js**. ![](figure/组件和发行版的构成-英文.png)
Download **Node.js** from its official website and install it on your local PC.
You are advised to install [Node.js](https://nodejs.org/) 12.x \(including npm 6.14.4\) or a later version \(12.13.0 or later is recommended\).
2. Install the **hpm-cli** tool using **npm** delivered with **Node.js**. Run the following command:
```
npm install -g @ohos/hpm-cli
```
3. Run the following command to check whether the installation is successful. If an HPM version is displayed, the installation is successful.
```
hpm -V or hpm --version
```
4. \(Optional\) Run the following command to upgrade the HPM version if needed:
```
npm update -g @ohos/hpm-cli
```
### \(Optional\) Modifying HPM Configurations<a name="section1940205015499"></a>
After the **hpm-cli** tool is installed, run the following command to view HPM configurations:
```
hpm config
```
Default HPM configurations are displayed upon the command execution. You can modify the default configurations as required. The following lists common HPM configurations:
```
registry = https://hpm.harmonyos.com/hpm/registry/api # Configure the address of the HPM registry (mandatory for downloading bundles).
login = https://hpm.harmonyos.com/hpm/auth/pk # Configure the address for HPM login (mandatory for publishing bundles).
loginUser = {your-account} # Configure the account for HPM login (mandatory for publishing bundles).
shellPath = C:\WINDOWS\System32\cmd.exe # Configure the shell for running HPM commands.
globalRepo = C:\Users\yourname\.global # Configure the path for storing bundles that are installed globally.
http_proxy = http://your-proxy-server:port # Configure the HTTP proxy.
https_proxy = http://your-proxy-server:port # Configure the HTTPS proxy.
```
For details about **hpm-cli** commands, see [HPM Commands](bundles-guide-overview.md).
### Downloading OpenHarmony Code<a name="section42591118155217"></a>
For details, see [Source Code Acquisition](../get-code/sourcecode-acquire.md).
### Installing Dependent Bundles<a name="section644212530524"></a>
The HPM publishes commonly used development tools \(such as those for burning, compiling, and compression\) as bundles. You can run the following command to install these tools. After the command is executed, the system automatically downloads and installs the tools, which need to be installed globally only once.
```
hpm i -g @ohos/llvm
hpm i -g @ohos/ninja
hpm i -g @ohos/gn
hpm i -g @ohos/hc_gen
hpm i -g @ohos/sysroot
```
These are a set of development tools \(such as **gn** and **ninja**\). With these tools, you can start your general bundle development based on source code.
## Bundle Development<a name="section15640113715318"></a>
# Preparations<a name="EN-US_TOPIC_0000001051770836"></a> # Installing hpm-cli Tool<a name="EN-US_TOPIC_0000001051770836"></a>
- [Hardware Requirements](#section98535485518) - [Installing Node.js and hpm](#section106591616205311)
- [Installing Node.js and the hpm-cli Tool](#section106591616205311) - [\(Optional\) Configuring hpm](#section71821165412)
- [\(Optional\) Modifying HPM Configurations](#section71821165412)
- [Downloading OpenHarmony Code](#section102338221707) - [Downloading OpenHarmony Code](#section102338221707)
- [Installing Dependent Bundles](#section19233183315020)
## Hardware Requirements<a name="section98535485518"></a> To develop a bundle, you first need to install the HarmonyOS Package Manager \(hpm\), a cross-platform command line tool developed based on Node.js. To run the hpm, you need to install Node.js, and then install the hpm using the Node Package Manager \(npm\).
- Development boards \(examples: Hi3861, Hi3516D V300, and Hi3518E V300\) ## Installing Node.js and hpm<a name="section106591616205311"></a>
- Host computer \(Windows workstation\)
- Linux server
**Figure 1** Hardware connections<a name="fig113816181847"></a>
![](figure/hardware-connections-24.png "hardware-connections-24")
## Installing **Node.js** and the **hpm-cli** Tool<a name="section106591616205311"></a>
1. Install **Node.js**. 1. Install **Node.js**.
...@@ -29,37 +20,49 @@ ...@@ -29,37 +20,49 @@
npm install -g @ohos/hpm-cli npm install -g @ohos/hpm-cli
``` ```
3. Run the following command to check whether the installation is successful. If an HPM version is displayed, the installation is successful. 3. Run the following command to check whether the installation is successful. If an hpm version is displayed, the installation is successful.
``` ```
hpm -V or hpm --version hpm -V or hpm --version
``` ```
4. \(Optional\) Run the following command to upgrade the HPM version if needed: 4. \(Optional\) Run the following command to upgrade the hpm version if needed:
``` ```
npm update -g @ohos/hpm-cli npm update -g @ohos/hpm-cli
``` ```
## \(Optional\) Modifying HPM Configurations<a name="section71821165412"></a> ## \(Optional\) Configuring hpm<a name="section71821165412"></a>
After the **hpm-cli** tool is installed, run the following command to view HPM configurations: After the **hpm-cli** tool is installed, run the following command to view the hpm configuration if you need to modify the configuration information, such as proxy and shell:
``` ```
hpm config hpm config
``` ```
Default HPM configurations are displayed upon the command execution. You can modify the default configurations as required. The following lists common HPM configurations: Default hpm configurations are displayed upon successful command execution. You can modify the default configurations as required. The following lists common hpm configurations:
``` ```
registry = https://hpm.harmonyos.com/hpm/registry/api # Configure the address of the HPM registry, mandatory for downloading bundles. registry = https://hpm.harmonyos.com
login = https://hpm.harmonyos.com/hpm/auth/pk # Configure the address for HPM login, mandatory for publishing bundles. ### login Settings
loginUser = {your-account} # Configure the account for HPM login, mandatory for publishing bundles. # loginUser = invitation_code
shellPath = C:\WINDOWS\System32\cmd.exe # Configure the shell for running HPM commands.
globalRepo = C:\Users\yourname\.global # Configure the path for storing bundles that are installed globally. #### Path Settings
http_proxy = http://your-proxy-server:port # Configure the HTTP proxy. shellPath = C:\WINDOWS\System32\cmd.exe
https_proxy = http://your-proxy-server:port # Configure the HTTPS proxy. # shellPath = C:\Program Files\Git\bin\sh.exe
# globalRepo = C:\Users\username\.hpm\global
#### Network Settings
# no_proxy = *.server.com
# http_proxy = http://user:pwd@proxy_server:port
# https_proxy = http://user:pwd@proxy_server:port
# strictSsl = true
#### Other Settings
# privateSupport = true|false
# ignoreBundles = @ohos/llvm,@ohos/gn,
# OSPlatform = Auto|linux|darwin|win32
``` ```
For details about **hpm-cli** commands, see [HPM Commands](bundles-guide-overview.md). For details about **hpm-cli** commands, see [HPM Commands](bundles-guide-overview.md).
...@@ -68,17 +71,3 @@ For details about **hpm-cli** commands, see [HPM Commands](bundles-guide-over ...@@ -68,17 +71,3 @@ For details about **hpm-cli** commands, see [HPM Commands](bundles-guide-over
For details, see [Source Code Acquisition](../get-code/sourcecode-acquire.md). For details, see [Source Code Acquisition](../get-code/sourcecode-acquire.md).
## Installing Dependent Bundles<a name="section19233183315020"></a>
The HPM publishes commonly used development tools \(such as those for burning, compiling, and compression\) as bundles. You can run the following command to install these tools. After the command is executed, the system automatically downloads and installs the tools, which need to be installed globally only once.
```
hpm i -g @ohos/llvm
hpm i -g @ohos/ninja
hpm i -g @ohos/gn
hpm i -g @ohos/hc_gen
hpm i -g @ohos/sysroot
```
These are a set of development tools \(such as **gn** and **ninja**\). With these tools, you can start your general bundle development based on source code.
# Development Guidelines<a name="EN-US_TOPIC_0000001157319417"></a> # Development Guidelines<a name="EN-US_TOPIC_0000001157319417"></a>
- **[Bundle Development](bundles-guide-overview.md)** - **[Overview](bundles-guide-overview.md)**
- **[Preparations](bundles-guide-prepare.md)** - **[Installing hpm-cli Tool](bundles-guide-prepare.md)**
- **[Bundle Development](bundles-guide-develop.md)** - **[Developing Bundles](bundles-guide-develop.md)**
# Development Specifications<a name="EN-US_TOPIC_0000001051452141"></a> # Bundle Development Specifications<a name="EN-US_TOPIC_0000001051452141"></a>
- [Overview](#section1725818533344) - [Overview](#section1725818533344)
- [Definition](#section4821219183514) - [Definition](#section4821219183514)
- [Bundle Division Principles](#section1089794263513) - [Bundle Division Rules](#section1089794263513)
- [Bundle Dependency](#section25701647163710) - [Bundle Dependency](#section25701647163710)
- [Bundle Composition](#section185538333914) - [Bundle Composition](#section185538333914)
...@@ -40,7 +40,7 @@ Bundles are designed for reuse purposes. Any reusable modules can be defined as ...@@ -40,7 +40,7 @@ Bundles are designed for reuse purposes. Any reusable modules can be defined as
- Code snippet - Code snippet
- Distribution - Distribution
### Bundle Division Principles<a name="section1089794263513"></a> ### Bundle Division Rules<a name="section1089794263513"></a>
In principle, bundles should be grouped at a fine-grained granularity as much as possible to achieve maximum reuse. The following factors are taken into account regarding bundle division: In principle, bundles should be grouped at a fine-grained granularity as much as possible to achieve maximum reuse. The following factors are taken into account regarding bundle division:
...@@ -59,7 +59,7 @@ A bundle dependency can be mandatory or optional. ...@@ -59,7 +59,7 @@ A bundle dependency can be mandatory or optional.
A bundle contains the following: A bundle contains the following:
- **src** directory for storing code files or code library - **src** directory for storing code files or code library of the bundle
- **ohos\_bundles** folder for storing dependent bundles \(It is automatically generated during bundle installation, without the need to submit to the code library.\) - **ohos\_bundles** folder for storing dependent bundles \(It is automatically generated during bundle installation, without the need to submit to the code library.\)
- **README.md** file for describing the bundle - **README.md** file for describing the bundle
- **bundle.json** file for declaring metadata of the bundle - **bundle.json** file for declaring metadata of the bundle
...@@ -138,7 +138,7 @@ Each **bundle.json** file has the following fields: ...@@ -138,7 +138,7 @@ Each **bundle.json** file has the following fields:
- **version**: a bundle version number, for example, 1.0.0. The version number must comply with the Semantic Versioning Specification \(SemVer\) standards. - **version**: a bundle version number, for example, 1.0.0. The version number must comply with the Semantic Versioning Specification \(SemVer\) standards.
- **description**: a brief description of a bundle - **description**: a brief description of a bundle
- **dependencies**: bundles that a bundle depends on - **dependencies**: bundles on which this bundle depends.
- **envs**: parameters required for bundle compilation, including global parameters and dependency parameters. - **envs**: parameters required for bundle compilation, including global parameters and dependency parameters.
...@@ -170,7 +170,7 @@ A basic **bundle.json** file needs to be enriched by bundle dependencies to im ...@@ -170,7 +170,7 @@ A basic **bundle.json** file needs to be enriched by bundle dependencies to im
} }
``` ```
In this example, **my-bundle** depends on **net 1.0.0**. After you globally install the hpm-cli tool, run the following command to obtain bundle dependencies from the remote repository: In the preceding example, the **my-bundle** bundle depends on the **net 1.0.0** bundle. After you globally install the hpm-cli tool, run the following command to obtain bundle dependencies from the remote repository:
``` ```
hpm install hpm install
...@@ -246,7 +246,7 @@ You can use the hpm-cli tool to manage the lifecycle of a bundle. The following ...@@ -246,7 +246,7 @@ You can use the hpm-cli tool to manage the lifecycle of a bundle. The following
</td> </td>
<td class="cellrowborder" valign="top" width="30.623062306230626%" headers="mcps1.2.4.1.2 "><p id="p2046811558481"><a name="p2046811558481"></a><a name="p2046811558481"></a>hpm init bundle</p> <td class="cellrowborder" valign="top" width="30.623062306230626%" headers="mcps1.2.4.1.2 "><p id="p2046811558481"><a name="p2046811558481"></a><a name="p2046811558481"></a>hpm init bundle</p>
</td> </td>
<td class="cellrowborder" valign="top" width="48.42484248424842%" headers="mcps1.2.4.1.3 "><p id="p1646818557481"><a name="p1646818557481"></a><a name="p1646818557481"></a>Creates a bundle project.</p> <td class="cellrowborder" valign="top" width="48.42484248424842%" headers="mcps1.2.4.1.3 "><p id="p1646818557481"><a name="p1646818557481"></a><a name="p1646818557481"></a>Create a bundle project.</p>
</td> </td>
</tr> </tr>
<tr id="row351184593713"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p18991313496"><a name="p18991313496"></a><a name="p18991313496"></a>hpm init -t template</p> <tr id="row351184593713"><td class="cellrowborder" valign="top" headers="mcps1.2.4.1.1 "><p id="p18991313496"><a name="p18991313496"></a><a name="p18991313496"></a>hpm init -t template</p>
...@@ -472,7 +472,7 @@ As it is rather complex to redefine the functionality of a distribution, OpenHar ...@@ -472,7 +472,7 @@ As it is rather complex to redefine the functionality of a distribution, OpenHar
} }
``` ```
In this example, the current bundle inherits from the **dist-wifi-iot 1.0.0** bundle of the distribution. In this example, the current bundle inherits from the **Bundledist-wifi-iot 1.0.0** bundle of the distribution.
Each distribution consists of many dependent bundles, which are represented by the **dependencies** field in **bundle.json**. Some dependencies are mandatory, and others can be added or removed required. In the **bundle.json** file, bundle names prefixed with a question mark \(?\) represent optional dependent bundles. If you want to inherit from a distribution involving such bundles, you can remove them and then add other bundles. Each distribution consists of many dependent bundles, which are represented by the **dependencies** field in **bundle.json**. Some dependencies are mandatory, and others can be added or removed required. In the **bundle.json** file, bundle names prefixed with a question mark \(?\) represent optional dependent bundles. If you want to inherit from a distribution involving such bundles, you can remove them and then add other bundles.
......
# Bundle Development<a name="EN-US_TOPIC_0000001111039520"></a> # Bundle Development<a name="EN-US_TOPIC_0000001111039520"></a>
- **[Development Specifications](bundles-standard-rules.md)** - **[Bundle Development Specifications](bundles-standard-rules.md)**
- **[Development Guidelines](bundles-guide.md)** - **[Development Guidelines](bundles-guide.md)**
......
# drivers # Drivers
- [HDF](driver-hdf.md) - [HDF](driver-hdf.md)
- [HDF Overview](driver-hdf-overview.md) - [HDF Overview](driver-hdf-overview.md)
- [driverr Development](driver-hdf-development.md) - [Driver Development](driver-hdf-development.md)
- [driverr Service Management](driver-hdf-servicemanage.md) - [Driver Service Management](driver-hdf-servicemanage.md)
- [driverr Message Mechanism Management](driver-hdf-news.md) - [Driver Message Mechanism Management](driver-hdf-news.md)
- [driverr Configuration Management](driver-hdf-manage.md) - [Driver Configuration Management](driver-hdf-manage.md)
- [HDF Development Example](driver-hdf-sample.md) - [HDF Development Example](driver-hdf-sample.md)
- [Platform driverrs](driver-platform.md) - [Platform Drivers](driver-platform.md)
- [GPIO](driver-platform-gpio-des.md) - [GPIO](driver-platform-gpio-des.md)
- [I2C](driver-platform-i2c-des.md) - [I2C](driver-platform-i2c-des.md)
- [RTC](driver-platform-rtc-des.md) - [RTC](driver-platform-rtc-des.md)
......
...@@ -66,7 +66,6 @@ Driver development based on the HDF consists of two parts: driver implementation ...@@ -66,7 +66,6 @@ Driver development based on the HDF consists of two parts: driver implementation
HDF_INIT(g_sampleDriverEntry); HDF_INIT(g_sampleDriverEntry);
``` ```
2. Compile the driver code. 2. Compile the driver code.
- Use the **Makefile** template provided by the HDF to compile the driver code. - Use the **Makefile** template provided by the HDF to compile the driver code.
...@@ -86,7 +85,6 @@ Driver development based on the HDF consists of two parts: driver implementation ...@@ -86,7 +85,6 @@ Driver development based on the HDF consists of two parts: driver implementation
LIB_SUBDIRS += # Directory of Makefile LIB_SUBDIRS += # Directory of Makefile
``` ```
3. Configure the driver. 3. Configure the driver.
HDF Configuration Source \(HCS\) is the source code that describes the configuration of the HDF. For details about the HCS, see [Driver Configuration Management](driver-hdf-manage.md). HDF Configuration Source \(HCS\) is the source code that describes the configuration of the HDF. For details about the HCS, see [Driver Configuration Management](driver-hdf-manage.md).
...@@ -169,7 +167,7 @@ Driver development based on the HDF consists of two parts: driver implementation ...@@ -169,7 +167,7 @@ Driver development based on the HDF consists of two parts: driver implementation
> DEVICE_PRELOAD_INVALID > DEVICE_PRELOAD_INVALID
> } DevicePreload; > } DevicePreload;
> ``` > ```
> When the **preload** field in the configuration file is set to **0** \(**DEVICE\_PRELOAD\_ENABLE**\), the driver is loaded by default during system startup. When this field is set to **1** \(**DEVICE\_PRELOAD\_ENABLE\_STEP2**\), the driver is loaded after system startup if quick start is enabled; it is loaded during system startup otherwise. When this field is set to **2** \(**DEVICE\_PRELOAD\_DISABLE**\), the driver is not loaded by default during system startup and can be dynamically loaded later. If the driver service does not exist when a user-level application obtains the driver service \(for details about how to obtain the driver service, see [Driver Message Mechanism Management](drive-hdf-news.md)\), the HDF attempts to dynamically load the driver. > When the **preload** field in the configuration file is set to **0** \(**DEVICE\_PRELOAD\_ENABLE**\), the driver is loaded by default during system startup. When this field is set to **1** \(**DEVICE\_PRELOAD\_ENABLE\_STEP2**\), the driver is loaded after system startup if quick start is enabled; it is loaded during system startup otherwise. When this field is set to **2** \(**DEVICE\_PRELOAD\_DISABLE**\), the driver is not loaded by default during system startup and can be dynamically loaded later. If the driver service does not exist when a user-level application obtains the driver service \(for details about how to obtain the driver service, see [Driver Message Mechanism Management](driver-hdf-news.md)\), the HDF attempts to dynamically load the driver.
>- Sequential loading \(drivers must be loaded by default\) >- Sequential loading \(drivers must be loaded by default\)
> In the configuration file, the **priority** field \(the value is an integer ranging from 0 to 200\) indicates the priority of the host and driver. For drivers in different hosts, a smaller host priority value indicates a higher driver loading priority; for drivers in the same host, a smaller driver priority value indicates a higher driver loading priority. > In the configuration file, the **priority** field \(the value is an integer ranging from 0 to 200\) indicates the priority of the host and driver. For drivers in different hosts, a smaller host priority value indicates a higher driver loading priority; for drivers in the same host, a smaller driver priority value indicates a higher driver loading priority.
...@@ -49,7 +49,7 @@ The message mechanism provides the following features: ...@@ -49,7 +49,7 @@ The message mechanism provides the following features:
## How to Develop<a name="section946912121153"></a> ## How to Develop<a name="section946912121153"></a>
1. Set the value of the **policy** field in the driver configuration information to **2** \(SERVICE\_POLICY\_CAPACITY, see [Driver Service Management](drive-hdf-servicemanage.md)\). 1. Set the value of the **policy** field in the driver configuration information to **2** \(SERVICE\_POLICY\_CAPACITY, see [Driver Service Management](driver-hdf-servicemanage.md)\).
``` ```
device_sample :: Device { device_sample :: Device {
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
- **[HDF Overview](driver-hdf-overview.md)** - **[HDF Overview](driver-hdf-overview.md)**
- **[driverr Development](driver-hdf-development.md)** - **[Driver Development](driver-hdf-development.md)**
- **[driverr Service Management](driver-hdf-servicemanage.md)** - **[Driver Service Management](driver-hdf-servicemanage.md)**
- **[driverr Message Mechanism Management](driver-hdf-news.md)** - **[Driver Message Mechanism Management](driver-hdf-news.md)**
- **[driverr Configuration Management](driver-hdf-manage.md)** - **[Driver Configuration Management](driver-hdf-manage.md)**
- **[HDF Development Example](driver-hdf-sample.md)** - **[HDF Development Example](driver-hdf-sample.md)**
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
## Overview<a name="section141575391542"></a> ## Overview<a name="section141575391542"></a>
The Liquid Crystal Display \(LCD\) driver powers on the LCD and initializes internal LCD registers through APIs to enable the LCD to work properly. The display driver is developed based on the hardware driver foundation \([HDF](drive-hdf-overview.md)\). It provides power-on, power-off, and sending of the initialization sequence for LCD hardware across OSs and platforms. The display driver model is shown in [Figure 1](#fig69138814229). The Liquid Crystal Display \(LCD\) driver powers on the LCD and initializes internal LCD registers through APIs to enable the LCD to work properly. The display driver is developed based on the hardware driver foundation \([HDF](driver-hdf-overview.md)\). It provides power-on, power-off, and sending of the initialization sequence for LCD hardware across OSs and platforms. The display driver model is shown in [Figure 1](#fig69138814229).
**Figure 1** Architecture of the display driver model<a name="fig69138814229"></a> **Figure 1** Architecture of the display driver model<a name="fig69138814229"></a>
![](figure/architecture-of-the-display-driver-model.png "architecture-of-the-display-driver-model") ![](figure/architecture-of-the-display-driver-model.png "architecture-of-the-display-driver-model")
...@@ -66,7 +66,6 @@ The display driver model is developed based on the HDF, platform APIs, and APIs ...@@ -66,7 +66,6 @@ The display driver model is developed based on the HDF, platform APIs, and APIs
Based on the LCD hardware interfaces, use the I2C, SPI, and MIPI interfaces provided by the platform to download the LCD initialization sequence. For details, see the SPEC provided by the LCD supplier. Based on the LCD hardware interfaces, use the I2C, SPI, and MIPI interfaces provided by the platform to download the LCD initialization sequence. For details, see the SPEC provided by the LCD supplier.
4. Implement other HDF interfaces as required, for example, the **Release** interface. 4. Implement other HDF interfaces as required, for example, the **Release** interface.
5. Use the HDF to create other device nodes for implementing service logic or debugging as required. 5. Use the HDF to create other device nodes for implementing service logic or debugging as required.
......
...@@ -68,14 +68,13 @@ The interfaces shown in the figure are described as follows: ...@@ -68,14 +68,13 @@ The interfaces shown in the figure are described as follows:
Generally, the touchscreen driver IC is separated from the LCD driver IC. In this case, the touchscreen driver IC requires both 1.8 V and 3.3 V power supplies. Nowadays, the touchscreen driver IC and LCD driver IC can be integrated. Therefore, the touchscreen, requires only the 1.8 V power supply, and the 3.3 V power required internally is supplied by the LCD VSP power \(typical value: 5.5 V\) in the driver IC. Generally, the touchscreen driver IC is separated from the LCD driver IC. In this case, the touchscreen driver IC requires both 1.8 V and 3.3 V power supplies. Nowadays, the touchscreen driver IC and LCD driver IC can be integrated. Therefore, the touchscreen, requires only the 1.8 V power supply, and the 3.3 V power required internally is supplied by the LCD VSP power \(typical value: 5.5 V\) in the driver IC.
2. **I/O control interfaces** 2. **I/O control interfaces**
- RESET: reset pin, which is used to reset the driver IC on the host when suspending or resuming the system. - RESET: reset pin, which is used to reset the driver IC on the host when suspending or resuming the system.
- INT: interrupt pin, which needs to be set to the input direction and pull-up status during driver initialization. After detecting an external touch signal, the driver triggers the interrupt by operating the interrupt pin. The driver reads the touch reporting data in the ISR function. - INT: interrupt pin, which needs to be set to the input direction and pull-up status during driver initialization. After detecting an external touch signal, the driver triggers the interrupt by operating the interrupt pin. The driver reads the touch reporting data in the ISR function.
3. **Communications interfaces** 3. **Communications interfaces**
- I2C: Since only a small amount of touch data is reported by the touchscreen, I2C is used to transmit the reported data. For details about the I2C protocol and interfaces, see [I2C](drive-platform-i2c-des.md#section1695201514281). - I2C: Since only a small amount of touch data is reported by the touchscreen, I2C is used to transmit the reported data. For details about the I2C protocol and interfaces, see [I2C](driver-platform-i2c-des.md#section1695201514281).
- SPI: In addition to touch reporting data coordinates, some vendors need to obtain basic capacitance data. Therefore, Serial Peripheral Interface \(SPI\) is used to transmit such huge amount of data. For details about the SPI protocol and interfaces, see [SPI](drive-platform-spi-des.md#section71363452477). - SPI: In addition to touch reporting data coordinates, some vendors need to obtain basic capacitance data. Therefore, Serial Peripheral Interface \(SPI\) is used to transmit such huge amount of data. For details about the SPI protocol and interfaces, see [SPI](driver-platform-spi-des.md#section71363452477).
## Development Guidelines<a name="section65745222184"></a> ## Development Guidelines<a name="section65745222184"></a>
...@@ -109,7 +108,7 @@ Regardless of the OS and system on a chip \(SoC\), the input driver is developed ...@@ -109,7 +108,7 @@ Regardless of the OS and system on a chip \(SoC\), the input driver is developed
3. Implement differentiated adaptation APIs of the touchscreen. 3. Implement differentiated adaptation APIs of the touchscreen.
Use the platform APIs to perform operations for the reset pins, interrupt pins, and power based on the communications interfaces designed for boards. For details about the GPIO-related operations, see [GPIO](drive-platform-gpio-des.md#section259614242196). Use the platform APIs to perform operations for the reset pins, interrupt pins, and power based on the communications interfaces designed for boards. For details about the GPIO-related operations, see [GPIO](driver-platform-gpio-des.md#section259614242196).
## Development Example<a name="section263714411191"></a> ## Development Example<a name="section263714411191"></a>
......
...@@ -106,7 +106,7 @@ The method for converting GPIO pin numbers varies according to the GPIO controll ...@@ -106,7 +106,7 @@ The method for converting GPIO pin numbers varies according to the GPIO controll
A controller manages 12 groups of GPIO pins. Each group contains 8 GPIO pins. A controller manages 12 groups of GPIO pins. Each group contains 8 GPIO pins.
GPIO pin number = GPIO group index \(0-11\) x Number of GPIO pins in each group \(8\) + Offset in the group GPIO pin number = GPIO group index \(011\) x Number of GPIO pins in each group \(8\) + Offset in the group
Example: GPIO number of GPIO10\_3 = 10 x 8 + 3 = 83 Example: GPIO number of GPIO10\_3 = 10 x 8 + 3 = 83
......
...@@ -132,7 +132,7 @@ Before performing SPI communication, obtain an SPI device handle by calling **S ...@@ -132,7 +132,7 @@ Before performing SPI communication, obtain an SPI device handle by calling **S
DevHandle SpiOpen\(const struct SpiDevInfo \*info\); DevHandle SpiOpen\(const struct SpiDevInfo \*info\);
**Table 2** Description of **SpiOpen** **Table 2** Description of SpiOpen
<a name="table7603619123820"></a> <a name="table7603619123820"></a>
<table><tbody><tr id="row1060351914386"><td class="cellrowborder" valign="top" width="50%"><p id="p14603181917382"><a name="p14603181917382"></a><a name="p14603181917382"></a><strong id="b139290298482"><a name="b139290298482"></a><a name="b139290298482"></a>Parameter</strong></p> <table><tbody><tr id="row1060351914386"><td class="cellrowborder" valign="top" width="50%"><p id="p14603181917382"><a name="p14603181917382"></a><a name="p14603181917382"></a><strong id="b139290298482"><a name="b139290298482"></a><a name="b139290298482"></a>Parameter</strong></p>
...@@ -185,7 +185,7 @@ After obtaining the SPI device handle, obtain the SPI device configuration param ...@@ -185,7 +185,7 @@ After obtaining the SPI device handle, obtain the SPI device configuration param
int32\_t SpiGetCfg\(DevHandle handle, struct SpiCfg \*cfg\); int32\_t SpiGetCfg\(DevHandle handle, struct SpiCfg \*cfg\);
**Table 3** Description of **SpiGetCfg** **Table 3** Description of SpiGetCfg
<a name="table14209152141313"></a> <a name="table14209152141313"></a>
<table><tbody><tr id="row1420918529133"><td class="cellrowborder" valign="top" width="50%"><p id="p42091852141314"><a name="p42091852141314"></a><a name="p42091852141314"></a><strong id="b6279123012486"><a name="b6279123012486"></a><a name="b6279123012486"></a>Parameter</strong></p> <table><tbody><tr id="row1420918529133"><td class="cellrowborder" valign="top" width="50%"><p id="p42091852141314"><a name="p42091852141314"></a><a name="p42091852141314"></a><strong id="b6279123012486"><a name="b6279123012486"></a><a name="b6279123012486"></a>Parameter</strong></p>
...@@ -224,7 +224,7 @@ int32\_t SpiGetCfg\(DevHandle handle, struct SpiCfg \*cfg\); ...@@ -224,7 +224,7 @@ int32\_t SpiGetCfg\(DevHandle handle, struct SpiCfg \*cfg\);
``` ```
int32_t ret; int32_t ret;
struct SpiCfg cfg = {0}; /* SPI configuration information */ struct SpiCfg cfg = {0}; /* SPI configuration information */
ret = SpiGetCfg(spiHandle, &cfg); /* Set SPI device configuration parameters. */ ret = SpiGetCfg(spiHandle, &cfg); /* Obtain SPI device configuration parameters. */
if (ret != 0) { if (ret != 0) {
HDF_LOGE("SpiGetCfg: failed, ret %d\n", ret); HDF_LOGE("SpiGetCfg: failed, ret %d\n", ret);
} }
...@@ -236,7 +236,7 @@ After obtaining the SPI device handle, set SPI device configuration parameters b ...@@ -236,7 +236,7 @@ After obtaining the SPI device handle, set SPI device configuration parameters b
int32\_t SpiSetCfg\(DevHandle handle, struct SpiCfg \*cfg\); int32\_t SpiSetCfg\(DevHandle handle, struct SpiCfg \*cfg\);
**Table 4** Description of **SpiSetCfg** **Table 4** Description of SpiSetCfg
<a name="table219052945210"></a> <a name="table219052945210"></a>
<table><tbody><tr id="row14191192918522"><td class="cellrowborder" valign="top" width="50%"><p id="p17424155016529"><a name="p17424155016529"></a><a name="p17424155016529"></a><strong id="b11281163011480"><a name="b11281163011480"></a><a name="b11281163011480"></a>Parameter</strong></p> <table><tbody><tr id="row14191192918522"><td class="cellrowborder" valign="top" width="50%"><p id="p17424155016529"><a name="p17424155016529"></a><a name="p17424155016529"></a><strong id="b11281163011480"><a name="b11281163011480"></a><a name="b11281163011480"></a>Parameter</strong></p>
...@@ -293,7 +293,7 @@ To write data into an SPI device only once, call the following function: ...@@ -293,7 +293,7 @@ To write data into an SPI device only once, call the following function:
int32\_t SpiWrite\(DevHandle handle, uint8\_t \*buf, uint32\_t len\); int32\_t SpiWrite\(DevHandle handle, uint8\_t \*buf, uint32\_t len\);
**Table 5** Description of **SpiWrite** **Table 5** Description of SpiWrite
<a name="table1018490043"></a> <a name="table1018490043"></a>
<table><tbody><tr id="row31848013417"><td class="cellrowborder" valign="top" width="50%"><p id="p1415816132411"><a name="p1415816132411"></a><a name="p1415816132411"></a><strong id="b42810303484"><a name="b42810303484"></a><a name="b42810303484"></a>Parameter</strong></p> <table><tbody><tr id="row31848013417"><td class="cellrowborder" valign="top" width="50%"><p id="p1415816132411"><a name="p1415816132411"></a><a name="p1415816132411"></a><strong id="b42810303484"><a name="b42810303484"></a><a name="b42810303484"></a>Parameter</strong></p>
...@@ -350,7 +350,7 @@ To read data from an SPI device only once, call the following function: ...@@ -350,7 +350,7 @@ To read data from an SPI device only once, call the following function:
int32\_t SpiRead\(DevHandle handle, uint8\_t \*buf, uint32\_t len\); int32\_t SpiRead\(DevHandle handle, uint8\_t \*buf, uint32\_t len\);
**Table 6** Description of **SpiRead** **Table 6** Description of SpiRead
<a name="table0265191412124"></a> <a name="table0265191412124"></a>
<table><tbody><tr id="row42651914141213"><td class="cellrowborder" valign="top" width="50%"><p id="p1483184123"><a name="p1483184123"></a><a name="p1483184123"></a><strong id="b528223019480"><a name="b528223019480"></a><a name="b528223019480"></a>Parameter</strong></p> <table><tbody><tr id="row42651914141213"><td class="cellrowborder" valign="top" width="50%"><p id="p1483184123"><a name="p1483184123"></a><a name="p1483184123"></a><strong id="b528223019480"><a name="b528223019480"></a><a name="b528223019480"></a>Parameter</strong></p>
...@@ -407,7 +407,7 @@ To launch a custom transfer, call the following function: ...@@ -407,7 +407,7 @@ To launch a custom transfer, call the following function:
int32\_t SpiTransfer\(DevHandle handle, struct SpiMsg \*msgs, uint32\_t count\); int32\_t SpiTransfer\(DevHandle handle, struct SpiMsg \*msgs, uint32\_t count\);
**Table 7** Description of **SpiTransfer** **Table 7** Description of SpiTransfer
<a name="table1934414174212"></a> <a name="table1934414174212"></a>
<table><tbody><tr id="row1134415176216"><td class="cellrowborder" valign="top" width="50%"><p id="p13295152320217"><a name="p13295152320217"></a><a name="p13295152320217"></a><strong id="b1628393012482"><a name="b1628393012482"></a><a name="b1628393012482"></a>Parameter</strong></p> <table><tbody><tr id="row1134415176216"><td class="cellrowborder" valign="top" width="50%"><p id="p13295152320217"><a name="p13295152320217"></a><a name="p13295152320217"></a><strong id="b1628393012482"><a name="b1628393012482"></a><a name="b1628393012482"></a>Parameter</strong></p>
...@@ -474,7 +474,7 @@ void SpiClose\(DevHandle handle\); ...@@ -474,7 +474,7 @@ void SpiClose\(DevHandle handle\);
This function will release the resources previously obtained. This function will release the resources previously obtained.
**Table 8** Description of **SpiClose** **Table 8** Description of SpiClose
<a name="table72517953115"></a> <a name="table72517953115"></a>
<table><tbody><tr id="row1525793312"><td class="cellrowborder" valign="top" width="50%"><p id="p115402031153111"><a name="p115402031153111"></a><a name="p115402031153111"></a><strong id="b1728493044820"><a name="b1728493044820"></a><a name="b1728493044820"></a>Parameter</strong></p> <table><tbody><tr id="row1525793312"><td class="cellrowborder" valign="top" width="50%"><p id="p115402031153111"><a name="p115402031153111"></a><a name="p115402031153111"></a><strong id="b1728493044820"><a name="b1728493044820"></a><a name="b1728493044820"></a>Parameter</strong></p>
...@@ -491,7 +491,7 @@ This function will release the resources previously obtained. ...@@ -491,7 +491,7 @@ This function will release the resources previously obtained.
</table> </table>
``` ```
PalHandleDestroy(spiHandle); /* Destroy the SPI device handle. */ SpiClose(spiHandle); /* Destroy the SPI device handle. */
``` ```
## Usage Example<a name="section06541058155120"></a> ## Usage Example<a name="section06541058155120"></a>
...@@ -540,7 +540,7 @@ void SpiTestSample(void) ...@@ -540,7 +540,7 @@ void SpiTestSample(void)
HDF_LOGE("SpiWrite: failed, ret %d\n", ret); HDF_LOGE("SpiWrite: failed, ret %d\n", ret);
goto err; goto err;
} }
/* Read data of a specified length from an SPI device. */ /* Read data of a specific length from an SPI device. */
ret = SpiRead(spiHandle, rbuff, 4); ret = SpiRead(spiHandle, rbuff, 4);
if (ret != 0) { if (ret != 0) {
HDF_LOGE("SpiRead: failed, ret %d\n", ret); HDF_LOGE("SpiRead: failed, ret %d\n", ret);
......
# Platform drivers<a name="EN-US_TOPIC_0000001111199424"></a> # Platform Drivers<a name="EN-US_TOPIC_0000001111199424"></a>
- **[GPIO](driver-platform-gpio-des.md)** - **[GPIO](driver-platform-gpio-des.md)**
......
...@@ -52,7 +52,7 @@ OpenHarmony provides the following two types of Docker environments for you to q ...@@ -52,7 +52,7 @@ OpenHarmony provides the following two types of Docker environments for you to q
</td> </td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p552616549297"><a name="p552616549297"></a><a name="p552616549297"></a>swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard</p> <td class="cellrowborder" valign="top" headers="mcps1.2.6.1.3 "><p id="p552616549297"><a name="p552616549297"></a><a name="p552616549297"></a>swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard</p>
</td> </td>
<td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1633303300"><a name="p1633303300"></a><a name="p1633303300"></a>0.0.1</p> <td class="cellrowborder" valign="top" headers="mcps1.2.6.1.4 "><p id="p1633303300"><a name="p1633303300"></a><a name="p1633303300"></a>0.0.2</p>
</td> </td>
</tr> </tr>
<tr id="row5986201731214"><td class="cellrowborder" align="center" valign="top" width="15.831583158315832%" headers="mcps1.2.6.1.1 "><p id="p136981216143"><a name="p136981216143"></a><a name="p136981216143"></a>HPM-based Docker environment</p> <tr id="row5986201731214"><td class="cellrowborder" align="center" valign="top" width="15.831583158315832%" headers="mcps1.2.6.1.1 "><p id="p136981216143"><a name="p136981216143"></a><a name="p136981216143"></a>HPM-based Docker environment</p>
...@@ -287,9 +287,8 @@ Start building. Docker can be automatically installed only in Ubuntu. If you are ...@@ -287,9 +287,8 @@ Start building. Docker can be automatically installed only in Ubuntu. If you are
hpm run docker hpm run docker
``` ```
This example uses the **@ohos/hispark\_taurus** solution for illustration. If the execution is successful, the output is as follows: This example uses the **@ohos/hispark\_taurus** solution for illustration. If the execution is successful, the output is as follows:
``` ```
... ...
ohos ipcamera_hispark_taurus build success! ohos ipcamera_hispark_taurus build success!
......
...@@ -9,7 +9,7 @@ HUAWEI DevEco Device Tool is a one-stop integrated development environment \(IDE ...@@ -9,7 +9,7 @@ HUAWEI DevEco Device Tool is a one-stop integrated development environment \(IDE
The roadmap of Huawei DevEco Device Tool for supporting OpenHarmony device development is shown in the figure below. The roadmap of Huawei DevEco Device Tool for supporting OpenHarmony device development is shown in the figure below.
![](figure/3-22.png) ![](figure/3-27.png)
## Acquiring the Application Development Tool \(HUAWEI DevEco Studio\)<a name="section0904101019258"></a> ## Acquiring the Application Development Tool \(HUAWEI DevEco Studio\)<a name="section0904101019258"></a>
......
...@@ -162,7 +162,6 @@ You must install **Node.js** and HPM on your local PC. The installation proced ...@@ -162,7 +162,6 @@ You must install **Node.js** and HPM on your local PC. The installation proced
![](figure/en-us_image_0000001119915556.png) ![](figure/en-us_image_0000001119915556.png)
2. Learn more about the distribution. 2. Learn more about the distribution.
1. Read carefully the information about the distribution to learn its application scenarios, features, bundles, usage, and customization methods, as shown in the following figure. 1. Read carefully the information about the distribution to learn its application scenarios, features, bundles, usage, and customization methods, as shown in the following figure.
...@@ -185,7 +184,6 @@ You must install **Node.js** and HPM on your local PC. The installation proced ...@@ -185,7 +184,6 @@ You must install **Node.js** and HPM on your local PC. The installation proced
![](figure/en-us_image_0000001166715379.png) ![](figure/en-us_image_0000001166715379.png)
4. Download and install bundles. 4. Download and install bundles.
1. Decompress the downloaded file using the CLI tool CMD \(shell in Linux\). 1. Decompress the downloaded file using the CLI tool CMD \(shell in Linux\).
2. In the generated directory, run the **hpm install** command. 2. In the generated directory, run the **hpm install** command.
......
# Development Examples # Development Examples
- [WLAN-connected Products](device-wifi.md) - [WLAN-connected Products](device-wifi.md)
- [LED Peripheral Control](device-wifi-led-outcontrol.md) - [LED Peripheral Control](device-wlan-led-outcontrol.md)
- [Third-Party SDK Integration](device-wifi-sdk.md) - [Third-Party SDK Integration](device-wlan-sdk.md)
- [Cameras Without a Screen](device-iotcamera.md) - [Cameras Without a Screen](device-iotcamera.md)
- [Camera Control](device-iotcamera-control.md) - [Camera Control](device-iotcamera-control.md)
- [Overview](device-iotcamera-control-overview.md) - [Overview](device-iotcamera-control-overview.md)
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
- [Overview](device-camera-visual-overview.md) - [Overview](device-camera-visual-overview.md)
- [Preparations](device-camera-visual-prepare.md) - [Preparations](device-camera-visual-prepare.md)
- [Adding Pages](device-camera-visual-addpage.md) - [Adding Pages](device-camera-visual-addpage.md)
- [Building the Home Page](device-camera-visual-first-page.md) - [Building the Home Page](device-camera-visual-firstpage.md)
- [Building the Details Page](device-camera-visual-details.md) - [Building the Details Page](device-camera-visual-details.md)
- [Debugging and Packaging](device-camera-visual-debug.md) - [Debugging and Packaging](device-camera-visual-debug.md)
- [Running on the Device](device-camera-visual-run.md) - [Running on the Device](device-camera-visual-run.md)
- [FAQs](device-camera-visual-faqs.md) - [FAQs](device-camera-visual-faqs.md)
- [Development Guidelines on Clock Apps](oem_device_clockapp_des.md) - [Development Guidelines on Clock Apps](device-clock-guide.md)
- [Development Example for Platform Drivers](device-driver-demo.md) - [Development Example for Platform Drivers](device-driver-demo.md)
- [Development Example for Peripheral Drivers](device-outerdriver-demo.md) - [Development Example for Peripheral Drivers](device-outerdriver-demo.md)
\ No newline at end of file
...@@ -111,7 +111,6 @@ The following steps describe how to build the home page with a flexible layout t ...@@ -111,7 +111,6 @@ The following steps describe how to build the home page with a flexible layout t
} }
``` ```
- **index="\{\{swiperPage\}\}" duration="500" onchange="swiperChange"** sets the component attribute and event. **duration="500"** indicates that the duration of the swiping animation is 500 ms. - **index="\{\{swiperPage\}\}" duration="500" onchange="swiperChange"** sets the component attribute and event. **duration="500"** indicates that the duration of the swiping animation is 500 ms.
- **index="\{\{swiperPage\}\}"** specifies the index of the child component of **<swiper\>**. **\{\{swiperPage\}\}** indicates that the index value is dynamically bound to the **swiperPage** variable in the JavaScript code. The index value changes with the **swiperPage** value. - **index="\{\{swiperPage\}\}"** specifies the index of the child component of **<swiper\>**. **\{\{swiperPage\}\}** indicates that the index value is dynamically bound to the **swiperPage** variable in the JavaScript code. The index value changes with the **swiperPage** value.
- **onchange="swiperChange"** binds the change event of the **<swiper\>** component to the **swiperChange** function. The JavaScript code is as follows: - **onchange="swiperChange"** binds the change event of the **<swiper\>** component to the **swiperChange** function. The JavaScript code is as follows:
...@@ -141,7 +140,6 @@ The following steps describe how to build the home page with a flexible layout t ...@@ -141,7 +140,6 @@ The following steps describe how to build the home page with a flexible layout t
} }
``` ```
4. Set the information about a city to be displayed on a screen. On each screen, information of different types is displayed using different components. 4. Set the information about a city to be displayed on a screen. On each screen, information of different types is displayed using different components.
Add two **<stack\>** as child components \(directional layout\) to **<swiper\>**. Add **<text\>**, **<image\>**, **<progress\>**, and other components to each **<stack\>** to display the information. The following example shows the page structure: Add two **<stack\>** as child components \(directional layout\) to **<swiper\>**. Add **<text\>**, **<image\>**, **<progress\>**, and other components to each **<stack\>** to display the information. The following example shows the page structure:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- **[Adding Pages](device-camera-visual-addpage.md)** - **[Adding Pages](device-camera-visual-addpage.md)**
- **[Building the Home Page](device-camera-visual-first-page.md)** - **[Building the Home Page](device-camera-visual-firstpage.md)**
- **[Building the Details Page](device-camera-visual-details.md)** - **[Building the Details Page](device-camera-visual-details.md)**
......
...@@ -29,7 +29,7 @@ Download and install DevEco Studio. For details, see the [HUAWEI DevEco Studio ...@@ -29,7 +29,7 @@ Download and install DevEco Studio. For details, see the [HUAWEI DevEco Studio
The Clock app displays the current time through a clock face and numbers. The Clock app displays the current time through a clock face and numbers.
As shown in [Figure 1 Clock display effect](oem_device_clockapp_des.md#fig7763172132019), the UI consists of two parts: As shown in [Figure 1 Clock display effect](#fig7763172132019), the UI consists of two parts:
- Clock face area: displays a dynamic analog clock whose hands rotate accurately. - Clock face area: displays a dynamic analog clock whose hands rotate accurately.
- Digital time area: displays the current time in numerals. - Digital time area: displays the current time in numerals.
...@@ -177,9 +177,8 @@ To build such an app, we can create a page that has a flexible layout with two r ...@@ -177,9 +177,8 @@ To build such an app, we can create a page that has a flexible layout with two r
</div> </div>
``` ```
- **index.css** - **index.css**
``` ```
.container { .container {
flex-direction: column; flex-direction: column;
...@@ -217,11 +216,10 @@ To build such an app, we can create a page that has a flexible layout with two r ...@@ -217,11 +216,10 @@ To build such an app, we can create a page that has a flexible layout with two r
} }
``` ```
- **index.js** - **index.js**
A **.js** file is used to implement logic interactions of the clock app. The following **.js** file implements the function of periodically obtaining the system time. A **.js** file is used to implement logic interactions of the clock app. The following **.js** file implements the function of periodically obtaining the system time.
``` ```
export default { export default {
timer: undefined, timer: undefined,
...@@ -263,7 +261,7 @@ After finishing writing the app code, you need to sign and package the app befor ...@@ -263,7 +261,7 @@ After finishing writing the app code, you need to sign and package the app befor
## Running on the Real Device<a name="section092721731511"></a> ## Running on the Real Device<a name="section092721731511"></a>
Before you install the app and run it on the development board, install the DevEco Device Tool by following operations provided in [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/tool_install-0000001050164976). Burn OpenHarmony into the development board, and run it on the board. For details about how to build, burn, and run an image, see [Getting Started with Hi3516](../quick-start/quickstart-standard.md). After the image is running normally and the system is started properly, perform the following steps to install or uninstall the app: Before you install the app and run it on the development board, install the DevEco Device Tool by following operations provided in [HUAWEI DevEco Device Tool User Guide](https://device.harmonyos.com/en/docs/ide/user-guides/service_introduction-0000001050166905). Burn OpenHarmony into the development board, and run it on the board. For details about how to build, burn, and run an image, see . After the image is running normally and the system is started properly, perform the following steps to install or uninstall the app:
1. Obtain the HDC client from the following path: 1. Obtain the HDC client from the following path:
......
...@@ -34,7 +34,7 @@ In this example, an I2C driver is used. [Figure 1](#fig148041484161) shows the ...@@ -34,7 +34,7 @@ In this example, an I2C driver is used. [Figure 1](#fig148041484161) shows the
## Preparations<a name="section6926133918422"></a> ## Preparations<a name="section6926133918422"></a>
Follow the instructions in [Environment Setup for Standard System](../quick-start/quickstart-standard.md). Follow the instructions in [Environment Setup for Standard System](../quick-start/quickstart-standard-description.md).
>![](../public_sys-resources/icon-notice.gif) **NOTICE:** >![](../public_sys-resources/icon-notice.gif) **NOTICE:**
>This development example applies to standard, small, and mini OpenHarmony systems. The following sections use the standard system as an example. You can refer to the specific guide for your system to set up the environment. >This development example applies to standard, small, and mini OpenHarmony systems. The following sections use the standard system as an example. You can refer to the specific guide for your system to set up the environment.
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
## Overview<a name="section86753818426"></a> ## Overview<a name="section86753818426"></a>
This document describes how to develop a touchscreen driver on the Hi3516D V300 development board using the HDF input driver model, helping you quickly get started with peripheral driver development. This document describes how to develop a touchscreen driver on the Hi3516D V300 development board using the HDF input driver model, helping you quickly get started with OpenHarmony peripheral driver development.
### Hardware Resources<a name="section123071189431"></a> ### Hardware Resources<a name="section123071189431"></a>
...@@ -40,7 +40,7 @@ The input driver model mainly consists of the device manager, common drivers, an ...@@ -40,7 +40,7 @@ The input driver model mainly consists of the device manager, common drivers, an
In addition, the input driver model implements functions for reporting input data and parsing input device configurations. In addition, the input driver model implements functions for reporting input data and parsing input device configurations.
For details about the input driver model, see [Touchscreen Overview](../driver/drive-peripherals-touch-des.md#section175431838101617). For details about the input driver model, see [Touchscreen Overview](../driver/driver-peripherals-touch-des.md#section175431838101617).
## Setting Up the Environment<a name="section661075474418"></a> ## Setting Up the Environment<a name="section661075474418"></a>
......
# WLAN-connected Products<a name="EN-US_TOPIC_0000001157479363"></a> # WLAN-connected Products<a name="EN-US_TOPIC_0000001157479363"></a>
- **[LED Peripheral Control](device-wifi-led-outcontrol.md)** - **[LED Peripheral Control](device-wlan-led-outcontrol.md)**
- **[Third-Party SDK Integration](device-wifi-sdk.md)** - **[Third-Party SDK Integration](device-wlan-sdk.md)**
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- **[Cameras with a Screen](device-camera.md)** - **[Cameras with a Screen](device-camera.md)**
- **[Development Guidelines on Clock Apps](oem_device_clockapp_des.md)** - **[Development Guidelines on Clock Apps](device-clock-guide.md)**
- **[Development Example for Platform Drivers](device-driver-demo.md)** - **[Development Example for Platform Drivers](device-driver-demo.md)**
......
# Kernel # Kernel
- [Kernel for Mini and Small Systems](kernel-lite.md) - [Kernel for Mini and Small Systems](kernel-lite.md)
- [Kernel for Mini Systems](kernel-lite-mini.md)
- [Kernel Overview](kernel-mini-overview.md)
- [Basic Kernel](kernel-mini-basic.md)
- [Interrupt Management](kernel-mini-basic-interrupt.md)
- [Basic Concepts](kernel-mini-basic-interrupt-concept.md)
- [Development Guidelines](kernel-mini-basic-interrupt-guide.md)
- [Task Management](kernel-mini-basic-task.md)
- [Basic Concepts](kernel-mini-basic-task-basic.md)
- [Development Guidelines](kernel-mini-basic-task-guide.md)
- [Memory Management](kernel-mini-basic-memory.md)
- [Basic Concepts](kernel-mini-basic-memory-basic.md)
- [Static Memory](kernel-mini-basic-memory-static.md)
- [Dynamic Memory](kernel-mini-basic-memory-dynamic.md)
- [Kernel Communication Mechanisms](kernel-mini-basic-ipc.md)
- [Event](kernel-mini-basic-ipc-event.md)
- [Basic Concepts](kernel-mini-basic-ipc-event-basic.md)
- [Development Guidelines](kernel-mini-basic-ipc-event-guide.md)
- [Mutex](kernel-mini-basic-ipc-mutex.md)
- [Basic Concepts](kernel-mini-basic-ipc-mutex-basic.md)
- [Development Guidelines](kernel-mini-basic-ipc-mutex-guide.md)
- [Queue](kernel-mini-basic-ipc-queue.md)
- [Basic Concepts](kernel-mini-basic-ipc-queue-basic.md)
- [Development Guidelines](kernel-mini-basic-ipc-queue-guide.md)
- [Semaphore](kernel-mini-basic-ipc-sem.md)
- [Basic Concepts](kernel-mini-basic-ipc-sem-basic.md)
- [Development Guidelines](kernel-mini-basic-ipc-sem-guide.md)
- [Time Management](kernel-basic-mini-time.md)
- [Basic Concepts](kernel-mini-basic-time-basic.md)
- [Development Guidelines](kernel-mini-basic-time-guide.md)
- [Software Timer](kernel-mini-basic-soft.md)
- [Basic Concepts](kernel-mini-basic-soft-basic.md)
- [Development Guidelines](kernel-mini-basic-soft-guide.md)
- [Extension Components](kernel-mini-extend.md)
- [C++ Support](kernel-mini-extend-support.md)
- [CPUP](kernel-mini-extend-cpup.md)
- [Basic Concepts](kernel-mini-extend-cpup-basic.md)
- [Development Guidelines](kernel-mini-extend-cpup-guide.md)
- [Dynamic Loading](kernel-mini-extend-dynamic-loading.md)
- [Basic Concepts](kernel-mini-extend-dynamic-loading-basic.md)
- [Development Guidelines](kernel-mini-extend-dynamic-loading-guide.md)
- [File System](kernel-mini-extend-file.md)
- [FAT](kernel-mini-extend-file-fat.md)
- [LittleFS](kernel-mini-extend-file-lit.md)
- [Basic Concepts](kernel-mini-extend-file-littlefs-basic.md)
- [Development Guidelines](kernel-mini-extend-file-littlefs-guide.md)
- [Kernel Debugging](kernel-memory-inner.md)
- [Memory Debugging](kernel-mini-memory-debug.md)
- [Memory Information Statistics](kernel-mini-memory-debug-mes.md)
- [Memory Leak Check](kernel-mini-imemory-debug-det.md)
- [Memory Corruption Check](kernel-mini-memory-debug-cet.md)
- [Exception Debugging](kernel-mini-memory-exception.md)
- [Trace Debugging](kernel-mini-memory-trace.md)
- [Appendix](kernel-mini-app.md)
- [Kernel Coding Specification](kernel-mini-appx-code.md)
- [Basic Data Structure](kernel-mini-appx-data.md)
- [Doubly Linked List](kernel-mini-appx-data-list.md)
- [Standard Libraries](kernel-mini-appx-lib.md)
- [CMSIS Support](kernel-mini-appx-lib-cmsis.md)
- [POSIX Support](kernel-mini-appx-lib-posix.md)
- [Kernel for Small Systems](kernel-lite-small.md) - [Kernel for Small Systems](kernel-lite-small.md)
- [Basic Kernel](kernel-lite-small-basic.md) - [Kernel Overview](kernel-small-overview.md)
- [Process](kernel-lite-small-process.md) - [Kernel Startup](kernel-small-start.md)
- [Thread](kernel-lite-small-thread.md) - [Startup in Kernel Space](kernel-small-start-kernel.md)
- [Memory](kernel-lite-small-memory.md) - [Startup in User Space](kernel-small-start-user.md)
- [Network](kernel-lite-small-net.md) - [Basic Kernel](kernel-small-basics.md)
- [File System](kernel-lite-small-file.md) - [Interrupt and Exception Handling](kernel-small-basic-interrupt.md)
- [VFS](kernel-lite-small-file-vfs.md) - [Process Management](kernel-small-basic-process.md)
- [NFS](kernel-lite-small-file-nfs.md) - [Process](kernel-small-basic-process-process.md)
- [RAMFS](kernel-lite-small-file-ramfs.md) - [Thread](kernel-small-basic-process-thread.md)
- [FAT](kernel-lite-small-file-fat.md) - [Scheduler](kernel-small-basic-process-scheduler.md)
- [JFFS2](kernel-lite-small-file-jffs.md) - [Memory Management](kernel-small-basic-memory.md)
- [Standard Library](kernel-lite-small-lib.md) - [Heap Memory Management](kernel-small-basic-memory-heap.md)
- [Standard Library](kernel-lite-small-lib-standard.md) - [Physical Memory Management](kernel-small-basic-memory-physical.md)
- [Differences from the Linux Standard Library](kernel-lite-small-lib-differ.md) - [Virtual Memory Management](kernel-small-basic-memory-virtual.md)
- [Commissioning](kernel-lite-small-shell.md) - [Virtual-to-Physical Mapping](kernel-small-basic-inner-reflect.md)
- [Introduction to the Shell](kernel-lite-small-shell-des.md) - [Kernel Communication Mechanisms](kernel-small-basic-trans.md)
- [Shell Command Development Guidelines](kernel-lite-small-shell-guide.md) - [Event](kernel-small-basic-trans-event.md)
- [Shell Command Programming Example](kernel-lite-small-shell-sample.md) - [Semaphore](kernel-small-basic-trans-semaphore.md)
- [Shell Command Reference](kernel-lite-small-shell-cmd.md) - [Mutex](kernel-small-basic-trans-mutex.md)
- [System Commands](kernel-lite-small-shell-cmd-sys.md) - [Queue](kernel-small-basic-trans-queue.md)
- [cpup](kernel-lite-small-shell-cmd-sys-cpup.md) - [RW Lock](kernel-small-basic-trans-rwlock.md)
- [date](kernel-lite-small-shell-cmd-sys-date.md) - [Futex](kernel-small-basic-trans-user-mutex.md)
- [dmesg](kernel-lite-small-shell-cmd-sys-demsg.md) - [Signal](kernel-small-basic-trans-user-signal.md)
- [exec](kernel-lite-small-shell-cmd-sys-exec.md) - [Time Management](kernel-small-basic-time.md)
- [free](kernel-lite-small-shell-cmd-sys-free.md) - [Software Timer](kernel-small-basic-softtimer.md)
- [help](kernel-lite-small-shell-cmd-sys-help.md) - [Atomic Operation](kernel-small-basic-atomic.md)
- [hwi](kernel-lite-small-shell-cmd-sys-hwi.md) - [Extension Components](kernel-small-bundles.md)
- [kill](kernel-lite-small-shell-cmd-sys-kill.md) - [System Call](kernel-small-bundles-system.md)
- [log](kernel-lite-small-shell-cmd-sys-log.md) - [Dynamic Loading and Linking](kernel-small-bundles-linking.md)
- [memcheck](kernel-lite-small-shell-cmd-sys-mem.md) - [Virtual Dynamic Shared Object](kernel-small-bundles-share.md)
- [oom](kernel-lite-small-shell-cmd-sys-oom.md) - [LiteIPC](kernel-small-bundles-ipc.md)
- [pmm](kernel-lite-small-shell-cmd-sys-pmm.md) - [File Systems](kernel-small-bundles-fs.md)
- [reset](kernel-lite-small-shell-cmd-sys-reset.md) - [Virtual File System](kernel-small-bundles-fs-virtual.md)
- [sem](kernel-lite-small-shell-cmd-sys-sem.md) - [Supported File Systems](kernel-small-bundles-fs-support.md)
- [stack](kernel-lite-small-shell-cmd-sys-stack.md) - [FAT](kernel-small-bundles-fs-support-fat.md)
- [su](kernel-lite-small-shell-cmd-sys-su.md) - [JFFS2](kernel-small-bundles-fs-support-jffs2.md)
- [swtmr](kernel-lite-small-shell-cmd-sys-swymr.md) - [NFS](kernel-small-bundles-fs-support-nfs.md)
- [systeminfo](kernel-lite-small-shell-cmd-sys-sys.md) - [Ramfs](kernel-small-bundles-fs-support-ramfs.md)
- [task](kernel-lite-small-shell-cmd-sys-task.md) - [procfs](kernel-small-bundles-fs-support-procfs.md)
- [uname](kernel-lite-small-shell-cmd-sys-uname.md) - [File System Adaptation](kernel-small-bundles-fs-new.md)
- [vmm](kernel-lite-small-shell-cmd-sys-vmm.md) - [Debugging and Tools](kernel-small-debug.md)
- [watch](kernel-lite-small-shell-cmd-sys-watch.md) - [Shell](kernel-small-debug-shell.md)
- [File Commands](kernel-lite-small-shell-cmd-file.md) - [Introduction to the Shell](kernel-small-debug-shell-overview.md)
- [cat](kernel-lite-small-shell-cmd-file-cat.md) - [Shell Command Development Guidelines](kernel-small-debug-shell-guide.md)
- [cd](kernel-lite-small-shell-cmd-file-cd.md) - [Shell Command Programming Example](kernel-small-debug-shell-build.md)
- [chgrp](kernel-lite-small-shell-cmd-file-chgrp.md) - [Shell Command Reference](kernel-small-debug-shell-details.md)
- [chmod](kernel-lite-small-shell-cmd-file-chmod.md) - [System Commands](kernel-small-debug-shell-cmd.md)
- [chown](kernel-lite-small-shell-cmd-file-chown.md) - [cpup](kernel-small-debug-shell-cmd-cpup.md)
- [cp](kernel-lite-small-shell-cmd-file-cp.md) - [date](kernel-small-debug-shell-cmd-date.md)
- [format](kernel-lite-small-shell-cmd-file-format.md) - [dmesg](kernel-small-debug-shell-cmd-dmesg.md)
- [ls](kernel-lite-small-shell-cmd-file-is.md) - [exec](kernel-small-debug-shell-cmd-exec.md)
- [lsfd](kernel-lite-small-shell-cmd-file-isfd.md) - [free](kernel-small-debug-shell-cmd-free.md)
- [mkdir](kernel-lite-small-shell-cmd-file-mkdir.md) - [help](kernel-small-debug-shell-cmd-help.md)
- [mount](kernel-lite-small-shell-cmd-file-mount.md) - [hwi](kernel-small-debug-shell-cmd-hwi.md)
- [partinfo](kernel-lite-small-shell-cmd-file-part.md) - [kill](kernel-small-debug-shell-cmd-kill.md)
- [partition](kernel-lite-small-shell-cmd-file-partion.md) - [log](kernel-small-debug-shell-cmd-log.md)
- [pwd](kernel-lite-small-shell-cmd-file-pwd.md) - [memcheck](kernel-small-debug-shell-cmd-memcheck.md)
- [rm](kernel-lite-small-shell-cmd-file-rm.md) - [oom](kernel-small-debug-shell-cmd-oom.md)
- [rmdir](kernel-lite-small-shell-cmd-file-rmdir.md) - [pmm](kernel-small-debug-shell-cmd-pmm.md)
- [statfs](kernel-lite-small-shell-cmd-file-sta.md) - [reset](kernel-small-debug-shell-cmd-reset.md)
- [sync](kernel-lite-small-shell-cmd-file-sync.md) - [sem](kernel-small-debug-shell-cmd-sem.md)
- [touch](kernel-lite-small-shell-cmd-file-touch.md) - [stack](kernel-small-debug-shell-cmd-stack.md)
- [writeproc](kernel-lite-small-shell-cmd-file-write.md) - [su](kernel-small-debug-shell-cmd-su.md)
- [umount](kernel-lite-small-shell-cmd-file-umount.md) - [swtmr](kernel-small-debug-shell-cmd-swtmr.md)
- [Network Commands](kernel-lite-small-shell-cmd-net.md) - [systeminfo](kernel-small-debug-shell-cmd-sysinfo.md)
- [arp](kernel-lite-small-shell-cmd-net-arp.md) - [task](kernel-small-debug-shell-cmd-task.md)
- [dhclient](kernel-lite-small-shell-cmd-net-dh.md) - [uname](kernel-small-debug-shell-cmd-uname.md)
- [dns](kernel-lite-small-shell-cmd-net-dns.md) - [vmm](kernel-small-debug-shell-cmd-vmm.md)
- [ifconfig](kernel-lite-small-shell-cmd-net-ipc.md) - [watch](kernel-small-debug-shell-cmd-watch.md)
- [ipdebug](kernel-lite-small-shell-cmd-net-ipd.md) - [File Commands](kernel-small-debug-shell-file.md)
- [netstat](kernel-lite-small-shell-cmd-net-net.md) - [cat](kernel-small-debug-shell-file-cat.md)
- [ntpdate](kernel-lite-small-shell-cmd-net-ntp.md) - [cd](kernel-small-debug-shell-file-cd.md)
- [ping](kernel-lite-small-shell-cmd-net-ping.md) - [chgrp](kernel-small-debug-shell-file-chgrp.md)
- [ping6](kernel-lite-small-shell-cmd-net-ping6.md) - [chmod](kernel-small-debug-shell-file-chmod.md)
- [telnet](kernel-lite-small-shell-cmd-net-tel.md) - [chown](kernel-small-debug-shell-file-chown.md)
- [tftp](kernel-lite-small-shell-cmd-net-tftp.md) - [cp](kernel-small-debug-shell-file-cp.md)
- [Magic Key Usage](kernel-lite-small-shell-cmd-mag.md) - [format](kernel-small-debug-shell-file-format.md)
- [User-Space Exception Information](kernel-lite-small-shell-cmd-abn.md) - [ls](kernel-small-debug-shell-file-ls.md)
- [lsfd](kernel-small-debug-shell-file-lsfd.md)
- [mkdir](kernel-small-debug-shell-file-mkdir.md)
- [mount](kernel-small-debug-shell-file-mount.md)
- [partinfo](kernel-small-debug-shell-file-partinfo.md)
- [partition](kernel-small-debug-shell-file-partition.md)
- [pwd](kernel-small-debug-shell-file-pwd.md)
- [rm](kernel-small-debug-shell-file-rm.md)
- [rmdir](kernel-small-debug-shell-file-rmdir.md)
- [statfs](kernel-small-debug-shell-file-statfs.md)
- [sync](kernel-small-debug-shell-file-sync.md)
- [touch](kernel-small-debug-shell-file-touch.md)
- [writeproc](kernel-small-debug-shell-file-write.md)
- [umount](kernel-small-debug-shell-file-umount.md)
- [Network Commands](kernel-small-debug-shell-net.md)
- [arp](kernel-small-debug-shell-net-arp.md)
- [dhclient](kernel-small-debug-shell-net-dhclient.md)
- [dns](kernel-small-debug-shell-net-dns.md)
- [ifconfig](kernel-small-debug-shell-net-ifconfig.md)
- [ipdebug](kernel-small-debug-shell-net-ipdebug.md)
- [netstat](kernel-small-debug-shell-net-netstat.md)
- [ntpdate](kernel-small-debug-shell-net-ntpdate.md)
- [ping](kernel-small-debug-shell-net-ping.md)
- [ping6](kernel-small-debug-shell-net-ping6.md)
- [telnet](kernel-small-debug-shell-net-telnet.md)
- [tftp](kernel-small-debug-shell-net-tftp.md)
- [Magic Key](kernel-small-debug-shell-magickey.md)
- [User-Space Exception Information](kernel-small-debug-shell-error.md)
- [Trace](kernel-small-debug-trace.md)
- [Process Commissioning](kernel-small-debug-process.md)
- [CPUP](kernel-small-debug-process-cpu.md)
- [Memory Debugging](kernel-small-debug-memory.md)
- [Memory Information Statistics](kernel-small-debug-memory-info.md)
- [Memory Leak Check](kernel-small-debug-memory-leak.md)
- [Memory Corruption Check](kernel-small-debug-memory-corrupt.md)
- [Other Kernel Debugging Methods](kernel-small-debug-other.md)
- [Dying Gasp](kernel-small-debug-trace-other-lastwords.md)
- [Common Fault Locating Methods](kernel-small-debug-trace-other-faqs.md)
- [Appendix](kernel-small-apx.md)
- [Basic Data Structure](kernel-small-apx-structure.md)
- [Doubly Linked List](kernel-small-apx-dll.md)
- [Bitwise Operation](kernel-small-apx-bitwise.md)
- [Standard Library](kernel-small-apx-library.md)
- [Kernel for Standard Systems](kernel-standard.md) - [Kernel for Standard Systems](kernel-standard.md)
- [Linux Kernel Overview](kernel-standard-des.md) - [Linux Kernel Overview](kernel-standard-overview.md)
- [Guidelines for Using Patches on OpenHarmony Development Boards](kernel-standard-patch.md) - [Guidelines for Using Patches on OpenHarmony Development Boards](kernel-standard-patch.md)
- [Guidelines for Compiling and Building the Linux Kernel](kernel-standard-build.md) - [Guidelines for Compiling and Building the Linux Kernel](kernel-standard-build.md)
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
文件模式从 100755 更改为 100644
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册