XilinxProcessorIPLib/drivers/iic/src/xiic_master.c
static int IsBusBusy(XIic *InstancePtr)
{
	u32 CntlReg;
	u32 StatusReg;

	CntlReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET);
	StatusReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_SR_REG_OFFSET);

	/*
	 * If this device is already master of the bus as when using the
	 * repeated start and the bus is busy setup to wait for it to not be
	 * busy.
	 */
	if (((CntlReg & XIIC_CR_MSMS_MASK) == 0) &&	/* Not master */
		(StatusReg & XIIC_SR_BUS_BUSY_MASK)) {	/* Is busy */
		/*
		 * The bus is busy, clear pending BNB interrupt in case
		 * previously set and then enable BusNotBusy interrupt.
		 */
		InstancePtr->BNBOnly = TRUE;
		XIic_ClearEnableIntr(InstancePtr->BaseAddress,
					XIIC_INTR_BNB_MASK);
		InstancePtr->Stats.BusBusy++;

		return TRUE;
	}

	return FALSE;
}
/*****************************************************************************
*
* This function checks to see if the IIC bus is busy.  If so, it will enable
* the bus not busy interrupt such that the driver is notified when the bus
* is no longer busy.
*
* @param	InstancePtr points to the Iic instance to be worked on.
*
* @return
*		- FALSE indicates the IIC bus is not busy.
*		- TRUE indicates the bus was in use and that the BusNotBusy
*		interrupt is enabled which will update the EventStatus when
*		the bus is no longer busy.
*
* @note		None.
*
******************************************************************************/
This function checks to see if the IIC bus is busy.  If so, it will enable
the bus not busy interrupt such that the driver is notified when the bus
is no longer busy.
This function checks to see if the IIC bus is busy . If so it will enable the bus not busy interrupt such that the driver is notified when the bus is no longer busy .
static int IsBusBusy(XIic *InstancePtr)
{
	u32 CntlReg;
	u32 StatusReg;
	CntlReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET);
	StatusReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_SR_REG_OFFSET);
	if (((CntlReg & XIIC_CR_MSMS_MASK) == 0) &&	
		(StatusReg & XIIC_SR_BUS_BUSY_MASK)) {	
		InstancePtr->BNBOnly = TRUE;
		XIic_ClearEnableIntr(InstancePtr->BaseAddress,
					XIIC_INTR_BNB_MASK);
		InstancePtr->Stats.BusBusy++;
		return TRUE;
	}
	return FALSE;
}
static int IsBusBusy ( XIic * InstancePtr ) { u32 CntlReg ; u32 StatusReg ; CntlReg = XIic_ReadReg ( InstancePtr -> BaseAddress , XIIC_CR_REG_OFFSET ) ; StatusReg = XIic_ReadReg ( InstancePtr -> BaseAddress , XIIC_SR_REG_OFFSET ) ; if ( ( ( CntlReg & XIIC_CR_MSMS_MASK ) == 0 ) && ( StatusReg & XIIC_SR_BUS_BUSY_MASK ) ) { InstancePtr -> BNBOnly = TRUE ; XIic_ClearEnableIntr ( InstancePtr -> BaseAddress , XIIC_INTR_BNB_MASK ) ; InstancePtr -> Stats . BusBusy ++ ; return TRUE ; } return FALSE ; }
This function checks to see if the IIC bus is busy.
This function checks to see if the IIC bus is busy .
/*
	 * If this device is already master of the bus as when using the
	 * repeated start and the bus is busy setup to wait for it to not be
	 * busy.
	 */ /* Not master */ /* Is busy */ /*
		 * The bus is busy, clear pending BNB interrupt in case
		 * previously set and then enable BusNotBusy interrupt.
		 */