sysmonpsu: xsysmonpsu_polled_example.c File Reference

| sysmonpsu Xilinx SDK Drivers API Documentation

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

Functions
xsysmonpsu_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

This examples also assumes that there is a STDIO device in the system.

    MODIFICATION HISTORY:

    Ver   Who    Date     Changes

    1.0   kvn    12/15/15 First release
          ms     04/05/17 Modified Comment lines in functions to
                          recognize it as documentation block for doxygen
                          generation.
    2.3   ms    12/12/17 Added peripheral test support.
          mn    03/08/18 Update code to run at higher frequency and remove sleep

## Functions
int | SysMonPsuPolledPrintfExample (u16 SysMonDeviceId)
| This function runs a test on the System Monitor device using the driver APIs. More...
int | main (void)
| Main function that invokes the polled example in this file. More...

## Function Documentation

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 SysMonPsuPolledPrintfExample().

int SysMonPsuPolledPrintfExample | ( | u16 | SysMonDeviceId | ) |

This function runs a test on the System Monitor 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 the sequence registers to continuously monitor on-chip temperature, VCCINT and VCCAUX
- Setup configuration registers to start the sequence
- Read the latest on-chip temperature, VCCINT and VCCAUX

Parameters

  SysMonDeviceId | is the XPAR_<SYSMON_instance>_DEVICE_ID value from xparameters.h.

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

Note
  None

References XSysMonPsu_Config::BaseAddress, XSM_AVG_16_SAMPLES, XSM_CH_SUPPLY1, XSM_CH_SUPPLY3, XSM_CH_TEMP, XSM_MAX_SUPPLY1, XSM_MAX_SUPPLY3, XSM_MAX_TEMP, XSM_MIN_SUPPLY1, XSM_MIN_SUPPLY3, XSM_MIN_TEMP, XSM_SEQ_MODE_CONTINPASS, XSM_SEQ_MODE_SAFE, XSysMonPsu_CfgInitialize(), XSysMonPsu_GetAdcData(), XSysMonPsu_GetMinMaxMeasurement(), XSysMonPsu_IntrClear(), XSysMonPsu_IntrGetStatus(), XSysMonPsu_LookupConfig(), XSysMonPsu_RawToTemperature_OnChip, XSysMonPsu_RawToVoltage, XSysMonPsu_SelfTest(), XSysMonPsu_SetAlarmEnables(), XSysMonPsu_SetAvg(), XSysMonPsu_SetSeqAcqTime(), XSysMonPsu_SetSeqAvgEnables(), XSysMonPsu_SetSeqChEnables(), XSysMonPsu_SetSeqInputMode(), and XSysMonPsu_SetSequencerMode().

Referenced by main().