spi
Vitis Drivers API Documentation
xspi.h File Reference

Data Structures

struct  XSpi_Stats
 XSpi statistics. More...
 
struct  XSpi_Config
 This typedef contains configuration information for the device. More...
 
struct  XSpi
 The XSpi driver instance data. More...
 

Macros

#define XSpi_IntrGlobalEnable(InstancePtr)
 This macro writes to the global interrupt enable register to enable interrupts from the device. More...
 
#define XSpi_IntrGlobalDisable(InstancePtr)   XSpi_WriteReg(((InstancePtr)->BaseAddr), XSP_DGIER_OFFSET, 0)
 This macro disables all interrupts for the device by writing to the Global interrupt enable register. More...
 
#define XSpi_IsIntrGlobalEnabled(InstancePtr)
 This function determines if interrupts are enabled at the global level by reading the global interrupt register. More...
 
#define XSpi_IntrGetStatus(InstancePtr)   XSpi_ReadReg(((InstancePtr)->BaseAddr), XSP_IISR_OFFSET)
 This function gets the contents of the Interrupt Status Register. More...
 
#define XSpi_IntrClear(InstancePtr, ClearMask)
 This function clears the specified interrupts in the Interrupt status Register. More...
 
#define XSpi_IntrEnable(InstancePtr, EnableMask)
 This function sets the contents of the Interrupt Enable Register. More...
 
#define XSpi_IntrDisable(InstancePtr, DisableMask)
 Disable the specified Interrupts in the Interrupt Enable Register. More...
 
#define XSpi_IntrGetEnabled(InstancePtr)   XSpi_ReadReg(((InstancePtr)->BaseAddr), XSP_IIER_OFFSET)
 This function gets the contents of the Interrupt Enable Register. More...
 
#define XSpi_SetControlReg(InstancePtr, Mask)   XSpi_WriteReg(((InstancePtr)->BaseAddr), XSP_CR_OFFSET, (Mask))
 Set the contents of the control register. More...
 
#define XSpi_GetControlReg(InstancePtr)   XSpi_ReadReg(((InstancePtr)->BaseAddr), XSP_CR_OFFSET)
 Get the contents of the control register. More...
 
#define XSpi_GetStatusReg(InstancePtr)   XSpi_ReadReg(((InstancePtr)->BaseAddr), XSP_SR_OFFSET)
 Get the contents of the status register. More...
 
#define XSpi_SetXipControlReg(InstancePtr, Mask)   XSpi_WriteReg(((InstancePtr)->BaseAddr), XSP_CR_OFFSET, (Mask))
 Set the contents of the XIP control register. More...
 
#define XSpi_GetXipControlReg(InstancePtr)   XSpi_ReadReg(((InstancePtr)->BaseAddr), XSP_CR_OFFSET)
 Get the contents of the XIP control register. More...
 
#define XSpi_GetXipStatusReg(InstancePtr)   XSpi_ReadReg(((InstancePtr)->BaseAddr), XSP_SR_OFFSET)
 Get the contents of the status register. More...
 
#define XSpi_SetSlaveSelectReg(InstancePtr, Mask)   XSpi_WriteReg(((InstancePtr)->BaseAddr), XSP_SSR_OFFSET, (Mask))
 Set the contents of the slave select register. More...
 
#define XSpi_GetSlaveSelectReg(InstancePtr)   XSpi_ReadReg((InstancePtr)->BaseAddr, XSP_SSR_OFFSET)
 Get the contents of the slave select register. More...
 
#define XSpi_Enable(InstancePtr)
 Enable the device and uninhibit master transactions. More...
 
#define XSpi_Disable(InstancePtr)
 Disable the device. More...
 
Configuration options

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

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

#define XSP_MASTER_OPTION   0x1
 
#define XSP_CLK_ACTIVE_LOW_OPTION   0x2
 
#define XSP_CLK_PHASE_1_OPTION   0x4
 
#define XSP_LOOPBACK_OPTION   0x8
 
#define XSP_MANUAL_SSELECT_OPTION   0x10
 

Typedefs

typedef void(* XSpi_StatusHandler )(void *CallBackRef, u32 StatusEvent, unsigned int ByteCount)
 The handler data type allows the user to define a callback function to handle the asynchronous processing of the SPI driver. More...
 

Functions

int XSpi_Initialize (XSpi *InstancePtr, u16 DeviceId)
 Initializes a specific XSpi instance such that the driver is ready to use. More...
 
XSpi_ConfigXSpi_LookupConfig (u16 DeviceId)
 Looks up the device configuration based on the unique device ID. More...
 
int XSpi_CfgInitialize (XSpi *InstancePtr, XSpi_Config *Config, UINTPTR EffectiveAddr)
 Initializes a specific XSpi instance such that the driver is ready to use. More...
 
int XSpi_Start (XSpi *InstancePtr)
 This function enables interrupts for the SPI device. More...
 
int XSpi_Stop (XSpi *InstancePtr)
 This function stops the SPI device by disabling interrupts and disabling the device itself. More...
 
void XSpi_Reset (XSpi *InstancePtr)
 Resets the SPI device by writing to the Software Reset register. More...
 
int XSpi_SetSlaveSelect (XSpi *InstancePtr, u32 SlaveMask)
 Selects or deselect the slave with which the master communicates. More...
 
u32 XSpi_GetSlaveSelect (XSpi *InstancePtr)
 Gets the current slave select bit mask for the SPI device. More...
 
int XSpi_Transfer (XSpi *InstancePtr, u8 *SendBufPtr, u8 *RecvBufPtr, unsigned int ByteCount)
 Transfers the specified data on the SPI bus. More...
 
void XSpi_SetStatusHandler (XSpi *InstancePtr, void *CallBackRef, XSpi_StatusHandler FuncPtr)
 Sets the status callback function, the status handler, which the driver calls when it encounters conditions that should be reported to the higher layer software. More...
 
void XSpi_InterruptHandler (void *InstancePtr)
 The interrupt handler for SPI interrupts. More...
 
int XSpi_SelfTest (XSpi *InstancePtr)
 Runs a self-test on the driver/device. More...
 
void XSpi_GetStats (XSpi *InstancePtr, XSpi_Stats *StatsPtr)
 Gets a copy of the statistics for an SPI device. More...
 
void XSpi_ClearStats (XSpi *InstancePtr)
 Clears the statistics for the SPI device. More...
 
int XSpi_SetOptions (XSpi *InstancePtr, u32 Options)
 This function sets the options for the SPI device driver. More...
 
u32 XSpi_GetOptions (XSpi *InstancePtr)
 This function gets the options for the SPI device. More...