diff --git a/en/device-dev/driver/driver-platform-adc-des.md b/en/device-dev/driver/driver-platform-adc-des.md index 8e8651b245086b0a0bbd251fbf8912d21ce61952..63da8cd7e0fc7b6a6024b42e4d1e7be260ecdd4c 100644 --- a/en/device-dev/driver/driver-platform-adc-des.md +++ b/en/device-dev/driver/driver-platform-adc-des.md @@ -1,15 +1,5 @@ # ADC -- [Overview](#section1) -- [Available APIs](#section2) -- [Usage Guidelines](#section3) - - [How to Use](#section4) - - [Opening an ADC Device](#section5) - - [Obtaining the AD Conversion Result](#section6) - - [Closing an ADC Device](#section7) - -- [Example](#section8) - ## Overview - An analog-to-digital converter (ADC) is a device that converts analog signals into digital signals. diff --git a/en/device-dev/driver/driver-platform-adc-develop.md b/en/device-dev/driver/driver-platform-adc-develop.md index ac140f67d2103b95f5ca0506c70ffdca37e354d2..1a303dc429a6d19f05d652f1175ad371809c40d8 100644 --- a/en/device-dev/driver/driver-platform-adc-develop.md +++ b/en/device-dev/driver/driver-platform-adc-develop.md @@ -1,11 +1,5 @@ # ADC -- [Overview](#section268031773165048) -- [How to Develop](#section100579767165048) - - [AdcMethod](#section1618135285210) - -- [Development Example](#section1745221471165048) - ## Overview 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. @@ -13,29 +7,7 @@ The analog-to-digital converter \(ADC\) is a device that converts analog signals **Figure 1** Unified service mode ![](figures/unified-service-mode.png "ADC-unified-service-mode") -## How to Develop - -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. - -2. Configure attribute files. - - Add the **deviceNode** information to the **device\_info.hcs** file. - - \(Optional\) Add the **adc\_config.hcs** file. - -3. Instantiate the ADC controller object. - - Initialize **AdcDevice**. - - Instantiate **AdcMethod** in the **AdcDevice** object. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [AdcMethod](#section1618135285210) and [Table 1](#table1943202316536). - - -4. Debug the driver. - - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the connect operation and whether the signal collection is successful. - +## Available APIs ### AdcMethod @@ -99,6 +71,30 @@ struct AdcMethod { +## How to Develop + +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. + +2. Configure attribute files. + - Add the **deviceNode** information to the **device\_info.hcs** file. + - \(Optional\) Add the **adc\_config.hcs** file. + +3. Instantiate the ADC controller object. + - Initialize **AdcDevice**. + - Instantiate **AdcMethod** in the **AdcDevice** object. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [AdcMethod](#section1618135285210) and [Table 1](#table1943202316536). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the connect operation and whether the signal collection is successful. + + ## Development Example 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.