XilinxProcessorIPLib/drivers/can/src/xcan.c
int XCan_VmInitialize(XCan *InstancePtr, u16 DeviceId, UINTPTR VirtAddr)
{
	XCan_Config *ConfigPtr;

	Xil_AssertNonvoid(InstancePtr != NULL);

	/*
	 * Clear instance memory
	 */
	memset(InstancePtr, 0, sizeof(XCan));

	/*
	 * Lookup the device configuration in the temporary CROM table. Use this
	 * configuration info down below when initializing this instance of the
	 * driver.
	 */
	ConfigPtr = XCan_LookupConfig(DeviceId);
	if (ConfigPtr == NULL) {
		return XST_DEVICE_NOT_FOUND;
	}

	/*
	 * Populate Base Address field using the given virtual base address
	 */
	InstancePtr->BaseAddress = VirtAddr;

	/*
	 * Invoke local initialization to populate other fields in the driver
	 * instance structure and reset the device.
	 */
	Initialize(InstancePtr, ConfigPtr);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This routine initializes of a specific XCan instance/driver. This function
* should only be used if Virtual Memory support is necessary. The caller is
* responsible for calculating the correct device base address in Virtual memory
* address space and passing it into this function.
*
* This initialization entails:
* - Search for device configuration given the device ID.
* - Initialize Base Address field of the XCan structure using the given virtual
*   address parameter value.
* - Populate all other data fields in the XCan structure.
* - Reset the device.
*
* @param 	InstancePtr is a pointer to the XCan instance to be worked on.
* @param 	DeviceId is the unique ID of the device controlled by this XCan
*		instance.  Passing in a device ID associates the generic XCan
*		instance to a specific device, as chosen by the caller or
*		application developer.
* @param	VirtAddr is the device base address in the virtual memory
*		address space. The caller is responsible for keeping the address
*		mapping from VirtAddr to the device physical base address
*		unchanged once this function is invoked. Unexpected errors may
*		occur if the address mapping changes after this function is
*		called.
*
* @return
* 		- XST_SUCCESS if initialization was successful
* 		- XST_DEVICE_NOT_FOUND if device configuration information was
*		not found for a device with the supplied device ID.
*
* @note		None.
*
******************************************************************************/
This routine initializes of a specific XCan instance/driver. This function
should only be used if Virtual Memory support is necessary. The caller is
responsible for calculating the correct device base address in Virtual memory
address space and passing it into this function.

This initialization entails:
Search for device configuration given the device ID.
Initialize Base Address field of the XCan structure using the given virtual
address parameter value.
Populate all other data fields in the XCan structure.
Reset the device.
This routine initializes of a specific XCan instance / driver . This function should only be used if Virtual Memory support is necessary . The caller is responsible for calculating the correct device base address in Virtual memory address space and passing it into this function . This initialization entails : Search for device configuration given the device ID . Initialize Base Address field of the XCan structure using the given virtual address parameter value . Populate all other data fields in the XCan structure . Reset the device .
int XCan_VmInitialize(XCan *InstancePtr, u16 DeviceId, UINTPTR VirtAddr)
{
	XCan_Config *ConfigPtr;
	Xil_AssertNonvoid(InstancePtr != NULL);
	memset(InstancePtr, 0, sizeof(XCan));
	ConfigPtr = XCan_LookupConfig(DeviceId);
	if (ConfigPtr == NULL) {
		return XST_DEVICE_NOT_FOUND;
	}
	InstancePtr->BaseAddress = VirtAddr;
	Initialize(InstancePtr, ConfigPtr);
	return XST_SUCCESS;
}
int XCan_VmInitialize ( XCan * InstancePtr , u16 DeviceId , UINTPTR VirtAddr ) { XCan_Config * ConfigPtr ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; memset ( InstancePtr , 0 , sizeof ( XCan ) ) ; ConfigPtr = XCan_LookupConfig ( DeviceId ) ; if ( ConfigPtr == NULL ) { return XST_DEVICE_NOT_FOUND ; } InstancePtr -> BaseAddress = VirtAddr ; Initialize ( InstancePtr , ConfigPtr ) ; return XST_SUCCESS ; }
This routine initializes of a specific XCan instance/driver.
This routine initializes of a specific XCan instance / driver .
/*
	 * Clear instance memory
	 */ /*
	 * Lookup the device configuration in the temporary CROM table. Use this
	 * configuration info down below when initializing this instance of the
	 * driver.
	 */ /*
	 * Populate Base Address field using the given virtual base address
	 */ /*
	 * Invoke local initialization to populate other fields in the driver
	 * instance structure and reset the device.
	 */