Software Drivers

xsysmon.h File Reference

#include "xil_types.h"
#include "xil_assert.h"
#include "xstatus.h"
#include "xsysmon_hw.h"

Classes

struct  XSysMon_Config
struct  XSysMon

Defines

#define XSYSMON_H
#define XSM_CH_CALIBRATION   XSM_CH_ADC_CALIB
#define XSM_ATR_BRAM_UPPER   XSM_ATR_VBRAM_UPPER
#define XSM_ATR_BRAM_LOWER   XSM_ATR_VBRAM_LOWER
#define XSysMon_IsEventSamplingModeSet(InstancePtr)
#define XSysMon_IsDrpBusy(InstancePtr)
#define XSysMon_IsDrpLocked(InstancePtr)
#define XSysMon_RawToTemperature(AdcData)   ((((float)(AdcData)/65536.0f)/0.00198421639f ) - 273.15f)
#define XSysMon_RawToVoltage(AdcData)   ((((float)(AdcData))* (3.0f))/65536.0f)
#define XSysMon_TemperatureToRaw(Temperature)   ((int)(((Temperature) + 273.15f)*65536.0f*0.00198421639f))
#define XSysMon_VoltageToRaw(Voltage)   ((int)((Voltage)*65536.0f/3.0f))
Indexes for the different channels.



#define XSM_CH_TEMP   0x0
#define XSM_CH_VCCINT   0x1
#define XSM_CH_VCCAUX   0x2
#define XSM_CH_VPVN   0x3
#define XSM_CH_VREFP   0x4
#define XSM_CH_VREFN   0x5
#define XSM_CH_VBRAM   0x6
#define XSM_CH_SUPPLY_CALIB   0x07
#define XSM_CH_ADC_CALIB   0x08
#define XSM_CH_GAINERR_CALIB   0x09
#define XSM_CH_VCCPINT   0x0D
#define XSM_CH_VCCPAUX   0x0E
#define XSM_CH_VCCPDRO   0x0F
#define XSM_CH_AUX_MIN   16
#define XSM_CH_AUX_MAX   31
#define XSM_CH_VUSR0   32
#define XSM_CH_VUSR1   33
#define XSM_CH_VUSR2   34
#define XSM_CH_VUSR3   35
Indexes for reading the Calibration Coefficient Data.



#define XSM_CALIB_SUPPLY_OFFSET_COEFF   0
#define XSM_CALIB_ADC_OFFSET_COEFF   1
#define XSM_CALIB_GAIN_ERROR_COEFF   2
Indexes for reading the Minimum/Maximum Measurement Data.



#define XSM_MAX_TEMP   0
#define XSM_MAX_VCCINT   1
#define XSM_MAX_VCCAUX   2
#define XSM_MAX_VCCBRAM   3
#define XSM_MIN_TEMP   4
#define XSM_MIN_VCCINT   5
#define XSM_MIN_VCCAUX   6
#define XSM_MIN_VCCBRAM   7
#define XSM_MAX_VCCPINT   8
#define XSM_MAX_VCCPAUX   9
#define XSM_MAX_VCCPDRO   0xA
#define XSM_MIN_VCCPINT   0xC
#define XSM_MIN_VCCPAUX   0xD
#define XSM_MIN_VCCPDRO   0xE
#define XSM_MAX_VUSR0   0x80
#define XSM_MAX_VUSR1   0x81
#define XSM_MAX_VUSR2   0x82
#define XSM_MAX_VUSR3   0x83
#define XSM_MIN_VUSR0   0x88
#define XSM_MIN_VUSR1   0x89
#define XSM_MIN_VUSR2   0x8A
#define XSM_MIN_VUSR3   0x8B
Alarm Threshold(Limit) Register (ATR) indexes.



#define XSM_ATR_TEMP_UPPER   0
#define XSM_ATR_VCCINT_UPPER   1
#define XSM_ATR_VCCAUX_UPPER   2
#define XSM_ATR_OT_UPPER   3
#define XSM_ATR_TEMP_LOWER   4
#define XSM_ATR_VCCINT_LOWER   5
#define XSM_ATR_VCCAUX_LOWER   6
#define XSM_ATR_OT_LOWER   7
#define XSM_ATR_VBRAM_UPPER   8
#define XSM_ATR_VCCPINT_UPPER   9
#define XSM_ATR_VCCPAUX_UPPER   0xA
#define XSM_ATR_VCCPDRO_UPPER   0xB
#define XSM_ATR_VBRAM_LOWER   0xC
#define XSM_ATR_VCCPINT_LOWER   0xD
#define XSM_ATR_VCCPAUX_LOWER   0xE
#define XSM_ATR_VCCPDRO_LOWER   0xF
#define XSM_ATR_VUSR0_UPPER   0x10
#define XSM_ATR_VUSR1_UPPER   0x11
#define XSM_ATR_VUSR2_UPPER   0x12
#define XSM_ATR_VUSR3_UPPER   0x13
#define XSM_ATR_VUSR0_LOWER   0x18
#define XSM_ATR_VUSR1_LOWER   0x19
#define XSM_ATR_VUSR2_LOWER   0x1A
#define XSM_ATR_VUSR3_LOWER   0x1B
Averaging to be done for the channels.



#define XSM_AVG_0_SAMPLES   0
#define XSM_AVG_16_SAMPLES   1
#define XSM_AVG_64_SAMPLES   2
#define XSM_AVG_256_SAMPLES   3
Channel Sequencer Modes of operation.



#define XSM_SEQ_MODE_SAFE   0
#define XSM_SEQ_MODE_ONEPASS   1
#define XSM_SEQ_MODE_CONTINPASS   2
#define XSM_SEQ_MODE_SINGCHAN   3
#define XSM_SEQ_MODE_SIMUL   4
#define XSM_SEQ_MODE_INDEPENDENT   8

Functions

XSysMon_ConfigXSysMon_LookupConfig (u16 DeviceId)
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)
int XSysMon_SelfTest (XSysMon *InstancePtr)
void XSysMon_IntrGlobalEnable (XSysMon *InstancePtr)
void XSysMon_IntrGlobalDisable (XSysMon *InstancePtr)
void XSysMon_IntrEnable (XSysMon *InstancePtr, u32 Mask)
void XSysMon_IntrDisable (XSysMon *InstancePtr, u32 Mask)
u32 XSysMon_IntrGetEnabled (XSysMon *InstancePtr)
u32 XSysMon_IntrGetStatus (XSysMon *InstancePtr)
void XSysMon_IntrClear (XSysMon *InstancePtr, u32 Mask)

Detailed Description


Define Documentation

#define XSM_ATR_BRAM_LOWER   XSM_ATR_VBRAM_LOWER
#define XSM_ATR_BRAM_UPPER   XSM_ATR_VBRAM_UPPER
#define XSM_ATR_OT_LOWER   7

Lower Over Temperature limit

#define XSM_ATR_OT_UPPER   3

Lower Over Temperature limit

#define XSM_ATR_TEMP_LOWER   4

Low user Temperature

#define XSM_ATR_TEMP_UPPER   0

High user Temperature

#define XSM_ATR_VBRAM_LOWER   0xC

VRBAM Lower Alarm, 7 Series and Zynq

#define XSM_ATR_VBRAM_UPPER   8

VBRAM high voltage limit

#define XSM_ATR_VCCAUX_LOWER   6

VCCAUX low voltage limit

#define XSM_ATR_VCCAUX_UPPER   2

VCCAUX high voltage limit

#define XSM_ATR_VCCINT_LOWER   5

VCCINT low voltage limit

#define XSM_ATR_VCCINT_UPPER   1

VCCINT high voltage limit

#define XSM_ATR_VCCPAUX_LOWER   0xE

VCCPAUX Lower Alarm, Zynq

#define XSM_ATR_VCCPAUX_UPPER   0xA

VCCPAUX Upper Alarm, Zynq

#define XSM_ATR_VCCPDRO_LOWER   0xF

VCCPDRO Lower Alarm, Zynq

#define XSM_ATR_VCCPDRO_UPPER   0xB

VCCPDRO Upper Alarm, Zynq

#define XSM_ATR_VCCPINT_LOWER   0xD

VCCPINT Lower Alarm, Zynq

#define XSM_ATR_VCCPINT_UPPER   9

VCCPINT Upper Alarm, Zynq

#define XSM_ATR_VUSR0_LOWER   0x18

VUSER0 Lower Alarm, Ultrascale

#define XSM_ATR_VUSR0_UPPER   0x10

VUSER0 Upper Alarm, Ultrascale

#define XSM_ATR_VUSR1_LOWER   0x19

VUSER1 Lower Alarm, Ultrascale

#define XSM_ATR_VUSR1_UPPER   0x11

VUSER1 Upper Alarm, Ultrascale

#define XSM_ATR_VUSR2_LOWER   0x1A

VUSER2 Lower Alarm, Ultrascale

#define XSM_ATR_VUSR2_UPPER   0x12

VUSER2 Upper Alarm, Ultrascale

#define XSM_ATR_VUSR3_LOWER   0x1B

VUSER3 Lower Alarm, Ultrascale

#define XSM_ATR_VUSR3_UPPER   0x13

VUSER3 Upper Alarm, Ultrascale

#define XSM_AVG_0_SAMPLES   0

No Averaging

#define XSM_AVG_16_SAMPLES   1

Average 16 samples

#define XSM_AVG_256_SAMPLES   3

Average 256 samples

#define XSM_AVG_64_SAMPLES   2

Average 64 samples

#define XSM_CALIB_ADC_OFFSET_COEFF   1

ADC Offset Calib Coefficient

#define XSM_CALIB_GAIN_ERROR_COEFF   2

Gain Error Calib Coefficient

#define XSM_CALIB_SUPPLY_OFFSET_COEFF   0

Supply Offset Calib Coefficient

#define XSM_CH_ADC_CALIB   0x08

ADC Offset Channel Reg

#define XSM_CH_AUX_MAX   31

Channel number for Last Aux channel

#define XSM_CH_AUX_MIN   16

Channel number for 1st Aux Channel

#define XSM_CH_CALIBRATION   XSM_CH_ADC_CALIB
#define XSM_CH_GAINERR_CALIB   0x09

Gain Error Channel Reg

#define XSM_CH_SUPPLY_CALIB   0x07

Supply Calib Data Reg

#define XSM_CH_TEMP   0x0

On Chip Temperature

#define XSM_CH_VBRAM   0x6

VBRAM - 7 Series and Zynq

#define XSM_CH_VCCAUX   0x2

VCCAUX

#define XSM_CH_VCCINT   0x1

VCCINT

#define XSM_CH_VCCPAUX   0x0E

On-chip PS VCCPAUX Channel, Zynq

#define XSM_CH_VCCPDRO   0x0F

On-chip PS VCCPDRO Channel, Zynq

#define XSM_CH_VCCPINT   0x0D

On-chip PS VCCPINT Channel, Zynq

#define XSM_CH_VPVN   0x3

VP/VN Dedicated analog inputs

#define XSM_CH_VREFN   0x5

VREFN

#define XSM_CH_VREFP   0x4

VREFP

#define XSM_CH_VUSR0   32

VUSER0 Supply - UltraScale

#define XSM_CH_VUSR1   33

VUSER1 Supply - UltraScale

#define XSM_CH_VUSR2   34

VUSER2 Supply - UltraScale

#define XSM_CH_VUSR3   35

VUSER3 Supply - UltraScale

#define XSM_MAX_TEMP   0

Maximum Temperature Data

#define XSM_MAX_VCCAUX   2

Maximum VCCAUX Data

#define XSM_MAX_VCCBRAM   3

Maximum VCCBRAM Data, 7 Series/Zynq

#define XSM_MAX_VCCINT   1

Maximum VCCINT Data

#define XSM_MAX_VCCPAUX   9

Maximum VCCPAUX Data, Zynq

#define XSM_MAX_VCCPDRO   0xA

Maximum VCCPDRO Data, Zynq

#define XSM_MAX_VCCPINT   8

Maximum VCCPINT Data, Zynq

#define XSM_MAX_VUSR0   0x80

Maximum VUSR0 Data, Ultrascale

#define XSM_MAX_VUSR1   0x81

Maximum VUSR1 Data, Ultrascale

#define XSM_MAX_VUSR2   0x82

Maximum VUSR2 Data, Ultrascale

#define XSM_MAX_VUSR3   0x83

Maximum VUSR3 Data, Ultrascale

#define XSM_MIN_TEMP   4

Minimum Temperature Data

#define XSM_MIN_VCCAUX   6

Minimum VCCAUX Data

#define XSM_MIN_VCCBRAM   7

Minimum VCCBRAM Data, 7 Series/Zynq

#define XSM_MIN_VCCINT   5

Minimum VCCINT Data

#define XSM_MIN_VCCPAUX   0xD

Minimum VCCPAUX Data, Zynq

#define XSM_MIN_VCCPDRO   0xE

Minimum VCCPDRO Data, Zynq

#define XSM_MIN_VCCPINT   0xC

Minimum VCCPINT Data, Zynq

#define XSM_MIN_VUSR0   0x88

Minimum VUSR0 Data, Ultrascale

#define XSM_MIN_VUSR1   0x89

Minimum VUSR1 Data, Ultrascale

#define XSM_MIN_VUSR2   0x8A

Minimum VUSR2 Data, Ultrascale

#define XSM_MIN_VUSR3   0x8B

Minimum VUSR3 Data, Ultrascale

#define XSM_SEQ_MODE_CONTINPASS   2

Continuous Cycling Seqquencer

#define XSM_SEQ_MODE_INDEPENDENT   8

Independent ADC Sequencer, 7 Series and Zynq XADC only

#define XSM_SEQ_MODE_ONEPASS   1

Onepass through Sequencer

#define XSM_SEQ_MODE_SAFE   0

Default Safe Mode

#define XSM_SEQ_MODE_SIMUL   4

Simultaneous Cycling Sequencer, 7 Series and Zynq XADC only

#define XSM_SEQ_MODE_SINGCHAN   3

Single channel - No Sequencing

#define XSYSMON_H
#define XSysMon_IsDrpBusy ( InstancePtr   ) 
Value:
((XSysMon_ReadReg((InstancePtr)->Config.BaseAddress,              \
                                XSM_SR_OFFSET) & XSM_SR_JTAG_BUSY_MASK) ? \
                                TRUE : FALSE)

This macro checks if the Dynamic Reconfiguration Port (DRP) transaction from the JTAG is in progress.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
  • TRUE if the DRP transaction from JTAG is in Progress.
  • FALSE if there is no DRP transaction from the JTAG.
Note:
C-Style signature: int XSysMon_IsDrpBusy(XSysMon *InstancePtr);
#define XSysMon_IsDrpLocked ( InstancePtr   ) 
Value:
(((XSysMon_ReadReg((InstancePtr)->Config.BaseAddress,               \
                                XSM_SR_OFFSET) & XSM_SR_JTAG_LOCKED_MASK) ? \
                                TRUE : FALSE))

This macro checks if the Dynamic Reconfiguration Port (DRP) is locked by the JTAG.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
  • TRUE if the DRP is locked by the JTAG.
  • FALSE if the DRP is not locked by the JTAG.
Note:
C-Style signature: int XSysMon_IsDrpLocked(XSysMon *InstancePtr);
#define XSysMon_IsEventSamplingModeSet ( InstancePtr   ) 
Value:
(((XSysMon_ReadReg((InstancePtr)->Config.BaseAddress,           \
                                XSM_CFR0_OFFSET) & XSM_CFR0_EC_MASK) ?  \
                                TRUE : FALSE))

This macro checks if the SysMonitor/ADC device is in Event Sampling mode.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
  • TRUE if the device is in Event Sampling Mode.
  • FALSE if the device is in Continuous Sampling Mode.
Note:
C-Style signature: int XSysMon_IsEventSamplingMode(XSysMon *InstancePtr);
#define XSysMon_RawToTemperature ( AdcData   )     ((((float)(AdcData)/65536.0f)/0.00198421639f ) - 273.15f)

This macro converts System Monitor/ADC Raw Data to Temperature(centigrades).

Parameters:
AdcData is the SysMon Raw ADC Data.
Returns:
The Temperature in centigrades.
Note:
C-Style signature: float XSysMon_RawToTemperature(u32 AdcData);
#define XSysMon_RawToVoltage ( AdcData   )     ((((float)(AdcData))* (3.0f))/65536.0f)

This macro converts System Monitor/ADC Raw Data to Voltage(volts).

Parameters:
AdcData is the System Monitor/ADC Raw Data.
Returns:
The Voltage in volts.
Note:
C-Style signature: float XSysMon_RawToVoltage(u32 AdcData);
#define XSysMon_TemperatureToRaw ( Temperature   )     ((int)(((Temperature) + 273.15f)*65536.0f*0.00198421639f))

This macro converts Temperature in centigrades to System Monitor/ADC Raw Data.

Parameters:
Temperature is the Temperature in centigrades to be converted to System Monitor/ADC Raw Data.
Returns:
The System Monitor/ADC Raw Data.
Note:
C-Style signature: int XSysMon_TemperatureToRaw(float Temperature);
#define XSysMon_VoltageToRaw ( Voltage   )     ((int)((Voltage)*65536.0f/3.0f))

This macro converts Voltage in Volts to System Monitor/ADC Raw Data.

Parameters:
Voltage is the Voltage in volts to be converted to System Monitor/ADC Raw Data.
Returns:
The System Monitor/ADC Raw Data.
Note:
C-Style signature: int XSysMon_VoltageToRaw(float Voltage);

Function Documentation

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

Functions in xsysmon.c

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_IntrClear ( XSysMon InstancePtr,
u32  Mask 
)

This function clears the specified interrupts in the Interrupt Status Register (IPISR).

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Mask is the bit-mask of the interrupts to be cleared. Bit positions of 1 will be cleared. Bit positions of 0 will not change the previous interrupt status. This mask is formed by OR'ing XSM_IPIXR_* bits which are defined in xsysmon_hw.h.
Returns:
None.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
void XSysMon_IntrDisable ( XSysMon InstancePtr,
u32  Mask 
)

This function disables the specified interrupts in the device.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Mask is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XSM_IPIXR_* bits defined in xsysmon_hw.h.
Returns:
None.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
void XSysMon_IntrEnable ( XSysMon InstancePtr,
u32  Mask 
)

This function enables the specified interrupts in the device. Interrupts enabled using this function will not occur until the global interrupt enable bit is set by using the XSysMon_IntrGlobalEnable()function.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Mask is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XSM_IPIXR_* bits defined in xsysmon_hw.h.
Returns:
None.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
u32 XSysMon_IntrGetEnabled ( XSysMon InstancePtr  ) 

This function returns the enabled interrupts read from the Interrupt Enable Register (IPIER). Use the XSM_IPIXR_* constants defined in xsysmon_hw.h to interpret the returned value.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
A 32-bit value representing the contents of the IPIER.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
u32 XSysMon_IntrGetStatus ( XSysMon InstancePtr  ) 

This function returns the interrupt status read from Interrupt Status Register(IPISR). Use the XSM_IPIXR_* constants defined in xsysmon_hw.h to interpret the returned value.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
A 32-bit value representing the contents of the IPISR.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
void XSysMon_IntrGlobalDisable ( XSysMon InstancePtr  ) 

This function disables the global interrupt in the Global Interrupt Enable Register (GIER) so that the interrupt output from the System Monitor/ADC device is disabled.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
void XSysMon_IntrGlobalEnable ( XSysMon InstancePtr  ) 

Functions in xsysmon_intr.c

This function enables the global interrupt in the Global Interrupt Enable Register (GIER) so that the interrupt output from the System Monitor/ADC device is enabled. Interrupts enabled using XSysMon_IntrEnable() will not occur until the global interrupt enable bit is set by using this function.

Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
None.
Note:
The device must be configured at hardware build time to include interrupt component for this function to work.
XSysMon_Config* XSysMon_LookupConfig ( u16  DeviceId  ) 

Functions in xsysmon_sinit.c

This function looks up the device configuration based on the unique device ID. The table XSysMon_ConfigTable contains the configuration info for each device in the system.

Parameters:
DeviceId contains the ID of the device for which the device configuration pointer is to be returned.
Returns:
  • A pointer to the configuration found.
  • NULL if the specified device ID was not found.
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.
int XSysMon_SelfTest ( XSysMon InstancePtr  ) 

Functions in xsysmon_selftest.c

Run a self-test on the driver/device. The test

  • Resets the device,
  • Writes a value into the Alarm Threshold register and reads it back for comparison.
  • Resets the device again.
Parameters:
InstancePtr is a pointer to the XSysMon instance.
Returns:
  • XST_SUCCESS if the value read from the Alarm Threshold register is the same as the value written.
  • XST_FAILURE Otherwise
Note:
This is a destructive test in that resets of the device are performed. Refer to the device specification for the device status after the reset operation.
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.