diff --git a/en/device-dev/driver/driver-platform-rtc-des.md b/en/device-dev/driver/driver-platform-rtc-des.md index b124a0cd79fd3214479a155e54a3352e970e3315..529546787b0efa2a3f01185d27a0dfc416fcc208 100644 --- a/en/device-dev/driver/driver-platform-rtc-des.md +++ b/en/device-dev/driver/driver-platform-rtc-des.md @@ -6,7 +6,7 @@ The real-time clock \(RTC\) driver provides precise real time for the operating ## Available APIs -**Table 1** APIs provided by the RTC driver +**Table 1** APIs provided by the RTC driver

Capability

@@ -95,7 +95,7 @@ The real-time clock \(RTC\) driver provides precise real time for the operating
->![](../public_sys-resources/icon-note.gif) **NOTE:** +>![](../public_sys-resources/icon-note.gif) **NOTE**
>All functions provided in this document can be called only in kernel mode. ## Usage Guidelines @@ -106,19 +106,19 @@ During the OS startup, the HDF loads the RTC driver based on the configuration f [Figure 1](#fig1610020107333) illustrates the process of using an RTC device. -**Figure 1** Process of using an RTC device +**Figure 1** Process of using an RTC device ![](figures/process-of-using-an-rtc-device.png "process-of-using-an-rtc-device") ### Creating an RTC Device Handle 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**
>Currently, only one RTC device is supported in the OS. DevHandle RtcOpen\(void\); -**Table 2** Description of RtcOpen +**Table 2** Description of RtcOpen

Parameter

@@ -165,7 +165,7 @@ You can call the following function to release the RTC device handle, thereby re void RtcClose\(DevHandle handle\); -**Table 3** Description of RtcClose +**Table 3** Description of RtcClose

Parameter

@@ -188,11 +188,11 @@ RtcClose(handle); ### Registering RtcAlarmCallback -After the OS is started, call the following function to register **RtcAlarmCallback**, which will be invoked when an alarm is generated at the specified time: +After the OS is started, call the following function to register **RtcAlarmCallback**, which will be invoked when an alarm is generated at the specified time: int32\_t RtcRegisterAlarmCallback\(DevHandle handle, enum RtcAlarmIndex alarmIndex, RtcAlarmCallback cb\); -**Table 4** Description of RtcRegisterAlarmCallback +**Table 4** Description of RtcRegisterAlarmCallback

Parameter

@@ -234,7 +234,7 @@ int32\_t RtcRegisterAlarmCallback\(DevHandle handle, enum RtcAlarmIndex alarmInd
-The following is an example of registering **RtcAlarmCallback** for processing alarm **RTC\_ALARM\_INDEX\_A**: +The following is an example of registering **RtcAlarmCallback** for processing alarm **RTC\_ALARM\_INDEX\_A**: ``` /* Register an RTC alarm callback. */ @@ -265,7 +265,7 @@ Call the following function to read time information from the RTC driver, includ int32\_t RtcReadTime\(DevHandle handle, struct RtcTime \*time\); -**Table 5** Description of RtcReadTime +**Table 5** Description of RtcReadTime

Parameter

@@ -318,7 +318,7 @@ Call the following function to set the RTC time: int32\_t RtcWriteTime\(DevHandle handle, struct RtcTime \*time\); -**Table 6** Description of RtcWriteTime +**Table 6** Description of RtcWriteTime

Parameter

@@ -354,8 +354,8 @@ int32\_t RtcWriteTime\(DevHandle handle, struct RtcTime \*time\);
->![](../public_sys-resources/icon-note.gif) **NOTE:** ->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. +>![](../public_sys-resources/icon-note.gif) **NOTE**
+>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. ``` int32_t ret; @@ -382,7 +382,7 @@ Call the following function to read the alarm time: int32\_t RtcReadAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct RtcTime \*time\); -**Table 7** Description of RtcReadAlarm +**Table 7** Description of RtcReadAlarm

Parameter

@@ -440,7 +440,7 @@ Call the following function to set the RTC alarm time based on the alarm index: int32\_t RtcWriteAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct RtcTime \*time\); -**Table 8** Description of RtcWriteAlarm +**Table 8** Description of RtcWriteAlarm

Parameter

@@ -481,8 +481,8 @@ int32\_t RtcWriteAlarm\(DevHandle handle, enum RtcAlarmIndex alarmIndex, struct
->![](../public_sys-resources/icon-note.gif) **NOTE:** ->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. +>![](../public_sys-resources/icon-note.gif) **NOTE**
+>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. ``` int32_t ret; @@ -505,11 +505,11 @@ if (ret != 0) { - Enabling or disabling alarm interrupts -Before performing alarm operations, use the following function to enable alarm interrupts, so that **RtcAlarmCallback** will be called when the alarm is not generated upon a timeout: +Before performing alarm operations, use the following function to enable alarm interrupts, so that **RtcAlarmCallback** will be called when the alarm is not generated upon a timeout: int32\_t RtcAlarmInterruptEnable\(DevHandle handle, enum RtcAlarmIndex alarmIndex, uint8\_t enable\); -**Table 9** Description of RtcAlarmInterruptEnable +**Table 9** Description of RtcAlarmInterruptEnable

Parameter

@@ -566,7 +566,7 @@ Call the following function to read the frequency of the external crystal oscill int32\_t RtcGetFreq\(DevHandle handle, uint32\_t \*freq\); -**Table 10** Description of RtcGetFreq +**Table 10** Description of RtcGetFreq

Parameter

@@ -619,7 +619,7 @@ Call the following function to set the frequency of the external crystal oscilla int32\_t RtcSetFreq\(DevHandle handle, uint32\_t freq\); -**Table 11** Description of RtcSetFreq +**Table 11** Description of RtcSetFreq

Parameter

@@ -672,7 +672,7 @@ Call the following function to perform a reset on the RTC driver \(after the res int32\_t RtcReset\(DevHandle handle\); -**Table 12** Description of RtcReset +**Table 12** Description of RtcReset

Parameter

@@ -719,7 +719,7 @@ Call the following function to read the configuration of a custom RTC register b int32\_t RtcReadReg\(DevHandle handle, uint8\_t usrDefIndex, uint8\_t \*value\); -**Table 13** Description of RtcReadReg +**Table 13** Description of RtcReadReg

Parameter

@@ -778,7 +778,7 @@ Call the following function to configure a register based on the specified regis int32\_t RtcWriteReg\(DevHandle handle, uint8\_t usrDefIndex, uint8\_t value\); -**Table 14** Description of RtcWriteReg +**Table 14** Description of RtcWriteReg

Parameter

@@ -838,7 +838,7 @@ This section describes the process of using RTC APIs: 1. During the OS startup, the HDF identifies the RTC component in the system. 2. The HDF initializes and creates the RTC device. 3. You can perform operations on the RTC device by calling different APIs. -4. Call the **RtcClose** function to release the device handle and device resources. +4. Call the **RtcClose** function to release the device handle and device resources. Example: @@ -926,5 +926,4 @@ void RtcTestSample(void) /* Release the RTC device handle. */ RtcClose(handle); } -``` - +``` \ No newline at end of file