XilinxProcessorIPLib/drivers/spips/examples/xspips_tpm_polled_example.c
int SpiPsReadID(XSpiPs *SpiPtr)
{
	int Status;
	u32 VendId;
	u8 RevId;

	Status = SpiPsTpmTransfer(SpiPtr, XSPIPS_TPM_DID_VID, NULL, (u8*)&VendId, 4);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	Status = SpiPsTpmTransfer(SpiPtr, XSPIPS_TPM_RID, NULL, &RevId, 1);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	xil_printf("Vendor ID 0x%x Revision ID 0x%x\r\n", VendId, RevId);

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
*
* This function reads vendor identification information.
*
* @param	SpiPtr is a pointer to the SPIPS driver component to use.
*
* @return	XST_SUCCESS if successful, else XST_FAILURE.
*
* @note		None.
*
******************************************************************************/
This function reads vendor identification information.
This function reads vendor identification information .
int SpiPsReadID(XSpiPs *SpiPtr)
{
	int Status;
	u32 VendId;
	u8 RevId;
	Status = SpiPsTpmTransfer(SpiPtr, XSPIPS_TPM_DID_VID, NULL, (u8*)&VendId, 4);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = SpiPsTpmTransfer(SpiPtr, XSPIPS_TPM_RID, NULL, &RevId, 1);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	xil_printf("Vendor ID 0x%x Revision ID 0x%x\r\n", VendId, RevId);
	return XST_SUCCESS;
}
int SpiPsReadID ( XSpiPs * SpiPtr ) { int Status ; u32 VendId ; u8 RevId ; Status = SpiPsTpmTransfer ( SpiPtr , XSPIPS_TPM_DID_VID , NULL , ( u8 * ) & VendId , 4 ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = SpiPsTpmTransfer ( SpiPtr , XSPIPS_TPM_RID , NULL , & RevId , 1 ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } xil_printf ( " \r \n " , VendId , RevId ) ; return XST_SUCCESS ; }
This function reads vendor identification information.
This function reads vendor identification information .