未验证 提交 f4ea14e4 编写于 作者: K king_he 提交者: Gitee

update en/device-dev/driver/driver-platform-pin-des.md.

Signed-off-by: Nking_he <6384784@qq.com>
上级 a76adc87
......@@ -5,12 +5,12 @@
### Pin<a name="section2"></a>
- The pin, also called pin controller, manages pin resources of system on a chip (SoC) vendors and provides the pin multiplexing function.
- The pin module defines a set of common methods for managing pins, including:
The pin module, also called pin controller, manages pin resources of system on a chip (SoC) vendors and provides the pin multiplexing function.
The module defines a set of common methods for managing pins, including:
- Obtaining or releasing the pin description handle: The kernel compares the pin name passed in with the pin names of each controller in the linked list. If a match is found, a pin description handle is obtained. After the operation on the pin is complete, the pin description handle will be released.
- Setting or obtaining the pull type of a pin: The pull type can be pull-up, pull-down, or floating.
- Setting or obtaining the pull strength of a pin: You can set the pull strength as required.
- Setting or obtaining the functions of a pin to implement pin multiplexing
- Setting or obtaining the pull type of a pin: The pull type can be pull-up, pull-down, or floating.
- Setting or obtaining the pull strength of a pin: You can set the pull strength as required.
- Setting or obtaining the functions of a pin to implement pin multiplexing
### Basic Concepts<a name="section3"></a>
Pin, as a software concept, provides APIs for uniformly managing the pins from different SoC vendors, providing the pin multiplexing function, and configuring the electrical features of pins.
......@@ -52,7 +52,7 @@ The table below describes the APIs of the pin module. For more details, see API
**Table 1** Pin driver APIs
<a name="table1"></a>
| **API** | **Description** |
| **API** | **Description** |
| ------------------------------------------------------------ | ---------------- |
| DevHandle PinGet(const char *pinName); | Obtains the pin description handle.|
| void PinPut(DevHandle handle); | Releases the pin description handle.|
......@@ -88,7 +88,7 @@ DevHandle PinGet(const char *pinName);
| Parameter | Description |
| ---------- | ----------------------- |
| pinName | Pointer to the pin name. |
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| NULL | Failed to obtain the pin description handle.|
| handle | Pin description handle obtained. |
......@@ -120,7 +120,7 @@ int32_t PinSetPull(DevHandle handle, enum PinPullType pullType);
| ---------- | ----------------------- |
| handle | Pin description handle. |
| pullType | Pull type to set. |
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| 0 | The operation is successful.|
| Negative value | The operation fails.|
......@@ -154,7 +154,7 @@ int32_t PinGetPull(DevHandle handle, enum PinPullType *pullType);
| ---------- | ------------------------- |
| handle | Pin description handle. |
| pullType | Pointer to the pull type obtained.|
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
| Negative value | The operation fails. |
......@@ -187,7 +187,7 @@ int32_t PinSetStrength(DevHandle handle, uint32_t strength);
| ---------- | ----------------------- |
| handle | Pin description handle. |
| strength | Pull strength to set. |
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| 0 | The operation is successful.|
| Negative value | The operation fails.|
......@@ -221,7 +221,7 @@ int32_t PinGetStrength(DevHandle handle, uint32_t *strength);
| ---------- | ------------------------- |
| handle | Pin description handle. |
| strength | Pointer to the pull strength obtained.|
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
| Negative value | The operation fails. |
......@@ -256,7 +256,7 @@ int32_t PinSetFunc(DevHandle handle, const char *funcName);
| ---------- | ------------------- |
| handle | Pin description handle. |
| funcName | Pointer to the pin function to set. |
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| 0 | The operation is successful.|
| Negative value | The operation fails.|
......@@ -289,7 +289,7 @@ int32_t PinGetFunc(DevHandle handle, const char **funcName);
| ---------- | --------------------- |
| handle | Pin description handle. |
| funcName | Pointer to the function name obtained.|
| **Return Value**| **Description** |
| **Return Value**| **Description** |
| 0 | The operation is successful. |
| Negative value | The operation fails. |
......@@ -406,4 +406,4 @@ ERR:
/* Release the pin description handle. */
PinPut(handle);
return ret;
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册