![]() |
sysmonpsv
Vitis Drivers API Documentation
|
Macros | |
#define | XSYSMONPSV_INTR_OFFSET 0xCU |
Interrupt Offset. More... | |
#define | XSYSMONPSV_LOCK_CODE 0xF9E8D7C6 |
Lock code value. More... | |
#define | XSYSMONPSV_INTR_0_ID (144U + 32U) |
Interrupt unique ID. More... | |
#define | XSYSMONPSV_INTR_1_ID (145U + 32U) |
Interrupt unique ID. More... | |
#define | XSYSMONPSV_BIT_ALARM0 0U |
Bit for supply[0-31]. More... | |
#define | XSYSMONPSV_BIT_ALARM1 1U |
Bit for supply[32-63]. More... | |
#define | XSYSMONPSV_BIT_ALARM2 2U |
Bit for supply[64-95]. More... | |
#define | XSYSMONPSV_BIT_ALARM3 3U |
Bit for supply[96-127]. More... | |
#define | XSYSMONPSV_BIT_ALARM4 4U |
Bit for supply[128-159]. More... | |
#define | XSYSMONPSV_BIT_ALARM5 5U |
Reserved. More... | |
#define | XSYSMONPSV_BIT_ALARM6 6U |
Reserved. More... | |
#define | XSYSMONPSV_BIT_ALARM7 7U |
Reserved. More... | |
#define | XSYSMONPSV_BIT_OT 8U |
Over Temperature bit. More... | |
#define | XSYSMONPSV_BIT_TEMP 9U |
Temperature bit. More... | |
#define | XSYSMONPSV_UP_SAT_SIGNED_VAL 0x7FFF |
Signed upper saturation value. More... | |
#define | XSYSMONPSV_LOW_SAT_SIGNED_VAL 0x8000 |
Signed lower saturation value. More... | |
#define | XSYSMONPSV_UP_SAT_VAL 0xFFFF |
Upper saturation value. More... | |
#define | XSYSMONPSV_LOW_SAT_VAL 0x0000 |
Upper saturation value. More... | |
#define | compare(val, thresh) |
Macro to compare threshold with current value. More... | |
#define | twoscomp(val) ((((val) ^ 0xFFFF) + 1) & 0x0000FFFF) |
Macro for 2's compliment. More... | |
#define | ALARM_REG(address) ((address) / 32U) |
Alarm Register offet for supply. More... | |
#define | ALARM_SHIFT(address) ((address) % 32U) |
Supply bit in Alarm Register. More... | |
#define | GET_BIT(nr) (1UL << (nr)) |
Macro for bit shifter. More... | |
Functions | |
int | XSysMonPsv_TempOffset (XSysMonPsv_TempType Type) |
Provides the register offset for the different type. More... | |
int | XSysMonPsv_TempThreshOffset (XSysMonPsv_TempEvt Event, XSysMonPsv_EventDir Dir, u32 *Offset) |
Provides the temperature threshold (upper or lower) offset. More... | |
u32 | XSysMonPsv_SupplyOffset (XSysMonPsv *InstancePtr, int Supply) |
Provides the supply offset. More... | |
u32 | XSysMonPsv_SupplyThreshOffset (XSysMonPsv *InstancePtr, int Supply, XSysMonPsv_EventDir Dir) |
Provides the supply threshold (upper or lower) offset. More... | |
void | XSysMonPsv_Q8P7ToCelsius (u32 RawData, int *Val, int *Val2) |
Converts Q8P7 To Celsius. More... | |
void | XSysMonPsv_CelsiusToQ8P7 (u32 *RawData, int Val, int Val2) |
Converts Celsius To Q8P7. More... | |
void | XSysMonPsv_SupplyRawToProcessed (int RawData, int *Val, int *Val2) |
Converts raw data to processed. More... | |
void | XSysMonPsv_SupplyProcessedToRaw (int Val, int Val2, u32 RegVal, u32 *RawData) |
Converts processed data to raw. More... | |
u32 | XSysMonPsv_IsAlarmPresent (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply) |
Checks if the supply value has exceeded the set threshold values. More... | |
u32 | XSysMonPsv_ClearAlarm (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply) |
Clears alarm status. More... | |
int | XSysMonPsv_InterruptEnable (XSysMonPsv *InstancePtr, u32 Mask, u8 IntrNum) |
Enables the specified interrupts in the device. More... | |
int | XSysMonPsv_InterruptDisable (XSysMonPsv *InstancePtr, u32 Mask, u8 IntrNum) |
Disables the specified interrupts in the device. More... | |
int | XSysMonPsv_InterruptGetStatus (XSysMonPsv *InstancePtr, u32 *IntrStatus) |
Returns the interrupt status read from Interrupt Status Register(ISR). More... | |
void | XSysMonPsv_InterruptClear (XSysMonPsv *InstancePtr, u32 Mask) |
Clears the specified interrupts in the Interrupt Status Register(ISR). More... | |
void | XSysMonPsv_UnlockRegspace (XSysMonPsv *InstancePtr) |
Unlocks the register space of InstancePtr hardware. More... | |
#define ALARM_REG | ( | address | ) | ((address) / 32U) |
Alarm Register offet for supply.
Referenced by XSysMonPsv_DisableVoltageEvents(), and XSysMonPsv_EnableVoltageEvents().
#define ALARM_SHIFT | ( | address | ) | ((address) % 32U) |
Supply bit in Alarm Register.
Referenced by XSysMonPsv_DisableVoltageEvents(), and XSysMonPsv_EnableVoltageEvents().
#define compare | ( | val, | |
thresh | |||
) |
Macro to compare threshold with current value.
#define GET_BIT | ( | nr | ) | (1UL << (nr)) |
Macro for bit shifter.
Referenced by XSysMonPsv_EnableVoltageEvents().
#define twoscomp | ( | val | ) | ((((val) ^ 0xFFFF) + 1) & 0x0000FFFF) |
Macro for 2's compliment.
Referenced by XSysMonPsv_Q8P7ToCelsius().
#define XSYSMONPSV_BIT_ALARM0 0U |
Bit for supply[0-31].
#define XSYSMONPSV_BIT_ALARM1 1U |
Bit for supply[32-63].
#define XSYSMONPSV_BIT_ALARM2 2U |
Bit for supply[64-95].
#define XSYSMONPSV_BIT_ALARM3 3U |
Bit for supply[96-127].
#define XSYSMONPSV_BIT_ALARM4 4U |
Bit for supply[128-159].
#define XSYSMONPSV_BIT_ALARM5 5U |
Reserved.
#define XSYSMONPSV_BIT_ALARM6 6U |
Reserved.
#define XSYSMONPSV_BIT_ALARM7 7U |
Reserved.
#define XSYSMONPSV_BIT_OT 8U |
Over Temperature bit.
#define XSYSMONPSV_BIT_TEMP 9U |
Temperature bit.
#define XSYSMONPSV_INTR_0_ID (144U + 32U) |
Interrupt unique ID.
#define XSYSMONPSV_INTR_1_ID (145U + 32U) |
Interrupt unique ID.
#define XSYSMONPSV_INTR_OFFSET 0xCU |
Interrupt Offset.
#define XSYSMONPSV_LOCK_CODE 0xF9E8D7C6 |
Lock code value.
Referenced by XSysMonPsv_UnlockRegspace().
#define XSYSMONPSV_LOW_SAT_SIGNED_VAL 0x8000 |
Signed lower saturation value.
Referenced by XSysMonPsv_SupplyProcessedToRaw().
#define XSYSMONPSV_LOW_SAT_VAL 0x0000 |
Upper saturation value.
Referenced by XSysMonPsv_SupplyProcessedToRaw().
#define XSYSMONPSV_UP_SAT_SIGNED_VAL 0x7FFF |
Signed upper saturation value.
Referenced by XSysMonPsv_SupplyProcessedToRaw().
#define XSYSMONPSV_UP_SAT_VAL 0xFFFF |
Upper saturation value.
Referenced by XSysMonPsv_SupplyProcessedToRaw().
enum XSysMonPsv_EventDir |
enum XSysMonPsv_TempEvt |
enum XSysMonPsv_TempType |
void XSysMonPsv_CelsiusToQ8P7 | ( | u32 * | RawData, |
int | Val, | ||
int | Val2 | ||
) |
Converts Celsius To Q8P7.
RawData | Raw Temperature Data. |
Val | Numerator for covnersion to deg C. |
Val2 | Denominator for conversion to deg C in Q8.7 format. |
u32 XSysMonPsv_ClearAlarm | ( | XSysMonPsv * | InstancePtr, |
XSysMonPsv_Supply | Supply | ||
) |
Clears alarm status.
InstancePtr | Pointer to the driver instance. |
Supply | Enum which indicates the desired supply. |
References XSysMonPsv::Config, XSysMonPsv_Config::Supply_List, XSYSMONPSV_ALARM_FLAG0, XSYSMONPSV_INVALID, XSYSMONPSV_INVALID_SUPPLY, XSysMonPsv_ReadReg32(), and XSysMonPsv_WriteReg32().
void XSysMonPsv_InterruptClear | ( | XSysMonPsv * | InstancePtr, |
u32 | Mask | ||
) |
Clears the specified interrupts in the Interrupt Status Register(ISR).
InstancePtr | Pointer to the struct InstancePtr. |
Mask | 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.* |
References XSYSMONPSV_ISR_OFFSET, and XSysMonPsv_WriteReg32().
int XSysMonPsv_InterruptDisable | ( | XSysMonPsv * | InstancePtr, |
u32 | Mask, | ||
u8 | IntrNum | ||
) |
Disables the specified interrupts in the device.
InstancePtr | Pointer to the driver instance. |
Mask | 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 InstancePtr.h. |
IntrNum | Interrupt disable register to be used |
References XSYSMONPSV_IDR0_OFFSET, XSYSMONPSV_PCSR_LOCK, and XSysMonPsv_WriteReg32().
int XSysMonPsv_InterruptEnable | ( | XSysMonPsv * | InstancePtr, |
u32 | Mask, | ||
u8 | IntrNum | ||
) |
Enables the specified interrupts in the device.
InstancePtr | Pointer to the driver instance. |
Mask | 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 XSYSMON_IER_* bits defined in InstancePtr.h. |
IntrNum | Interrupt enable register to be used |
References XSYSMONPSV_IER0_OFFSET, XSYSMONPSV_PCSR_LOCK, and XSysMonPsv_WriteReg32().
Referenced by XSysMonPsv_EnableVoltageEvents().
int XSysMonPsv_InterruptGetStatus | ( | XSysMonPsv * | InstancePtr, |
u32 * | IntrStatus | ||
) |
Returns the interrupt status read from Interrupt Status Register(ISR).
Use the XSYSMONPSV_ISR* constants defined in InstancePtr.h to interpret the returned value.
InstancePtr | Pointer to the driver instance. |
IntrStatus | 32-bit value representing the contents of the Interrupt Status Register (ISR). |
References XSYSMONPSV_ISR_OFFSET, and XSysMonPsv_ReadReg32().
u32 XSysMonPsv_IsAlarmPresent | ( | XSysMonPsv * | InstancePtr, |
XSysMonPsv_Supply | Supply | ||
) |
Checks if the supply value has exceeded the set threshold values.
InstancePtr | Pointer to the driver instance. |
Supply | Enum which indicates the desired supply. |
References XSysMonPsv::Config, XSysMonPsv_Config::Supply_List, XSYSMONPSV_ALARM_FLAG0, XSYSMONPSV_INVALID, XSYSMONPSV_INVALID_SUPPLY, and XSysMonPsv_ReadReg32().
void XSysMonPsv_Q8P7ToCelsius | ( | u32 | RawData, |
int * | Val, | ||
int * | Val2 | ||
) |
Converts Q8P7 To Celsius.
RawData | Raw temperature Data. |
Val | Value in Q8P7 format. |
Val2 | Constant 128. |
References twoscomp.
Referenced by XSysMonPsv_ReadTempProcessed(), and XSysMonPsv_ReadTempProcessedSat().
u32 XSysMonPsv_SupplyOffset | ( | XSysMonPsv * | InstancePtr, |
int | Supply | ||
) |
Provides the supply offset.
InstancePtr | Pointer to the XSysMonPsv instance. |
Supply | Enum which indicates the desired supply. |
References XSysMonPsv::Config, XSysMonPsv_Config::Supply_List, and XSYSMONPSV_SUPPLY.
Referenced by XSysMonPsv_ReadSupplyProcessed(), and XSysMonPsv_ReadSupplyRaw().
void XSysMonPsv_SupplyProcessedToRaw | ( | int | Val, |
int | Val2, | ||
u32 | RegVal, | ||
u32 * | RawData | ||
) |
Converts processed data to raw.
Val | Numerator for conversion to volts. |
Val2 | Denominator for conversion to volts. |
RegVal | Register Value. |
RawData | Converted Raw data. |
References XSYSMONPSV_LOW_SAT, XSYSMONPSV_LOW_SAT_SIGNED, XSYSMONPSV_LOW_SAT_SIGNED_VAL, XSYSMONPSV_LOW_SAT_VAL, XSYSMONPSV_SUPPLY_FMT_MASK, XSYSMONPSV_SUPPLY_FMT_SHIFT, XSYSMONPSV_SUPPLY_MODE_MASK, XSYSMONPSV_SUPPLY_MODE_SHIFT, XSYSMONPSV_UP_SAT, XSYSMONPSV_UP_SAT_SIGNED, XSYSMONPSV_UP_SAT_SIGNED_VAL, and XSYSMONPSV_UP_SAT_VAL.
void XSysMonPsv_SupplyRawToProcessed | ( | int | RawData, |
int * | Val, | ||
int * | Val2 | ||
) |
Converts raw data to processed.
RawData | Raw voltage data. |
Val | Numerator for conversion to volts. |
Val2 | Denominator for conversion to volts. |
References XSYSMONPSV_SUPPLY_FMT_MASK, XSYSMONPSV_SUPPLY_FMT_SHIFT, XSYSMONPSV_SUPPLY_MANTISSA_MASK, XSYSMONPSV_SUPPLY_MANTISSA_SIGN, XSYSMONPSV_SUPPLY_MODE_MASK, and XSYSMONPSV_SUPPLY_MODE_SHIFT.
Referenced by XSysMonPsv_ReadSupplyProcessed().
u32 XSysMonPsv_SupplyThreshOffset | ( | XSysMonPsv * | InstancePtr, |
int | Supply, | ||
XSysMonPsv_EventDir | Dir | ||
) |
Provides the supply threshold (upper or lower) offset.
InstancePtr | Pointer to the XSysMonPsv instance. |
Supply | Enum which indicates the desired supply. |
Dir | Type of the direction - falling or rising. |
References XSysMonPsv::Config, XSysMonPsv_Config::Supply_List, XSYSMONPSV_EV_DIR_RISING, XSYSMONPSV_SUPPLY_TH_LOWER, and XSYSMONPSV_SUPPLY_TH_UPPER.
Referenced by XSysMonPsv_GetSupplyThresholdLower(), XSysMonPsv_GetSupplyThresholdUpper(), XSysMonPsv_SetSupplyThresholdLower(), and XSysMonPsv_SetSupplyThresholdUpper().
int XSysMonPsv_TempOffset | ( | XSysMonPsv_TempType | Type | ) |
Provides the register offset for the different type.
Type | Max or Min Temperature Type |
References XSYSMONPSV_DEVICE_TEMP_MAX, XSYSMONPSV_TEMP, XSYSMONPSV_TEMP_MAX, and XSYSMONPSV_TEMP_MIN.
Referenced by XSysMonPsv_ReadTempProcessed(), and XSysMonPsv_ReadTempRaw().
int XSysMonPsv_TempThreshOffset | ( | XSysMonPsv_TempEvt | Event, |
XSysMonPsv_EventDir | Dir, | ||
u32 * | Offset | ||
) |
Provides the temperature threshold (upper or lower) offset.
Event | Temp or OT event type. |
Dir | Falling or rising direction |
Offset | Upper or lower threshold offset. |
References XSYSMONPSV_DEVICE_TEMP_TH_FALLING, XSYSMONPSV_DEVICE_TEMP_TH_RISING, XSYSMONPSV_EV_DIR_RISING, XSYSMONPSV_OT_EVENT, XSYSMONPSV_OT_TEMP_TH_FALLING, XSYSMONPSV_OT_TEMP_TH_RISING, and XSYSMONPSV_TEMP_EVENT.
void XSysMonPsv_UnlockRegspace | ( | XSysMonPsv * | InstancePtr | ) |
Unlocks the register space of InstancePtr hardware.
InstancePtr | Pointer to the driver instance. |
References XSYSMONPSV_LOCK_CODE, XSYSMONPSV_PCSR_LOCK, and XSysMonPsv_WriteReg32().