#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_Config * | XSysMon_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) |
#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 | ) |
((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.
InstancePtr | is a pointer to the XSysMon instance. |
#define XSysMon_IsDrpLocked | ( | InstancePtr | ) |
(((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.
InstancePtr | is a pointer to the XSysMon instance. |
#define XSysMon_IsEventSamplingModeSet | ( | InstancePtr | ) |
(((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.
InstancePtr | is a pointer to the XSysMon instance. |
#define XSysMon_RawToTemperature | ( | AdcData | ) | ((((float)(AdcData)/65536.0f)/0.00198421639f ) - 273.15f) |
This macro converts System Monitor/ADC Raw Data to Temperature(centigrades).
AdcData | is the SysMon Raw ADC Data. |
#define XSysMon_RawToVoltage | ( | AdcData | ) | ((((float)(AdcData))* (3.0f))/65536.0f) |
This macro converts System Monitor/ADC Raw Data to Voltage(volts).
AdcData | is the System Monitor/ADC Raw Data. |
#define XSysMon_TemperatureToRaw | ( | Temperature | ) | ((int)(((Temperature) + 273.15f)*65536.0f*0.00198421639f)) |
This macro converts Temperature in centigrades to System Monitor/ADC Raw Data.
Temperature | is the Temperature in centigrades to be converted to System Monitor/ADC Raw Data. |
#define XSysMon_VoltageToRaw | ( | Voltage | ) | ((int)((Voltage)*65536.0f/3.0f)) |
This macro converts Voltage in Volts to System Monitor/ADC Raw Data.
Voltage | is the Voltage in volts to be converted to System Monitor/ADC Raw Data. |
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.
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. |
void XSysMon_DisableTempUpdate | ( | XSysMon * | InstancePtr | ) |
This function disables the Temperature updation logic for TEMP_OUT port
InstancePtr | is a pointer to the XSysMon instance. |
void XSysMon_DisableUserOverTemp | ( | XSysMon * | InstancePtr | ) |
This function disables programming of the powerdown temperature for the OverTemp signal in the OT Powerdown register.
InstancePtr | is a pointer to the XSysMon instance. |
void XSysMon_EnableTempUpdate | ( | XSysMon * | InstancePtr | ) |
This function enables the Temperature updation logic so that temperature can be sent over TEMP_OUT port.
InstancePtr | is a pointer to the XSysMon instance. |
void XSysMon_EnableUserOverTemp | ( | XSysMon * | InstancePtr | ) |
This function enables programming of the powerdown temperature for the OverTemp signal in the OT Powerdown register.
InstancePtr | is a pointer to the XSysMon instance. |
u8 XSysMon_GetAdcClkDivisor | ( | XSysMon * | InstancePtr | ) |
The function gets the ADCCLK divisor from the Configuration Register 2.
InstancePtr | is a pointer to the XSysMon instance. |
u16 XSysMon_GetAdcData | ( | XSysMon * | InstancePtr, | |
u8 | Channel | |||
) |
Get the ADC converted data for the specified channel.
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. |
u32 XSysMon_GetAlarmEnables | ( | XSysMon * | InstancePtr | ) |
This function gets the status of the alarm output enables in the Configuration Register 1.
InstancePtr | is a pointer to the XSysMon instance. |
Bit positions of 1 indicate that the alarm output is enabled. Bit positions of 0 indicate that the alarm output is disabled.
u32 XSysMon_GetAlarmOutputStatus | ( | XSysMon * | InstancePtr | ) |
This function reads the contents of Alarm Output Register.
InstancePtr | is a pointer to the XSysMon instance. |
u16 XSysMon_GetAlarmThreshold | ( | XSysMon * | InstancePtr, | |
u8 | AlarmThrReg | |||
) |
This function returns the contents of the specified Alarm Threshold Register.
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. |
u8 XSysMon_GetAvg | ( | XSysMon * | InstancePtr | ) |
This function returns the number of samples of averaging configured for all the channels in the Configuration Register 0.
InstancePtr | is a pointer to the XSysMon instance. |
u16 XSysMon_GetCalibCoefficient | ( | XSysMon * | InstancePtr, | |
u8 | CoeffType | |||
) |
This function gets the calibration coefficient data for the specified parameter.
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. |
u16 XSysMon_GetCalibEnables | ( | XSysMon * | InstancePtr | ) |
This function reads the value of the calibration enables from the Configuration Register 1.
InstancePtr | is a pointer to the XSysMon instance. |
u16 XSysMon_GetMinMaxMeasurement | ( | XSysMon * | InstancePtr, | |
u8 | MeasurementType | |||
) |
This function reads the Minimum/Maximum measurement for one of the following 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. |
u16 XSysMon_GetOverTemp | ( | XSysMon * | InstancePtr | ) |
This function returns the powerdown temperature of the OverTemp signal in the OT Powerdown register.
InstancePtr | is a pointer to the XSysMon instance. |
u32 XSysMon_GetSeqAcqTime | ( | XSysMon * | InstancePtr | ) |
This function gets the status of acquisition from the ADC Channel Acquisition Time Sequencer Registers.
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
u64 XSysMon_GetSeqChEnables | ( | XSysMon * | InstancePtr | ) |
This function gets the channel enable bits status from the ADC Channel Selection Sequencer Registers.
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
u8 XSysMon_GetSequencerMode | ( | XSysMon * | InstancePtr | ) |
This function gets the channel sequencer mode from the Configuration Register 1.
InstancePtr | is a pointer to the XSysMon instance. |
u32 XSysMon_GetStatus | ( | XSysMon * | InstancePtr | ) |
The functions reads the contents of the Status Register.
InstancePtr | is a pointer to the XSysMon instance. |
void XSysMon_IntrClear | ( | XSysMon * | InstancePtr, | |
u32 | Mask | |||
) |
This function clears the specified interrupts in the Interrupt Status Register (IPISR).
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. |
void XSysMon_IntrDisable | ( | XSysMon * | InstancePtr, | |
u32 | Mask | |||
) |
This function disables the specified interrupts in the device.
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. |
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.
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. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
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.
DeviceId | contains the ID of the device for which the device configuration pointer is to be returned. |
void XSysMon_Reset | ( | XSysMon * | InstancePtr | ) |
This function forces the software reset of the complete SystemMonitor/ADC Hard Macro and the SYSMON ADC Core Logic.
InstancePtr | is a pointer to the XSysMon instance. |
void XSysMon_ResetAdc | ( | XSysMon * | InstancePtr | ) |
This function resets the SystemMonitor/ADC Hard Macro in the device.
InstancePtr | is a pointer to the XSysMon instance. |
int XSysMon_SelfTest | ( | XSysMon * | InstancePtr | ) |
Functions in xsysmon_selftest.c
Run a self-test on the driver/device. The test
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. | |
Divisor | is clock divisor used to derive ADCCLK from DCLK. Valid values of the divisor are
|
void XSysMon_SetAlarmEnables | ( | XSysMon * | InstancePtr, | |
u32 | AlmEnableMask | |||
) |
This function enables the alarm outputs for the specified alarms in the Configuration Registers 1 and 3:
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. |
void XSysMon_SetAlarmThreshold | ( | XSysMon * | InstancePtr, | |
u8 | AlarmThrReg, | |||
u16 | Value | |||
) |
This functions sets the contents of the given Alarm Threshold Register.
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. |
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.
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 :
|
void XSysMon_SetCalibEnables | ( | XSysMon * | InstancePtr, | |
u16 | Calibration | |||
) |
This function enables the specified calibration in the Configuration Register 1 :
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; |
void XSysMon_SetExtenalMux | ( | XSysMon * | InstancePtr, | |
u8 | Channel | |||
) |
The function enables the external mux and connects a channel to the mux.
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. |
void XSysMon_SetOverTemp | ( | XSysMon * | InstancePtr, | |
u16 | Value | |||
) |
This function sets the powerdown temperature for the OverTemp signal in the OT Powerdown register.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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. |
void XSysMon_SetSequencerEvent | ( | XSysMon * | InstancePtr, | |
int | IsEventMode | |||
) |
The function enables the Event mode or Continuous mode in the sequencer mode.
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. |
void XSysMon_SetSequencerMode | ( | XSysMon * | InstancePtr, | |
u8 | SequencerMode | |||
) |
This function sets the specified Channel Sequencer Mode in the Configuration Register 1 :
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. |
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.
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. |
void XSysMon_SetTempWaitCycles | ( | XSysMon * | InstancePtr, | |
u16 | WaitCycles | |||
) |
This function sets the number of Wait Cycles for Temperature updation logic
InstancePtr | is a pointer to the XSysMon instance. |
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.
InstancePtr | is a pointer to the XSysMon instance. |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.