XilinxProcessorIPLib/drivers/iic/examples/xiic_tenbitaddr_example.c
int TenBitAddrWriteData(u16 ByteCount)
{
	int Status;

	/*
	 * Set the defaults.
	 */
	TransmitComplete = 1;

	/*
	 * Start the IIC device.
	 */
	Status = XIic_Start(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/*
	 * Set the Global Interrupt Enable.
	 */
	XIic_IntrGlobalEnable(IicInstance.BaseAddress);

	/*
	 * Wait for AAS interrupt and transmission to complete.
	 */
	while ((TransmitComplete) || (XIic_IsIicBusy(&IicInstance) == TRUE)) {
		if (SlaveWrite) {
			XIic_SlaveSend(&IicInstance, WriteBuffer, SEND_COUNT);
			SlaveWrite = 0;
		}
	}

	/*
	 * Disable the Global Interrupt Enable bit.
	 */
	XIic_IntrGlobalDisable(IicInstance.BaseAddress);

	/*
	 * Stop the IIC device.
	 */
	Status = XIic_Stop(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* This function writes a buffer of bytes to the IIC bus when the IIC master
* initiates a read operation.
*
* @param	ByteCount contains the number of bytes in the buffer to be
*		written.
*
* @return	XST_SUCCESS if successful else XST_FAILURE.
*
* @note		None.
*
******************************************************************************/
This function writes a buffer of bytes to the IIC bus when the IIC master
initiates a read operation.
This function writes a buffer of bytes to the IIC bus when the IIC master initiates a read operation .
int TenBitAddrWriteData(u16 ByteCount)
{
	int Status;
	TransmitComplete = 1;
	Status = XIic_Start(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	XIic_IntrGlobalEnable(IicInstance.BaseAddress);
	while ((TransmitComplete) || (XIic_IsIicBusy(&IicInstance) == TRUE)) {
		if (SlaveWrite) {
			XIic_SlaveSend(&IicInstance, WriteBuffer, SEND_COUNT);
			SlaveWrite = 0;
		}
	}
	XIic_IntrGlobalDisable(IicInstance.BaseAddress);
	Status = XIic_Stop(&IicInstance);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int TenBitAddrWriteData ( u16 ByteCount ) { int Status ; TransmitComplete = 1 ; Status = XIic_Start ( & IicInstance ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIic_IntrGlobalEnable ( IicInstance . BaseAddress ) ; while ( ( TransmitComplete ) || ( XIic_IsIicBusy ( & IicInstance ) == TRUE ) ) { if ( SlaveWrite ) { XIic_SlaveSend ( & IicInstance , WriteBuffer , SEND_COUNT ) ; SlaveWrite = 0 ; } } XIic_IntrGlobalDisable ( IicInstance . BaseAddress ) ; Status = XIic_Stop ( & IicInstance ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } return XST_SUCCESS ; }
This function writes a buffer of bytes to the IIC bus when the IIC master
initiates a read operation.
This function writes a buffer of bytes to the IIC bus when the IIC master initiates a read operation .
/*
	 * Set the defaults.
	 */ /*
	 * Start the IIC device.
	 */ /*
	 * Set the Global Interrupt Enable.
	 */ /*
	 * Wait for AAS interrupt and transmission to complete.
	 */ /*
	 * Disable the Global Interrupt Enable bit.
	 */ /*
	 * Stop the IIC device.
	 */