sysmonpsv
Xilinx SDK Drivers API Documentation
xsysmonpsv.h File Reference

Macros

#define XSysMonPsv_GetAlarmMask(InstancePtr, Supply)   Mask = 1 << (InstancePtr->Supply_List[Supply]/32)
 This macro returns the XSYSMONPSV_NEW_ALARMn_MASK for a configured supply. More...
 

Typedefs

typedef void(* XSysMonPsv_Handler )(void *CallBackRef)
 This data type defines a handler that an application defines to communicate with interrupt system to retrieve state information about an application. More...
 

Enumerations

This typedef defines Threshold types.
enum  XSysMonPsv_Threshold
 
This typedef defines value types for voltage readings.
enum  XSysMonPsv_Val {
  XSYSMONPSV_VAL, XSYSMONPSV_VAL_MIN, XSYSMONPSV_VAL_MAX, XSYSMONPSV_VAL_VREF_MIN,
  XSYSMONPSV_VAL_VREF_MAX
}
 

Functions

s32 XSysMonPsv_CfgInitialize (XSysMonPsv *InstancePtr, XSysMonPsv_Config *CfgPtr)
 This function initializes XSysMonPsv device/instance. More...
 
void XSysMonPsv_SystemReset (XSysMonPsv *InstancePtr)
 This function resets the SystemMonitor. More...
 
void XSysMonPsv_EnRegGate (XSysMonPsv *InstancePtr, u8 Enable)
 This function Gates the register outputs. More...
 
void XSysMonPsv_SetPMBusAddress (XSysMonPsv *InstancePtr, u8 Address)
 This function sets the PMBus address for the System Monitor. More...
 
void XSysMonPsv_PMBusEnable (XSysMonPsv *InstancePtr, u8 Enable)
 This function enables/disbles the PMBus on the System Monitor. More...
 
void XSysMonPsv_PMBusEnableCmd (XSysMonPsv *InstancePtr, u8 Enable)
 This function restricts or de-restrict all PMBs commands. More...
 
void XSysMonPsv_SelectExtInterface (XSysMonPsv *InstancePtr, u8 Interface)
 This function selects I2C or PMBus interface to which traffic from SMBus is routed to. More...
 
void XSysMonPsv_StatusReset (XSysMonPsv *InstancePtr, u8 ResetSupply, u8 ResetTemperature)
 This function Resets the Min and Max values of Supplies and Temperature to negative and positive saturation respectively. More...
 
u16 XSysMonPsv_ReadDevTempThreshold (XSysMonPsv *InstancePtr, XSysMonPsv_Threshold ThresholdType)
 This function returns the device temperature threshold for min and max values in signed Q8.7 format. More...
 
u16 XSysMonPsv_ReadOTTempThreshold (XSysMonPsv *InstancePtr, XSysMonPsv_Threshold ThresholdType)
 This function returns the OT temperature threshold for min and max values in signed Q8.7 format. More...
 
u32 XSysMonPsv_ReadDeviceTemp (XSysMonPsv *InstancePtr, XSysMonPsv_Val Value)
 This function returns the temperature values for the device in signed Q8.7 format. More...
 
u32 XSysMonPsv_ReadSupplyThreshold (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply, XSysMonPsv_Threshold ThresholdType)
 This function reads the raw value for Supply Threshold. More...
 
u32 XSysMonPsv_ReadSupplyValue (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply, XSysMonPsv_Val Value)
 This function reads the raw Supply Value for requested. More...
 
u32 XSysMonPsv_IsNewData (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply)
 This function is to be used to check if new data is available for a supply. More...
 
u32 XSysMonPsv_IsAlarmCondition (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply)
 This function is to be used to check if the supply value has exceeded the set threshold values. More...
 
void XSysMonPsv_IntrEnable (XSysMonPsv *InstancePtr, u32 Mask, u8 IntrNum)
 This function enables the specified interrupts in the device. More...
 
void XSysMonPsv_IntrDisable (XSysMonPsv *InstancePtr, u32 Mask, u8 IntrNum)
 This function disables the specified interrupts in the device. More...
 
u32 XSysMonPsv_IntrGetEnabled (XSysMonPsv *InstancePtr, u8 IntrNum)
 This function returns the enabled interrupts read from the Interrupt Enable Register (IER). More...
 
u32 XSysMonPsv_IntrGetStatus (XSysMonPsv *InstancePtr)
 This function returns the interrupt status read from Interrupt Status Register(ISR). More...
 
void XSysMonPsv_IntrClear (XSysMonPsv *InstancePtr, u32 Mask)
 This function clears the specified interrupts in the Interrupt Status Register (ISR). More...
 
void XSysMonPsv_SetNewDataIntSrc (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply, u32 Mask)
 This function sets a supply as a source new data interrupt. More...
 
XSysMonPsv_Config * XSysMonPsv_LookupConfig (void)
 This function looks for the device configuration based on the unique device ID. More...
 

Macro Definition Documentation

#define XSysMonPsv_GetAlarmMask (   InstancePtr,
  Supply 
)    Mask = 1 << (InstancePtr->Supply_List[Supply]/32)

This macro returns the XSYSMONPSV_NEW_ALARMn_MASK for a configured supply.

Parameters
Supplyis a type enum of supply enabled
Returns
A 32 bit mask to be used for configuring interrupts
Note
None

Typedef Documentation

typedef void(* XSysMonPsv_Handler)(void *CallBackRef)

This data type defines a handler that an application defines to communicate with interrupt system to retrieve state information about an application.

Parameters
CallBackRefis a callback reference passed in by the upper layer when setting the handler, and is passed back to the upper layer when the handler is called. It is used to find the device driver instance.

Enumeration Type Documentation

Enumerator
XSYSMONPSV_VAL 

Supply Value.

XSYSMONPSV_VAL_MIN 

Minimum Value reached since reset.

XSYSMONPSV_VAL_MAX 

Maximum Value reached since reset.

XSYSMONPSV_VAL_VREF_MIN 

Minimum value reached for a temperature since last VRef.

XSYSMONPSV_VAL_VREF_MAX 

Maximum value reached for a temperature since last VRef.

Function Documentation

s32 XSysMonPsv_CfgInitialize ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Config *  CfgPtr 
)

This function initializes XSysMonPsv device/instance.

This function must be called prior to using the System Monitor device.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
CfgPtrpoints to the XSysMonPsv device configuration structure.
Returns
  • XST_SUCCESS if successful.
Note
The user needs to first call the XSysMonPsv_LookupConfig() API which returns the Configuration structure pointer which is passed as a parameter to the XSysMonPsv_CfgInitialize() API.

Referenced by SysMonPsvIntrExample(), and SysMonPsvPolledExample().

void XSysMonPsv_EnRegGate ( XSysMonPsv *  InstancePtr,
u8  Enable 
)

This function Gates the register outputs.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Returns
None.
Note
None.

References XSYSMONPSV_PCSR_CONTROL, XSYSMONPSV_PCSR_MASK, and XSysMonPsv_WriteReg.

void XSysMonPsv_IntrClear ( XSysMonPsv *  InstancePtr,
u32  Mask 
)

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

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Maskis the 32 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.*
Returns
None.
Note
None.

References XSYSMONPSV_ISR_OFFSET, and XSysMonPsv_WriteReg.

Referenced by SysMonPsvIntrExample(), and SysMonPsvPolledExample().

void XSysMonPsv_IntrDisable ( XSysMonPsv *  InstancePtr,
u32  Mask,
u8  IntrNum 
)

This function disables the specified interrupts in the device.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Maskis the 32 bit-mask of the interrupts to be enabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XSYSMONPSV_IDR_* bits defined in xsysmonpsv_hw.h.
IntrNumis the interrupt disable register to be used
Returns
None.
Note
None.

References XSYSMONPSV_IDR0_OFFSET, and XSysMonPsv_WriteReg.

void XSysMonPsv_IntrEnable ( XSysMonPsv *  InstancePtr,
u32  Mask,
u8  IntrNum 
)

This function enables the specified interrupts in the device.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Maskis the 32 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 XSYSMONPSV_IER_* bits defined in xsysmonpsv_hw.h.
IntrNumis the interrupt enable register to be used
Returns
None.
Note
None.

References XSYSMONPSV_IER0_OFFSET, and XSysMonPsv_WriteReg.

Referenced by SysMonPsvIntrExample(), and SysMonPsvPolledExample().

u32 XSysMonPsv_IntrGetEnabled ( XSysMonPsv *  InstancePtr,
u8  IntrNum 
)

This function returns the enabled interrupts read from the Interrupt Enable Register (IER).

Use the XSYSMONPSV_IER0_* and XSYSMONPSV_IER1_* constants defined in xsysmonpsv_hw.h to interpret the returned value.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
IntrNumis the interrupt enable register to be used
Returns
A 32-bit value representing the contents of the Interrupt Mask Registers.
Note
None.

References XSYSMONPSV_IER0_OFFSET, and XSysMonPsv_ReadReg.

u32 XSysMonPsv_IntrGetStatus ( XSysMonPsv *  InstancePtr)

This function returns the interrupt status read from Interrupt Status Register(ISR).

Use the XSYSMONPSV_ISR* constants defined in xsysmonpsv_hw.h to interpret the returned value.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Returns
A 32-bit value representing the contents of the Interrupt Status Register (ISR).
Note
None.

References XSYSMONPSV_ISR_OFFSET, and XSysMonPsv_ReadReg.

Referenced by SysMonPsvPolledExample().

u32 XSysMonPsv_IsAlarmCondition ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Supply  Supply 
)

This function is to be used to check if the supply value has exceeded the set threshold values.

Parameters
InstancePtris a pointer to the driver instance.
Supplyis an enum which indicates the desired supply.
Returns
True if new data available False if new data isn't available Invalid if the Supply hasn't been configured
Note
None.

References XSYSMONPSV_ALARM_FLAG0, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

u32 XSysMonPsv_IsNewData ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Supply  Supply 
)

This function is to be used to check if new data is available for a supply.

Parameters
InstancePtris a pointer to the driver instance.
Supplyis an enum which indicates the desired supply.
Returns
True if new data available False if new data isn't available Invalid if the Supply hasn't been configured
Note
None.

References XSYSMONPSV_NEW_DATA_FLAG0, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

XSysMonPsv_Config* XSysMonPsv_LookupConfig ( void  )

This function looks for the device configuration based on the unique device ID.

The table XSysmonPsu_ConfigTable[] contains the configuration information for each device in the system.

Parameters
None.
Returns
A pointer to the configuration table entry corresponding to the given device , or NULL if no match is found.
Note
None.

Referenced by SysMonPsvIntrExample(), and SysMonPsvPolledExample().

void XSysMonPsv_PMBusEnable ( XSysMonPsv *  InstancePtr,
u8  Enable 
)

This function enables/disbles the PMBus on the System Monitor.

Parameters
InstancePtris a pointer to the driver instance.
Enableis the value which enables or disables the PMBus.
Returns
None.
Note
If Enable = 0, PMBus lines will be in tristate. If Enable = 1, PMBus lines will be active.

References XSYSMONPSV_CONFIG0, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

void XSysMonPsv_PMBusEnableCmd ( XSysMonPsv *  InstancePtr,
u8  Enable 
)

This function restricts or de-restrict all PMBs commands.

Parameters
InstancePtris a pointer to the driver instance.
Enableis the value which restrics or de-restrict the PMBus commands.
Returns
None.
Note
If Enable = 0, PMBus commands are disabled. If Enable = 1, PMBus commands are enabled.

References XSYSMONPSV_CONFIG0, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

u32 XSysMonPsv_ReadDeviceTemp ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Val  Value 
)

This function returns the temperature values for the device in signed Q8.7 format.

Parameters
InstancePtris a pointer to the driver instance.
Valueis an enum which indicates the typde of temperature value to be read
Tempis a pointer to which the device temperature is written to.
Returns
Temperature value requested XSYSMONPSV_FAILURE if invalid value requested
Note
None.

References XSYSMONPSV_DEVICE_TEMP_MAX, XSYSMONPSV_DEVICE_TEMP_MAX_MAX, XSYSMONPSV_DEVICE_TEMP_MIN, XSYSMONPSV_DEVICE_TEMP_MIN_MIN, XSysMonPsv_ReadReg, XSYSMONPSV_VAL_MAX, XSYSMONPSV_VAL_MIN, XSYSMONPSV_VAL_VREF_MAX, and XSYSMONPSV_VAL_VREF_MIN.

Referenced by SysMonPsvPolledExample().

u16 XSysMonPsv_ReadDevTempThreshold ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Threshold  ThresholdType 
)

This function returns the device temperature threshold for min and max values in signed Q8.7 format.

Parameters
InstancePtris a pointer to the driver instance.
ThresholdTypeis an enum which indicates the type of threshold
Returns
Device Temperature threshold in signed Q8.7 format.
Note
None.

References XSYSMONPSV_DEVICE_TEMP_TH, and XSysMonPsv_ReadReg.

u16 XSysMonPsv_ReadOTTempThreshold ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Threshold  ThresholdType 
)

This function returns the OT temperature threshold for min and max values in signed Q8.7 format.

Parameters
InstancePtris a pointer to the driver instance.
ThresholdTypeis an enum which indicates the type of threshold
Returns
OT Temperature threshold in signed Q8.7 format.
Note
None.

References XSYSMONPSV_OT_TEMP_TH, and XSysMonPsv_ReadReg.

u32 XSysMonPsv_ReadSupplyThreshold ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Supply  Supply,
XSysMonPsv_Threshold  ThresholdType 
)

This function reads the raw value for Supply Threshold.

Parameters
InstancePtris a pointer to the driver instance.
Supplyis an enum which indicates the desired supply to be read
ThresholdTypeis an enum which indicates the type of threshold
Returns
The raw Upper or Lower threshold of the Supply XSYSMONPSV_INVALID if the Supply hasn't been configured
Note
None.

References XSysMonPsv_ReadReg, XSYSMONPSV_SUPPLY_TH_LOWER, and XSYSMONPSV_SUPPLY_TH_UPPER.

u32 XSysMonPsv_ReadSupplyValue ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Supply  Supply,
XSysMonPsv_Val  Value 
)

This function reads the raw Supply Value for requested.

Parameters
InstancePtris a pointer to the driver instance.
Supplyis an enum which indicates the desired supply to be read
Valueis the type of reading for the Supply
Returns
The raw values for Min, Max or the prevailing Supply Value. Invalid if the Supply hasn't been configured
Note
None.

References XSysMonPsv_ReadReg, XSYSMONPSV_SUPPLY, XSYSMONPSV_SUPPLY_MAX, XSYSMONPSV_SUPPLY_MIN, XSYSMONPSV_VAL, and XSYSMONPSV_VAL_MIN.

Referenced by SysMonPsvPolledExample().

void XSysMonPsv_SelectExtInterface ( XSysMonPsv *  InstancePtr,
u8  Interface 
)

This function selects I2C or PMBus interface to which traffic from SMBus is routed to.

Parameters
InstancePtris a pointer to the driver instance.
Interfaceis a value which determies where the SMBus traffic gets routed to
Returns
None.
Note
If Interface = 1, I2C command interface is enabled. If Interface = 0, PMBus command interface is enabled.

References XSYSMONPSV_CONFIG0, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

void XSysMonPsv_SetNewDataIntSrc ( XSysMonPsv *  InstancePtr,
XSysMonPsv_Supply  Supply,
u32  Mask 
)

This function sets a supply as a source new data interrupt.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Supplyis an enum from the XSysMonPsv_Supply
Maskis a 32 bit Mask for NEW_DATA_n fields in the interrupt registers
Returns
None.
Note
None.

References XSYSMONPSV_NEW_DATA_INT_SRC, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

Referenced by SysMonPsvPolledExample().

void XSysMonPsv_SetPMBusAddress ( XSysMonPsv *  InstancePtr,
u8  Address 
)

This function sets the PMBus address for the System Monitor.

Parameters
InstancePtris a pointer to the device instance.
Addressis a value at which the Sysmon will be addressed on the PMBus.
Returns
None.
Note
None.

References XSYSMONPSV_CONFIG0, XSysMonPsv_ReadReg, and XSysMonPsv_WriteReg.

void XSysMonPsv_StatusReset ( XSysMonPsv *  InstancePtr,
u8  ResetSupply,
u8  ResetTemperature 
)

This function Resets the Min and Max values of Supplies and Temperature to negative and positive saturation respectively.

Parameters
InstancePtris a pointer to the driver instance.
ResetSupplywill reset the MIN and MAX values reached by the internal supplies since the last reset.
ResetTemperaturewill reset the MIN and MAX values reached by the device since the last reset.
Returns
None.
Note
None.

References XSYSMONPSV_STATUS_RESET, and XSysMonPsv_WriteReg.

void XSysMonPsv_SystemReset ( XSysMonPsv *  InstancePtr)

This function resets the SystemMonitor.

Parameters
InstancePtris a pointer to the XSysMonPsv instance.
Returns
None.
Note
None.

References XSYSMONPSV_PCSR_CONTROL, XSYSMONPSV_PCSR_MASK, and XSysMonPsv_WriteReg.