iicps
Vitis Drivers API Documentation
xiicps.h File Reference

Data Structures

struct  XIicPs_Config
 This typedef contains configuration information for the device. More...
 
struct  XIicPs
 The XIicPs driver instance data. More...
 

Macros

#define XIICPS_H
 by using protection macros More...
 
#define SENDING_ROLE   1
 name Role constants More...
 
#define RECVING_ROLE   0
 Transfer direction is receiving. More...
 
#define XIICPS_MAX_TRANSFER_SIZE   ((u32)255U - (u32)3U)
 Max transfer size. More...
 
#define XIicPs_SendByte(InstancePtr)
 Place one byte into the transmit FIFO. More...
 
#define XIicPs_RecvByte(InstancePtr)
 Receive one byte from FIFO. More...
 
Configuration options

The following options may be specified or retrieved for the device and enable/disable additional features of the IIC.

Each of the options are bit fields, so more than one may be specified.

#define XIICPS_7_BIT_ADDR_OPTION   0x01U
 7-bit address mode More...
 
#define XIICPS_10_BIT_ADDR_OPTION   0x02U
 10-bit address mode More...
 
#define XIICPS_SLAVE_MON_OPTION   0x04U
 Slave monitor mode. More...
 
#define XIICPS_REP_START_OPTION   0x08U
 Repeated Start. More...
 
Callback events

These constants specify the handler events that are passed to an application event handler from the driver.

These constants are bit masks such that more than one event can be passed to the handler.

#define XIICPS_EVENT_COMPLETE_SEND   0x0001U
 Transmit Complete Event. More...
 
#define XIICPS_EVENT_COMPLETE_RECV   0x0002U
 Receive Complete Event. More...
 
#define XIICPS_EVENT_TIME_OUT   0x0004U
 Transfer timed out. More...
 
#define XIICPS_EVENT_ERROR   0x0008U
 Receive error. More...
 
#define XIICPS_EVENT_ARB_LOST   0x0010U
 Arbitration lost. More...
 
#define XIICPS_EVENT_NACK   0x0020U
 NACK Received. More...
 
#define XIICPS_EVENT_SLAVE_RDY   0x0040U
 Slave ready. More...
 
#define XIICPS_EVENT_RX_OVR   0x0080U
 RX overflow. More...
 
#define XIICPS_EVENT_TX_OVR   0x0100U
 TX overflow. More...
 
#define XIICPS_EVENT_RX_UNF   0x0200U
 RX underflow. More...
 

Typedefs

typedef void(* XIicPs_IntrHandler )(void *CallBackRef, u32 StatusEvent)
 The handler data type allows the user to define a callback function to respond to interrupt events in the system. More...
 

Functions

XIicPs_ConfigXIicPs_LookupConfig (u16 DeviceId)
 Function for configuration lookup, in xiicps_sinit.c. More...
 
void XIicPs_SetStatusHandler (XIicPs *InstancePtr, void *CallBackRef, XIicPs_IntrHandler FunctionPtr)
 Functions for interrupts, in xiicps_intr.c. More...
 
s32 XIicPs_SelfTest (XIicPs *InstancePtr)
 Functions for selftest, in xiicps_selftest.c. More...
 
s32 XIicPs_CfgInitialize (XIicPs *InstancePtr, XIicPs_Config *ConfigPtr, u32 EffectiveAddr)
 Initializes a specific XIicPs instance such that the driver is ready to use. More...
 
void XIicPs_Abort (XIicPs *InstancePtr)
 Aborts a transfer in progress by resetting the FIFOs. More...
 
void XIicPs_Reset (XIicPs *InstancePtr)
 Resets the IIC device. More...
 
s32 XIicPs_BusIsBusy (XIicPs *InstancePtr)
 Check whether the I2C bus is busy. More...
 
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_MasterSend (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount, u16 SlaveAddr)
 Functions for device as master, in xiicps_master.c. More...
 
void XIicPs_MasterRecv (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount, u16 SlaveAddr)
 This function initiates an interrupt-driven receive in master mode. More...
 
s32 XIicPs_MasterSendPolled (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount, u16 SlaveAddr)
 This function initiates a polled mode send in master mode. More...
 
s32 XIicPs_MasterRecvPolled (XIicPs *InstancePtr, u8 *MsgPtr, s32 ByteCount, u16 SlaveAddr)
 This function initiates a polled mode receive in master mode. More...
 
void XIicPs_EnableSlaveMonitor (XIicPs *InstancePtr, u16 SlaveAddr)
 This function enables the slave monitor mode. More...
 
void XIicPs_DisableSlaveMonitor (XIicPs *InstancePtr)
 This function disables slave monitor mode. More...
 
void XIicPs_MasterInterruptHandler (XIicPs *InstancePtr)
 The interrupt handler for the master mode. More...
 
void XIicPs_SetupSlave (XIicPs *InstancePtr, u16 SlaveAddr)
 Functions for device as slave, in xiicps_slave.c. 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...
 
void XIicPsSclHold (XIicPs *InstancePtr, u8 Enable)
 Function to Enable/Disable Clock Stretching (SCL HOLD) More...
 
void XIicPsSetTimeOut (XIicPs *InstancePtr, u8 Value)
 Function to set TimeOut value. More...
 
s32 XIicPs_SetOptions (XIicPs *InstancePtr, u32 Options)
 Functions for setting and getting data rate, in xiicps_options.c. More...
 
s32 XIicPs_ClearOptions (XIicPs *InstancePtr, u32 Options)
 This function clears the options for the IIC device driver. More...
 
u32 XIicPs_GetOptions (XIicPs *InstancePtr)
 This function gets the options for the IIC device. More...
 
s32 XIicPs_SetSClk (XIicPs *InstancePtr, u32 FsclHz)
 This function sets the serial clock rate for the IIC device. More...
 
u32 XIicPs_GetSClk (XIicPs *InstancePtr)
 This function gets the serial clock rate for the IIC device. More...
 

Variables

XIicPs_Config XIicPs_ConfigTable []
 Configuration table. More...