![]() |
xadcps
Vitis Drivers API Documentation
|
This file contains a design example using the driver functions of the XADC/ADC driver.
This example here shows the usage of the driver/device in interrupt mode to handle on-chip temperature and voltage alarm interrupts.
This code assumes that no Operating System is being used.
The values of the on-chip temperature and the on-chip Vccaux voltage are read from the device and then the alarm thresholds are set in such a manner that the alarms occur.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a bss 01/20/12 First release 2.2 ms 01/23/17 Modified xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. 2.7 cog 07/24/23 Added support for SDT flow
Functions | |
int | XAdcIntrExample (XScuGic *IntcInstancePtr, XAdcPs *XAdcInstPtr, u16 XAdcDeviceId, u16 XAdcIntrId, int *Temp) |
This function runs a test on the XADC/ADC device using the driver APIs. More... | |
int | main (void) |
Main function that invokes the XADC Interrupt example. More... | |
int main | ( | void | ) |
Main function that invokes the XADC Interrupt example.
None. |
References XAdcIntrExample().
int XAdcIntrExample | ( | XScuGic * | IntcInstancePtr, |
XAdcPs * | XAdcInstPtr, | ||
u16 | XAdcDeviceId, | ||
u16 | XAdcIntrId, | ||
int * | Temp | ||
) |
This function runs a test on the XADC/ADC device using the driver APIs.
The function does the following tasks:
IntcInstancePtr | is a pointer to the Interrupt Controller driver Instance. |
XAdcInstPtr | is a pointer to the XAdcPs driver Instance. |
XAdcDeviceId | is the XPAR_<SYSMON_ADC_instance>_DEVICE_ID value from xparameters.h. |
XAdcIntrId | is XPAR_<INTC_instance>_<SYSMON_ADC_instance>_VEC_ID value from xparameters.h |
Temp | is an output parameter, it is a pointer through which the current temperature value is returned to the main function. |
References XAdcPs_Config::BaseAddress, XADCPS_ATR_TEMP_LOWER, XADCPS_ATR_TEMP_UPPER, XADCPS_ATR_VCCPAUX_LOWER, XADCPS_ATR_VCCPAUX_UPPER, XAdcPs_CfgInitialize(), XADCPS_CFR1_ALM_TEMP_MASK, XADCPS_CFR1_ALM_VCCPAUX_MASK, XADCPS_CH_TEMP, XADCPS_CH_VCCPAUX, XAdcPs_GetAdcData(), XAdcPs_IntrClear(), XAdcPs_IntrEnable(), XAdcPs_IntrGetStatus(), XADCPS_INTX_ALM0_MASK, XADCPS_INTX_ALM5_MASK, XAdcPs_LookupConfig(), XAdcPs_SelfTest(), XADCPS_SEQ_MODE_INDEPENDENT, XADCPS_SEQ_MODE_SAFE, XAdcPs_SetAlarmEnables(), XAdcPs_SetAlarmThreshold(), and XAdcPs_SetSequencerMode().
Referenced by main().