RTC standalone driver
Introduction
The Zynq® UltraScale+™ MPSoC real time clock (RTC) provides the real time even when the device is powered off.When the device is off, the RTC is switched to the battery power supply. A battery-backed RAM (BBRAM) is
provided for when device is operating in the battery mode. However, the RTC controller and user interface are only
Table of Contents
operational when the low-power domain supply is ON.
The RTC has an alarm function that generates an alarm at a specific time and date with a 136-year range.
The RTC also has periodic software calibration and logic to correct the static fractional inaccuracy of an oscillator.
How to enable
Source Path for the driverhttps://github.com/Xilinx/embeddedsw/commits/master/XilinxProcessorIPLib/drivers/rtcpsu
Driver source code is organized into different folders. Below diagram shows the rtcpsu driver source organization
rtcpsu
|
-- doc - Provides the API and data structure details
|
-- examples - Reference application to show how to use the driver APIs and calling sequence
|
-- src - Driver source files
Features Supported in the driver
Controller Features supported
- Maintains the real time, even when the device is off (powered-off).
- Has the capability to generate an alarm at a specific time and date.
- Includes the means for periodic software calibration of the RTC.
- Includes logic to correct the static fractional inaccuracy of the oscillator.
- Keeps track of time within a window of more than 136 years (232 seconds) from a reference point.
- Implemented as three counters.
- 16-bit tick counter creates one second based on the crystal clock.
- 4-bit fraction counter keeps track of the static crystal errors in one second that is less than one oscillator tick.
- 32-bit seconds counter holds the real time and allows on-demand reload whenever current time of the RTC is set.
- Allows wake-up at a specific second within the 136 years (32-bit alarm)
Driver Supported Features
The RTC Standalone driver support the below things.- All controller features supported.
Known Issues and Limitations
- None.
Test cases
- Refer below path for testing different examples for each feature of the IP.
https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/rtcpsu/examples
- xrtcpsu_alarm_interrupt_example.c : This alarm example uses the XRtcPsu driver in interrupt mode. It sets alarm for a specified time from the current time.
- xrtcpsu_alarm_polled_example.c : This alarm example uses the XRtcPsu driver in polled mode. It sets alarm for a specified time from the current time.
- xrtcpsu_periodic_alarm_interrupt_example.c : This periodic alarm example using the XRtcPsu driver in interrupt mode. It sets periodical alarm for specified times from the current time. For demontration purpose, a periodic alarm for future 2Secs was implemented for 10 such events.
- xrtcpsu_seconds_interrupt_example.c : This seconds example uses the XRtcPsu driver in interrupt mode.
- xrtcpsu_seconds_polled_example.c : This seconds example uses the XRtcPsu driver in polled mode.
- xrtcpsu_set_calibration_example.c : This example uses the XRtcPsu driver to update the calibration register value.
- xrtcpsu_set_time_example.c : This example uses the XRtcPsu driver to update the current time.
Change Log
2017.1
- Summary
- rtcpsu : Fixed compilation warnings
- RTCPSU : Corrected calibration and frequency macros.
- rtcpsu: Added readme.txt file to generate doxygen for examples
- Commits
- Summary
2017.2
- Summary
- rtcpsu: Modified filename tag in examples
- Commits
- d65236a : rtcpsu: Modified filename tag in examples
- Summary
2017.3
2018.1
- None
2018.2
- None
2018.3
- None
2019.1
- Summary
- rtcpsu: Fixed MISRA-C warnings
- Commits
- cd670ac: MISRA-C:No brackets to loop body
- f79d426: MISRA-C:No brackets to then/else
- e8eb02a: MISRA-C:Casting operation to a pointer
- fc917b6: MISRA-C:Array has no bounds specified
- dddc939: MISRA-C:Literal value requires a U suffix
- b37d04e: MISRA-C:Logical conjunctions need brackets
- dd928e7: MISRA-C:Pointer param should be declared pointer to const
- 405723b: Updated year and change version history
- Summary
- 2019.2
2020.1
- None
2020.2
- Summary
- rtcpsu: Update Makefile for parallel make execution
- rtcpsu: MISRA-C fixes
- Commits
- ab20b8 rtcpsu: Update Makefile for parallel make execution
- 92526b rtcpsu:MISRA-C: Remove const keyword
- ea1f2b rtcpsu: Fixed MISRAC rule 4.5 violation
- c41c38 rtcpsu: Fixed MISRAC rule 10.4 violation
- 8a0f2d rtcpsu: Fixed MISRAC rule 10.6 violation
- ac9a95 rtcpsu: Fixed MISRAC rule 10.3 violation
- f8fe2f rtcpsu: Fixed MISRAC rule 8.4 violation
- Summary