XilinxProcessorIPLib/drivers/iicps/examples/xiicps_slave_monitor_example.c
static int IicPsFindDevice(u16 Addr)
{
	int Status;

	Status = IicPsSlaveMonitor(Addr,0,XPAR_XIICPS_0_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	Status = IicPsSlaveMonitor(Addr,1,XPAR_XIICPS_1_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	Status = IicPsSlaveMonitor(Addr,0,XPAR_XIICPS_1_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	Status = IicPsSlaveMonitor(Addr,1,XPAR_XIICPS_0_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	return XST_FAILURE;
}
/*****************************************************************************/
/**
*
* This function checks whether the slave in alive or not.
*
* @param	Addr : Address of the slave device
* @return	XST_SUCCESS if successful, otherwise XST_FAILURE.
*
* @note 	None.
*
*******************************************************************************/
This function checks whether the slave in alive or not.
This function checks whether the slave in alive or not .
static int IicPsFindDevice(u16 Addr)
{
	int Status;
	Status = IicPsSlaveMonitor(Addr,0,XPAR_XIICPS_0_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	Status = IicPsSlaveMonitor(Addr,1,XPAR_XIICPS_1_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	Status = IicPsSlaveMonitor(Addr,0,XPAR_XIICPS_1_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	Status = IicPsSlaveMonitor(Addr,1,XPAR_XIICPS_0_INTR);
	if (Status == XST_SUCCESS) {
		return XST_SUCCESS;
	}
	return XST_FAILURE;
}
static int IicPsFindDevice ( u16 Addr ) { int Status ; Status = IicPsSlaveMonitor ( Addr , 0 , XPAR_XIICPS_0_INTR ) ; if ( Status == XST_SUCCESS ) { return XST_SUCCESS ; } Status = IicPsSlaveMonitor ( Addr , 1 , XPAR_XIICPS_1_INTR ) ; if ( Status == XST_SUCCESS ) { return XST_SUCCESS ; } Status = IicPsSlaveMonitor ( Addr , 0 , XPAR_XIICPS_1_INTR ) ; if ( Status == XST_SUCCESS ) { return XST_SUCCESS ; } Status = IicPsSlaveMonitor ( Addr , 1 , XPAR_XIICPS_0_INTR ) ; if ( Status == XST_SUCCESS ) { return XST_SUCCESS ; } return XST_FAILURE ; }
This function checks whether the slave in alive or not.
This function checks whether the slave in alive or not .