![]() |
iicps
Xilinx SDK Drivers API Documentation
|
Functions | |
s32 | TransmitFifoFill (XIicPs *InstancePtr) |
Put more data into the transmit FIFO, number of bytes is ether expected number of bytes for this transfer or available space in FIFO, which ever is less. More... | |
void | XIicPs_SetupSlave (XIicPs *InstancePtr, u16 SlaveAddr) |
This function sets up the device to be a slave. More... | |
void | XIicPs_SlaveSend (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount) |
This function setup a slave interrupt-driven send. More... | |
void | XIicPs_SlaveRecv (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount) |
This function setup a slave interrupt-driven receive. More... | |
s32 | XIicPs_SlaveSendPolled (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount) |
This function sends a buffer in polled mode as a slave. More... | |
s32 | XIicPs_SlaveRecvPolled (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount) |
This function receives a buffer in polled mode as a slave. More... | |
void | XIicPs_SlaveInterruptHandler (XIicPs *InstancePtr) |
The interrupt handler for slave mode. More... | |
s32 TransmitFifoFill | ( | XIicPs * | InstancePtr | ) |
#include <xiicps_slave.c>
Put more data into the transmit FIFO, number of bytes is ether expected number of bytes for this transfer or available space in FIFO, which ever is less.
InstancePtr | is a pointer to the XIicPs instance. |
References XIicPs_Config::BaseAddress, XIICPS_FIFO_DEPTH, XIicPs_ReadReg, XIicPs_SendByte, and XIICPS_TRANS_SIZE_OFFSET.
Referenced by XIicPs_SlaveInterruptHandler().
void XIicPs_SetupSlave | ( | XIicPs * | InstancePtr, |
u16 | SlaveAddr | ||
) |
#include <xiicps_slave.c>
This function sets up the device to be a slave.
InstancePtr | is a pointer to the XIicPs instance. |
SlaveAddr | is the address of the slave we are receiving from. |
References XIicPs_Config::BaseAddress, and XIICPS_ADDR_MASK.
Referenced by IicPsSlavePolledExample().
void XIicPs_SlaveInterruptHandler | ( | XIicPs * | InstancePtr | ) |
#include <xiicps_slave.c>
The interrupt handler for slave mode.
It does the protocol handling for the interrupt-driven transfers.
Completion events and errors are signaled to upper layer for proper handling.
The interrupts that are handled are:
DATA If the instance is sending, it means that the master wants to read more data from us. Send more data, and check whether we are done with this send.
If the instance is receiving, it means that the master has writen more data to us. Receive more data, and check whether we are done with with this receive.
COMP This marks that stop sequence has been sent from the master, transfer is about to terminate. However, for receiving, the master may have written us some data, so receive that first.
It is an error if the amount of transfered data is less than expected.
InstancePtr | is a pointer to the XIicPs instance. |
References XIicPs_Config::BaseAddress, TransmitFifoFill(), XIICPS_EVENT_COMPLETE_SEND, XIICPS_IMR_OFFSET, XIICPS_ISR_OFFSET, XIICPS_IXR_DATA_MASK, XIicPs_ReadReg, and XIicPs_WriteReg.
void XIicPs_SlaveRecv | ( | XIicPs * | InstancePtr, |
u8 * | MsgPtr, | ||
s32 | ByteCount | ||
) |
#include <xiicps_slave.c>
This function setup a slave interrupt-driven receive.
Data processing for the receive is handled by the interrupt handler.
InstancePtr | is a pointer to the XIicPs instance. |
MsgPtr | is the pointer to the receive buffer. |
ByteCount | is the number of bytes to be received. |
References XIicPs_Config::BaseAddress, XIicPs_EnableInterrupts, XIICPS_IXR_COMP_MASK, XIICPS_IXR_DATA_MASK, XIICPS_IXR_NACK_MASK, XIICPS_IXR_RX_OVR_MASK, XIICPS_IXR_RX_UNF_MASK, and XIICPS_IXR_TO_MASK.
s32 XIicPs_SlaveRecvPolled | ( | XIicPs * | InstancePtr, |
u8 * | MsgPtr, | ||
s32 | ByteCount | ||
) |
#include <xiicps_slave.c>
This function receives a buffer in polled mode as a slave.
InstancePtr | is a pointer to the XIicPs instance. |
MsgPtr | is the pointer to the receive buffer. |
ByteCount | is the number of bytes to be received. |
References XIicPs_Config::BaseAddress, XIICPS_ISR_OFFSET, XIICPS_IXR_COMP_MASK, XIICPS_IXR_DATA_MASK, XIicPs_ReadReg, XIicPs_RecvByte, XIICPS_SR_OFFSET, XIICPS_SR_RXDV_MASK, and XIicPs_WriteReg.
void XIicPs_SlaveSend | ( | XIicPs * | InstancePtr, |
u8 * | MsgPtr, | ||
s32 | ByteCount | ||
) |
#include <xiicps_slave.c>
This function setup a slave interrupt-driven send.
It set the repeated start for the device is the tranfer size is larger than FIFO depth. Data processing for the send is initiated by the interrupt handler.
InstancePtr | is a pointer to the XIicPs instance. |
MsgPtr | is the pointer to the send buffer. |
ByteCount | is the number of bytes to be sent. |
References XIicPs_Config::BaseAddress, XIicPs_EnableInterrupts, XIICPS_IXR_COMP_MASK, XIICPS_IXR_DATA_MASK, XIICPS_IXR_NACK_MASK, XIICPS_IXR_TO_MASK, and XIICPS_IXR_TX_OVR_MASK.
s32 XIicPs_SlaveSendPolled | ( | XIicPs * | InstancePtr, |
u8 * | MsgPtr, | ||
s32 | ByteCount | ||
) |
#include <xiicps_slave.c>
This function sends a buffer in polled mode as a slave.
InstancePtr | is a pointer to the XIicPs instance. |
MsgPtr | is the pointer to the send buffer. |
ByteCount | is the number of bytes to be sent. |
References XIicPs_Config::BaseAddress, XIICPS_FIFO_DEPTH, XIICPS_ISR_OFFSET, XIICPS_IXR_NACK_MASK, XIicPs_ReadReg, XIicPs_SendByte, XIICPS_SR_OFFSET, XIICPS_SR_RXDV_MASK, XIICPS_SR_RXRW_MASK, XIICPS_SR_TXDV_MASK, and XIicPs_WriteReg.