sysmon
Xilinx SDK Drivers API Documentation
xsysmon_polled_example.c File Reference

Overview

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

The example here shows the driver/device in polled mode to check the on-chip temperature and voltages.

Note

The values of the on-chip temperature and the on-chip Vccaux voltage are read from the device and then the alarm thresholds are set in such a manner that the alarms occur.

MODIFICATION HISTORY:
Ver   Who    Date     Changes

1.00a xd/sv 05/22/07 First release 2.00a sdm 09/26/08 Added code to return temperature value to the main function. TestappPeripheral prints the temperature 4.00a ktn 10/22/09 Updated the example to use macros that have been renamed to remove _m from the name of the macro. 5.03a bss 04/25/13 Modified SysMonPolledExample function to set Sequencer Mode as Safe mode instead of Single channel mode before configuring Sequencer registers. CR #703729 7.3 ms 01/23/17 Added xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028.

Functions

int SysMonPolledExample (u16 SysMonDeviceId, int *Temp)
 This function runs a test on the System Monitor/ADC device using the driver APIs. More...
 
int main (void)
 Main function that invokes the polled example in this file. More...
 

Function Documentation

◆ main()

int main ( void  )

Main function that invokes the polled example in this file.

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

References SysMonPolledExample().

◆ SysMonPolledExample()

int SysMonPolledExample ( u16  SysMonDeviceId,
int *  Temp 
)

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

This function does the following tasks:

  • Initiate the System Monitor device driver instance
  • Run self-test on the device
  • Setup alarms for on-chip temperature and VCCAUX
  • Setup the sequence registers to continuously monitor on-chip temperature and VCCAUX
  • Setup configuration registers to start the sequence
  • Read latest on-chip temperature and VCCAUX, as well as their maximum and minimum values. Also check if alarm(s) are set
Parameters
SysMonDeviceIdis the XPAR_<SYSMON_ADC_instance>_DEVICE_ID value from xparameters.h.
Tempis an output parameter, it is a pointer through which the current temperature value is returned to the main function.
Returns
  • XST_SUCCESS if the example has completed successfully.
  • XST_FAILURE if the example has failed.
Note
None

Referenced by main().