未验证 提交 2b70f792 编写于 作者: O openharmony_ci 提交者: Gitee

!4012 【OpenHarmony开源贡献者计划2022】pin, regulator英文相关格式及表达问题

Merge pull request !4012 from king_he/dirver-2a
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
### Pin<a name="section2"></a> ### 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, 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 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. - 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 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 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 functions of a pin to implement pin multiplexing
### Basic Concepts<a name="section3"></a> ### 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. 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.
......
...@@ -79,13 +79,10 @@ The PWM module adaptation involves the following steps: ...@@ -79,13 +79,10 @@ The PWM module adaptation involves the following steps:
- Initialize **PwmDev**. - Initialize **PwmDev**.
- Instantiate **PwmMethod** in the **PwmDev** object. - Instantiate **PwmMethod** in the **PwmDev** object.
>![](../public_sys-resources/icon-note.gif) **NOTE** For details, see [Available APIs](#available-apis).
>For details, see [Available APIs](#available-apis). 4. \(Optional\) Debug the driver.
For new drivers, verify the basic functions, such as the PWM control status and response to interrupts.
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> ## Development Example<a name="section1883877829164144"></a>
...@@ -341,6 +338,3 @@ The following uses **pwm\_hi35xx.c** as an example to present the contents tha ...@@ -341,6 +338,3 @@ The following uses **pwm\_hi35xx.c** as an example to present the contents tha
HiPwmRemove(hp); //Release HiPwm. HiPwmRemove(hp); //Release HiPwm.
} }
``` ```
\ No newline at end of file
...@@ -341,8 +341,6 @@ The regulator module adaptation procedure is as follows: ...@@ -341,8 +341,6 @@ The regulator module adaptation procedure is as follows:
} }
``` ```
4. Debug the driver. 4. (Optional) Debug the driver.
(Optional) Verify the basic functions of the new driver, for example, whether the test cases are successful after the driver is loaded.
Verify the basic functions of the new driver, for example, whether the test cases are successful after the driver is loaded.
\ No newline at end of file
...@@ -95,7 +95,7 @@ The real-time clock \(RTC\) driver provides precise real time for the operating ...@@ -95,7 +95,7 @@ The real-time clock \(RTC\) driver provides precise real time for the operating
</tbody> </tbody>
</table> </table>
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE**<br>
>All functions provided in this document can be called only in kernel mode. >All functions provided in this document can be called only in kernel mode.
## Usage Guidelines<a name="section20636145604113"></a> ## Usage Guidelines<a name="section20636145604113"></a>
...@@ -113,7 +113,7 @@ During the OS startup, the HDF loads the RTC driver based on the configuration f ...@@ -113,7 +113,7 @@ During the OS startup, the HDF loads the RTC driver based on the configuration f
After the RTC driver is loaded, you can use the API provided by the HDF and call APIs of the RTC driver. After the RTC driver is loaded, you can use the API provided by the HDF and call APIs of the RTC driver.
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE**<br>
>Currently, only one RTC device is supported in the OS. >Currently, only one RTC device is supported in the OS.
DevHandle RtcOpen\(void\); DevHandle RtcOpen\(void\);
...@@ -354,7 +354,7 @@ int32\_t RtcWriteTime\(DevHandle handle, struct RtcTime \*time\); ...@@ -354,7 +354,7 @@ int32\_t RtcWriteTime\(DevHandle handle, struct RtcTime \*time\);
</tbody> </tbody>
</table> </table>
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE**<br>
>The RTC start time is 1970/01/01 Thursday 00:00:00 \(UTC\). The maximum value of **year** must be set based on the requirements specified in the product manual of the in-use component. You do not need to configure the day of the week. >The RTC start time is 1970/01/01 Thursday 00:00:00 \(UTC\). The maximum value of **year** must be set based on the requirements specified in the product manual of the in-use component. You do not need to configure the day of the week.
``` ```
...@@ -481,7 +481,7 @@ int32\_t RtcWriteAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct ...@@ -481,7 +481,7 @@ int32\_t RtcWriteAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct
</tbody> </tbody>
</table> </table>
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE**<br>
>The RTC start time is 1970/01/01 Thursday 00:00:00 \(UTC\). The maximum value of **year** must be set based on the requirements specified in the product manual of the in-use component. You do not need to configure the day of the week. >The RTC start time is 1970/01/01 Thursday 00:00:00 \(UTC\). The maximum value of **year** must be set based on the requirements specified in the product manual of the in-use component. You do not need to configure the day of the week.
``` ```
...@@ -927,4 +927,3 @@ void RtcTestSample(void) ...@@ -927,4 +927,3 @@ void RtcTestSample(void)
RtcClose(handle); RtcClose(handle);
} }
``` ```
\ No newline at end of file
...@@ -194,13 +194,11 @@ The RTC module adaptation involves the following steps: ...@@ -194,13 +194,11 @@ The RTC module adaptation involves the following steps:
- Initialize **RtcHost**. - Initialize **RtcHost**.
- Instantiate **RtcMethod** in the **RtcHost** object. - Instantiate **RtcMethod** in the **RtcHost** object.
>![](../public_sys-resources/icon-note.gif) **NOTE** For details, see [Available APIs](#available-apis).
>For details, see [Available APIs](#available-apis). 4. \(Optional\) Debug the driver.
For new drivers, verify the basic functions, such as the RTC control status and response to interrupts.
4. Debug the driver.
- \(Optional\) For new drivers, verify the basic functions, such as the RTC control status and response to interrupts.
## Development Example<a name="section1594883301142407"></a> ## Development Example<a name="section1594883301142407"></a>
...@@ -463,6 +461,3 @@ The following uses **rtc\_hi35xx.c** as an example to present the contents tha ...@@ -463,6 +461,3 @@ The following uses **rtc\_hi35xx.c** as an example to present the contents tha
RtcHostDestroy(host); // Release RtcHost. RtcHostDestroy(host); // Release RtcHost.
} }
``` ```
\ No newline at end of file
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
## Overview<a name="section193356154511"></a> ## Overview<a name="section193356154511"></a>
- Serial Peripheral Interface \(SPI\) is a serial bus specification used for high-speed, full-duplex, and synchronous communication. Serial Peripheral Interface \(SPI\) is a serial bus specification used for high-speed, full-duplex, and synchronous communication.
- SPI is developed by Motorola. It is commonly used for communication with flash memory, real-time clocks, sensors, and analog-to-digital \(A/D\) converters. SPI is developed by Motorola. It is commonly used for communication with flash memory, real-time clocks, sensors, and analog-to-digital \(A/D\) converters.
- SPI works in controller/device mode. Generally, there is one SPI controller that controls one or more SPI devices. They are connected via four wires: SPI works in controller/device mode. Generally, there is one SPI controller that controls one or more SPI devices. They are connected via four wires:
- SCLK: clock signals output from the SPI controller - SCLK: clock signals output from the SPI controller
- MOSI: data output from the SPI controller and input into an SPI device - MOSI: data output from the SPI controller and input into an SPI device
- MISO: data output from an SPI device and input into the SPI controller - MISO: data output from an SPI device and input into the SPI controller
- CS: signals enabled by an SPI device and controlled by the SPI controller - CS: signals enabled by an SPI device and controlled by the SPI controller
- [Figure 1](#fig89085710359) shows the connection between one SPI controller and two SPI devices \(device A and device B\). In this figure, device A and device B share three pins \(SCLK, MISO, and MOSI\) of the controller. CS0 of device A and CS1 of device B are connected to CS0 and CS1 of the controller, respectively. [Figure 1](#fig89085710359) shows the connection between one SPI controller and two SPI devices \(device A and device B\). In this figure, device A and device B share three pins \(SCLK, MISO, and MOSI\) of the controller. CS0 of device A and CS1 of device B are connected to CS0 and CS1 of the controller, respectively.
**Figure 1** SPI controller/device connection<a name="fig89085710359"></a> **Figure 1** SPI controller/device connection<a name="fig89085710359"></a>
![](figures/spi-controller-device-connection.png "spi-controller-device-connection") ![](figures/spi-controller-device-connection.png "spi-controller-device-connection")
- SPI communication is usually initiated by the SPI controller and is operated as follows: SPI communication is usually initiated by the SPI controller and is operated as follows:
1. A single SPI device is selected at a time via the CS to communicate with the SPI controller. 1. A single SPI device is selected at a time via the CS to communicate with the SPI controller.
2. Clock signals are provided for the selected SPI device via the SCLK. 2. Clock signals are provided for the selected SPI device via the SCLK.
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
- Obtaining and setting SPI device configuration parameters. - Obtaining and setting SPI device configuration parameters.
>![](../public_sys-resources/icon-note.gif) **NOTE:** >![](../public_sys-resources/icon-note.gif) **NOTE**<br>
>Currently, these functions are only applicable in the communication initiated by the SPI controller. >Currently, these functions are only applicable in the communication initiated by the SPI controller.
## Available APIs<a name="section1325964832615"></a> ## Available APIs<a name="section1325964832615"></a>
...@@ -546,4 +546,3 @@ err: ...@@ -546,4 +546,3 @@ err:
SpiClose(spiHandle); SpiClose(spiHandle);
} }
``` ```
\ No newline at end of file
...@@ -102,12 +102,10 @@ The SPI module adaptation involves the following steps: ...@@ -102,12 +102,10 @@ The SPI module adaptation involves the following steps:
- Initialize **SpiCntlr**. - Initialize **SpiCntlr**.
- Instantiate **SpiCntlrMethod** in the **SpiCntlr** object. - Instantiate **SpiCntlrMethod** in the **SpiCntlr** object.
>![](../public_sys-resources/icon-note.gif) **NOTE** For details, see [Available APIs](#section752964871810).
>For details, see [Available APIs](#section752964871810). 4. \(Optional\) Debug the driver.
For new drivers, verify the basic functions, such as the SPI control status and response to interrupts.
4. Debug the driver.
- \(Optional\) For new drivers, verify the basic functions, such as the SPI control status and response to interrupts.
## Development Example<a name="section956157227152909"></a> ## Development Example<a name="section956157227152909"></a>
...@@ -442,7 +440,3 @@ The following uses **spi\_hi35xx.c** as an example to present the contents tha ...@@ -442,7 +440,3 @@ The following uses **spi\_hi35xx.c** as an example to present the contents tha
SpiCntlrDestroy(cntlr); // Release the Pl022 object. SpiCntlrDestroy(cntlr); // Release the Pl022 object.
} }
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册