未验证 提交 06a0ee75 编写于 作者: O openharmony_ci 提交者: Gitee

!21931 翻译完成 21376+20584+20608

Merge pull request !21931 from ester.zhou/TR-20765
...@@ -171,6 +171,8 @@ struct DragControllerPage { ...@@ -171,6 +171,8 @@ struct DragControllerPage {
## DragInfo ## DragInfo
**System capability**: SystemCapability.ArkUI.ArkUI.Full
Defines the attributes required for initiating a drag action and information carried in the dragging process. Defines the attributes required for initiating a drag action and information carried in the dragging process.
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
......
...@@ -57,7 +57,7 @@ struct Index { ...@@ -57,7 +57,7 @@ struct Index {
Row() { Row() {
Column() { Column() {
Image((<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.icon').id)))) Image((<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.icon').id))))
Image(((<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.drawable') Image(((<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.icon')
.id))).getForeground()).getPixelMap()) .id))).getForeground()).getPixelMap())
}.height('50%') }.height('50%')
}.width('50%') }.width('50%')
...@@ -80,7 +80,8 @@ Obtains this **pixelMap** object. ...@@ -80,7 +80,8 @@ Obtains this **pixelMap** object.
**Example** **Example**
```ts ```ts
pixmap: PixelMap = (<DrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.icon') let resManager = getContext().resourceManager
let pixmap: PixelMap = (<DrawableDescriptor> (resManager.getDrawableDescriptor($r('app.media.icon')
.id))).getPixelMap(); .id))).getPixelMap();
``` ```
...@@ -99,7 +100,8 @@ Obtains the **pixelMap** object where the foreground, background, and mask are b ...@@ -99,7 +100,8 @@ Obtains the **pixelMap** object where the foreground, background, and mask are b
**Example** **Example**
```ts ```ts
pixmap: PixelMap = (<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.drawable') let resManager = getContext().resourceManager
let pixmap: PixelMap = (<LayeredDrawableDescriptor> (resManager.getDrawableDescriptor($r('app.media.icon')
.id))).getPixelMap(); .id))).getPixelMap();
``` ```
...@@ -118,7 +120,8 @@ Obtains the **DrawableDescriptor** object of the foreground. ...@@ -118,7 +120,8 @@ Obtains the **DrawableDescriptor** object of the foreground.
**Example** **Example**
```ts ```ts
drawable: DrawableDescriptor = (<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.drawable') let resManager = getContext().resourceManager
let drawable: DrawableDescriptor = (<LayeredDrawableDescriptor> (resManager.getDrawableDescriptor($r('app.media.icon')
.id))).getForeground(); .id))).getForeground();
``` ```
...@@ -137,7 +140,8 @@ Obtains the **DrawableDescriptor** object of the background. ...@@ -137,7 +140,8 @@ Obtains the **DrawableDescriptor** object of the background.
**Example** **Example**
```ts ```ts
drawable: DrawableDescriptor = (<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.drawable') let resManager = getContext().resourceManager
drawable: DrawableDescriptor = (<LayeredDrawableDescriptor> (resManager.getDrawableDescriptor($r('app.media.icon')
.id))).getBackground(); .id))).getBackground();
``` ```
...@@ -156,6 +160,26 @@ Obtains the **DrawableDescriptor** object of the mask. ...@@ -156,6 +160,26 @@ Obtains the **DrawableDescriptor** object of the mask.
**Example** **Example**
```ts ```ts
drawable: DrawableDescriptor = (<LayeredDrawableDescriptor> (this.resManager.getDrawableDescriptor($r('app.media.drawable') let resManager = getContext().resourceManager
let drawable: DrawableDescriptor = (<LayeredDrawableDescriptor> (resManager.getDrawableDescriptor($r('app.media.icon')
.id))).getMask(); .id))).getMask();
``` ```
## LayeredDrawableDescriptor.getMaskClipPath
static getMaskClipPath(): string
Obtains the built-in clipping path parameters of the system. It is a static method of **LayeredDrawableDescriptor**.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Return value**
| Type | Description |
| ---------------------------------------- | -------------------- |
| string | String of the clipping path.|
**Example**
```ts
Image($r('app.media.icon'))
.width('200px').height('200px')
.clip(new Path({commands:LayeredDrawableDescriptor.getMaskClipPath()}))
```
...@@ -48,7 +48,7 @@ Implements a component observer for completion of component layout and drawing, ...@@ -48,7 +48,7 @@ Implements a component observer for completion of component layout and drawing,
on(type: 'layout', callback: () => void): void on(type: 'layout', callback: () => void): void
Registers a listener for completion of component layout or drawing. Registers a listener for completion of component layout.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
...@@ -63,7 +63,7 @@ Registers a listener for completion of component layout or drawing. ...@@ -63,7 +63,7 @@ Registers a listener for completion of component layout or drawing.
off(type: 'layout', callback?: () => void): void off(type: 'layout', callback?: () => void): void
Unregisters the listener for completion of component layout or drawing. Unregisters the listener for completion of component layout.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
...@@ -74,6 +74,36 @@ Unregisters the listener for completion of component layout or drawing. ...@@ -74,6 +74,36 @@ Unregisters the listener for completion of component layout or drawing.
| type | string | Yes | Type of the listener. The value must be **'layout'** or **'draw'**.<br>**'layout'**: completion of component layout.<br>**'draw'**: completion of component drawing.| | type | string | Yes | Type of the listener. The value must be **'layout'** or **'draw'**.<br>**'layout'**: completion of component layout.<br>**'draw'**: completion of component drawing.|
| callback | void | No | Callback to unregister. If this parameter is not specified, all callbacks of the specified type are unregistered.| | callback | void | No | Callback to unregister. If this parameter is not specified, all callbacks of the specified type are unregistered.|
### on
on(type: 'draw', callback: () => void): void
Registers a listener for completion of component drawing.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Type of the listener. The value must be **'layout'** or **'draw'**.<br>**'layout'**: completion of component layout.<br>**'draw'**: completion of component drawing.|
| callback | void | Yes | Callback invoked upon completion of component layout or drawing. |
### off
off(type: 'draw', callback?: () => void): void
Unregisters the listener for completion of component drawing.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Type of the listener. The value must be **'layout'** or **'draw'**.<br>**'layout'**: completion of component layout.<br>**'draw'**: completion of component drawing.|
| callback | void | No | Callback to unregister. If this parameter is not specified, all callbacks of the specified type are unregistered.|
**Example** **Example**
```ts ```ts
......
...@@ -41,7 +41,7 @@ Since API version 9, this API is supported in ArkTS widgets. ...@@ -41,7 +41,7 @@ Since API version 9, this API is supported in ArkTS widgets.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Description: | | Name | Description |
| ------------------- | ------------------------------------------------------------ | | ------------------- | ------------------------------------------------------------ |
| Linear | The animation speed keeps unchanged. | | Linear | The animation speed keeps unchanged. |
| Ease | The animation starts slowly, accelerates, and then slows down towards the end. The cubic-bezier curve (0.25, 0.1, 0.25, 1.0) is used.| | Ease | The animation starts slowly, accelerates, and then slows down towards the end. The cubic-bezier curve (0.25, 0.1, 0.25, 1.0) is used.|
...@@ -279,10 +279,10 @@ Creates a custom curve. ...@@ -279,10 +279,10 @@ Creates a custom curve.
```ts ```ts
import Curves from '@ohos.curves' import Curves from '@ohos.curves'
interpolate(fraction) { let interpolate = function(fraction) {
return Math.sqrt(fraction); return Math.sqrt(fraction)
} }
private curve = Curves.customCurve(this.interpolate) // Create a custom curve. let curve = Curves.customCurve(interpolate) // Create a custom interpolation curve.
``` ```
......
...@@ -27,7 +27,7 @@ Matrix constructor, which is used to create a 4 x 4 matrix by using the input pa ...@@ -27,7 +27,7 @@ Matrix constructor, which is used to create a 4 x 4 matrix by using the input pa
| Name| Type | Mandatory| Description | | Name| Type | Mandatory| Description |
| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| option | [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number] | Yes | A number array whose length is 16 (4 x 4). For details, see **Description of a 4 x 4 matrix**.<br>Default value:<br>[1,&nbsp;0,&nbsp;0,&nbsp;0,<br>0,&nbsp;1,&nbsp;0,&nbsp;0,<br>0,&nbsp;0,&nbsp;1,&nbsp;0,<br>0,&nbsp;0,&nbsp;0,&nbsp;1] | | option | [number,number,number,number,<br>number,number,number,number,<br>number,number,number,number,<br>number,number,number,number] | Yes | A number array whose length is 16 (4 x 4). For details, see **Description of a 4 x 4 matrix**.<br>Default value:<br>[1, 0, 0, 0,<br>0, 1, 0, 0,<br>0, 0, 1, 0,<br>0, 0, 0, 1] |
**Return value** **Return value**
...@@ -170,6 +170,132 @@ struct Test { ...@@ -170,6 +170,132 @@ struct Test {
![en-us_image_0000001219744181](figures/en-us_image_0000001219744181.png) ![en-us_image_0000001219744181](figures/en-us_image_0000001219744181.png)
## matrix4.invert<sup>(deprecated)</sup>
invert(): Matrix4Transit
Inverts this matrix object.
This API is deprecated since API version 10.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Return value**
| Type | Description |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|
## matrix4.combine<sup>(deprecated)</sup>
combine(options: Matrix4Transit): Matrix4Transit
Combines the effects of two matrices to generate a new matrix object.
This API is deprecated since API version 10.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | --------------------------------- | ---- | ------------------ |
| option | [Matrix4Transit](#matrix4transit) | Yes | Matrix object to be combined.|
**Return value**
| Type | Description |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|
## matrix4.translate<sup>(deprecated)</sup>
translate(options: TranslateOption): Matrix4Transit
Translates this matrix object along the x, y, and z axes.
This API is deprecated since API version 10.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ----------------------------------- | ---- | -------------- |
| option | [TranslateOption](#translateoption) | Yes | Translation configuration.|
**Return value**
| Type | Description |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|
## matrix4.scale<sup>(deprecated)</sup>
scale(options: ScaleOption): Matrix4Transit
Scales this matrix object along the x, y, and z axes.
This API is deprecated since API version 10.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | --------------------------- | ---- | -------------- |
| option | [ScaleOption](#scaleoption) | Yes | Scaling configuration.|
**Return value**
| Type | Description |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|
## matrix4.rotate<sup>(deprecated)</sup>
rotate(options: RotateOption): Matrix4Transit
Rotates this matrix object along the x, y, and z axes.
This API is deprecated since API version 10.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ----------------------------- | ---- | -------------- |
| option | [RotateOption](#rotateoption) | Yes | Rotation configuration.|
**Return value**
| Type | Description |
| --------------------------------- | ---------------------- |
| [Matrix4Transit](#matrix4transit) | Inverse matrix object of the current matrix.|
## matrix4.transformPoint<sup>(deprecated)</sup>
transformPoint(options: [number, number]): [number, number]
Applies the current transformation effect to a coordinate point.
This API is deprecated since API version 10.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ---------------- | ---- | ------------------ |
| option | [number, number] | Yes | Point to be transformed.|
**Return value**
| Type | Description |
| ---------------- | --------------------------- |
| [number, number] | Point object after matrix transformation|
## Matrix4Transit ## Matrix4Transit
...@@ -330,7 +456,6 @@ Scales this matrix object along the x, y, and z axes. ...@@ -330,7 +456,6 @@ Scales this matrix object along the x, y, and z axes.
| ------ | --------------------------- | ---- | -------------- | | ------ | --------------------------- | ---- | -------------- |
| option | [ScaleOption](#scaleoption) | Yes | Scaling configuration.| | option | [ScaleOption](#scaleoption) | Yes | Scaling configuration.|
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -375,7 +500,6 @@ Rotates this matrix object along the x, y, and z axes. ...@@ -375,7 +500,6 @@ Rotates this matrix object along the x, y, and z axes.
| ------ | ----------------------------- | ---- | -------------- | | ------ | ----------------------------- | ---- | -------------- |
| option | [RotateOption](#rotateoption) | Yes | Rotation configuration.| | option | [RotateOption](#rotateoption) | Yes | Rotation configuration.|
**Return value** **Return value**
| Type | Description | | Type | Description |
......
...@@ -46,7 +46,7 @@ The environment configuration is as follows: ...@@ -46,7 +46,7 @@ The environment configuration is as follows:
<sn></sn> <!-- sn: device SN list. SNs are separated using semicolons (;). All local devices are used when the SN is empty. The device with the specified SN will be used if the SN is not empty. --> <sn></sn> <!-- sn: device SN list. SNs are separated using semicolons (;). All local devices are used when the SN is empty. The device with the specified SN will be used if the SN is not empty. -->
</device> </device>
<!-- L0 device configuration --> <!-- Mini-system device configuration -->
<device type="com" label="wifiiot"> <!-- type: device connection mode. com indicates the serial port connection mode. label indicates the device type, for example, wifiot. --> <device type="com" label="wifiiot"> <!-- type: device connection mode. com indicates the serial port connection mode. label indicates the device type, for example, wifiot. -->
<serial> <!-- serial: serial port definition. --> <serial> <!-- serial: serial port definition. -->
<com></com> <!-- com: serial port of the local connection, for example, COM20. --> <com></com> <!-- com: serial port of the local connection, for example, COM20. -->
...@@ -63,7 +63,7 @@ The environment configuration is as follows: ...@@ -63,7 +63,7 @@ The environment configuration is as follows:
</serial> </serial>
</device> </device>
<!-- L1 device local connection configuration --> <!-- Small-system device local connection configuration -->
<device type="com" label="ipcamera"> <device type="com" label="ipcamera">
<serial> <serial>
<com></com> <com></com>
...@@ -75,7 +75,7 @@ The environment configuration is as follows: ...@@ -75,7 +75,7 @@ The environment configuration is as follows:
</serial> </serial>
</device> </device>
<!-- L1 device remote connection configuration. Multiple connections can be configured. --> <!-- Small-system device remote connection configuration. Multiple connections can be configured. -->
<device type="com" label="ipcamera"> <device type="com" label="ipcamera">
<ip></ip> <ip></ip>
<port></port> <port></port>
...@@ -383,7 +383,7 @@ Check whether xDevice runs properly. ...@@ -383,7 +383,7 @@ Check whether xDevice runs properly.
If the AT command serial port is the same as the log output serial port, the serial ports can be set to the same port. That is, in the **user_config** file, the COM port whose **type** is **cmd** and the COM port whose **type** is **deploy** can be set to the same port, for example, **COM18**. If the AT command serial port is the same as the log output serial port, the serial ports can be set to the same port. That is, in the **user_config** file, the COM port whose **type** is **cmd** and the COM port whose **type** is **deploy** can be set to the same port, for example, **COM18**.
![L0-1](figures/L0-1.PNG) ![Mini-system-device-1](figures/L0-1.PNG)
The following is an example of the modified **user_config.xml** file: The following is an example of the modified **user_config.xml** file:
...@@ -476,7 +476,7 @@ Check whether xDevice runs properly. ...@@ -476,7 +476,7 @@ Check whether xDevice runs properly.
The COM port whose **type** is **cmd** corresponds to the AT command serial port on the board. The port is used to send commands to the device. In the example, the **ChA(COM20)** serial port is used. The COM port whose **type** is **cmd** corresponds to the AT command serial port on the board. The port is used to send commands to the device. In the example, the **ChA(COM20)** serial port is used.
![L0-1](figures/L0-1.PNG) ![small-system-device-1](figures/L0-1.PNG)
IP camera devices have two connection modes. One is to connect through the local serial port, and the other is to connect through the IP address of the local area network. IP camera devices have two connection modes. One is to connect through the local serial port, and the other is to connect through the IP address of the local area network.
......
...@@ -34,7 +34,7 @@ The following describes how to start and run the light module driver on an RK356 ...@@ -34,7 +34,7 @@ The following describes how to start and run the light module driver on an RK356
### When to Use ### When to Use
Light control is widely used in daily life. For example, a light is blinking when a mobile phone receives an SMS message or has low battery level, and a light changes its colors based on the device charging status. These actions are implemented by calling the APIs provided by the light driver model. Light control is widely used in daily life. For example, a light is blinking when a mobile device receives an SMS message or has low battery level, and a light changes its colors based on the device charging status. These actions are implemented by calling the APIs provided by the light driver model.
### Available APIs ### Available APIs
......
# Preparations<a name="EN-US_TOPIC_0000001055087693"></a> # Preparations
## Setting Up the Development Environment<a name="section1912530122716"></a> ## Setting Up the Development Environment
Download and install DevEco Studio. For details, see the [HUAWEI DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/software_install-0000001053582415). Download and configure DevEco Studio. For details, see [DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/software_install-0000001053582415).
## Creating a Project<a name="section1456035192720"></a> ## Creating a Project
1. Open the project wizard using either of the following methods: 1. Open the DevEco Studio project wizard using either of the following methods:
- If no project is open, select **Create HarmonyOS Project** on the welcome page. - If no project is open, select **Create Project** on the welcome page.
- If a project is already open, go to **File** \> **New** \> **New Project** on the menu bar. - If a project is already open, choose **File** \> **New** \> **Create Project** on the menu bar.
2. Choose the **Smart Vision** for **Device** and **Empty Feature Ability** for **Template**. 2. Select the **Empty Ability** template under **Application** and click **Next**.
![](figures/empty-feature-ability.png) ![](figures/empty-feature-ability.png)
3. Click **Next** and configure the project. 3. Enter project information by retaining the default values, and click **Finish**.
- **Project Name**: project name.
- **Package Name**: software package name. By default, this name will also be used as your application ID. Your application must have a unique ID to be released.
- **Save Location**: path for storing project files. The path cannot contain Chinese characters or spaces.
- **Compatible API Version**: compatible API version of the SDK.
4. Click **Finish**. DevEco Studio will automatically generate the sample code and resources that match your project type. Wait until the project is created. For details about the parameters, see [DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/create_new_project-0000001053342414-V3).
After the project is created, DevEco Studio automatically starts project synchronization.
# Platform Driver Porting<a name="EN-US_TOPIC_0000001154372314"></a> # Platform Driver Porting
Create a platform driver in the source code directory **//device/vendor_name/soc_name/drivers**. If there is no repository for the vendor of your SoC, contact the [device SIG](https://gitee.com/openharmony/community/blob/master/sig/sig_devboard/sig_devboard.md) to create one.
Create a platform driver in the source code directory **//device/vendor\_name/soc\_name/drivers**. If there is no repository for the vendor of your SoC, contact the [device SIG](https://gitee.com/openharmony/community/blob/master/sig/sig_devboard/sig_devboard.md) to create one.
The recommended directory structure is as follows: The recommended directory structure is as follows:
...@@ -29,13 +31,15 @@ device ...@@ -29,13 +31,15 @@ device
│ ├── board_name │ ├── board_name
``` ```
The HDF creates driver models for all platform drivers. The main task of porting platform drivers is to inject instances into the models. You can find the definitions of these models in the source code directory **//drivers/framework/support/platform/include**. The HDF creates driver models for all platform drivers. The main task of porting platform drivers is to inject instances into the models. You can find the definitions of these models in the source code directory **//drivers/hdf_core/framework/support/platform/include**.
The following uses the GPIO as an example to describe how to port the platform driver: The following uses the GPIO as an example to describe how to port the platform driver:
1. Create a GPIO driver. 1. Create a GPIO driver.
Create the **soc\_name\_gpio.c** file in the source code directory **//device/vendor\_name/soc\_name/drivers/gpio**. The sample code is as follows: Create the **soc_name_gpio.c** file in the **//device/vendor_name/soc_name/drivers/gpio** directory. The sample code is as follows:
``` ```
#include "gpio_core.h" #include "gpio_core.h"
...@@ -85,10 +89,11 @@ The following uses the GPIO as an example to describe how to port the platform d ...@@ -85,10 +89,11 @@ The following uses the GPIO as an example to describe how to port the platform d
2. Create a build entry for the vendor driver. 2. Create a build entry for the vendor driver.
As described above, **device/vendor\_name/drivers/lite.mk** is the entry for building vendor drivers. We need to start building from this entry. As described above, **device/vendor_name/drivers/lite.mk** is the entry for building vendor drivers. We need to start building from this entry.
``` ```
# File: device/vendor_name/drivers/lite.mk #File: device/vendor_name/drivers/lite.mk
SOC_VENDOR_NAME := $(subst $/",,$(LOSCFG_DEVICE_COMPANY)) SOC_VENDOR_NAME := $(subst $/",,$(LOSCFG_DEVICE_COMPANY))
SOC_NAME := $(subst $/",,$(LOSCFG_PLATFORM)) SOC_NAME := $(subst $/",,$(LOSCFG_PLATFORM))
...@@ -101,7 +106,7 @@ The following uses the GPIO as an example to describe how to port the platform d ...@@ -101,7 +106,7 @@ The following uses the GPIO as an example to describe how to port the platform d
3. Create a build entry for the SoC driver. 3. Create a build entry for the SoC driver.
``` ```
# File: device/vendor_name/soc_name/drivers/lite.mk #File: device/vendor_name/soc_name/drivers/lite.mk
SOC_DRIVER_ROOT := $(LITEOSTOPDIR)/../../device/$(SOC_VENDOR_NAME)/$(SOC_NAME)/drivers/ SOC_DRIVER_ROOT := $(LITEOSTOPDIR)/../../device/$(SOC_VENDOR_NAME)/$(SOC_NAME)/drivers/
...@@ -118,6 +123,7 @@ The following uses the GPIO as an example to describe how to port the platform d ...@@ -118,6 +123,7 @@ The following uses the GPIO as an example to describe how to port the platform d
4. Create a build entry for the GPIO driver. 4. Create a build entry for the GPIO driver.
``` ```
include $(LITEOSTOPDIR)/config.mk include $(LITEOSTOPDIR)/config.mk
include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk include $(LITEOSTOPDIR)/../../drivers/adapter/khdf/liteos/lite.mk
...@@ -131,7 +137,7 @@ The following uses the GPIO as an example to describe how to port the platform d ...@@ -131,7 +137,7 @@ The following uses the GPIO as an example to describe how to port the platform d
# Specify the file to be compiled. # Specify the file to be compiled.
LOCAL_SRCS += soc_name_gpio.c LOCAL_SRCS += soc_name_gpio.c
# Build parameters # Compiling parameters
LOCAL_CFLAGS += -fstack-protector-strong -Wextra -Wall -Werror -fsigned-char -fno-strict-aliasing -fno-common LOCAL_CFLAGS += -fstack-protector-strong -Wextra -Wall -Werror -fsigned-char -fno-strict-aliasing -fno-common
include $(HDF_DRIVER) include $(HDF_DRIVER)
...@@ -139,12 +145,14 @@ The following uses the GPIO as an example to describe how to port the platform d ...@@ -139,12 +145,14 @@ The following uses the GPIO as an example to describe how to port the platform d
5. Configure the product loading driver. 5. Configure the product loading driver.
All device information of the product is defined in the source code file **//vendor/vendor\_name/product\_name/config/device\_info/device\_info.hcs**. All device information of the product is defined in the source code file **//vendor/vendor_name/product_name/config/device_info/device_info.hcs**.
Add the platform driver to the host of the platform. Add the platform driver to the host of the platform.
>![](../public_sys-resources/icon-note.gif) **NOTE:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>The value of **moduleName** must be the same as that defined in the driver. >
> The value of **moduleName** must be the same as that defined in the driver.
``` ```
root { root {
...@@ -161,5 +169,3 @@ The following uses the GPIO as an example to describe how to port the platform d ...@@ -161,5 +169,3 @@ The following uses the GPIO as an example to describe how to port the platform d
} }
} }
``` ```
...@@ -546,13 +546,13 @@ To adapt the graphics subsystem, you need to add the `graphic_utils` component t ...@@ -546,13 +546,13 @@ To adapt the graphics subsystem, you need to add the `graphic_utils` component t
For details about `graphic` configuration, see `//vendor/bearpi/bearpi_hm_micro/graphic_config/product_graphic_lite_config.h`. For details about `graphic` configuration, see `//vendor/bearpi/bearpi_hm_micro/graphic_config/product_graphic_lite_config.h`.
#### ACE Subsystem Adaptation #### ArkUI Subsystem Adaptation
To adapt the ACE subsystem, you need to add the `ace_engine_lite` component to the `config.json` file. To adapt the ArkUI subsystem, you need to add the `ace_engine_lite` component to the `config.json` file.
``` ```
{ {
"subsystem": "ace", "subsystem": "arkui",
"components": [ "components": [
{ {
"component": "ace_engine_lite", "component": "ace_engine_lite",
......
...@@ -22,7 +22,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You ...@@ -22,7 +22,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You
1. Prepare the files to be burnt. 1. Prepare the files to be burnt.
1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\liteos** or **D:\linux**. 1. On the client platform, create a folder for storing the files to be burnt, for example, **D:\liteos** or **D:\linux**.
2. Save the burning configuration file and boot file to the new folder. 2. Save the burning configuration file and boot file to the new folder.
- For L1_LiteOS, the burning configuration file is **L1_3516_liteos.xml**, and the boot file is **[u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot)**. - For the small system with the LiteOS kernel, the burning configuration file is **L1_3516_liteos.xml**, and the boot file is **[u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot)**.
You need to prepare the **L1_3516_liteos.xml** file on your own by applying the template below: You need to prepare the **L1_3516_liteos.xml** file on your own by applying the template below:
...@@ -35,7 +35,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You ...@@ -35,7 +35,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You
<Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="60M" Length="50M" SelectFile="D:\liteos\userfs_vfat.img"/> <Part Sel="1" PartitionName="" FlashType="emmc" FileSystem="none" Start="60M" Length="50M" SelectFile="D:\liteos\userfs_vfat.img"/>
</Partition_Info> </Partition_Info>
``` ```
- For L1_Linux, the burning configuration file is **L1_3516_linux.xml**, and the boot file is **[u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot)**. - For the small system with the Linux kernel, the burning configuration file is **L1_3516_linux.xml**, and the boot file is **[u-boot-hi3516dv300.bin](https://gitee.com/openharmony/device_board_hisilicon/tree/master/hispark_taurus/uboot/out/boot)**.
You need to prepare the **L1_3516_linux.xml** file on your own by applying the template below: You need to prepare the **L1_3516_linux.xml** file on your own by applying the template below:
...@@ -53,8 +53,8 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You ...@@ -53,8 +53,8 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You
For the Hi3516 development board, the files required for burning of the mini system are as follows: For the Hi3516 development board, the files required for burning of the mini system are as follows:
- L1_LiteOS: **OHOS_Image.bin**, **rootfs_vfat.img**, and **userfs_vfat.img** - Small system with the LiteOS kernel: **OHOS_Image.bin**, **rootfs_vfat.img**, and **userfs_vfat.img**
- 1_Linux: **uImage_hi3516dv300_smp**, **rootfs_ext4.img**, **userfs_ext4.img**, and **userdata_ext4.img** - Small system with the Linux kernel: **uImage_hi3516dv300_smp**, **rootfs_ext4.img**, **userfs_ext4.img**, and **userdata_ext4.img**
2. Burn the image files using HiTool. 2. Burn the image files using HiTool.
1. Open HiTool. 1. Open HiTool.
...@@ -77,7 +77,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You ...@@ -77,7 +77,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You
If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected. If **hisilicon \#** is displayed on the terminal tool page, the serial port of the development board is connected.
3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup. 3. Copy the following startup parameters in the serial port terminal tool and press **Enter** to complete the setup.
- Startup parameters corresponding to L1_LiteOS: - Startup parameters corresponding to the small system with the LiteOS kernel:
``` ```
setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800;go 0x80000000"; setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800;go 0x80000000";
...@@ -85,7 +85,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You ...@@ -85,7 +85,7 @@ The following exemplifies how to burn an image to Hi3516DV300 using HiTool. You
saveenv saveenv
sa;reset sa;reset
``` ```
- Startup parameters corresponding to L1_Linux: - Startup parameters corresponding to small system with the Linux kernel:
``` ```
setenv bootargs "mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs),1024M(userdata)" setenv bootargs "mem=128M console=ttyAMA0,115200 root=/dev/mmcblk0p3 rw rootfstype=ext4 rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),50M(rootfs),50M(userfs),1024M(userdata)"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册