XilinxProcessorIPLib/drivers/can/src/xcan.c
int XCan_Initialize(XCan *InstancePtr, u16 DeviceId)
{
	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 base address value in the
	 * configuration structure.
	 */
	InstancePtr->BaseAddress = ConfigPtr->BaseAddress;

	/*
	 * 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 a specific XCan instance/driver. This function
* should only be used when no Virtual Memory support is needed. To use virtual
* memory, the caller should invoke XCan_VmInitialize(). See the description of
* XCan_VmInitialize() for detailed information.
*
* This initialization entails:
* - Search for device configuration given the device ID.
* - Initialize Base Address field of the XCan structure using the device address
*   in the found device configuration.
* - 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.
*
* @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 a specific XCan instance/driver. This function
should only be used when no Virtual Memory support is needed. To use virtual
memory, the caller should invoke XCan_VmInitialize(). See the description of
XCan_VmInitialize() for detailed information.

This initialization entails:
Search for device configuration given the device ID.
Initialize Base Address field of the XCan structure using the device address
in the found device configuration.
Populate all other data fields in the XCan structure
Reset the device.
This routine initializes a specific XCan instance / driver . This function should only be used when no Virtual Memory support is needed . To use virtual memory the caller should invoke XCan_VmInitialize () . See the description of XCan_VmInitialize () for detailed information . This initialization entails : Search for device configuration given the device ID . Initialize Base Address field of the XCan structure using the device address in the found device configuration . Populate all other data fields in the XCan structure Reset the device .
int XCan_Initialize(XCan *InstancePtr, u16 DeviceId)
{
	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 = ConfigPtr->BaseAddress;
	Initialize(InstancePtr, ConfigPtr);
	return XST_SUCCESS;
}
int XCan_Initialize ( XCan * InstancePtr , u16 DeviceId ) { 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 = ConfigPtr -> BaseAddress ; Initialize ( InstancePtr , ConfigPtr ) ; return XST_SUCCESS ; }
This routine initializes a specific XCan instance/driver.
This routine initializes 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 base address value in the
	 * configuration structure.
	 */ /*
	 * Invoke local initialization to populate other fields in the driver
	 * instance structure and reset the device.
	 */