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

Overview

This file contains an example using the XRtcPsu driver.

This function calculates new calibration value and updates the calibration register value.

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.6 tjs 09/17/18 Fixed compilation warnings 1.8 sg 07/17/19 Update example sequence for finding new calibration values 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.

 
#include "xparameters.h"
#include "xrtcpsu.h"
#include "xil_printf.h"
#include <stdio.h>
#include "sleep.h"

Functions

int RtcPsuSetCalibrationExample (UINTPTR BaseAddress)
 This function does a minimal set Calibration test on the XRtcPsu device. More...
 
int main (void)
 Main function to call the Rtc set calibration example. More...
 

Function Documentation

int main ( void  )

Main function to call the Rtc set calibration example.

Returns
XST_SUCCESS if successful, otherwise XST_FAILURE.
Note
None

References RtcPsuSetCalibrationExample().

int RtcPsuSetCalibrationExample ( UINTPTR  BaseAddress)

This function does a minimal set Calibration test on the XRtcPsu device.

This function updates the Calibration register value.

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.

References XRtcPsu_Config::BaseAddr, XRtcPsu::CalibrationValue, XRtcPsu_DT::Day, XRtcPsu_DT::Hour, XRtcPsu_DT::Min, XRtcPsu_DT::Month, XRtcPsu::OscillatorFreq, XRtcPsu_DT::Sec, XRtcPsu_CalculateCalibration(), XRtcPsu_CfgInitialize(), XRtcPsu_DateTimeToSec(), XRtcPsu_LookupConfig(), XRtcPsu_SelfTest(), XRtcPsu_SetTime(), and XRtcPsu_DT::Year.

Referenced by main().