![]() |
rtcpsu
Vitis Drivers API Documentation
|
This file contains an 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.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00 kvn 05/12/15 First Release 1.3 kvn 05/26/16 Added volatile keyword for PeriodicAlarms variable. ms 04/10/17 Modified filename tag to include the file in doxygen examples. 1.13 ht 06/21/23 Added support for system device-tree flow. 1.15 ht 12/13/24 Fix C++ compilation warnings and errors in SDT flow. 1.17 vlt 12/16/25 Update Doxygen comments to include SDT flow details.
#include "xparameters.h"#include "xrtcpsu.h"#include "xscugic.h"#include "xil_exception.h"#include "xil_printf.h"#include "xinterrupt_wrap.h"Functions | |
| int | RtcPsuPeriodicAlarmIntrExample (XRtcPsu *RtcInstPtr, UINTPTR BaseAddress) |
| This function does a minimal test on the Rtc device and driver as a design example. More... | |
| void | Handler (void *CallBackRef, u32 Event) |
| This function is the handler which performs processing to handle interrupt events from the device. More... | |
| int | main (void) |
| Main function to call the RTC Alarm interrupt example. More... | |
| void Handler | ( | void * | CallBackRef, |
| u32 | Event | ||
| ) |
This function is the handler which performs processing to handle interrupt events from the device.
It is called from an interrupt context. so the amount of processing should be minimal.
This handler provides an example of how to handle interrupt data for the device and is application specific.
| CallBackRef | contains a callback reference from the driver, in this case it is the instance pointer for the XRtcPsu driver. |
| Event | contains the specific kind of event that has occurred. |
| int main | ( | void | ) |
Main function to call the RTC Alarm interrupt example.
References RtcPsuPeriodicAlarmIntrExample().
| int RtcPsuPeriodicAlarmIntrExample | ( | XRtcPsu * | RtcInstPtr, |
| UINTPTR | BaseAddress | ||
| ) |
This function does a minimal test on the Rtc device and driver as a design example.
The purpose of this function is to illustrate how to use periodic alarm feature in the XRtcPsu driver.
This function sets periodical alarm for specified times from the current.
| RtcInstPtr | is a pointer to the instance of the RTC driver which is going to be connected to the interrupt controller. |
| BaseAddress | contains the base address of the device |
| RtcIntrId | is the interrupt Id and is typically XPAR_<RTCPSU_instance>_INTR value from xparameters_ps.h. |
References XRtcPsu_Config::BaseAddr, XRtcPsu_DT::Day, Handler(), XRtcPsu_DT::Hour, XRtcPsu_Config::IntrId, XRtcPsu_Config::IntrParent, XRtcPsu_DT::Min, XRtcPsu_DT::Month, XRtcPsu_DT::Sec, XRtcPsu_DT::WeekDay, XRtcPsu_CfgInitialize(), XRtcPsu_ClearInterruptMask(), XRtcPsu_GetCurrentTime(), XRtcPsu_InterruptHandler(), XRtcPsu_LookupConfig(), XRtcPsu_ResetAlarm, XRtcPsu_SecToDateTime(), XRtcPsu_SelfTest(), XRtcPsu_SetAlarm(), XRtcPsu_SetHandler(), XRtcPsu_SetInterruptMask(), and XRtcPsu_DT::Year.
Referenced by main().