sysmonpsu
Vitis Drivers API Documentation
xsysmonpsu_ams_example.c File Reference

Overview

This file contains a design example using the driver functions of the System Monitor driver.

This example here shows the usage of the driver/device in single channel sequencer off mode to measure AMS block voltages.

Note

This code assumes that no Operating System is being used.

The value of the on-chip Vccint voltage is read from the device and then the alarm thresholds are set in such a manner that the alarm occurs.

MODIFICATION HISTORY:
Ver   Who    Date     Changes


1.0 mn 12/13/17 First release 2.4 mn 04/26/18 Remove usleeps from AMS CTRL example 2.5 aad 08/26/19 Added local timeout poll function for IAR compiler support 2.9 cog 07/20/23 Added support for SDT flow.

 

Functions

int SysMonPsuAMSExample (XScuGic *XScuGicInstancePtr, XSysMonPsu *SysMonInstPtr, u32 SysMonDeviceId, u16 SysMonIntrId)
 This function runs a test on the System Monitor device using the driver APIs. More...
 
int main (void)
 Main function that invokes the Single Channel Interrupt example. More...
 

Function Documentation

int main ( void  )

Main function that invokes the Single Channel Interrupt example.

Parameters
None.
Returns
  • XST_SUCCESS if the example has completed successfully.
  • XST_FAILURE if the example has failed.
Note
None.

References SysMonPsuAMSExample().

int SysMonPsuAMSExample ( XScuGic *  XScuGicInstancePtr,
XSysMonPsu SysMonInstPtr,
u32  SysMonDeviceId,
u16  SysMonIntrId 
)

This function runs a test on the System Monitor device using the driver APIs.

The function does the following tasks:

  • Initiate the System Monitor device driver instance
  • Run self-test on the device
  • Reset the device
  • Set up alarm for VCCINT
  • Set up the configuration registers for single channel continuous mode for VCCINT channel
  • Setup interrupt system
  • Enable interrupts
  • Wait until the VCCINT alarm interrupt occurs
Parameters
XScuGicInstancePtris a pointer to the Interrupt Controller driver Instance.
SysMonInstPtris a pointer to the XSysMon driver Instance.
SysMonDeviceIdis the XPAR_<SYSMON_instance>_DEVICE_ID value from xparameters.h.
SysMonIntrIdis XPAR_<SYSMON_instance>_VEC_ID value from xparameters_ps.h
Returns
  • XST_SUCCESS if the example has completed successfully.
  • XST_FAILURE if the example has failed.
Note
This function may never return if no interrupt occurs.

References XSysMonPsu_Config::BaseAddress, XSysMonPsu::Config, XSM_CH_DDRPHY_VREF, XSM_CH_RESERVE1, XSM_CH_VCC_PSDDRPLL, XSM_CH_VCC_PSLL0, XSM_CH_VCC_PSLL3, XSM_CH_VCCAUX, XSM_CH_VCCBRAM, XSM_CH_VCCINT, XSM_SEQ_MODE_SINGCHAN, XSysMonPsu_CfgInitialize(), XSysMonPsu_GetAdcData(), XSysMonPsu_IntrClear(), XSysMonPsu_IntrGetStatus(), XSYSMONPSU_ISR_1_OFFSET, XSysMonPsu_LookupConfig(), XSysMonPsu_RawToVoltage, XSysMonPsu_SelfTest(), XSysMonPsu_SetSequencerMode(), and XSysMonPsu_SetSingleChParams().

Referenced by main().