diff --git a/en/device-dev/driver/driver-platform-mmc-develop.md b/en/device-dev/driver/driver-platform-mmc-develop.md index d6a0e3f9b8953266ba611fcb3b386bfd95029997..26b6ecf7acb4ab5e9f60d9fb0d0062fa2a35ead4 100644 --- a/en/device-dev/driver/driver-platform-mmc-develop.md +++ b/en/device-dev/driver/driver-platform-mmc-develop.md @@ -1,11 +1,5 @@ # MMC -- [Overview](#section1846388309162704) -- [How to Develop](#section1617495117162704) - - [MmcCntlrOps](#section6203107192915) - -- [Development Example](#section1220893490162704) - ## Overview In the Hardware Driver Foundation \(HDF\) framework, the MultiMedia Card \(MMC\) 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. @@ -13,31 +7,9 @@ In the Hardware Driver Foundation \(HDF\) framework, the MultiMedia Card \(MMC\) **Figure 1** Independent service mode ![](figures/independent-service-mode.png "independent-service-mode") -## How to Develop - -The MMC 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 **mmc\_config.hcs** file. - -3. Instantiate the MMC controller object. - - Initialize **MmcCntlr**. - - Instantiate **MmcCntlrOps** in the **MmcCntlr** object. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [MmcCntlrOps](#section6203107192915) and [Table 1](#table99129433019). - - -4. Debug the driver. - - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the mount operation and whether the device starts successfully. - +## Available APIs -### MmcCntlrOps +MmcCntlrOps ``` struct MmcCntlrOps { @@ -219,6 +191,30 @@ struct MmcCntlrOps { +## How to Develop + +The MMC 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 **mmc\_config.hcs** file. + +3. Instantiate the MMC controller object. + - Initialize **MmcCntlr**. + - Instantiate **MmcCntlrOps** in the **MmcCntlr** object. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [MmcCntlrOps](#section6203107192915) and [Table 1](#table99129433019). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify basic functions, for example, verify the information returned after the mount operation and whether the device starts successfully. + + ## Development Example The following uses **himci.c** as an example to present the contents that need to be provided by the vendor to implement device functions. diff --git a/en/device-dev/driver/driver-platform-pwm-des.md b/en/device-dev/driver/driver-platform-pwm-des.md index 6c1e273c10eed66c2eedff8800dc89722e28b641..ca50d1809e7989eccb7ffe85c173c899ab08de59 100644 --- a/en/device-dev/driver/driver-platform-pwm-des.md +++ b/en/device-dev/driver/driver-platform-pwm-des.md @@ -1,22 +1,5 @@ # PWM -- [Overview](#section1_PWM_des) - - [PwmConfig Structure](#section1.1_PWM_des) -- [Available APIs](#section2_PWM_des) -- [Usage Guidelines](#section3_PWM_des) - - [How to Use](#section3.1_PWM_des) - - [Opening a PWM Device Handle](#section3.2_PWM_des) - - [Closing a PWM Device Handle](#section3.3_PWM_des) - - [Enabling a PWM Device](#section3.4_PWM_des) - - [Disabling a PWM Device](#section3.5_PWM_des) - - [Setting the PWM Period](#section3.6_PWM_des) - - [Setting the PWM Signal ON-State Time](#section3.7_PWM_des) - - [Setting the PWM Polarity](#section3.8_PWM_des) - - [Setting PWM Device Parameters](#section3.9_PWM_des) - - [Obtaining PWM Device Parameters](#section3.10_PWM_des) - -- [Usage Example](#section3_PWM_des) - ## Overview Pulse width modulation (PWM) is a method used to digitally encode analog signal levels and convert them into pulses. It can be used for motor control and backlight brightness adjustment. diff --git a/en/device-dev/driver/driver-platform-pwm-develop.md b/en/device-dev/driver/driver-platform-pwm-develop.md index 3dee4faaf4d9ae03db430da4a6d8ac682bef7a45..0af82ba636f135d6af1ffc027812cc18a1833179 100644 --- a/en/device-dev/driver/driver-platform-pwm-develop.md +++ b/en/device-dev/driver/driver-platform-pwm-develop.md @@ -1,11 +1,5 @@ # PWM -- [Overview](#section1591602238164144) -- [How to Develop](#section967396342164144) - - [PwmMethod](#section14560119104318) - -- [Development Example](#section1883877829164144) - ## Overview 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. @@ -13,31 +7,9 @@ In the Hardware Driver Foundation \(HDF\) framework, the Pulse Width Modulator \ **Figure 1** Independent service mode ![](figures/independent-service-mode.png "independent-service-mode-10") -## How to Develop - -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. - -2. Configure attribute files. - - Add the **deviceNode** information to the **device\_info.hcs** file. - - \(Optional\) Add the **pwm\_config.hcs** file. - -3. Instantiate the PWM controller object. - - Initialize **PwmDev**. - - Instantiate **PwmMethod** in the **PwmDev** object. - - >![](../public_sys-resources/icon-note.gif) **NOTE:** - >For details, see [PwmMethod](#section14560119104318) and [Table 1](#table11173154124311). - - -4. Debug the driver. - - \(Optional\) For new drivers, verify the basic functions, such as the PWM control status and response to interrupts. - +## Available APIs -### PwmMethod +PwmMethod ``` struct PwmMethod { @@ -91,6 +63,30 @@ struct PwmMethod { +## How to Develop + +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. + +2. Configure attribute files. + - Add the **deviceNode** information to the **device\_info.hcs** file. + - \(Optional\) Add the **pwm\_config.hcs** file. + +3. Instantiate the PWM controller object. + - Initialize **PwmDev**. + - Instantiate **PwmMethod** in the **PwmDev** object. + + >![](../public_sys-resources/icon-note.gif) **NOTE:** + >For details, see [PwmMethod](#section14560119104318) and [Table 1](#table11173154124311). + + +4. Debug the driver. + - \(Optional\) For new drivers, verify the basic functions, such as the PWM control status and response to interrupts. + + ## Development Example 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.