From db779e7f35f2a10326f8cbe23263d8337af19c2a Mon Sep 17 00:00:00 2001 From: annie_wangli Date: Wed, 23 Feb 2022 14:07:36 +0800 Subject: [PATCH] update docs Signed-off-by: annie_wangli --- .../driver/driver-platform-adc-des.md | 10 ---- .../driver/driver-platform-adc-develop.md | 54 +++++++++---------- 2 files changed, 25 insertions(+), 39 deletions(-) diff --git a/en/device-dev/driver/driver-platform-adc-des.md b/en/device-dev/driver/driver-platform-adc-des.md index 8e8651b245..63da8cd7e0 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 ac140f67d2..1a303dc429 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. -- GitLab