devcfg: Devcfg_v3_5

| devcfg Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Typedefs | Functions | Variables
Devcfg_v3_5

## Data Structures
struct | XDcfg_Config
| This typedef contains configuration information for the device. More...
struct | XDcfg
| The XDcfg driver instance data. More...

## Macros
#define | XDcfg_Unlock(InstancePtr)
| Unlock the Device Config Interface block. More...
#define | XDcfg_GetPsVersion(InstancePtr)
| Get the version number of the PS from the Miscellaneous Control Register. More...
#define | XDcfg_ReadMultiBootConfig(InstancePtr)
| Read the multiboot config register value. More...
#define | XDcfg_SelectIcapInterface(InstancePtr)
| Selects ICAP interface for reconfiguration after the initial configuration of the PL. More...
#define | XDcfg_SelectPcapInterface(InstancePtr)
| Selects PCAP interface for reconfiguration after the initial configuration of the PL. More...

## Typedefs
typedef void(* | XDcfg_IntrHandler )(void *CallBackRef, u32 Status)
| The handler data type allows the user to define a callback function to respond to interrupt events in the system. More...

## Functions
int | XDcfg_CfgInitialize (XDcfg *InstancePtr, XDcfg_Config *ConfigPtr, u32 EffectiveAddress)
| Initialize the Device Config Interface driver. More...
void | XDcfg_EnablePCAP (XDcfg *InstancePtr)
| The functions enables the PCAP interface by setting the PCAP mode bit in the control register. More...
void | XDcfg_DisablePCAP (XDcfg *InstancePtr)
| The functions disables the PCAP interface by clearing the PCAP mode bit in the control register. More...
void | XDcfg_SetControlRegister (XDcfg *InstancePtr, u32 Mask)
| The function sets the contents of the Control Register. More...
void | XDcfg_ClearControlRegister (XDcfg *InstancePtr, u32 Mask)
| The function Clears the specified bit positions of the Control Register. More...
u32 | XDcfg_GetControlRegister (XDcfg *InstancePtr)
| The function reads the contents of the Control Register. More...
void | XDcfg_SetLockRegister (XDcfg *InstancePtr, u32 Data)
| The function sets the contents of the Lock Register. More...
u32 | XDcfg_GetLockRegister (XDcfg *InstancePtr)
| The function reads the contents of the Lock Register. More...
void | XDcfg_SetConfigRegister (XDcfg *InstancePtr, u32 Data)
| The function sets the contents of the Configuration Register with the given value. More...
u32 | XDcfg_GetConfigRegister (XDcfg *InstancePtr)
| The function reads the contents of the Configuration Register with the given value. More...
void | XDcfg_SetStatusRegister (XDcfg *InstancePtr, u32 Data)
| The function sets the contents of the Status Register. More...
u32 | XDcfg_GetStatusRegister (XDcfg *InstancePtr)
| The function reads the contents of the Status Register. More...
void | XDcfg_SetRomShadowRegister (XDcfg *InstancePtr, u32 Data)
| The function sets the contents of the ROM Shadow Control Register. More...
u32 | XDcfg_GetSoftwareIdRegister (XDcfg *InstancePtr)
| The function reads the contents of the Software ID Register. More...
void | XDcfg_SetMiscControlRegister (XDcfg *InstancePtr, u32 Mask)
| The function sets the bit mask for the feature in Miscellaneous Control Register. More...
u32 | XDcfg_GetMiscControlRegister (XDcfg *InstancePtr)
| The function reads the contents of the Miscellaneous Control Register. More...
u32 | XDcfg_IsDmaBusy (XDcfg *InstancePtr)
| This function checks if DMA command queue is full. More...
void | XDcfg_InitiateDma (XDcfg *InstancePtr, u32 SourcePtr, u32 DestPtr, u32 SrcWordLength, u32 DestWordLength)
| This function initiates the DMA transfer. More...
u32 | XDcfg_Transfer (XDcfg *InstancePtr, void *SourcePtr, u32 SrcWordLength, void *DestPtr, u32 DestWordLength, u32 TransferType)
| This function starts the DMA transfer. More...
XDcfg_Config * | XDcfg_LookupConfig (u16 DeviceId)
| Lookup the device configuration based on the unique device ID. More...
int | XDcfg_SelfTest (XDcfg *InstancePtr)
| Run a self-test on the Device Configuration Interface. More...
void | XDcfg_IntrEnable (XDcfg *InstancePtr, u32 Mask)
| This function enables the specified interrupts in the device. More...
void | XDcfg_IntrDisable (XDcfg *InstancePtr, u32 Mask)
| This function disables the specified interrupts in the device. More...
u32 | XDcfg_IntrGetEnabled (XDcfg *InstancePtr)
| This function returns the enabled interrupts read from the Interrupt Mask Register. More...
u32 | XDcfg_IntrGetStatus (XDcfg *InstancePtr)
| This function returns the interrupt status read from Interrupt Status Register. More...
void | XDcfg_IntrClear (XDcfg *InstancePtr, u32 Mask)
| This function clears the specified interrupts in the Interrupt Status Register. More...
void | XDcfg_InterruptHandler (XDcfg *InstancePtr)
| The interrupt handler for the Device Config Interface. More...
void | XDcfg_SetHandler (XDcfg *InstancePtr, void *CallBackFunc, void *CallBackRef)
| This function sets the handler that will be called when an event (interrupt) occurs that needs application's attention. More...
void | XDcfg_ResetHw (u32 BaseAddr)
| This function perform the reset sequence to the given devcfg interface by configuring the appropriate control bits in the devcfg specifc registers the devcfg reset squence involves the following steps Disable all the interuupts Clear the status Update relevant config registers with reset values Disbale the looopback mode and pcap rate enable. More...

## Variables
XDcfg_Config | XDcfg_ConfigTable [1]
| This table contains configuration information for each Device Config Interface instance in the system. More...

## Macro Definition Documentation

#define XDcfg_GetPsVersion | ( |  | InstancePtr | ) |

Value:
((XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, \
XDCFG_MCTRL_OFFSET)) & \
XDCFG_MCTRL_PCAP_PS_VERSION_MASK) >> \
XDCFG_MCTRL_PCAP_PS_VERSION_SHIFT
XDCFG_MCTRL_PCAP_PS_VERSION_MASK
#define XDCFG_MCTRL_PCAP_PS_VERSION_MASK
PS Version Mask.
Definition: xdevcfg_hw.h:406
XDcfg_ReadReg
#define XDcfg_ReadReg(BaseAddr, RegOffset)
Read the given register.
Definition: xdevcfg_hw.h:450
XDCFG_MCTRL_PCAP_PS_VERSION_SHIFT
#define XDCFG_MCTRL_PCAP_PS_VERSION_SHIFT
PS Version Shift.
Definition: xdevcfg_hw.h:407
XDCFG_MCTRL_OFFSET
#define XDCFG_MCTRL_OFFSET
Miscellaneous Control Reg.
Definition: xdevcfg_hw.h:85

Get the version number of the PS from the Miscellaneous Control Register.

Parameters

  InstancePtr | is a pointer to the instance of XDcfg driver.

Returns
  Version of the PS.

Note
  C-style signature: void XDcfg_GetPsVersion(XDcfg* InstancePtr)

#define XDcfg_ReadMultiBootConfig | ( |  | InstancePtr | ) |

Value:
XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, \
XDCFG_MULTIBOOT_ADDR_OFFSET)
XDCFG_MULTIBOOT_ADDR_OFFSET
#define XDCFG_MULTIBOOT_ADDR_OFFSET
Multi BootAddress Pointer.
Definition: xdevcfg_hw.h:82
XDcfg_ReadReg
#define XDcfg_ReadReg(BaseAddr, RegOffset)
Read the given register.
Definition: xdevcfg_hw.h:450

Read the multiboot config register value.

Parameters

  InstancePtr | is a pointer to the instance of XDcfg driver.

Returns
  None.

Note
  C-style signature: u32 XDcfg_ReadMultiBootConfig(XDcfg* InstancePtr)

#define XDcfg_SelectIcapInterface | ( |  | InstancePtr | ) |

Value:
XDcfg_WriteReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET, \
((XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET)) \
& ( ~XDCFG_CTRL_PCAP_PR_MASK)))
XDCFG_CTRL_OFFSET
#define XDCFG_CTRL_OFFSET
Control Register.
Definition: xdevcfg_hw.h:71
XDcfg_ReadReg
#define XDcfg_ReadReg(BaseAddr, RegOffset)
Read the given register.
Definition: xdevcfg_hw.h:450
XDcfg_WriteReg
#define XDcfg_WriteReg(BaseAddr, RegOffset, Data)
Write to the given register.
Definition: xdevcfg_hw.h:468
XDCFG_CTRL_PCAP_PR_MASK
#define XDCFG_CTRL_PCAP_PR_MASK
Enable PCAP for PR.
Definition: xdevcfg_hw.h:104

Selects ICAP interface for reconfiguration after the initial configuration of the PL.

Parameters

  InstancePtr | is a pointer to the instance of XDcfg driver.

Returns
  None.

Note
  C-style signature: void XDcfg_SelectIcapInterface(XDcfg* InstancePtr)

#define XDcfg_SelectPcapInterface | ( |  | InstancePtr | ) |

Value:
XDcfg_WriteReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET, \
((XDcfg_ReadReg((InstancePtr)->Config.BaseAddr, XDCFG_CTRL_OFFSET)) \
| XDCFG_CTRL_PCAP_PR_MASK))
XDCFG_CTRL_OFFSET
#define XDCFG_CTRL_OFFSET
Control Register.
Definition: xdevcfg_hw.h:71
XDcfg_ReadReg
#define XDcfg_ReadReg(BaseAddr, RegOffset)
Read the given register.
Definition: xdevcfg_hw.h:450
XDcfg_WriteReg
#define XDcfg_WriteReg(BaseAddr, RegOffset, Data)
Write to the given register.
Definition: xdevcfg_hw.h:468
XDCFG_CTRL_PCAP_PR_MASK
#define XDCFG_CTRL_PCAP_PR_MASK
Enable PCAP for PR.
Definition: xdevcfg_hw.h:104

Selects PCAP interface for reconfiguration after the initial configuration of the PL.

Parameters

  InstancePtr | is a pointer to the instance of XDcfg driver.

Returns
  None.

Note
  C-style signature: void XDcfg_SelectPcapInterface(XDcfg* InstancePtr)

#define XDcfg_Unlock | ( |  | InstancePtr | ) |

Value:
XDcfg_WriteReg((InstancePtr)->Config.BaseAddr, \
XDCFG_UNLOCK_OFFSET, XDCFG_UNLOCK_DATA)
XDCFG_UNLOCK_DATA
#define XDCFG_UNLOCK_DATA
First APB access data.
Definition: xdevcfg_hw.h:424
XDCFG_UNLOCK_OFFSET
#define XDCFG_UNLOCK_OFFSET
Unlock Register.
Definition: xdevcfg_hw.h:84
XDcfg_WriteReg
#define XDcfg_WriteReg(BaseAddr, RegOffset, Data)
Write to the given register.
Definition: xdevcfg_hw.h:468

Unlock the Device Config Interface block.

Parameters

  InstancePtr | is a pointer to the instance of XDcfg driver.

Returns
  None.

Note
  C-style signature: void XDcfg_Unlock(XDcfg* InstancePtr)

Referenced by XDcfg_CfgInitialize().

## Typedef Documentation

typedef void(* XDcfg_IntrHandler)(void *CallBackRef, u32 Status)

The handler data type allows the user to define a callback function to respond to interrupt events in the system.

This function is executed in interrupt context, so amount of processing should be minimized.

Parameters

  CallBackRef | is the callback reference passed in by the upper layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. Its type is unimportant to the driver component, so it is a void pointer.
  Status | is the Interrupt status of the XDcfg device.

## Function Documentation

int XDcfg_CfgInitialize | ( | XDcfg * | InstancePtr,
|  | XDcfg_Config * | ConfigPtr,
|  | u32 | EffectiveAddress
| ) |  |

Initialize the Device Config Interface driver.

This function must be called before other functions of the driver are called.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  ConfigPtr | is the config structure.
  EffectiveAddress | is the base address for the device. It could be a virtual address if address translation is supported in the system, otherwise it is the physical address.

Returns
  - XST_SUCCESS if initialization was successful.
  - XST_DEVICE_IS_STARTED if the device has already been started.

Note
  The very first APB access to the Device Configuration Interface block needs to be a write to the UNLOCK register with the value of 0x757BDF0D. This step is to be done once after reset, any other APB access has to come after this. The APB access is considered illegal if the step is not done or if it is done incorrectly. Furthermore, if any of efuse_sec_cfg[5:0] is high, the following additional actions would be carried out. In other words, if all bits are low, the following steps are not done.
  1. AES is disabled
  2. All APB writes disabled
  3. SoC debug fully enabled

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg_Config::DeviceId, XDcfg::IsReady, XDcfg::IsStarted, and XDcfg_Unlock.

Referenced by DcfgSelfTestExample(), XDcfgInterruptExample(), and XDcfgRegReadExample().

void XDcfg_ClearControlRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Mask
| ) |  |

The function Clears the specified bit positions of the Control Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Mask | is the 32 bit value which holds the bit positions to be cleared.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CTRL_OFFSET, XDcfg_ReadReg, and XDcfg_WriteReg.

void XDcfg_DisablePCAP | ( | XDcfg * | InstancePtr | ) |

The functions disables the PCAP interface by clearing the PCAP mode bit in the control register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CTRL_OFFSET, XDCFG_CTRL_PCAP_MODE_MASK, XDcfg_ReadReg, and XDcfg_WriteReg.

void XDcfg_EnablePCAP | ( | XDcfg * | InstancePtr | ) |

The functions enables the PCAP interface by setting the PCAP mode bit in the control register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  None.

Note
  Enable FPGA programming from PCAP interface. Enabling this bit disables all the external interfaces from programming of FPGA except for ICAP. The user needs to ensure that the FPGA is programmed through either PCAP or ICAP.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CTRL_OFFSET, XDCFG_CTRL_PCAP_MODE_MASK, XDcfg_ReadReg, and XDcfg_WriteReg.

Referenced by XDcfgInterruptExample().

u32 XDcfg_GetConfigRegister | ( | XDcfg * | InstancePtr | ) |

The function reads the contents of the Configuration Register with the given value.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  A 32-bit value representing the contents of the Config Register. Use the XDCFG_CFG_*_MASK constants defined in xdevcfg_hw.h to interpret the returned value.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CFG_OFFSET, and XDcfg_ReadReg.

u32 XDcfg_GetControlRegister | ( | XDcfg * | InstancePtr | ) |

The function reads the contents of the Control Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  A 32-bit value representing the contents of the Control Register. Use the XDCFG_CTRL_*_MASK constants defined in xdevcfg_hw.h to interpret the returned value.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CTRL_OFFSET, and XDcfg_ReadReg.

Referenced by XDcfg_SelfTest().

u32 XDcfg_GetLockRegister | ( | XDcfg * | InstancePtr | ) |

The function reads the contents of the Lock Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  A 32-bit value representing the contents of the Lock Register. Use the XDCFG_CR_*_MASK constants defined in xdevcfg_hw.h to interpret the returned value.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_LOCK_OFFSET, and XDcfg_ReadReg.

u32 XDcfg_GetMiscControlRegister | ( | XDcfg * | InstancePtr | ) |

The function reads the contents of the Miscellaneous Control Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  32 Bit boot software ID.

Note
  This register is locked for write once the system enters usermode. Hence API to reading the register only is provided.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_MCTRL_OFFSET, and XDcfg_ReadReg.

u32 XDcfg_GetSoftwareIdRegister | ( | XDcfg * | InstancePtr | ) |

The function reads the contents of the Software ID Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  32 Bit boot software ID.

Note
  This register is locked for write once the system enters usermode. Hence API for reading the register only is provided.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDcfg_ReadReg, and XDCFG_SW_ID_OFFSET.

u32 XDcfg_GetStatusRegister | ( | XDcfg * | InstancePtr | ) |

The function reads the contents of the Status Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  A 32-bit value representing the contents of the Status Register. Use the XDCFG_STATUS_*_MASK constants defined in xdevcfg_hw.h to interpret the returned value.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDcfg_ReadReg, and XDCFG_STATUS_OFFSET.

void XDcfg_InitiateDma | ( | XDcfg * | InstancePtr,
|  | u32 | SourcePtr,
|  | u32 | DestPtr,
|  | u32 | SrcWordLength,
|  | u32 | DestWordLength
| ) |  |

This function initiates the DMA transfer.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  SourcePtr | contains a pointer to the source memory where the data is to be transferred from.
  SrcWordLength | is the number of words (32 bit) to be transferred for the source transfer.
  DestPtr | contains a pointer to the destination memory where the data is to be transferred to.
  DestWordLength | is the number of words (32 bit) to be transferred for the Destination transfer.

Returns
  None.

Note
  It is the responsibility of the caller function to ensure that correct values are passed to this function.

          The 2 LSBs of the SourcePtr (Source)/ DestPtr (Destination)

  address when equal to 2�b01 indicates the last DMA command of an overall transfer.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDCFG_DMA_DEST_ADDR_OFFSET, XDCFG_DMA_DEST_LEN_OFFSET, XDCFG_DMA_SRC_ADDR_OFFSET, XDCFG_DMA_SRC_LEN_OFFSET, and XDcfg_WriteReg.

Referenced by XDcfg_GetConfigReg(), and XDcfg_Transfer().

void XDcfg_InterruptHandler | ( | XDcfg * | InstancePtr | ) |

The interrupt handler for the Device Config Interface.

Events are signaled to upper layer for proper handling.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_INT_STS_OFFSET, XDcfg_ReadReg, and XDcfg_WriteReg.

void XDcfg_IntrClear | ( | XDcfg * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function clears the specified interrupts in the Interrupt Status Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Mask | is the 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. This mask is formed by OR'ing XDCFG_INT_* bits which are defined in xdevcfg_hw.h.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_INT_STS_OFFSET, and XDcfg_WriteReg.

Referenced by XDcfg_GetConfigReg(), and XDcfgInterruptExample().

void XDcfg_IntrDisable | ( | XDcfg * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function disables the specified interrupts in the device.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Mask | is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XDCFG_INT_* bits defined in xdevcfg_hw.h.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_INT_MASK_OFFSET, XDcfg_ReadReg, and XDcfg_WriteReg.

Referenced by XDcfgInterruptExample().

void XDcfg_IntrEnable | ( | XDcfg * | InstancePtr,
|  | u32 | Mask
| ) |  |

This function enables the specified interrupts in the device.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Mask | is the 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 XDCFG_INT_* bits defined in xdevcfg_hw.h.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_INT_MASK_OFFSET, XDcfg_ReadReg, and XDcfg_WriteReg.

Referenced by XDcfgInterruptExample().

u32 XDcfg_IntrGetEnabled | ( | XDcfg * | InstancePtr | ) |

This function returns the enabled interrupts read from the Interrupt Mask Register.

Use the XDCFG_INT_* constants defined in xdevcfg_hw.h to interpret the returned value.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  A 32-bit value representing the contents of the IMR.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_INT_MASK_OFFSET, and XDcfg_ReadReg.

u32 XDcfg_IntrGetStatus | ( | XDcfg * | InstancePtr | ) |

This function returns the interrupt status read from Interrupt Status Register.

Use the XDCFG_INT_* constants defined in xdevcfg_hw.h to interpret the returned value.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  A 32-bit value representing the contents of the Interrupt Status register.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_INT_STS_OFFSET, and XDcfg_ReadReg.

Referenced by XDcfg_GetConfigReg(), and XDcfgInterruptExample().

u32 XDcfg_IsDmaBusy | ( | XDcfg * | InstancePtr | ) |

This function checks if DMA command queue is full.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  XST_SUCCESS is the DMA is busy XST_FAILURE if the DMA is idle

Note
  The DMA queue has a depth of two.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDcfg_ReadReg, XDCFG_STATUS_DMA_CMD_Q_F_MASK, and XDCFG_STATUS_OFFSET.

Referenced by XDcfg_Transfer().

XDcfg_Config * XDcfg_LookupConfig | ( | u16 | DeviceId | ) |

Lookup the device configuration based on the unique device ID.

The table contains the configuration info for each device in the system.

Parameters

  DeviceId | is the unique device ID of the device being looked up.

Returns
  A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.

Note
  None.

References XDcfg_ConfigTable.

Referenced by DcfgSelfTestExample(), XDcfgInterruptExample(), and XDcfgRegReadExample().

void XDcfg_ResetHw | ( | u32 | BaseAddr | ) |

This function perform the reset sequence to the given devcfg interface by configuring the appropriate control bits in the devcfg specifc registers the devcfg reset squence involves the following steps Disable all the interuupts Clear the status Update relevant config registers with reset values Disbale the looopback mode and pcap rate enable.

Parameters

  BaseAddress | of the interface

Returns
  N/A

Note
  This function will not modify the slcr registers that are relavant for devcfg controller

References XDCFG_CFG_OFFSET, XDCFG_CONFIG_RESET_VALUE, XDCFG_CTRL_OFFSET, XDCFG_CTRL_PCAP_RATE_EN_MASK, XDCFG_DMA_DEST_ADDR_OFFSET, XDCFG_DMA_DEST_LEN_OFFSET, XDCFG_DMA_SRC_ADDR_OFFSET, XDCFG_DMA_SRC_LEN_OFFSET, XDCFG_INT_MASK_OFFSET, XDCFG_INT_STS_OFFSET, XDCFG_MCTRL_OFFSET, XDCFG_MCTRL_PCAP_LPBK_MASK, XDcfg_ReadReg, and XDcfg_WriteReg.

int XDcfg_SelfTest | ( | XDcfg * | InstancePtr | ) |

Run a self-test on the Device Configuration Interface.

This test does a control register write and reads back the same value.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.

Returns
  - XST_SUCCESS if self-test was successful.
  - XST_FAILURE if fails.

Note
  None.

References XDcfg::IsReady, XDCFG_CTRL_NIDEN_MASK, XDcfg_GetControlRegister(), and XDcfg_SetControlRegister().

Referenced by DcfgSelfTestExample(), XDcfgInterruptExample(), and XDcfgRegReadExample().

void XDcfg_SetConfigRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Data
| ) |  |

The function sets the contents of the Configuration Register with the given value.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Data | is the 32 bit data to be written to the Register.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CFG_OFFSET, and XDcfg_WriteReg.

void XDcfg_SetControlRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Mask
| ) |  |

The function sets the contents of the Control Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Mask | is the 32 bit mask data to be written to the Register. The mask definitions are defined in the xdevcfg_hw.h file.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CTRL_OFFSET, XDcfg_ReadReg, and XDcfg_WriteReg.

Referenced by XDcfg_SelfTest(), XDcfg_Transfer(), and XDcfgInterruptExample().

void XDcfg_SetHandler | ( | XDcfg * | InstancePtr,
|  | void * | CallBackFunc,
|  | void * | CallBackRef
| ) |  |

This function sets the handler that will be called when an event (interrupt) occurs that needs application's attention.

Parameters

  InstancePtr | is a pointer to the XDcfg instance
  CallBackFunc | is the address of the callback function.
  CallBackRef | is a user data item that will be passed to the callback function when it is invoked.

Returns
  None.

Note
  None.

References XDcfg::IsReady.

Referenced by XDcfgInterruptExample().

void XDcfg_SetLockRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Data
| ) |  |

The function sets the contents of the Lock Register.

These bits can only be set to a 1. They will be cleared after a Power On Reset.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Data | is the 32 bit data to be written to the Register.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_LOCK_OFFSET, and XDcfg_WriteReg.

void XDcfg_SetMiscControlRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Mask
| ) |  |

The function sets the bit mask for the feature in Miscellaneous Control Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Mask | is the bit-mask of the feature to be set.

Returns
  None.

Note
  None

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_MCTRL_OFFSET, XDcfg_ReadReg, and XDcfg_WriteReg.

void XDcfg_SetRomShadowRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Data
| ) |  |

The function sets the contents of the ROM Shadow Control Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Data | is the 32 bit data to be written to the Register.

Returns
  None.

Note
  This register is can only be written and is used to control the RAM shadow of 32 bit 4K page ROM pages in user mode

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_ROM_SHADOW_OFFSET, and XDcfg_WriteReg.

void XDcfg_SetStatusRegister | ( | XDcfg * | InstancePtr,
|  | u32 | Data
| ) |  |

The function sets the contents of the Status Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  Data | is the 32 bit data to be written to the Register.

Returns
  None.

Note
  None.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_STATUS_OFFSET, and XDcfg_WriteReg.

u32 XDcfg_Transfer | ( | XDcfg * | InstancePtr,
|  | void * | SourcePtr,
|  | u32 | SrcWordLength,
|  | void * | DestPtr,
|  | u32 | DestWordLength,
|  | u32 | TransferType
| ) |  |

This function starts the DMA transfer.

This function only starts the operation and returns before the operation may be completed. If the interrupt is enabled, an interrupt will be generated when the operation is completed, otherwise it is necessary to poll the Status register to determine when it is completed. It is the responsibility of the caller to determine when the operation is completed by handling the generated interrupt or polling the Status Register.

Parameters

  InstancePtr | is a pointer to the XDcfg instance.
  SourcePtr | contains a pointer to the source memory where the data is to be transferred from.
  SrcWordLength | is the number of words (32 bit) to be transferred for the source transfer.
  DestPtr | contains a pointer to the destination memory where the data is to be transferred to.
  DestWordLength | is the number of words (32 bit) to be transferred for the Destination transfer.
  TransferType | contains the type of PCAP transfer being requested. The definitions can be found in the xdevcfg.h file.

Returns
  - XST_SUCCESS.if DMA transfer initiated successfully
  - XST_DEVICE_BUSY if DMA is busy
  - XST_INVALID_PARAM if invalid Source / Destination address is sent or an invalid Source / Destination length is sent

Note
  It is the responsibility of the caller to ensure that the cache is flushed and invalidated both before the DMA operation is started and after the DMA operation completes if the memory pointed to is cached. The caller must also ensure that the pointers contain physical address rather than a virtual address if address translation is being used.

          The 2 LSBs of the SourcePtr (Source)/ DestPtr (Destination)

  address when equal to 2�b01 indicates the last DMA command of an overall transfer.

References XDcfg_Config::BaseAddr, XDcfg::Config, XDcfg::IsReady, XDCFG_CTRL_OFFSET, XDCFG_CTRL_PCAP_RATE_EN_MASK, XDcfg_InitiateDma(), XDcfg_IsDmaBusy(), XDCFG_MCTRL_OFFSET, XDCFG_MCTRL_PCAP_LPBK_MASK, XDcfg_ReadReg, XDcfg_SetControlRegister(), XDCFG_STATUS_OFFSET, XDCFG_STATUS_PCFG_INIT_MASK, and XDcfg_WriteReg.

Referenced by XDcfg_GetConfigReg(), and XDcfgInterruptExample().

## Variable Documentation

XDcfg_Config XDcfg_ConfigTable[1]

Initial value:
= {
{
XPAR_XDCFG_0_DEVICE_ID,
XPAR_XDCFG_0_BASEADDR,
}
}

This table contains configuration information for each Device Config Interface instance in the system.

Referenced by XDcfg_LookupConfig().