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

!2133 修改kernel 等链接

Merge pull request !2133 from Annie_wang/master
......@@ -16,7 +16,7 @@
- [MIPI CSI](driver-platform-mipicsi-develop.md)
- [MIPI DSI](driver-platform-mipidsi-develop.md)
- [MMC](driver-platform-mmc-develop.md)
- [PIN](driver-platform-pin-develop.md)
- [Pin](driver-platform-pin-develop.md)
- [PWM](driver-platform-pwm-develop.md)
- [Regulator](driver-platform-regulator-develop.md)
- [RTC](driver-platform-rtc-develop.md)
......
......@@ -222,6 +222,6 @@ Driver development based on the HDF involves driver implementation and driver co
> DEVICE_PRELOAD_INVALID
> } DevicePreload;
> ```
> If the **preload** field in the configuration file is set to **0** (DEVICE\_PRELOAD\_ENABLE), the driver is loaded by default during the system boot process. If **preload** is set to **1** (DEVICE\_PRELOAD\_ENABLE\_STEP2), the driver is loaded after a quick start is complete if the system supports quick start. If the system does not support quick start, the value **1** has the same meaning as DEVICE\_PRELOAD\_ENABLE. If **preload** is set to **2** (DEVICE\_PRELOAD\_DISABLE), the driver is dynamically loaded instead of being loaded during the system boot process. When a user-mode process requests the driver service (for details, see [Driver Message Mechanism Management](driver-hdf-message-managements.md)), the HDF attempts to dynamically load the driver if the driver service does not exist.
> If the **preload** field in the configuration file is set to **0** (DEVICE\_PRELOAD\_ENABLE), the driver is loaded by default during the system boot process. If **preload** is set to **1** (DEVICE\_PRELOAD\_ENABLE\_STEP2), the driver is loaded after a quick start is complete if the system supports quick start. If the system does not support quick start, the value **1** has the same meaning as DEVICE\_PRELOAD\_ENABLE. If **preload** is set to **2** (DEVICE\_PRELOAD\_DISABLE), the driver is dynamically loaded instead of being loaded during the system boot process. When a user-mode process requests the driver service (for details, see [Driver Message Mechanism Management](driver-hdf-message-management.md)), the HDF attempts to dynamically load the driver if the driver service does not exist.
>- 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.
......@@ -2,7 +2,7 @@
## Overview<a name="section268031773165048"></a>
The analog-to-digital converter \(ADC\) is a device that converts analog signals into digital signals. In the Hardware Driver Foundation \(HDF\) framework, the ADC module uses the unified service mode for API adaptation. In this mode, a device service is used as the ADC manager to handle external access requests in a unified manner, which is reflected in the configuration file. The unified service mode applies to the scenario where there are many device objects of the same type, for example, when the ADC has more than 10 controllers. If the independent service mode is used, more device nodes need to be configured and memory resources will be consumed by services.
The analog-to-digital converter \(ADC\) is a device that converts analog signals into digital signals. In the Hardware Driver Foundation \(HDF\), the ADC module uses the unified service mode for API adaptation. In this mode, a device service is used as the ADC manager to handle external access requests in a unified manner, which is reflected in the configuration file. The unified service mode applies to the scenario where there are many device objects of the same type, for example, when the ADC has more than 10 controllers. If the independent service mode is used, more device nodes need to be configured and memory resources will be consumed by services.
**Figure 1** Unified service mode<a name="fig14423182615525"></a>
![](figures/unified-service-mode.png "ADC-unified-service-mode")
......@@ -77,7 +77,7 @@ The ADC module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -87,8 +87,9 @@ The ADC module adaptation involves the following steps:
- Initialize **AdcDevice**.
- Instantiate **AdcMethod** in the **AdcDevice** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [AdcMethod](#section1618135285210) and [Table 1](#table1943202316536).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......@@ -99,13 +100,13 @@ The ADC module adaptation involves the following steps:
The following uses **adc\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exits.
- ADC driver entry reference
Many devices may connect to the ADC. In the HDF framework, a manager object needs to be created for the ADC. When a device needs to be started, the manager object locates the device based on the specified parameters.
Many devices may connect to the ADC. In the HDF, a manager object needs to be created for the ADC. When a device needs to be started, the manager object locates the device based on the specified parameters.
The driver of the ADC manager is implemented by the core layer. Vendors do not need to pay attention to the implementation of this part. However, when they implement the **Init** function, the **AdcDeviceAdd** function of the core layer must be called to implement the corresponding features.
......@@ -116,7 +117,7 @@ The following uses **adc\_hi35xx.c** as an example to present the contents tha
.Release = Hi35xxAdcRelease,
.moduleName = "hi35xx_adc_driver",// (Mandatory) This parameter must be the same as that in the .hcs file.
};
HDF_INIT(g_hi35xxAdcDriverEntry); // Call HDF_INIT to register the driver entry with the HDF framework.
HDF_INIT(g_hi35xxAdcDriverEntry); // Call HDF_INIT to register the driver entry with the HDF.
// Driver entry of the adc_core.c manager service at the core layer
struct HdfDriverEntry g_adcManagerEntry = {
......@@ -378,7 +379,7 @@ The following uses **adc\_hi35xx.c** as an example to present the contents tha
Function description:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
```
static void Hi35xxAdcRelease(struct HdfDeviceObject *device)
......
......@@ -53,8 +53,9 @@ In the HDF, the HDMI module uses the independent service mode for API adaptation
};
```
**Table 1** APIs for the members in the HdmiCntlrOps structure
**Table 1** APIs for the members in the HdmiCntlrOps structure
| Method| Input Parameter| Output Parameter| Return Value| Description|
| ------------------------ | ------------------------------------------------------------ | -------------------------------------- | ------------------ | -------------------------------------------------- |
| hardWareInit | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| –| Initializes HDMI hardware.|
......
......@@ -68,8 +68,9 @@ The I2C module adaptation involves the following steps:
- Initialize **I2cCntlr**.
- Instantiate **I2cMethod** and **I2cLockMethod** in **I2cCntlr**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [I2cMethod and I2cLockMethod](#section1683458184518) and [Table 1](#table10549174014611).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......
......@@ -116,8 +116,9 @@ The MIPI DSI module adaptation involves the following steps:
- Initialize **MipiDsiCntlr**.
- Instantiate **MipiDsiCntlrMethod** in the **MipiDsiCntlr** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [MipiDsiCntlrMethod](#section10711202141617) and [Table 1](#table218771071713).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......
......@@ -207,8 +207,9 @@ The MMC module adaptation involves the following steps:
- Initialize **MmcCntlr**.
- Instantiate **MmcCntlrOps** in the **MmcCntlr** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [MmcCntlrOps](#section6203107192915) and [Table 1](#table99129433019).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......
......@@ -55,6 +55,7 @@ The pin module adaptation involves the following steps:
- Instantiate **PinCntlrMethod** in the **PinCntlr** object.
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#section2_PINDevelop).
4. Debug the driver.
......
......@@ -2,9 +2,9 @@
## Overview<a name="section1591602238164144"></a>
In the Hardware Driver Foundation \(HDF\) framework, the Pulse Width Modulator \(PWM\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
In the Hardware Driver Foundation \(HDF\), the Pulse Width Modulator \(PWM\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
**Figure 1** Independent service mode<a name="fig983655084219"></a>
**Figure 1** Independent service mode<a name="fig983655084219"></a>
![](figures/independent-service-mode.png "independent-service-mode-10")
## Available APIs<a name="section752964871810"></a>
......@@ -69,7 +69,7 @@ The PWM module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -79,8 +79,9 @@ The PWM module adaptation involves the following steps:
- Initialize **PwmDev**.
- Instantiate **PwmMethod** in the **PwmDev** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [PwmMethod](#section14560119104318) and [Table 1](#table11173154124311).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......@@ -91,7 +92,7 @@ The PWM module adaptation involves the following steps:
The following uses **pwm\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exits.
......@@ -105,7 +106,7 @@ The following uses **pwm\_hi35xx.c** as an example to present the contents tha
.Init = HdfPwmInit,
.Release = HdfPwmRelease,
};
// Call HDF_INIT to register the driver entry with the HDF framework.
// Call HDF_INIT to register the driver entry with the HDF.
HDF_INIT(g_hdfPwm);
```
......@@ -327,7 +328,7 @@ The following uses **pwm\_hi35xx.c** as an example to present the contents tha
Function description:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources.
```
static void HdfPwmRelease(struct HdfDeviceObject *obj)
......
......@@ -65,7 +65,8 @@ The regulator module adaptation involves the following steps:
- Instantiate **RegulatorMethod**.
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#section2_REGULATORDevelop).
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
- (Optional) Verify basic functionalities of new drivers. For example, verify the information returned when the driver is loaded and whether data is successfully transmitted.
......
# RTC<a name="EN-US_TOPIC_0000001153785954"></a>
- [Overview](#section509989381142407)
- [How to Develop](#section1784450860142407)
- [RtcMethod](#section13652132473017)
- [Development Example](#section1594883301142407)
## Overview<a name="section509989381142407"></a>
In the Hardware Driver Foundation \(HDF\) framework, the real-time clock \(RTC\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDFDeviceManager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
......@@ -190,7 +184,7 @@ The RTC module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -200,8 +194,9 @@ The RTC module adaptation involves the following steps:
- Initialize **RtcHost**.
- Instantiate **RtcMethod** in the **RtcHost** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [RtcMethod](#section13652132473017) and [Table 1](#table12929217311).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......@@ -212,7 +207,7 @@ The RTC module adaptation involves the following steps:
The following uses **rtc\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exit.
......@@ -226,7 +221,7 @@ The following uses **rtc\_hi35xx.c** as an example to present the contents tha
.Release = HiRtcRelease, //See the Release function.
.moduleName = "HDF_PLATFORM_RTC", // (Mandatory) This parameter must be the same as that in the .hcs file.
};
// Call HDF_INIT to register the driver entry with the HDF framework.
// Call HDF_INIT to register the driver entry with the HDF.
HDF_INIT(g_rtcDriverEntry);
```
......@@ -450,7 +445,7 @@ The following uses **rtc\_hi35xx.c** as an example to present the contents tha
**Function description**:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** or **Bind** function has the corresponding value assignment operations.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** or **Bind** function has the corresponding value assignment operations.
```
static void HiRtcRelease(struct HdfDeviceObject *device)
......
......@@ -263,7 +263,8 @@ struct SdioDeviceOps {
</tbody>
</table>
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>![](../public_sys-resources/icon-note.gif) **NOTE**
>CommonInfo includes the following information:
>- **maxBlockNum**: specifies the maximum number of blocks in a request.
>- **maxBlockSize**: specifies the maximum number of bytes in a block.
......@@ -279,7 +280,7 @@ The SDIO module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -289,8 +290,9 @@ The SDIO module adaptation involves the following steps:
- Initialize **SdioDevice**.
- Instantiate **SdioDeviceOps** in the **SdioDevice** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [SdioDeviceOps](#section482911395315) and [Table 1](#table878215448417).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......@@ -301,7 +303,7 @@ The SDIO module adaptation involves the following steps:
The following uses **sdio\_adapter.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exit.
......@@ -315,7 +317,7 @@ The following uses **sdio\_adapter.c** as an example to present the contents t
.Release = Hi35xxLinuxSdioRelease// See the Release function.
.moduleName = "HDF_PLATFORM_SDIO",// (Mandatory) The value must be the same as that of moduleName in the .hcs file.
};
// Call HDF_INIT to register the driver entry with the HDF framework.
// Call HDF_INIT to register the driver entry with the HDF.
HDF_INIT(g_sdioDriverEntry);
```
......@@ -542,7 +544,7 @@ The following uses **sdio\_adapter.c** as an example to present the contents t
Function description:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Bind** function has the corresponding value assignment operations.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Bind** function has the corresponding value assignment operations.
```
......
......@@ -3,7 +3,7 @@
## Overview<a name="section84922229152909"></a>
In the Hardware Driver Foundation \(HDF\) framework, the Serial Peripheral Interface \(SPI\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDFDeviceManager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
In the Hardware Driver Foundation \(HDF\), the Serial Peripheral Interface \(SPI\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDFDeviceManager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
**Figure 1** Independent service mode<a name="fig666465313303"></a>
![](figures/independent-service-mode.png "SPI-independent-service-mode")
......@@ -92,7 +92,7 @@ The SPI module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -102,7 +102,8 @@ The SPI module adaptation involves the following steps:
- Initialize **SpiCntlr**.
- Instantiate **SpiCntlrMethod** in the **SpiCntlr** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#section752964871810).
4. Debug the driver.
......@@ -113,7 +114,7 @@ The SPI module adaptation involves the following steps:
The following uses **spi\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exit.
......@@ -127,7 +128,7 @@ The following uses **spi\_hi35xx.c** as an example to present the contents tha
.Init = HdfSpiDeviceInit, // See the Init function.
.Release = HdfSpiDeviceRelease, //See the Release function.
};
// Call HDF_INIT to register the driver entry with the HDF framework.
// Call HDF_INIT to register the driver entry with the HDF.
HDF_INIT(g_hdfSpiDevice);
```
......@@ -425,7 +426,7 @@ The following uses **spi\_hi35xx.c** as an example to present the contents tha
Function description:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
```
static void HdfSpiDeviceRelease(struct HdfDeviceObject *device)
......
......@@ -8,7 +8,7 @@
## Overview<a name="section1761881586154520"></a>
In the Hardware Driver Foundation \(HDF\) framework, the Universal Asynchronous Receiver/Transmitter \(UART\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
In the Hardware Driver Foundation \(HDF\), the Universal Asynchronous Receiver/Transmitter \(UART\) uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
**Figure 1** Independent service mode<a name="fig1474518243468"></a>
![](figures/independent-service-mode.png "independent-service-mode-14")
......@@ -174,7 +174,7 @@ The UART module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -184,8 +184,9 @@ The UART module adaptation involves the following steps:
- Initialize **UartHost**.
- Instantiate **UartHostMethod** in the **UartHost** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [UartHostMethod](#section192316441461) and [Table 1](#table22862114719).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......@@ -196,7 +197,7 @@ The UART module adaptation involves the following steps:
The following uses **uart\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exit.
......@@ -210,7 +211,7 @@ The following uses **uart\_hi35xx.c** as an example to present the contents th
.Init = HdfUartDeviceInit, // See the Init function.
.Release = HdfUartDeviceRelease, //See the Release function.
};
// Call HDF_INIT to register the driver entry with the HDF framework.
// Call HDF_INIT to register the driver entry with the HDF.
HDF_INIT(g_hdfUartDevice);
```
......@@ -515,7 +516,7 @@ The following uses **uart\_hi35xx.c** as an example to present the contents th
Function description:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
```
void HdfUartDeviceRelease(struct HdfDeviceObject *device)
......
......@@ -3,7 +3,7 @@
## Overview<a name="section1315827527160117"></a>
In the Hardware Driver Foundation \(HDF\) framework, the Watchdog \(also called Watchdog timer\) module uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
In the Hardware Driver Foundation \(HDF\), the Watchdog \(also called Watchdog timer\) module uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to handle external access requests. After receiving an access request from an API, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDF Device Manager can be directly used. However, you need to configure a device node for each device, which increases the memory usage.
**Figure 1** Independent service mode<a name="fig61584136211"></a>
![](figures/independent-service-mode.png "independent-service-mode-15")
......@@ -117,7 +117,7 @@ The Watchdog module adaptation involves the following steps:
1. Instantiate the driver entry.
- Instantiate the **HdfDriverEntry** structure.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework.
- Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF.
2. Configure attribute files.
- Add the **deviceNode** information to the **device\_info.hcs** file.
......@@ -127,8 +127,9 @@ The Watchdog module adaptation involves the following steps:
- Initialize **WatchdogCntlr**.
- Instantiate **WatchdogMethod** in the **WatchdogCntlr** object.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>For details, see [WatchdogMethod](#section220331929) and [Table 1](#table1370451732).
>![](../public_sys-resources/icon-note.gif) **NOTE**
>For details, see [Available APIs](#availableapis).
4. Debug the driver.
......@@ -139,7 +140,7 @@ The Watchdog module adaptation involves the following steps:
The following uses **watchdog\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke.
Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exit.
......@@ -153,7 +154,7 @@ The following uses **watchdog\_hi35xx.c** as an example to present the content
.Release = Hi35xxWatchdogRelease, //See the Release function.
.moduleName = "HDF_PLATFORM_WATCHDOG",// (Mandatory) The value must be the same as that of moduleName in the .hcs file.
};
HDF_INIT(g_watchdogDriverEntry);// Call HDF_INIT to register the driver entry with the HDF framework.
HDF_INIT(g_watchdogDriverEntry);// Call HDF_INIT to register the driver entry with the HDF.
```
2. Add the **deviceNode** information to the **device\_info.hcs** file and configure the component attributes in the **watchdog\_config.hcs** file. The **deviceNode** information is related to registration of the driver entry. The device attribute values are closely related to the default values or value ranges of the **WatchdogCntlr** members at the core layer.
......@@ -244,7 +245,7 @@ The following uses **watchdog\_hi35xx.c** as an example to present the content
Input parameters:
**HdfDeviceObject**: device object created by the HDF framework for each driver. It stores device-related private data and service APIs.
**HdfDeviceObject**: device object created by the HDF for each driver. It stores device-related private data and service APIs.
Return values:
......@@ -327,7 +328,7 @@ The following uses **watchdog\_hi35xx.c** as an example to present the content
Input parameters:
**HdfDeviceObject**: device object created by the HDF framework for each driver. It stores device-related private data and service APIs.
**HdfDeviceObject**: device object created by the HDF for each driver. It stores device-related private data and service APIs.
Return values:
......@@ -335,7 +336,7 @@ The following uses **watchdog\_hi35xx.c** as an example to present the content
Function description:
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations.
```
static void Hi35xxWatchdogRelease(struct HdfDeviceObject *device)
......
......@@ -78,9 +78,9 @@ FAQs are used to help developers solve problems frequently encountered during de
## Startup and Recovery<a name="section83501764443"></a>
- [System startup interrupted due to "parse failed!" error](faqs-startup-and-recovery.md#section835662214302)
- [System automatically restarted again and again](faqs-startup-and-recovery.md#section3857921143117)
- [Failed to call the SetParameter or GetParameter API with correct parameter values](faqs-startup-and-recovery.md#section548818116328)
- [System startup interrupted due to "parse failed!" error](faqs-startup.md#section835662214302)
- [System automatically restarted again and again](faqs-startup.md#section3857921143117)
- [Failed to call the SetParameter or GetParameter API with correct parameter values](faqs-startup.md#section548818116328)
## System Services<a name="section19567132114455"></a>
......
......@@ -22,9 +22,9 @@
- [Development Guidelines on Media Playback](subsys-multimedia-video-play-guide.md)
- [Development Guidelines on Media Recording](subsys-multimedia-video-record-guide.md)
- [Utils](subsys-utils.md)
- [Utils Overview](subsys_utils_overview.md)
- [Utils Development Guidelines](subsys_utils_guide.md)
- [Utils FAQ](subsys_utils_faqs.md)
- [Utils Overview](subsys-utils-overview.md)
- [Utils Development Guidelines](subsys-utils-guide.md)
- [Utils FAQ](subsys-utils-faqs.md)
- [AI Framework](subsys-aiframework.md)
- [AI Engine Framework](subsys-aiframework-guide.md)
- [Development Environment](subsys-aiframework-envbuild.md)
......
......@@ -30,7 +30,7 @@ The ability management framework manages running status of OpenHarmony applicati
**Figure 3** Lifecycle state transition of a Page ability<a name="fig56111543375"></a>
![](figure/图片1.png)
![](figure/fig1.png)
- **OnStart\(\)**
......
......@@ -74,7 +74,7 @@ Understanding the following concepts would be helpful for you in configuring HiS
- In the example YAML file, the event domain name is **MODULEA**. The event domain contains two events named **EVENT\_NAMEA** and **EVENT\_NAMEB**.
- **EVENT\_NAMEA** is defined as a critical event of the fault type. The event contains the **NAME1** parameter of the string type, the **NAME2** parameter of the string type, and the **NAME3** parameter of the unsigned short integer type. Therefore, you can perform [real-time subscription](subsys-dfx-hisysevent-listening.md) to the event based on the event domain **MODULEA** and event name **EVENT\_NAMEA**.
- **EVENT\_NAMEB** is defined as a general event of the statistics type. The event contains the **NAME1** parameter of the unsigned short integer type and the **NAME2** parameter of the integer type. Because two event tags named **tag1** and **tag2** are defined for **EVENT\_NAMEB** in the **\__BASE** parameter, you can perform [real-time subscription](subsys-dfx-hisysevent-read.md) to the event based on the event domain **MODULEA** and event name **EVENT\_NAMEB**, or based on the event tag.
- **EVENT\_NAMEB** is defined as a general event of the statistics type. The event contains the **NAME1** parameter of the unsigned short integer type and the **NAME2** parameter of the integer type. Because two event tags named **tag1** and **tag2** are defined for **EVENT\_NAMEB** in the **\__BASE** parameter, you can perform [real-time subscription](subsys-dfx-hisysevent-listening.md) to the event based on the event domain **MODULEA** and event name **EVENT\_NAMEB**, or based on the event tag.
```
##########################################
......
......@@ -42,7 +42,7 @@ The security level of each device in a Super Device provides the decision-making
### Constraints
The default security level of OpenHarmony devices is SL1. Device manufacturers can customize a higher security level based on service requirements. For details, see [Customizing Device Security Levels](#Customizing_Device_Security_Levels).
The default security level of OpenHarmony devices is SL1. Device manufacturers can customize a higher security level based on service requirements. For details, see [Customizing Device Security Levels](#customizingdevicesecuritylevels).
## Development Guidelines
......@@ -187,7 +187,7 @@ To ensure its integrity and non-repudiation, the security level information must
The DSLM module provides default implementation of security level information synchronization and verification. It is assumed that the security level of all OpenHarmony devices is SL1, and a loose verification scheme is used. For details, see the [source code](https://gitee.com/openharmony/security_device_security_level/tree/master/oem_property/ohos).
You can change the device security level as required. For details about the OpenHarmony device security levels, see [Basic Concepts](#Basic_Concepts). You can also use more severe verification schemes, including but are not limited to using device-specific credential, periodically downloading updated credentials from a server and strictly authenticating the issuer and validity period of the credentials, and using Trusted Execution Environment (TEE) or even Secure Element (SE) to sign credential files.
You can change the device security level as required. For details about the OpenHarmony device security levels, see [Basic Concepts](#basicconcepts). You can also use more severe verification schemes, including but are not limited to using device-specific credential, periodically downloading updated credentials from a server and strictly authenticating the issuer and validity period of the credentials, and using Trusted Execution Environment (TEE) or even Secure Element (SE) to sign credential files.
### Generating a Credential File
......
......@@ -10,4 +10,3 @@
- **[Development on Device Security Level Management](subsys-security-devicesecuritylevel.md)**
- **[Development on Key Management](subsys-security-huks.md)**
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册