Software Drivers

xsysmon.c File Reference

#include "xsysmon.h"

Functions

int XSysMon_CfgInitialize (XSysMon *InstancePtr, XSysMon_Config *ConfigPtr, u32 EffectiveAddr)
void XSysMon_Reset (XSysMon *InstancePtr)
u32 XSysMon_GetStatus (XSysMon *InstancePtr)
u32 XSysMon_GetAlarmOutputStatus (XSysMon *InstancePtr)
void XSysMon_StartAdcConversion (XSysMon *InstancePtr)
void XSysMon_ResetAdc (XSysMon *InstancePtr)
u16 XSysMon_GetAdcData (XSysMon *InstancePtr, u8 Channel)
u16 XSysMon_GetCalibCoefficient (XSysMon *InstancePtr, u8 CoeffType)
u16 XSysMon_GetMinMaxMeasurement (XSysMon *InstancePtr, u8 MeasurementType)
void XSysMon_SetAvg (XSysMon *InstancePtr, u8 Average)
u8 XSysMon_GetAvg (XSysMon *InstancePtr)
int XSysMon_SetSingleChParams (XSysMon *InstancePtr, u8 Channel, int IncreaseAcqCycles, int IsEventMode, int IsDifferentialMode)
void XSysMon_SetAlarmEnables (XSysMon *InstancePtr, u32 AlmEnableMask)
u32 XSysMon_GetAlarmEnables (XSysMon *InstancePtr)
void XSysMon_SetCalibEnables (XSysMon *InstancePtr, u16 Calibration)
u16 XSysMon_GetCalibEnables (XSysMon *InstancePtr)
void XSysMon_SetSequencerMode (XSysMon *InstancePtr, u8 SequencerMode)
u8 XSysMon_GetSequencerMode (XSysMon *InstancePtr)
void XSysMon_SetSequencerEvent (XSysMon *InstancePtr, int IsEventMode)
void XSysMon_SetExtenalMux (XSysMon *InstancePtr, u8 Channel)
void XSysMon_SetAdcClkDivisor (XSysMon *InstancePtr, u8 Divisor)
u8 XSysMon_GetAdcClkDivisor (XSysMon *InstancePtr)
int XSysMon_SetSeqChEnables (XSysMon *InstancePtr, u64 ChEnableMask)
u64 XSysMon_GetSeqChEnables (XSysMon *InstancePtr)
int XSysMon_SetSeqAvgEnables (XSysMon *InstancePtr, u64 AvgEnableChMask)
u64 XSysMon_GetSeqAvgEnables (XSysMon *InstancePtr)
int XSysMon_SetSeqInputMode (XSysMon *InstancePtr, u32 InputModeChMask)
u32 XSysMon_GetSeqInputMode (XSysMon *InstancePtr)
int XSysMon_SetSeqAcqTime (XSysMon *InstancePtr, u32 AcqCyclesChMask)
u32 XSysMon_GetSeqAcqTime (XSysMon *InstancePtr)
void XSysMon_SetAlarmThreshold (XSysMon *InstancePtr, u8 AlarmThrReg, u16 Value)
u16 XSysMon_GetAlarmThreshold (XSysMon *InstancePtr, u8 AlarmThrReg)
void XSysMon_SetOverTemp (XSysMon *InstancePtr, u16 Value)
u16 XSysMon_GetOverTemp (XSysMon *InstancePtr)
void XSysMon_EnableUserOverTemp (XSysMon *InstancePtr)
void XSysMon_DisableUserOverTemp (XSysMon *InstancePtr)
void XSysMon_EnableTempUpdate (XSysMon *InstancePtr)
void XSysMon_DisableTempUpdate (XSysMon *InstancePtr)
void XSysMon_SetTempWaitCycles (XSysMon *InstancePtr, u16 WaitCycles)

Detailed Description

This file contains the driver API functions that can be used to access the System Monitor/ADC device.

Refer to the xsysmon.h header file for more information about this driver.

Note:
None.
 MODIFICATION HISTORY:
 Ver   Who    Date     Changes
 ----- -----  -------- -----------------------------------------------------
 1.00a xd/sv  05/22/07 First release
 2.00a sv     07/07/08 Modified the ADC data functions to return 16 bits of
						data.
 3.00a sdm    09/02/09 Added APIs for V6 SysMon.
 4.00a ktn    10/22/09 Updated the file to use the HAL processor APIs/macros.
			The macros have been renamed to remove _m from the name
			of the macro.
 5.00a sdm    06/15/11 Added support for XADC (7 Series Families).
 5.01a bss    02/28/12 Added support for Zynq.
 5.02a bss    11/23/12 Added XSysMon_EnableTempUpdate,
			XSysMon_DisableTempUpdate and XSysMon_SetTempWaitCycles
			APIs (CR #679872)
 5.03a bss    04/25/13 Modified XSysMon_SetSeqChEnables,
			XSysMon_SetSeqAvgEnables, XSysMon_SetSeqInputMode
			and XSysMon_SetSeqAcqTime APIs to check for Safe Mode
			instead of Single Channel mode. CR #703729
 7.0	bss    7/25/14  Modified XSysMon_GetAdcData,
			XSysMon_GetMinMaxMeasurement,
			XSysMon_SetSingleChParams, XSysMon_SetAlarmEnables,
			XSysMon_GetAlarmEnables,XSysMon_SetSeqChEnables,
			XSysMon_GetSeqChEnables,XSysMon_SetSeqAvgEnables,
			XSysMon_GetSeqAvgEnables,XSysMon_SetAlarmThreshold
			and XSysMon_GetAlarmThreshold to support Ultrascale
 

Function Documentation

int XSysMon_CfgInitialize ( XSysMon InstancePtr,
XSysMon_Config ConfigPtr,
u32  EffectiveAddr 
)

This function initializes a specific XSysMon device/instance. This function must be called prior to using the System Monitor/ADC device.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
ConfigPtr points to the XSysMon device configuration structure.
EffectiveAddr is the device base address in the virtual memory address space. If the address translation is not used then the physical address is passed. Unexpected errors may occur if the address mapping is changed after this function is invoked.
Returns:
  • XST_SUCCESS if successful.
Note:
The user needs to first call the XSysMon_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XSysMon_CfgInitialize() API.
void XSysMon_DisableTempUpdate ( XSysMon InstancePtr  ) 

This function disables the Temperature updation logic for TEMP_OUT port

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
None
void XSysMon_DisableUserOverTemp ( XSysMon InstancePtr  ) 

This function disables programming of the powerdown temperature for the OverTemp signal in the OT Powerdown register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
This API should be used only with V6 SysMon/7 Series and Zynq XADC since the upper threshold of OverTemp is programmable in only V6 SysMon/7 Series and Zynq XADC.
void XSysMon_EnableTempUpdate ( XSysMon InstancePtr  ) 

This function enables the Temperature updation logic so that temperature can be sent over TEMP_OUT port.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
None
void XSysMon_EnableUserOverTemp ( XSysMon InstancePtr  ) 

This function enables programming of the powerdown temperature for the OverTemp signal in the OT Powerdown register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
This API should be used only with V6/7 Series since the upper threshold of OverTemp is programmable in only V6 SysMon/7 Series and Zynq XADC.
u8 XSysMon_GetAdcClkDivisor ( XSysMon InstancePtr  ) 

The function gets the ADCCLK divisor from the Configuration Register 2.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The divisor read from the Configuration Register 2.
Note:
The ADCCLK is an internal clock used by the ADC and is synchronized to the DCLK clock. The ADCCLK is equal to DCLK divided by the user selection in the Configuration Register 2.
u16 XSysMon_GetAdcData ( XSysMon InstancePtr,
u8  Channel 
)

Get the ADC converted data for the specified channel.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Channel is the channel number. Use the XSM_CH_* defined in the file xsysmon.h. The valid channels are 0 to 5 and 16 to 31 for all the device families. Channel 6 is valid for 7 Series and Zynq. Channel 13, 14, 15 are valid for Zynq. 32 to 35 are valid for Ultrascale.
Returns:
A 16-bit value representing the ADC converted data for the specified channel. The System Monitor/ADC device guarantees a 10 bit resolution for the ADC converted data and data is the 10 MSB bits of the 16 data read from the device.
Note:
The channels 7,8,9 are used for calibration of the device and hence there is no associated data with this channel. Please make sure that the proper channel number is passed.
u32 XSysMon_GetAlarmEnables ( XSysMon InstancePtr  ) 

This function gets the status of the alarm output enables in the Configuration Register 1.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
This is the bit-mask of the enabled alarm outputs in the Configuration Register 1. Use the masks XSM_CFR_ALM_*, XSM_CFR_ALM*_* and XSM_CFR_OT_MASK defined in xsysmon_hw.h to interpret the returned value.

Bit positions of 1 indicate that the alarm output is enabled. Bit positions of 0 indicate that the alarm output is disabled.

Note:
The implementation of the alarm enables in the Configuration register 1 is such that alarms for the bit positions of 1 will be disabled and alarms for bit positions of 0 will be enabled. The enabled alarm outputs returned by this function is the negated value of the the data read from the Configuration Register 1.
u32 XSysMon_GetAlarmOutputStatus ( XSysMon InstancePtr  ) 

This function reads the contents of Alarm Output Register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
A 32-bit value read from the Alarm Output Register. Use the XSM_AOR_*_MASK constants defined in xsysmon_hw.h to interpret the value.
Note:
None.
u16 XSysMon_GetAlarmThreshold ( XSysMon InstancePtr,
u8  AlarmThrReg 
)

This function returns the contents of the specified Alarm Threshold Register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
AlarmThrReg is the index of an Alarm Threshold Register to be read. Use XSM_ATR_* constants defined in xsysmon.h to specify the index.
Returns:
A 16-bit value representing the contents of the selected Alarm Threshold Register.
Note:
Over Temperature upper threshold is programmable only in V6 and 7 Series XADC BRAM high and low voltage threshold registers are available only in 7 Series and Zynq XADC. All the remaining Alarm Threshold registers specified by the constants XSM_ATR_*, are available in all the families of the Sysmon.
u8 XSysMon_GetAvg ( XSysMon InstancePtr  ) 

This function returns the number of samples of averaging configured for all the channels in the Configuration Register 0.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The averaging read from the Configuration Register 0 is returned. Use the XSM_AVG_* bit definitions defined in xsysmon.h file to interpret the returned value :
  • XSM_AVG_0_SAMPLES means no averaging
  • XSM_AVG_16_SAMPLES means 16 samples of averaging
  • XSM_AVG_64_SAMPLES means 64 samples of averaging
  • XSM_AVG_256_SAMPLES means 256 samples of averaging
Note:
None.
u16 XSysMon_GetCalibCoefficient ( XSysMon InstancePtr,
u8  CoeffType 
)

This function gets the calibration coefficient data for the specified parameter.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
CoeffType specifies the calibration coefficient to be read. Use XSM_CALIB_* constants defined in xsysmon.h to specify the calibration coefficient to be read.
Returns:
A 16-bit value representing the calibration coefficient. The System Monitor/ADC device guarantees a 10 bit resolution for the ADC converted data and data is the 10 MSB bits of the 16 data read from the device.
Note:
None.
u16 XSysMon_GetCalibEnables ( XSysMon InstancePtr  ) 

This function reads the value of the calibration enables from the Configuration Register 1.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The value of the calibration enables in the Configuration Register 1 :
  • XSM_CFR1_CAL_ADC_OFFSET_MASK : ADC offset correction
  • XSM_CFR1_CAL_ADC_GAIN_OFFSET_MASK : ADC gain and offset correction
  • XSM_CFR1_CAL_PS_OFFSET_MASK : Power Supply sensor offset correction
  • XSM_CFR1_CAL_PS_GAIN_OFFSET_MASK : Power Supply sensor gain and offset correction
  • XSM_CFR1_CAL_DISABLE_MASK : No Calibration
Note:
None.
u16 XSysMon_GetMinMaxMeasurement ( XSysMon InstancePtr,
u8  MeasurementType 
)

This function reads the Minimum/Maximum measurement for one of the following parameters :

  • Minimum Temperature (XSM_MIN_TEMP) - All families
  • Minimum VCCINT (XSM_MIN_VCCINT) - All families
  • Minimum VCCAUX (XSM_MIN_VCCAUX) - All families
  • Maximum Temperature (XSM_MAX_TEMP) - All families
  • Maximum VCCINT (XSM_MAX_VCCINT) - All families
  • Maximum VCCAUX (XSM_MAX_VCCAUX) - All families
  • Maximum VCCBRAM (XSM_MAX_VCCBRAM) - 7 series and Zynq only
  • Minimum VCCBRAM (XSM_MIN_VCCBRAM) - 7 series and Zynq only
  • Maximum VCCPINT (XSM_MAX_VCCPINT) - Zynq only
  • Maximum VCCPAUX (XSM_MAX_VCCPAUX) - Zynq only
  • Maximum VCCPDRO (XSM_MAX_VCCPDRO) - Zynq only
  • Minimum VCCPINT (XSM_MIN_VCCPINT) - Zynq only
  • Minimum VCCPAUX (XSM_MIN_VCCPAUX) - Zynq only
  • Minimum VCCPDRO (XSM_MIN_VCCPDRO) - Zynq only
  • Maximum VUSER0 (XSM_MAX_VUSR0) - Ultrascale
  • Maximum VUSER1 (XSM_MAX_VUSR1) - Ultrascale
  • Maximum VUSER2 (XSM_MAX_VUSR2) - Ultrascale
  • Maximum VUSER3 (XSM_MAX_VUSR3) - Ultrascale
  • Minimum VUSER0 (XSM_MIN_VUSR0) - Ultrascale
  • Minimum VUSER1 (XSM_MIN_VUSR1) - Ultrascale
  • Minimum VUSER2 (XSM_MIN_VUSR2) - Ultrascale
  • Minimum VUSER3 (XSM_MIN_VUSR3) - Ultrascale
Parameters:
InstancePtr is a pointer to the XSysMon instance.
MeasurementType specifies the parameter for which the Minimum/Maximum measurement has to be read. Use XSM_MAX_* and XSM_MIN_* constants defined in xsysmon.h to specify the data to be read.
Returns:
A 16-bit value representing the maximum/minimum measurement for specified parameter. The System Monitor/ADC device guarantees a 10 bit resolution for the ADC converted data and data is the 10 MSB bits of 16 bit data read from the device.
u16 XSysMon_GetOverTemp ( XSysMon InstancePtr  ) 

This function returns the powerdown temperature of the OverTemp signal in the OT Powerdown register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
A 12-bit OT Upper Alarm Register powerdown value.
Note:
This API has been deprecated. Use XSysMon_GetAlarmThreshold(), instead. This API should be used only with V6/7 Series since the upper threshold of OverTemp is programmable in only V6 SysMon/7 Series and Zynq XADC.
u32 XSysMon_GetSeqAcqTime ( XSysMon InstancePtr  ) 

This function gets the status of acquisition from the ADC Channel Acquisition Time Sequencer Registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The acquisition time for all the channels. Use XSM_SEQ_CH__* defined in xsysmon_hw.h to interpret the Channel numbers. Bit masks of 1 are the channels for which acquisition cycles are extended and bit mask of 0 are the channels for which acquisition cycles are not extended.
Note:
None.
u64 XSysMon_GetSeqAvgEnables ( XSysMon InstancePtr  ) 

This function returns the channels for which the averaging has been enabled in the ADC Channel Averaging Enables Sequencer Registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The status of averaging (enabled/disabled) for all the channels. Use XSM_SEQ_CH__* defined in xsysmon_hw.h to interpret the Channel numbers. Bit masks of 1 are the channels for which averaging is enabled and bit mask of 0 are the channels for averaging is disabled.
Note:
None.
u64 XSysMon_GetSeqChEnables ( XSysMon InstancePtr  ) 

This function gets the channel enable bits status from the ADC Channel Selection Sequencer Registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
Gets the channel enable bits. Use XSM_SEQ_CH_* defined in xsysmon_hw.h to interpret the Channel numbers. Bit masks of 1 are the channels that are enabled and bit mask of 0 are the channels that are disabled.
None.
Note:
None.
u32 XSysMon_GetSeqInputMode ( XSysMon InstancePtr  ) 

This function gets the Analog input mode for all the channels from the ADC Channel Analog-Input Mode Sequencer Registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The input mode for all the channels. Use XSM_SEQ_CH_* defined in xsysmon_hw.h to interpret the Channel numbers. Bit masks of 1 are the channels for which input mode is differential and bit mask of 0 are the channels for which input mode is unipolar.
Note:
None.
u8 XSysMon_GetSequencerMode ( XSysMon InstancePtr  ) 

This function gets the channel sequencer mode from the Configuration Register 1.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
The channel sequencer mode :
  • XSM_SEQ_MODE_SAFE : Default safe mode
  • XSM_SEQ_MODE_ONEPASS : One pass through sequence
  • XSM_SEQ_MODE_CONTINPASS : Continuous channel sequencing
  • XSM_SEQ_MODE_SINGCHAN : Single channel/Sequencer off
  • XSM_SEQ_MODE_SIMUL : Simulataneous sampling mode
  • XSM_SEQ_MODE_INDEPENDENT : Independent mode
Note:
None.
u32 XSysMon_GetStatus ( XSysMon InstancePtr  ) 

The functions reads the contents of the Status Register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
A 32-bit value representing the contents of the Status Register. Use the XSM_SR_*_MASK constants defined in xsysmon_hw.h to interpret the returned value.
Note:
None.
void XSysMon_Reset ( XSysMon InstancePtr  ) 

This function forces the software reset of the complete SystemMonitor/ADC Hard Macro and the SYSMON ADC Core Logic.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
The Control registers in the SystemMonitor/ADC Hard Macro are not affected by this reset, only the Status registers are reset. Refer to the device data sheet for the device status and register values after the reset. Use the XSysMon_ResetAdc() to reset only the SystemMonitor/ADC Hard Macro.
void XSysMon_ResetAdc ( XSysMon InstancePtr  ) 

This function resets the SystemMonitor/ADC Hard Macro in the device.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
The Control registers in the SystemMonitor/ADC Hard Macro are not affected by this reset, only the Status registers are reset. This reset causes the ADC to begin with a new conversion. Refer to the device data sheet for the device status and register values after the reset. Use the XSysMon_Reset() API to reset both the SystemMonitor/ADC Hard Macro and the SYSMON ADC Core Logic.
void XSysMon_SetAdcClkDivisor ( XSysMon InstancePtr,
u8  Divisor 
)

The function sets the frequency of the ADCCLK by configuring the DCLK to ADCCLK ratio in the Configuration Register #2.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Divisor is clock divisor used to derive ADCCLK from DCLK. Valid values of the divisor are

  • 8 to 255 for V5 SysMon.
  • 0 to 255 for V6/7 Series and Zynq XADC. Values 0, 1, 2 are all mapped to 2. Refer to the device specification for more details.
Returns:
None.
Note:
- The ADCCLK is an internal clock used by the ADC and is synchronized to the DCLK clock. The ADCCLK is equal to DCLK divided by the user selection in the Configuration Register 2.
  • There is no Assert on the minimum value of the Divisor. Users must take care such that the minimum value of Divisor used is 8, in case of V5 SysMon.
void XSysMon_SetAlarmEnables ( XSysMon InstancePtr,
u32  AlmEnableMask 
)

This function enables the alarm outputs for the specified alarms in the Configuration Registers 1 and 3:

  • OT for Over Temperature (XSM_CFR_OT_MASK)
  • ALM0 for On board Temperature (XSM_CFR_ALM_TEMP_MASK)
  • ALM1 for VCCINT (XSM_CFR_ALM_VCCINT_MASK)
  • ALM2 for VCCAUX (XSM_CFR_ALM_VCCAUX_MASK)
  • ALM3 for VBRAM (XSM_CFR_ALM_VBRAM_MASK)for 7 Series and Zynq
  • ALM4 for VCCPINT (XSM_CFR_ALM_VCCPINT_MASK) for Zynq
  • ALM5 for VCCPAUX (XSM_CFR_ALM_VCCPAUX_MASK) for Zynq
  • ALM6 for VCCPDRO (XSM_CFR_ALM_VCCPDRO_MASK) for Zynq
  • ALM8 for VUSER0 (XSM_CFR_ALM_VUSR0_MASK) for Ultrascale
  • ALM9 for VUSER1 (XSM_CFR_ALM_VUSR1_MASK) for Ultrascale
  • ALM10 for VUSER2 (XSM_CFR_ALM_VUSR2_MASK) for Ultrascale
  • ALM11 for VUSER3 (XSM_CFR_ALM_VUSR3_MASK) for Ultrascale
Parameters:
InstancePtr is a pointer to the XSysMon instance.
AlmEnableMask is the bit-mask of the alarm outputs to be enabled in the Configuration Register 1. Bit positions of 1 will be enabled. Bit positions of 0 will be disabled. This mask is formed by OR'ing XSM_CFR_ALM_*_MASK, XSM_CFR_ALM_*_MASK and XSM_CFR_OT_MASK masks defined in xsysmon_hw.h.
Returns:
None.
Note:
The implementation of the alarm enables in the Configuration register 1 is such that the alarms for bit positions of 1 will be disabled and alarms for bit positions of 0 will be enabled. The alarm outputs specified by the AlmEnableMask are negated before writing to the Configuration Register 1.
void XSysMon_SetAlarmThreshold ( XSysMon InstancePtr,
u8  AlarmThrReg,
u16  Value 
)

This functions sets the contents of the given Alarm Threshold Register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
AlarmThrReg is the index of an Alarm Threshold Register to be set. Use XSM_ATR_* constants defined in xsysmon.h to specify the index.
Value is the 16-bit threshold value to write into the register.
Returns:
None.
Note:
Over Temperature upper threshold is programmable only in V6, 7 Series/Zynq XADC and UltraScale. BRAM high and low voltage threshold registers are available only in 7 Series XADC and UltraScale. VUSER0 to VUSER3 threshold registers are available only in UltraScale. All the remaining Alarm Threshold registers specified by the constants XSM_ATR_*, are available in all the families of the Sysmon.
void XSysMon_SetAvg ( XSysMon InstancePtr,
u8  Average 
)

This function sets the number of samples of averaging that is to be done for all the channels in both the single channel mode and sequence mode of operations.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Average is the number of samples of averaging programmed to the Configuration Register 0. Use the XSM_AVG_* definitions defined in xsysmon.h file :

  • XSM_AVG_0_SAMPLES for no averaging
  • XSM_AVG_16_SAMPLES for 16 samples of averaging
  • XSM_AVG_64_SAMPLES for 64 samples of averaging
  • XSM_AVG_256_SAMPLES for 256 samples of averaging
Returns:
None.
Note:
None.
void XSysMon_SetCalibEnables ( XSysMon InstancePtr,
u16  Calibration 
)

This function enables the specified calibration in the Configuration Register 1 :

  • XSM_CFR1_CAL_ADC_OFFSET_MASK : Calibration 0 -ADC offset correction
  • XSM_CFR1_CAL_ADC_GAIN_OFFSET_MASK : Calibration 1 -ADC gain and offset correction
  • XSM_CFR1_CAL_PS_OFFSET_MASK : Calibration 2 -Power Supply sensor offset correction
  • XSM_CFR1_CAL_PS_GAIN_OFFSET_MASK : Calibration 3 -Power Supply sensor gain and offset correction
  • XSM_CFR1_CAL_DISABLE_MASK : No Calibration
Parameters:
InstancePtr is a pointer to the XSysMon instance.
Calibration is the Calibration to be applied. Use XSM_CFR1_CAL*_* bits defined in xsysmon_hw.h. Multiple calibrations can be enabled at a time by oring the XSM_CFR1_CAL_ADC_* and XSM_CFR1_CAL_PS_* bits. Calibration can be disabled by specifying XSM_CFR1_CAL_DISABLE_MASK;
Returns:
None.
Note:
None.
void XSysMon_SetExtenalMux ( XSysMon InstancePtr,
u8  Channel 
)

The function enables the external mux and connects a channel to the mux.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Channel is the channel number used to connect to the external Mux. The valid channels are 0 to 6, 8, and 16 to 31.
Returns:
  • XST_SUCCESS if the given values were written successfully to the Configuration Register 0.
  • XST_FAILURE if the channel sequencer is enabled or the input parameters are not valid for the selected channel.
Note:
The External Mux is only available in 7 Series and Zynq XADC. This API should be used only with 7 Series and Zynq XADC.
void XSysMon_SetOverTemp ( XSysMon InstancePtr,
u16  Value 
)

This function sets the powerdown temperature for the OverTemp signal in the OT Powerdown register.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Value is the 16-bit OT Upper Alarm Register powerdown value. Valid values are 0 to 0x0FFF.
Returns:
None.
Note:
This API has been deprecated. Use XSysMon_SetAlarmThreshold(), instead. This API should be used only with V6/7 Series since the upper threshold of OverTemp is programmable in in only V6 SysMon/7 Series and Zynq XADC.
int XSysMon_SetSeqAcqTime ( XSysMon InstancePtr,
u32  AcqCyclesChMask 
)

This function sets the number of Acquisition cycles in the ADC Channel Acquisition Time Sequencer Registers. The sequencer must be in the Safe Mode before writing to these registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
AcqCyclesChMask is the bit mask of all the channels for which the number of acquisition cycles is to be extended. Use XSM_SEQ_CH__* defined in xsysmon_hw.h to specify the Channel numbers. Acquisition cycles will be extended to 10 ADCCLK cycles for bit masks of 1 and will be the default 4 ADCCLK cycles for bit masks of 0. The AcqCyclesChMask is a 32 bit mask that is written to the two 16 bit ADC Channel Acquisition Time Sequencer Registers.
Returns:
  • XST_SUCCESS if the given values were written successfully to the Channel Sequencer Registers.
  • XST_FAILURE if the channel sequencer is enabled.
Note:
None.
int XSysMon_SetSeqAvgEnables ( XSysMon InstancePtr,
u64  AvgEnableChMask 
)

This function enables the averaging for the specified channels in the ADC Channel Averaging Enable Sequencer Registers. The sequencer must be in the Safe Mode before writing to these registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
AvgEnableChMask is the bit mask of all the channels for which averaging is to be enabled. Use XSM_SEQ_CH__* defined in xsysmon_hw.h to specify the Channel numbers. Averaging will be enabled for bit masks of 1 and disabled for bit mask of 0. The AvgEnableChMask is a 64 bit mask that is written to the three 16 bit ADC Channel Averaging Enable Sequencer Registers.
Returns:
  • XST_SUCCESS if the given values were written successfully to the ADC Channel Averaging Enables Sequencer Registers.
  • XST_FAILURE if the channel sequencer is enabled.
Note:
None.
int XSysMon_SetSeqChEnables ( XSysMon InstancePtr,
u64  ChEnableMask 
)

This function enables the specified channels in the ADC Channel Selection Sequencer Registers. The sequencer must be in the Safe Mode before writing to these registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
ChEnableMask is the bit mask of all the channels to be enabled. Use XSM_SEQ_CH_* defined in xsysmon_hw.h to specify the Channel numbers. Bit masks of 1 will be enabled and bit mask of 0 will be disabled. The ChEnableMask is a 64 bit mask that is written to the three 16 bit ADC Channel Selection Sequencer Registers.
Returns:
  • XST_SUCCESS if the given values were written successfully to the ADC Channel Selection Sequencer Registers.
  • XST_FAILURE if the channel sequencer is enabled.
Note:
None.
int XSysMon_SetSeqInputMode ( XSysMon InstancePtr,
u32  InputModeChMask 
)

This function sets the Analog input mode for the specified channels in the ADC Channel Analog-Input Mode Sequencer Registers. The sequencer must be in the Safe Mode before writing to these registers.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
InputModeChMask is the bit mask of all the channels for which the input mode is differential mode. Use XSM_SEQ_CH__* defined in xsysmon_hw.h to specify the channel numbers. Differential input mode will be set for bit masks of 1 and unipolar input mode for bit masks of 0. The InputModeChMask is a 32 bit mask that is written to the two 16 bit ADC Channel Analog-Input Mode Sequencer Registers.
Returns:
  • XST_SUCCESS if the given values were written successfully to the ADC Channel Analog-Input Mode Sequencer Registers.
  • XST_FAILURE if the channel sequencer is enabled.
Note:
None.
void XSysMon_SetSequencerEvent ( XSysMon InstancePtr,
int  IsEventMode 
)

The function enables the Event mode or Continuous mode in the sequencer mode.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
IsEventMode is a boolean parameter that specifies continuous sampling (specify FALSE) or event driven sampling mode (specify TRUE) for the given channel.
Returns:
None.
Note:
The Event mode is only available in 7 Series XADC and Zynq. This API should be used only with 7 Series XADC and Zynq .
void XSysMon_SetSequencerMode ( XSysMon InstancePtr,
u8  SequencerMode 
)

This function sets the specified Channel Sequencer Mode in the Configuration Register 1 :

  • Default safe mode (XSM_SEQ_MODE_SAFE)
  • One pass through sequence (XSM_SEQ_MODE_ONEPASS)
  • Continuous channel sequencing (XSM_SEQ_MODE_CONTINPASS)
  • Single Channel/Sequencer off (XSM_SEQ_MODE_SINGCHAN)
  • Simulataneous sampling mode (XSM_SEQ_MODE_SIMUL)
  • Independent mode (XSM_SEQ_MODE_INDEPENDENT)
Parameters:
InstancePtr is a pointer to the XSysMon instance.
SequencerMode is the sequencer mode to be set. Use XSM_SEQ_MODE_* bits defined in xsysmon.h.
Returns:
None.
Note:
Only one of the modes can be enabled at a time.
int XSysMon_SetSingleChParams ( XSysMon InstancePtr,
u8  Channel,
int  IncreaseAcqCycles,
int  IsEventMode,
int  IsDifferentialMode 
)

The function sets the given parameters in the Configuration Register 0 in the single channel mode.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Channel is the channel number for conversion. The valid channels are 0 to 5, 8, and 16 to 31. Channel 6 is valid for 7 series and Zynq XADC. Channel 32 to 35 are valid for Ultrascale.
IncreaseAcqCycles is a boolean parameter which specifies whether the Acquisition time for the external channels has to be increased to 10 ADCCLK cycles (specify TRUE) or remain at the default 4 ADCCLK cycles (specify FALSE). This parameter is only valid for the external channels.
IsEventMode is a boolean parameter that specifies continuous sampling (specify FALSE) or event driven sampling mode (specify TRUE) for the given channel.
IsDifferentialMode is a boolean parameter which specifies unipolar(specify FALSE) or differential mode (specify TRUE) for the analog inputs. The input mode is only valid for the external channels.
Returns:
  • XST_SUCCESS if the given values were written successfully to the Configuration Register 0.
  • XST_FAILURE if the channel sequencer is enabled or the input parameters are not valid for the selected channel.
Note:
  • The number of samples for the averaging for all the channels is set by using the function XSysMon_SetAvg.
  • The calibration of the device is done by doing a ADC conversion on the calibration channel(channel 8). The input parameters IncreaseAcqCycles, IsDifferentialMode and IsEventMode are not valid for this channel.
void XSysMon_SetTempWaitCycles ( XSysMon InstancePtr,
u16  WaitCycles 
)

This function sets the number of Wait Cycles for Temperature updation logic

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
The default number of wait cycles are 1000(0x3E8).
void XSysMon_StartAdcConversion ( XSysMon InstancePtr  ) 

This function starts the ADC conversion in the Single Channel event driven sampling mode. The EOC bit in Status Register will be set once the conversion is finished. Refer to the device specification for more details.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
The default state of the CONVST bit is a logic 0. The conversion is started when the CONVST bit is set to 1 from 0. This bit is cleared in this function so that the next conversion can be started by setting this bit.