60#include "xil_assert.h"
88#define XIic_Send10BitAddrByte1(SlaveAddress, Operation) \
90 u8 LocalAddr = (u8)((SlaveAddress) >> 7); \
91 LocalAddr = (LocalAddr & 0xF6) | 0xF0 | (Operation); \
92 XIic_WriteReg(InstancePtr->BaseAddress, XIIC_DTR_REG_OFFSET, \
110#define XIic_Send10BitAddrByte2(SlaveAddress) \
111 XIic_WriteReg(InstancePtr->BaseAddress, XIIC_DTR_REG_OFFSET, \
112 (u32)(SlaveAddress));
128#define XIic_Send7BitAddr(SlaveAddress, Operation) \
130 u8 LocalAddr = (u8)(SlaveAddress << 1); \
131 LocalAddr = (LocalAddr & 0xFE) | (Operation); \
132 XIic_WriteReg(InstancePtr->BaseAddress, XIIC_DTR_REG_OFFSET, \
151#define XIic_DisableIntr(BaseAddress, InterruptMask) \
152 XIic_WriteIier((BaseAddress), XIic_ReadIier(BaseAddress) & ~(InterruptMask))
169#define XIic_EnableIntr(BaseAddress, InterruptMask) \
170 XIic_WriteIier((BaseAddress), XIic_ReadIier(BaseAddress) | (InterruptMask))
187#define XIic_ClearIntr(BaseAddress, InterruptMask) \
188 XIic_WriteIisr((BaseAddress), XIic_ReadIisr(BaseAddress) & (InterruptMask))
206#define XIic_ClearEnableIntr(BaseAddress, InterruptMask) \
208 XIic_WriteIisr(BaseAddress, \
209 (XIic_ReadIisr(BaseAddress) & (InterruptMask))); \
211 XIic_WriteIier(BaseAddress, \
212 (XIic_ReadIier(BaseAddress) | (InterruptMask))); \
229#define XIic_FlushRxFifo(InstancePtr) \
233 XIic_ReadReg(InstancePtr->BaseAddress, XIIC_RFO_REG_OFFSET) + 1; \
234 for (LoopCnt = 0; LoopCnt < BytesToRead; LoopCnt++) { \
235 XIic_ReadReg(InstancePtr->BaseAddress, XIIC_DRR_REG_OFFSET); \
253#define XIic_FlushTxFifo(InstancePtr) \
256 u32 CntlReg = XIic_ReadReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET); \
257 XIic_WriteReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET, \
258 CntlReg | XIIC_CR_TX_FIFO_RESET_MASK); \
259 XIic_WriteReg(InstancePtr->BaseAddress, XIIC_CR_REG_OFFSET, CntlReg); \
275#define XIic_ReadRecvByte(InstancePtr) \
277 *InstancePtr->RecvBufferPtr++ = \
278 XIic_ReadReg(InstancePtr->BaseAddress, XIIC_DRR_REG_OFFSET); \
279 InstancePtr->RecvByteCount--; \
280 InstancePtr->Stats.RecvBytes++; \
296#define XIic_WriteSendByte(InstancePtr) \
298 XIic_WriteReg(InstancePtr->BaseAddress, XIIC_DTR_REG_OFFSET, \
299 *InstancePtr->SendBufferPtr++); \
300 InstancePtr->SendByteCount--; \
301 InstancePtr->Stats.SendBytes++; \
323#define XIic_SetControlRegister(InstancePtr, ControlRegister, ByteCount) \
325 (ControlRegister) &= ~(XIIC_CR_NO_ACK_MASK | XIIC_CR_DIR_IS_TX_MASK); \
326 if (InstancePtr->Options & XII_SEND_10_BIT_OPTION) { \
327 (ControlRegister) |= XIIC_CR_DIR_IS_TX_MASK; \
329 if ((ByteCount) == 1) { \
330 (ControlRegister) |= XIIC_CR_NO_ACK_MASK; \
void(* XIic_ArbLostFuncPtr)(XIic *InstancePtr)
XIic_Config XIic_ConfigTable[]
void(* XIic_RecvMasterFuncPtr)(XIic *InstancePtr)
void(* XIic_NotAddrAsSlaveFuncPtr)(XIic *InstancePtr)
void(* XIic_SendSlaveFuncPtr)(XIic *InstancePtr)
void(* XIic_SendMasterFuncPtr)(XIic *InstancePtr)
void XIic_TransmitFifoFill(XIic *InstancePtr, int Role)
void(* XIic_BusNotBusyFuncPtr)(XIic *InstancePtr)
void(* XIic_AddrAsSlaveFuncPtr)(XIic *InstancePtr)
void(* XIic_RecvSlaveFuncPtr)(XIic *InstancePtr)