Syntax
int X<DUT>_Initialize(X<DUT> *InstancePtr, uintptr BaseAddress);
int X<DUT>_Initialize(X<DUT> *InstancePtr, u16 DeviceId);
int X<DUT>_Initialize(X<DUT> *InstancePtr, const char* InstanceName);
Description
int X<DUT>_Initialize(X<DUT>
*InstancePtr, uintptr BaseAddress)
: For use on standalone systems, initialize the
specified BaseAddress
of a device. This API will write a proper value to
InstancePtr
which then can be used in other APIs.
DeviceId
is
no longer populated into the driver config struct. Instead the BaseAddress
is used to identify the driver instance. The DeviceId
will also not be populated in the xparameters.h
file. Software applications using these drivers developed in the
classic Vitis or Vitis HLS
tools will need to be updated to reflect this change using #ifdef
SDT
as shown in the following example:
#ifndef SDT
#define GPIO_EXAMPLE_DEVICE_ID XPAR_GPIO_0_DEVICE_ID
#else
#define XGPIO_AXI_BASEADDRESS XPAR_XGPIO_0_BASEADDR
#endif
int X<DUT>_Initialize(X<DUT>
*InstancePtr, u16 DeviceId)
: For use on standalone systems, initialize a device.
This API will write a proper value to InstancePtr
which
then can be used in other APIs. AMD recommends
calling this API to initialize a device except when an MMU is used in the system, in which
case refer to function X<DUT>_CfgInitialize
.
int X<DUT>_Initialize(X<DUT>
*InstancePtr, const char* InstanceName)
: For use on Linux systems, initialize a
specifically named uio
device. Create up to five memory
mappings and assign the slave base addresses by mmap
,
utilizing the uio
device information in sysfs.
Where the various arguments are defined as:
-
InstancePtr
- A pointer to the device instance.
-
DeviceId
- Device ID as defined in xparameters.h.
-
BaseAddress
- The BaseAddress as defined in xparameters.h.
-
InstanceName
- The name of the
uio
device.
Return
XST_SUCCESS
indicates
success, otherwise fail.