| sysmon Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xsysmon_low_level_example.c File Reference

## Overview

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

The example here shows using 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 sv     07/07/08 Changed the example to read 16 bits of data from the
                    the ADC data registers.
    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.01a bss    03/13/12 Modified while loop condition to wait for EOS bit
                            to become high
    5.03a bss    04/25/13 Modified SysMonLowLevelExample 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.
    7.8   cog  07/20/23 Added support for SDT flow

## Functions
int | SysMonLowLevelExample (u32 BaseAddress)
| This function runs a test on the System Monitor device using the basic driver functions. More...
int | main (void)
| Main function that invokes the example given in this file. More...

## Function Documentation

int main | ( | void |  | ) |

Main function that invokes the example given in this file.

Parameters

  None. |

Returns
  - XST_SUCCESS if the example has completed successfully.
  - XST_FAILURE if the example has failed.

Note
  None.

References SysMonLowLevelExample().

int SysMonLowLevelExample | ( | u32 | BaseAddress | ) |

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

The function does the following tasks:

- Reset the device
- Setup alarm thresholds for on-chip temperature and VCCAUX.
- Setup 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

  BaseAddress | is the XPAR_<SYSMON_ADC_instance>_BASEADDRESS value from xparameters.h.

Returns
  XST_SUCCESS

Note
  None.

References XSM_AOR_OFFSET, XSM_AOR_TEMP_MASK, XSM_AOR_VCCAUX_MASK, XSM_ATR_TEMP_UPPER_OFFSET, XSM_ATR_VCCAUX_LOWER_OFFSET, XSM_ATR_VCCAUX_UPPER_OFFSET, XSM_CFR0_AVG16_MASK, XSM_CFR0_AVG_VALID_MASK, XSM_CFR0_OFFSET, XSM_CFR1_ALM_ALL_MASK, XSM_CFR1_ALM_TEMP_MASK, XSM_CFR1_ALM_VCCAUX_MASK, XSM_CFR1_OFFSET, XSM_CFR1_SEQ_CONTINPASS_MASK, XSM_CFR1_SEQ_SAFEMODE_MASK, XSM_CFR1_SEQ_VALID_MASK, XSM_CFR2_CD_SHIFT, XSM_CFR2_OFFSET, XSM_MAX_TEMP_OFFSET, XSM_MAX_VCCAUX_OFFSET, XSM_MIN_TEMP_OFFSET, XSM_MIN_VCCAUX_OFFSET, XSM_SEQ00_OFFSET, XSM_SEQ01_OFFSET, XSM_SEQ02_OFFSET, XSM_SEQ03_OFFSET, XSM_SEQ05_OFFSET, XSM_SEQ07_OFFSET, XSM_SEQ_CH_AUX00, XSM_SEQ_CH_AUX15, XSM_SEQ_CH_AUX_SHIFT, XSM_SEQ_CH_TEMP, XSM_SEQ_CH_VCCAUX, XSM_SR_EOS_MASK, XSM_SR_OFFSET, XSM_SRR_IPRST_MASK, XSM_SRR_OFFSET, XSM_TEMP_OFFSET, XSM_VCCAUX_OFFSET, XSysMon_ReadReg, and XSysMon_WriteReg.

Referenced by main().