提交 52ba6ebf 编写于 作者: E ester.zhou

Update docs (10789)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 926c2e84
# Use Case<a name="EN-US_TOPIC_0000001055301733"></a>
This use case takes **camera\_sample** \(contained in the source code\) as an example for photographing, recording, and previewing on the development board.
This use case takes **camera\_sample** \(contained in the source code\) as an example for photographing, recording, and previewing on the development board.
- You can obtain source code of the sample from **applications/sample/camera/media/camera\_sample.cpp**.
- Before running the sample camera, you need to compile, burn, and run the image. For details, see [Hi3516 Development Board](../quick-start/quickstart-lite-introduction-hi3516#section26131214194212).
- You can obtain source code of the sample from **applications/sample/camera/media/camera\_sample.cpp**.
- Before running the sample camera, you need to compile, burn, and run the image. For details, see [Quick Start Overview](../quick-start/quickstart-overview.md).
>![](../public_sys-resources/icon-note.gif) **NOTE**<br/>
>After the development board is started, the home screen is loaded and displayed above the media layer by default. To prevent covering **camera\_sample**, you should remove the home screen during compilation or packaging.
>How to Remove: In **build/lite/components/applications.json**, comment out or delete the **//applications/sample/camera/launcher:launcher\_hap** line from the **target** field of **camera\_sample\_app**.
>After the development board is started, the home screen is loaded and displayed above the media layer by default. To prevent covering **camera\_sample**, you should remove the home screen during compilation or packaging.
>How to Remove: In **build/lite/components/applications.json**, comment out or delete the **//applications/sample/camera/launcher:launcher\_hap** line from the **target** field of **camera\_sample\_app**.
- The compilation result of the sample code is stored in **out/hi3516dv300/ipcamera\_hi3516dv300\_liteos/dev\_tools/bin**. To ensure that the code can be executed on the development board, you can copy the file to a TF card through a card reader, or modify the compilation script of **camera\_sample** to copy the compilation result to **rootfs.img**.
- The compilation result of the sample code is stored in **out/hi3516dv300/ipcamera\_hi3516dv300\_liteos/dev\_tools/bin**. To ensure that the code can be executed on the development board, you can copy the file to a TF card through a card reader, or modify the compilation script of **camera\_sample** to copy the compilation result to **rootfs.img**.
Modify the first **output\_dir** in the source code path **applications/sample/camera/media/BUILD.gn**.
Modify the first **output\_dir** in the source code path **applications/sample/camera/media/BUILD.gn**.
- Before: **output\_dir = "$root\_out\_dir/dev\_ools"**
- After: **output\_dir = "$root\_out\_dir/"**
- Before: **output\_dir = "$root\_out\_dir/dev\_ools"**
- After: **output\_dir = "$root\_out\_dir/"**
Recompile the source code repository and burn the code into the development board. Then you can find the **camera\_sample** file in the **bin** directory of the board.
Recompile the source code repository and burn the code into the development board. Then you can find the **camera\_sample** file in the **bin** directory of the board.
>![](../public_sys-resources/icon-notice.gif) **NOTICE**<br/>
>You should insert a TF card \(up to 128 GB supported\) for photographing and video recording before system startup. This way, the TF card will be automatically mounted to the **/sdcard** directory. If you insert the TF card after the system is started, you have to manually mount the TF card.
>You should insert a TF card \(up to 128 GB supported\) for photographing and video recording before system startup. This way, the TF card will be automatically mounted to the **/sdcard** directory. If you insert the TF card after the system is started, you have to manually mount the TF card.
>To view the photos and videos in the TF card, copy them to a computer. If you just want to preview photos and videos, you do not need to insert a TF card.
- Perform the following steps to run the sample:
1. Run the **cd** command to go to the end path of the executable program and start **camera\_sample** by running the command in the following figure.
1. Run the **cd** command to go to the end path of the executable program and start **camera\_sample** by running the command in the following figure.
**Figure 1** Starting camera\_sample<a name="fig380985885020"></a>
**Figure 1** Starting camera\_sample<a name="fig380985885020"></a>
![](figures/starting-camera_sample.png "starting-camera_sample")
The control commands are displayed as shown in the preceding figure. Press **S** to stop the current operation \(including video recording and preview\), and press **Q** to exit the program.
The control commands are displayed as shown in the preceding figure. Press **S** to stop the current operation \(including video recording and preview\), and press **Q** to exit the program.
2. Press **1** to take a photo in JPG format. The photo is saved in the **/sdcard** directory and named **Capture\***.
2. Press **1** to take a photo in JPG format. The photo is saved in the **/sdcard** directory and named **Capture\***.
**Figure 2** Serial port logs displayed after the photographing command is executed<a name="fig17819185018384"></a>
**Figure 2** Serial port logs displayed after the photographing command is executed<a name="fig17819185018384"></a>
![](figures/serial-port-logs-displayed-after-the-photographing-command-is-executed.png "serial-port-logs-displayed-after-the-photographing-command-is-executed")
To view the saved file, exit the program and enter the file system. To start the program again, return to the previous step.
**Figure 3** Saved files<a name="fig166391743154619"></a>
**Figure 3** Saved files<a name="fig166391743154619"></a>
![](figures/saved-files.png "saved-files")
3. Press **2** to start recording. The video file is in MP4 format and saved in the **/sdcard** directory with the name **Record\***. Press **S** to stop recording.
3. Press **2** to start recording. The video file is in MP4 format and saved in the **/sdcard** directory with the name **Record\***. Press **S** to stop recording.
**Figure 4** Serial port logs displayed after the recording command is executed<a name="fig6340814174317"></a>
**Figure 4** Serial port logs displayed after the recording command is executed<a name="fig6340814174317"></a>
![](figures/serial-port-logs-displayed-after-the-recording-command-is-executed.png "serial-port-logs-displayed-after-the-recording-command-is-executed")
4. Press **3** to start preview. The preview is displayed on the screen. Press **S** to stop preview.
4. Press **3** to start preview. The preview is displayed on the screen. Press **S** to stop preview.
**Figure 5** Serial port logs displayed after the preview command is executed<a name="fig9658148124414"></a>
**Figure 5** Serial port logs displayed after the preview command is executed<a name="fig9658148124414"></a>
![](figures/serial-port-logs-displayed-after-the-preview-command-is-executed.png "serial-port-logs-displayed-after-the-preview-command-is-executed")
The following figure shows the preview.
**Figure 6** Preview effect<a name="fig24541759597"></a>
**Figure 6** Preview effect<a name="fig24541759597"></a>
![](figures/preview-effect.jpg "preview-effect")
5. Press **Q** to exit.
5. Press **Q** to exit.
**Figure 7** Serial port logs displayed after the exit command is executed<a name="fig1755682174514"></a>
**Figure 7** Serial port logs displayed after the exit command is executed<a name="fig1755682174514"></a>
![](figures/serial-port-logs-displayed-after-the-exit-command-is-executed.png "serial-port-logs-displayed-after-the-exit-command-is-executed")
# Running on the Device<a name="EN-US_TOPIC_0000001054809161"></a>
Before you install the application 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 compile, burn, and run an image, see the [Hi3516 Development Board](../quick-start/Readme-EN.md). After the image is running normally and the system is started properly, perform the following steps to install or uninstall the application:
Before you install the application 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 compile, burn, and run an image, see the [Quick Start Overview](../quick-start/quickstart-overview.md). After the image is running normally and the system is started properly, perform the following steps to install or uninstall the application:
1. Store the compiled unsigned application installation package and installation tool in an SD card and insert the SD card into the development board slot. The installation tool is in **dev\_tools** of the directory where the image file is generated.
1. Store the compiled unsigned application installation package and installation tool in an SD card and insert the SD card into the development board slot. The installation tool is in **dev\_tools** of the directory where the image file is generated.
2. Run the following command to disable signature verification, which is enabled by default for application installation:
```
......@@ -15,11 +15,11 @@ Before you install the application and run it on the development board, install
./sdcard/dev_tools/bin/bm install -p /sdcard/airquality.hap
```
The **dev\_tools** directory stores the installation tool, and **airquality.hap** is the application installation package. Replace it with actual the package name.
The **dev\_tools** directory stores the installation tool, and **airquality.hap** is the application installation package. Replace it with actual the package name.
4. After the application is installed, touch the application icon on the home screen to enter the application.
**Figure 1** Home screen<a name="fig146361926155516"></a>
**Figure 1** Home screen<a name="fig146361926155516"></a>
![](figures/home-screen.png "home-screen")
5. \(Optional\) Uninstall the application.
......
......@@ -26,7 +26,7 @@ For details about the input driver model, see [Touchscreen Overview](../driver/
Follow the instructions in [Quick Start Overview](../quick-start/quickstart-overview.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.
## Developing a Touchscreen Driver<a name="section15233162984520"></a>
......@@ -37,9 +37,9 @@ Complete the following tasks to adapt a touchscreen IC based on the input driver
Configure the touchscreen driver description required for registering the driver with the HDF, for example, whether the driver is loaded and what is the loading priority.
You can configure the device driver description in the configuration file at **./drivers/adapter/khdf/linux/hcs/device\_info/device\_info.hcs**.
You can configure the device driver description in the configuration file at **./drivers/adapter/khdf/linux/hcs/device\_info/device\_info.hcs**.
The **device\_info.hcs** file contains all necessary information for registering drivers in the input driver model with the HDF. You do not need to make any modification for the information unless otherwise required in special scenarios. The private configuration data of each driver uses the **deviceMatchAttr** field to match the **match\_attr** field in the **input\_config.hcs** file.
The **device\_info.hcs** file contains all necessary information for registering drivers in the input driver model with the HDF. You do not need to make any modification for the information unless otherwise required in special scenarios. The private configuration data of each driver uses the **deviceMatchAttr** field to match the **match\_attr** field in the **input\_config.hcs** file.
The input-related fields in the configuration file are as follows. For details about these fields, see [Driver Development](../driver/driver-hdf-development.md).
......@@ -91,21 +91,21 @@ Pay attention to the following fields in the configuration file:
**preload**: specifies whether to load the driver.
**moduleName**: This value must be the same as the **moduleName** value in the driver entry structure.
**moduleName**: This value must be the same as the **moduleName** value in the driver entry structure.
**serviceName**: This value is used by the HDF to create a device node name.
**deviceMatchAttr**: This value must be the same as the **match\_attr** value in the private configuration data.
**deviceMatchAttr**: This value must be the same as the **match\_attr** value in the private configuration data.
After the device descriptions are configured, the HDF matches the configuration with the code registered with the driver entry structure based on the **moduleName** field, ensuring that drivers can be loaded properly. If multiple drivers are configured, the **priority** field determines the loading sequence of each driver.
After the device descriptions are configured, the HDF matches the configuration with the code registered with the driver entry structure based on the **moduleName** field, ensuring that drivers can be loaded properly. If multiple drivers are configured, the **priority** field determines the loading sequence of each driver.
### Configuring the Touchscreen<a name="section156331030144617"></a>
The private data includes the power-on and power-off sequence, and the platform hardware information includes the GPIO port that connects the touchscreen to the main board.
You can configure the touchscreen in the configuration file at **./drivers/adapter/khdf/linux/hcs/input/input\_config.hcs**.
You can configure the touchscreen in the configuration file at **./drivers/adapter/khdf/linux/hcs/input/input\_config.hcs**.
The **input\_config.hcs** file consists of the private configuration data of both the common driver and chip driver. Information of this file is read and parsed by the driver code. The configuration in the file includes the board-level hardware information and private configuration of the touchscreen. You can tailor the configuration during your development.
The **input\_config.hcs** file consists of the private configuration data of both the common driver and chip driver. Information of this file is read and parsed by the driver code. The configuration in the file includes the board-level hardware information and private configuration of the touchscreen. You can tailor the configuration during your development.
```
root {
......@@ -197,7 +197,7 @@ root {
}
```
In the example, **touchConfig** contains the **touch0** configuration, which describes the **boardConfig** and **chipConfig** configuration information. The **boardConfig** field provides the board-level hardware information of Hi3516D V300, and the **chipConfig** field provides the private configuration data of the touchscreen. To use another touchscreen, you can change the value of the **chipConfig** field. You can also configure multiple touchscreens for your product. In this example, **touch0** represents the hardware interface and chip configuration of the default touchscreen. If you need to configure a secondary touchscreen, add a **touch1** block parallel to **touch0**.
In the example, **touchConfig** contains the **touch0** configuration, which describes the **boardConfig** and **chipConfig** configuration information. The **boardConfig** field provides the board-level hardware information of Hi3516D V300, and the **chipConfig** field provides the private configuration data of the touchscreen. To use another touchscreen, you can change the value of the **chipConfig** field. You can also configure multiple touchscreens for your product. In this example, **touch0** represents the hardware interface and chip configuration of the default touchscreen. If you need to configure a secondary touchscreen, add a **touch1** block parallel to **touch0**.
### Adapting to the Private Drivers of the Touchscreen<a name="section17127331595"></a>
......@@ -207,7 +207,7 @@ The input driver model consists of three parts of drivers. To develop a brand-ne
1. Implement differentiated APIs for the touchscreen to adapt to the input chip driver.
You can obtain the sample code at **./drivers/framework/model/input/driver/touchscreen/touch\_gt911.c**.
You can obtain the sample code at **./drivers/framework/model/input/driver/touchscreen/touch\_gt911.c**.
```
static struct TouchChipOps g_gt911ChipOps = { // IC options of the touchscreen
......@@ -267,7 +267,7 @@ The input driver model consists of three parts of drivers. To develop a brand-ne
2. Initialize the input chip driver and register the driver with the HDF.
You can obtain the sample code at **./drivers/framework/model/input/driver/touchscreen/touch\_gt911.c**.
You can obtain the sample code at **./drivers/framework/model/input/driver/touchscreen/touch\_gt911.c**.
```
static int32_t HdfGoodixChipInit(struct HdfDeviceObject *device)
......@@ -304,7 +304,7 @@ The input driver model consists of three parts of drivers. To develop a brand-ne
1. Compile the Makefile.
Open the file at **./drivers/adapter/khdf/linux/model/input/Makefile**.
Open the file at **./drivers/adapter/khdf/linux/model/input/Makefile**.
Add the following content:
......@@ -313,7 +313,7 @@ The input driver model consists of three parts of drivers. To develop a brand-ne
$(INPUT_ROOT_DIR)/touchscreen/touch_gt911.o
```
**touch\_gt911.o** is the content added in this example.
**touch\_gt911.o** is the content added in this example.
2. Build source code and burn images. For details, see the related sections in [Quick Start Overview](../quick-start/quickstart-overview.md).
......
......@@ -16,7 +16,7 @@ Based on the Hi3861 platform, the OpenHarmony WLAN module provides abundant peri
#define LED_TEST_GPIO 9
```
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>![](../public_sys-resources/icon-note.gif) **NOTE**
>
>For details about the schematic diagram of the development board, contact the Hi3861 customer service personnel.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册