sysmonpsv: xsysmonpsv.c File Reference

| sysmonpsv Xilinx SDK Drivers API Documentation

- Overview
- APIs
- File List
- Examples

Functions
xsysmonpsv.c File Reference

## 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...

## 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

  InstancePtr | is a pointer to the XSysMonPsv instance.
  CfgPtr | points 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

  InstancePtr | is a pointer to the XSysMonPsv instance.

Returns
  None.

Note
  None.

References XSYSMONPSV_PCSR_CONTROL, XSYSMONPSV_PCSR_MASK, and XSysMonPsv_WriteReg.

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

  InstancePtr | is a pointer to the driver instance.
  Supply | is 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

  InstancePtr | is a pointer to the driver instance.
  Supply | is 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.

void XSysMonPsv_PMBusEnable | ( | XSysMonPsv * | InstancePtr,
|  | u8 | Enable
| ) |  |

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

Parameters

  InstancePtr | is a pointer to the driver instance.
  Enable | is 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

  InstancePtr | is a pointer to the driver instance.
  Enable | is 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

  InstancePtr | is a pointer to the driver instance.
  Value | is an enum which indicates the typde of temperature value to be read
  Temp | is 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

  InstancePtr | is a pointer to the driver instance.
  ThresholdType | is 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

  InstancePtr | is a pointer to the driver instance.
  ThresholdType | is 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

  InstancePtr | is a pointer to the driver instance.
  Supply | is an enum which indicates the desired supply to be read
  ThresholdType | is 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

  InstancePtr | is a pointer to the driver instance.
  Supply | is an enum which indicates the desired supply to be read
  Value | is 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

  InstancePtr | is a pointer to the driver instance.
  Interface | is 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_SetPMBusAddress | ( | XSysMonPsv * | InstancePtr,
|  | u8 | Address
| ) |  |

This function sets the PMBus address for the System Monitor.

Parameters

  InstancePtr | is a pointer to the device instance.
  Address | is 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

  InstancePtr | is a pointer to the driver instance.
  ResetSupply | will reset the MIN and MAX values reached by the internal supplies since the last reset.
  ResetTemperature | will 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

  InstancePtr | is a pointer to the XSysMonPsv instance.

Returns
  None.

Note
  None.

References XSYSMONPSV_PCSR_CONTROL, XSYSMONPSV_PCSR_MASK, and XSysMonPsv_WriteReg.