sysmonpsu: xsysmonpsu_low_level_example.c File Reference

| sysmonpsu Xilinx SDK Drivers API Documentation

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

Functions
xsysmonpsu_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.0   kvn    12/15/15 First release
          mn     03/08/18 Update code to run at higher frequency

## Functions
int | SysMonPsuLowLevelExample (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 SysMonPsuLowLevelExample().

int SysMonPsuLowLevelExample | ( | 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_instance>_BASEADDRESS value from xparameters.h.

Returns
  XST_SUCCESS

Note
  None.

References XSM_AVG_16_SAMPLES, XSM_SEQ_MODE_CONTINPASS, XSM_SEQ_MODE_SAFE, XSYSMONPSU_ALRM_SUP3_LWR_OFFSET, XSYSMONPSU_ALRM_SUP3_UPR_OFFSET, XSYSMONPSU_ALRM_TEMP_UPR_OFFSET, XSYSMONPSU_CFG_REG0_OFFSET, XSYSMONPSU_CFG_REG1_OFFSET, XSYSMONPSU_ISR_0_OFFSET, XSYSMONPSU_ISR_1_OFFSET, XSYSMONPSU_MAX_SUP3_OFFSET, XSYSMONPSU_MAX_TEMP_OFFSET, XSYSMONPSU_MIN_SUP3_OFFSET, XSYSMONPSU_MIN_TEMP_OFFSET, XSysmonPsu_ReadReg, XSYSMONPSU_SEQ_ACQ1_OFFSET, XSYSMONPSU_SEQ_AVERAGE0_OFFSET, XSYSMONPSU_SEQ_AVERAGE1_OFFSET, XSYSMONPSU_SEQ_CH0_OFFSET, XSYSMONPSU_SEQ_CH1_OFFSET, XSYSMONPSU_SEQ_INPUT_MDE1_OFFSET, XSYSMONPSU_STS_FLAG_OFFSET, XSYSMONPSU_SUP3_OFFSET, XSYSMONPSU_TEMP_OFFSET, XSYSMONPSU_VP_VN_OFFSET, and XSysmonPsu_WriteReg.

Referenced by main().