![]() |
devcfg
Xilinx SDK Drivers API Documentation
|
This file contains a design example using the DevCfg driver and hardware device.
This example prints out the values of all the configuration registers in the FPGA.
This example assumes that there is a UART Device or STDIO Device in the hardware system.
MODIFICATION HISTORY:
Ver Who Date Changes
3.1 sb 08/25/14 First Release *
Macros | |
Configuration Type1 packet headers masks | |
#define | XDC_TYPE_SHIFT 29 |
#define | XDC_REGISTER_SHIFT 13 |
#define | XDC_OP_SHIFT 27 |
#define | XDC_TYPE_1 1 |
#define | OPCODE_READ 1 |
Functions | |
int | XDcfgRegReadExample (u16 DeviceId) |
This function reads the configuration registers inside the FPGA. More... | |
int | XDcfg_GetConfigReg (XDcfg *DcfgInstancePtr, u32 ConfigReg, u32 *RegData) |
This function returns the value of the specified configuration register. More... | |
u32 | XDcfg_RegAddr (u8 Register, u8 OpCode, u8 Size) |
Generates a Type 1 packet header that reads back the requested Configuration register. More... | |
int | main (void) |
Main function to call the DevCfg Reg Read example. More... | |
int main | ( | void | ) |
Main function to call the DevCfg Reg Read example.
None. |
References XDcfgRegReadExample().
int XDcfg_GetConfigReg | ( | XDcfg * | DcfgInstancePtr, |
u32 | ConfigReg, | ||
u32 * | RegData | ||
) |
This function returns the value of the specified configuration register.
InstancePtr | is a pointer to the XHwIcap instance. |
ConfigReg | is a constant which represents the configuration register value to be returned. |
RegData | is the value of the specified configuration register. |
References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg_IntrClear(), XDCFG_IXR_D_P_DONE_MASK, XDCFG_IXR_DMA_DONE_MASK, XDCFG_IXR_PCFG_DONE_MASK, XDcfg_ReadReg, XDcfg_RegAddr(), XDCFG_STATUS_DMA_CMD_Q_F_MASK, and XDCFG_STATUS_OFFSET.
Referenced by XDcfgRegReadExample().
u32 XDcfg_RegAddr | ( | u8 | Register, |
u8 | OpCode, | ||
u8 | Size | ||
) |
Generates a Type 1 packet header that reads back the requested Configuration register.
Register | is the address of the register to be read back. |
OpCode | is the read/write operation code. |
Size | is the size of the word to be read. |
Referenced by XDcfg_GetConfigReg().
int XDcfgRegReadExample | ( | u16 | DeviceId | ) |
This function reads the configuration registers inside the FPGA.
DeviceId | is the unique device id of the device. |
References XDcfg_Config::BaseAddr, XDcfg_CfgInitialize(), XDcfg_GetConfigReg(), XDcfg_LookupConfig(), and XDcfg_SelfTest().
Referenced by main().