devcfg
Xilinx SDK Drivers API Documentation
xdevcfg_reg_readback_example.c File Reference

Overview

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.

Note
None.

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

Function Documentation

◆ main()

int main ( void  )

Main function to call the DevCfg Reg Read example.

Parameters
None.
Returns
  • XST_SUCCESS if successful
  • XST_FAILURE if unsuccessful
Note
None.

References XDcfgRegReadExample().

◆ XDcfg_GetConfigReg()

int XDcfg_GetConfigReg ( XDcfg DcfgInstancePtr,
u32  ConfigReg,
u32 *  RegData 
)

This function returns the value of the specified configuration register.

Parameters
InstancePtris a pointer to the XHwIcap instance.
ConfigRegis a constant which represents the configuration register value to be returned.
RegDatais the value of the specified configuration register.
Returns
  • XST_SUCCESS if successful
  • XST_FAILURE if unsuccessful
Note
None.

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().

◆ XDcfg_RegAddr()

u32 XDcfg_RegAddr ( u8  Register,
u8  OpCode,
u8  Size 
)

Generates a Type 1 packet header that reads back the requested Configuration register.

Parameters
Registeris the address of the register to be read back.
OpCodeis the read/write operation code.
Sizeis the size of the word to be read.
Returns
Type 1 packet header to read the specified register
Note
None.

Referenced by XDcfg_GetConfigReg().

◆ XDcfgRegReadExample()

int XDcfgRegReadExample ( u16  DeviceId)

This function reads the configuration registers inside the FPGA.

Parameters
DeviceIdis the unique device id of the device.
Returns
  • XST_SUCCESS if successful
  • XST_FAILURE if unsuccessful
Note
None.

References XDcfg_Config::BaseAddr, XDcfg_CfgInitialize(), XDcfg_GetConfigReg(), XDcfg_LookupConfig(), and XDcfg_SelfTest().

Referenced by main().