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) |
This function gives the register offset for the different type. More... | |
int | XSysMonPsv_TempThreshOffset (XSysMonPsv_TempEvt Event, XSysMonPsv_EventDir Dir, u32 *Offset) |
This function gives the temperature threshold (upper or lower) offset. More... | |
u32 | XSysMonPsv_SupplyOffset (XSysMonPsv *InstancePtr, int Supply) |
This function gives the supply offset. More... | |
u32 | XSysMonPsv_SupplyThreshOffset (XSysMonPsv *InstancePtr, int Supply, XSysMonPsv_EventDir Dir) |
This function gives the supply threshold (upper or lower) offset. More... | |
void | XSysMonPsv_Q8P7ToCelsius (u32 RawData, int *Val, int *Val2) |
This function converts Q8P7 To Celsius. More... | |
void | XSysMonPsv_CelsiusToQ8P7 (u32 *RawData, int Val, int Val2) |
This function converts Celsius To Q8P7. More... | |
void | XSysMonPsv_SupplyRawToProcessed (int RawData, int *Val, int *Val2) |
This function converts raw data to processed. More... | |
void | XSysMonPsv_SupplyProcessedToRaw (int Val, int Val2, u32 RegVal, u32 *RawData) |
This function converts processed data to raw. More... | |
u32 | XSysMonPsv_IsAlarmPresent (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply) |
This function is to be used to check if the supply value has exceeded the set threshold values. More... | |
u32 | XSysMonPsv_ClearAlarm (XSysMonPsv *InstancePtr, XSysMonPsv_Supply Supply) |
This function is to be used to clear alarm status. More... | |
int | XSysMonPsv_InterruptEnable (XSysMonPsv *InstancePtr, u32 Mask, u8 IntrNum) |
This function enables the specified interrupts in the device. More... | |
int | XSysMonPsv_InterruptDisable (XSysMonPsv *InstancePtr, u32 Mask, u8 IntrNum) |
This function disables the specified interrupts in the device. More... | |
int | XSysMonPsv_InterruptGetStatus (XSysMonPsv *InstancePtr, u32 *IntrStatus) |
This function returns the interrupt status read from Interrupt Status Register(ISR). More... | |
void | XSysMonPsv_InterruptClear (XSysMonPsv *InstancePtr, u32 Mask) |
This function clears the specified interrupts in the Interrupt Status Register (ISR). More... | |
void | XSysMonPsv_UnlockRegspace (XSysMonPsv *InstancePtr) |
This function 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 | ||
) |
This function converts Celsius To Q8P7.
RawData | is Raw Temperature Data. |
Val | is the numerator for covnersion to deg C. |
Val2 | is the denominator for conversion to deg C in Q8.7 format. |
u32 XSysMonPsv_ClearAlarm | ( | XSysMonPsv * | InstancePtr, |
XSysMonPsv_Supply | Supply | ||
) |
This function is to be used to clear alarm status.
InstancePtr | is a pointer to the driver instance. |
Supply | is an 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 | ||
) |
This function clears the specified interrupts in the Interrupt Status Register (ISR).
InstancePtr | is a pointer to the struct InstancePtr. |
Mask | is 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.* |
References XSYSMONPSV_ISR_OFFSET, and XSysMonPsv_WriteReg32().
int XSysMonPsv_InterruptDisable | ( | XSysMonPsv * | InstancePtr, |
u32 | Mask, | ||
u8 | IntrNum | ||
) |
This function disables the specified interrupts in the device.
InstancePtr | is a pointer to the driver instance. |
Mask | is 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 InstancePtr.h. |
IntrNum | is the 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 | ||
) |
This function enables the specified interrupts in the device.
InstancePtr | is a pointer to the driver instance. |
Mask | is 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 XSYSMON_IER_* bits defined in InstancePtr.h. |
IntrNum | is the 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 | ||
) |
This function 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 | is a pointer to the driver instance. |
A | 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 | ||
) |
This function is to be used to check if the supply value has exceeded the set threshold values.
InstancePtr | is a pointer to the driver instance. |
Supply | is an 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 | ||
) |
This function converts Q8P7 To Celsius.
RawData | is Raw temperature Data. |
Val | is value in Q8P7 format. |
Val2 | is constant 128. |
References twoscomp.
Referenced by XSysMonPsv_ReadTempProcessed(), and XSysMonPsv_ReadTempProcessedSat().
u32 XSysMonPsv_SupplyOffset | ( | XSysMonPsv * | InstancePtr, |
int | Supply | ||
) |
This function gives the supply offset.
InstancePtr | is a pointer to the XSysMonPsv instance. |
Supply | is an 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 | ||
) |
This function converts processed data to raw.
Val | is numerator for conversion to volts. |
Val2 | is denominator for conversion to volts. |
RegVal | is Register Value. |
RawData | is 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 | ||
) |
This function converts raw data to processed.
RawData | is raw voltage data. |
Val | is numerator for conversion to volts. |
Val2 | is 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 | ||
) |
This function gives the supply threshold (upper or lower) offset.
InstancePtr | is a pointer to the XSysMonPsv instance. |
Supply | is an enum which indicates the desired supply. |
Dir | is Falling or rising direction. |
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 | ) |
This function gives the register offset for the different type.
Type | is 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 | ||
) |
This function gives the temperature threshold (upper or lower) offset.
Event | is Temp or OT event type. |
Dir | is falling or rising direction |
Offset | is the 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 | ) |
This function unlocks the register space of InstancePtr hardware.
InstancePtr | is a pointer to the driver instance. |
References XSYSMONPSV_LOCK_CODE, XSYSMONPSV_PCSR_LOCK, and XSysMonPsv_WriteReg32().