提交 8b8c1e0a 编写于 作者: A annie_wangli

update docs

Signed-off-by: Nannie_wangli <annie.wangli@huawei.com>
上级 88a094cd
# MMC<a name="EN-US_TOPIC_0000001153669000"></a>
- [Overview](#section1846388309162704)
- [How to Develop](#section1617495117162704)
- [MmcCntlrOps](#section6203107192915)
- [Development Example](#section1220893490162704)
## Overview<a name="section1846388309162704"></a>
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<a name="fig19517114132810"></a>
![](figures/independent-service-mode.png "independent-service-mode")
## How to Develop<a name="section1617495117162704"></a>
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<a name="section752964871810"></a>
### MmcCntlrOps<a name="section6203107192915"></a>
MmcCntlrOps
```
struct MmcCntlrOps {
......@@ -219,6 +191,30 @@ struct MmcCntlrOps {
</tbody>
</table>
## How to Develop<a name="section1617495117162704"></a>
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<a name="section1220893490162704"></a>
The following uses **himci.c** as an example to present the contents that need to be provided by the vendor to implement device functions.
......
# PWM<a name="title_PWM_des"></a>
- [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 <a name="section1_PWM_des"></a>
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.
......
# PWM<a name="EN-US_TOPIC_0000001199714793"></a>
- [Overview](#section1591602238164144)
- [How to Develop](#section967396342164144)
- [PwmMethod](#section14560119104318)
- [Development Example](#section1883877829164144)
## 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.
......@@ -13,31 +7,9 @@ In the Hardware Driver Foundation \(HDF\) framework, the Pulse Width Modulator \
**Figure 1** Independent service mode<a name="fig983655084219"></a>
![](figures/independent-service-mode.png "independent-service-mode-10")
## How to Develop<a name="section967396342164144"></a>
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<a name="section752964871810"></a>
### PwmMethod<a name="section14560119104318"></a>
PwmMethod
```
struct PwmMethod {
......@@ -91,6 +63,30 @@ struct PwmMethod {
</tbody>
</table>
## How to Develop<a name="section967396342164144"></a>
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<a name="section1883877829164144"></a>
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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册