Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Driver Sources

The source code for the driver is included with the Vitis Unified Software Platform installation, as well as being available in the Xilinx Github repository. 

Driver Name

Path in Vitis

Path in Github

rtcpsu

<Vitis Install Directory>/data/embedded/XilinxProcessorIPLib/drivers/rtcpsu

https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/rtcpsu


Info

Note: To view the sources for a particular release, use the rel-version tag in github.  For example, for the 2020.1 release, the proper version of the code is: https://github.com/Xilinx/embeddedsw/tree/xilinx-v2020.1/XilinxProcessorIPLib/drivers/rtcpsu


The driver source code is organized into different folders. The table below shows the rtcpsu driver source organization.

DirectoryDescription
srcDriver source files
examplesExample applications that show how to use the driver features
docProvides the API and data structure details
dataDriver .tcl and .mdd file

Driver Implementation

For a full list of features supported by this IP, please refer Chapter 7: Real Time Clock in Zynqmp Trm

...

Links to Examples

Examples Path:

https://github.com/Xilinx/embeddedsw/tree/master/XilinxProcessorIPLib/drivers/rtcpsu


Test NameExample Source

Description


Alarmxrtcpsu_alarm_interrupt_example.cThis alarm example uses the XRtcPsu driver in interrupt mode. It sets alarm for a specified time from the current time.

xrtcpsu_alarm_polled_example.cThis 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.cThis 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.
secondsxrtcpsu_seconds_interrupt_example.cThis seconds example uses the XRtcPsu driver in interrupt mode.

xrtcpsu_seconds_polled_example.cThis seconds example uses the XRtcPsu driver in polled mode.
Calibrationxrtcpsu_set_calibration_example.cThis example uses the XRtcPsu driver to update the calibration register value
Set Timexrtcpsu_set_time_example.cThis example uses the XRtcPsu driver to update the current time.

Example Application Usage

RTC  Alarm examples

This alarm example uses the XRtcPsu driver in interrupt mode. It sets alarm for a specified time from the current time.

Expected Output

Code Block
xrtcpsu_alarm_interrupt_example.c
OUTPUT:
Day Convention : 0-Fri, 1-Sat, 2-Sun, 3-Mon, 4-Tue, 5-Wed, 6-Thur
Current RTC time is..
YEAR:MM:DD HR:MM:SS 	 2021:06:28 16:56:23	 Day = 3
Alarm generated.
Successfully ran RTC Alarm Polled Mode Example Test

xrtcpsu_alarm_polled_example.c
OUTPUT:
Day Convention : 0-Fri, 1-Sat, 2-Sun, 3-Mon, 4-Tue, 5-Wed, 6-Thur
Current RTC time is..
YEAR:MM:DD HR:MM:SS 	 2021:06:28 15:51:25	 Day = 3
Alarm generated.
Successfully ran RTC Alarm Polled Mode Example Test

xrtcpsu_periodic_alarm_interrupt_example.c
OUTPUT:
Day Convention : 0-Fri, 1-Sat, 2-Sun, 3-Mon, 4-Tue, 5-Wed, 6-Thur
Current RTC time is..
YEAR:MM:DD HR:MM:SS 	 2021:06:28 17:27:34	 Day = 3
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
2Sec Periodic Alarm generated.
Successfully ran RTC Periodic Alarm Interrupt Example Test

RTC  Seconds examples

This seconds example uses the XRtcPsu driver in interrupt mode.

Expected Output


Code Block
xrtcpsu_seconds_polled_example.c
OUTPUT:
Seconds value is 01.
Seconds value is 02.
Seconds value is 03.
Seconds value is 04.
Seconds value is 05.
Seconds value is 06.
Seconds value is 07.
Seconds value is 08.
Seconds value is 09.
Seconds value is 10.
Seconds feature tested.
Successfully ran RTC Seconds Polled Mode Example Test

xrtcpsu_seconds_interrupt_example.c
OUTPUT:
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
A new second is generated.
Successfully ran RTC Seconds Interrupt Example Test




RTC  Calibration examples

Expected Output

Code Block
xrtcpsu_set_calibration_example.c
OUTPUT:Enter Crystal oscillator frequency : 
Enter Internet / Network Time YEAR:MM:DD HR:MM:SS : 2021 6 28 17 39 44

Old Calibration value : 00007FFF Crystal Frequency : 00008000
New Calibration value : FFFEFFFF Crystal Frequency : 00008000
Successfully ran RTC Set Calibration Example Test


RTC  Set timeout examples

Expected Output

Code Block
xrtcpsu_set_time_example.c
OUTPUT:
Day Convention : 0-Fri, 1-Sat, 2-Sun, 3-Mon, 4-Tue, 5-Wed, 6-Thur
Last set time for RTC is..
YEAR:MM:DD HR:MM:SS 	 2049:08:31 14:11:07	 Day = 4
Current RTC time is..
YEAR:MM:DD HR:MM:SS 	 2049:09:27 02:48:07	 Day = 3
Enter Desired Current Time YEAR:MM:DD HR:MM:SS : 2021 6 28 15 50 45
Successfully ran RTC Set time Example Test


Example Design Architecture

NA


Change Log

  • 2021.2

    • None

...