Skip to content

Commit 5191fdc

Browse files
author
Amanda Butler
authored
Merge pull request #242 from bulislaw/pg_rtc
Add RTC HAL page to PG
2 parents ab86b64 + 02e9c22 commit 5191fdc

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

docs/contributing/rtc.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## RTC HAL API
2+
3+
The RTC HAL API provides a low-level interface to the Real Time Counter (RTC) of a target.
4+
5+
### Assumptions
6+
7+
#### Defined behavior
8+
9+
- The function `rtc_init` is safe to call repeatedly.
10+
- RTC accuracy is at least 10%.
11+
- `Init`/`free` doesn't stop RTC from counting.
12+
- Software reset doesn't stop RTC from counting.
13+
- Sleep modes don't stop RTC from counting.
14+
- Shutdown mode doesn't stop RTC from counting.
15+
16+
#### Undefined behavior
17+
18+
- Calling any function other than `rtc_init` before the initialization of the RTC.
19+
20+
#### Potential bugs
21+
22+
- Incorrect overflow handling.
23+
- Glitches due to ripple counter.
24+
25+
### Implementing the RTC API
26+
27+
RTC HAL API is in [hal/rtc_api.h](/docs/v5.4/mbed-os-api-doxy/rtc__api_8h_source.html). You need to implement the following functions to support RTC:
28+
29+
To enable sleep support in Mbed OS, you need to add the `RTC` label in the `device_has` option of the target's section in the `targets.json` file.

0 commit comments

Comments
 (0)