rtcpsu
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Groups Pages
xrtcpsu_alarm_polled_example.c File Reference

Overview

This file contains an example using the XRtcPsu driver in polled mode.

This function sets alarm for a specified time from the current time.

Note
If the device does not work properly, the example may hang.

MODIFICATION HISTORY:

Ver   Who    Date     Changes


1.00 kvn 05/12/15 First Release 1.13 ht 06/21/23 Added support for system device-tree flow. 1.17 vlt 12/16/25 Update Doxygen comments to include SDT flow details. 1.17 ht 01/19/26 Fix the printf comment to use EPOCH time as reference.

 
#include "xparameters.h"
#include "xrtcpsu.h"
#include "xil_printf.h"

Functions

int RtcPsuAlarmPolledExample (UINTPTR BaseAddress)
 This function does a minimal Alarm test on the XRtcPsu device in polled mode. More...
 
int main (void)
 Main function to call the Rtc Alarm Polled mode example. More...
 

Function Documentation

int main ( void  )

Main function to call the Rtc Alarm Polled mode example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE
Note
None

References RtcPsuAlarmPolledExample().

int RtcPsuAlarmPolledExample ( UINTPTR  BaseAddress)

This function does a minimal Alarm test on the XRtcPsu device in polled mode.

This function sets one time alarm from the current time to a specified time.

Parameters
BaseAddresscontains the base address of the device
Returns
XST_SUCCESS if successful, XST_FAILURE if unsuccessful
Note
- In XSCT/classic flow, DeviceId is used to look up the device configuration.
  • This function polls the RTC, it may hang if the hardware is not working correctly.

References XRtcPsu_Config::BaseAddr, XRtcPsu_DT::Day, XRtcPsu_DT::Hour, XRtcPsu_DT::Min, XRtcPsu_DT::Month, XRtcPsu_DT::Sec, XRtcPsu_DT::WeekDay, XRtcPsu_CfgInitialize(), XRtcPsu_GetCurrentTime(), XRtcPsu_IsAlarmEventGenerated(), XRtcPsu_LookupConfig(), XRtcPsu_SecToDateTime(), XRtcPsu_SelfTest(), XRtcPsu_SetAlarm(), and XRtcPsu_DT::Year.

Referenced by main().