Software Drivers

xhwicap.h File Reference

#include "xhwicap_i.h"
#include "xhwicap_l.h"
#include <xstatus.h>
#include "xparameters.h"

Classes

struct  XHwIcap_Config
struct  XHwIcap

Defines

#define XHWICAP_H_
#define XHwIcap_FifoWrite(InstancePtr, Data)
#define XHwIcap_FifoRead(InstancePtr)   (XHwIcap_ReadReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_RF_OFFSET))
#define XHwIcap_SetSizeReg(InstancePtr, Data)
#define XHwIcap_GetControlReg(InstancePtr)   (XHwIcap_ReadReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_CR_OFFSET))
#define XHwIcap_StartConfig(InstancePtr)
#define XHwIcap_StartReadBack(InstancePtr)
#define XHwIcap_GetStatusReg(InstancePtr)   (XHwIcap_ReadReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_SR_OFFSET))
#define XHwIcap_IsTransferDone(InstancePtr)   ((InstancePtr->IsTransferInProgress) ? FALSE : TRUE)
#define XHwIcap_IsDeviceBusy(InstancePtr)
#define XHwIcap_IntrGlobalEnable(InstancePtr)
#define XHwIcap_IntrGlobalDisable(InstancePtr)
#define XHwIcap_IntrGetStatus(InstancePtr)
#define XHwIcap_IntrDisable(InstancePtr, IntrMask)
#define XHwIcap_IntrEnable(InstancePtr, IntrMask)
#define XHwIcap_IntrGetEnabled(InstancePtr)
#define XHwIcap_IntrClear(InstancePtr, IntrMask)
#define XHwIcap_GetWrFifoVacancy(InstancePtr)   XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, XHI_WFV_OFFSET)
#define XHwIcap_GetRdFifoOccupancy(InstancePtr)   XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, XHI_RFO_OFFSET)

Typedefs

typedef void(* XHwIcap_StatusHandler )(void *CallBackRef, u32 StatusEvent, u32 WordCount)

Functions

int XHwIcap_CfgInitialize (XHwIcap *InstancePtr, XHwIcap_Config *ConfigPtr, u32 EffectiveAddr)
int XHwIcap_DeviceWrite (XHwIcap *InstancePtr, u32 *FrameBuffer, u32 NumWords)
int XHwIcap_DeviceRead (XHwIcap *InstancePtr, u32 *FrameBuffer, u32 NumWords)
void XHwIcap_Reset (XHwIcap *InstancePtr)
void XHwIcap_FlushFifo (XHwIcap *InstancePtr)
void XHwIcap_Abort (XHwIcap *InstancePtr)
XHwIcap_ConfigXHwIcap_LookupConfig (u16 DeviceId)
int XHwIcap_CommandDesync (XHwIcap *InstancePtr)
int XHwIcap_CommandCapture (XHwIcap *InstancePtr)
u32 XHwIcap_GetConfigReg (XHwIcap *InstancePtr, u32 ConfigReg, u32 *RegData)
int XHwIcap_SelfTest (XHwIcap *InstancePtr)
void XHwIcap_IntrHandler (void *InstancePtr)
void XHwIcap_SetInterruptHandler (XHwIcap *InstancePtr, void *CallBackRef, XHwIcap_StatusHandler FuncPtr)
int XHwIcap_DeviceReadFrame (XHwIcap *InstancePtr, long Top, long Block, long HClkRow, long MajorFrame, long MinorFrame, u32 *FrameBuffer)
int XHwIcap_DeviceWriteFrame (XHwIcap *InstancePtr, long Top, long Block, long HClkRow, long MajorFrame, long MinorFrame, u32 *FrameData)
int XHwIcap_SetClbBits (XHwIcap *InstancePtr, long Row, long Col, const u8 Resource[][2], const u8 Value[], long NumBits)
int XHwIcap_GetClbBits (XHwIcap *InstancePtr, long Row, long Col, const u8 Resource[][2], u8 Value[], long NumBits)

Detailed Description


Define Documentation

#define XHwIcap_FifoRead ( InstancePtr   )     (XHwIcap_ReadReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_RF_OFFSET))

Read data from the Read FIFO.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
The 32-bit Data read from the FIFO.
Note:
C-style Signature: u32 XHwIcap_FifoRead(XHwIcap *InstancePtr);
#define XHwIcap_FifoWrite ( InstancePtr,
Data   ) 
Value:
(XHwIcap_WriteReg(((InstancePtr)->HwIcapConfig.BaseAddress),    \
                XHI_WF_OFFSET, (Data)))

Write data to the Write FIFO.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Data is the 32-bit value to be written to the FIFO.
Returns:
None.
Note:
C-style Signature: void XHwIcap_FifoWrite(XHwIcap *InstancePtr, u32 Data);
#define XHwIcap_GetControlReg ( InstancePtr   )     (XHwIcap_ReadReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_CR_OFFSET))

Get the contents of the Control register.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
A 32-bit value representing the contents of the Control register.
Note:
u32 XHwIcap_GetControlReg(XHwIcap *InstancePtr);
#define XHwIcap_GetRdFifoOccupancy ( InstancePtr   )     XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, XHI_RFO_OFFSET)

This macro returns the occupancy of the Read FIFO.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
Returns:
The contents read from the Read FIFO Occupancy Register.
Note:
C-Style signature: u32 XHwIcap_GetRdFifoOccupancy(InstancePtr)
#define XHwIcap_GetStatusReg ( InstancePtr   )     (XHwIcap_ReadReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_SR_OFFSET))

Get the contents of the status register.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
A 32-bit value representing the contents of the status register.
Note:
u32 XHwIcap_GetStatusReg(XHwIcap *InstancePtr);
#define XHwIcap_GetWrFifoVacancy ( InstancePtr   )     XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, XHI_WFV_OFFSET)

This macro returns the vacancy of the Write FIFO. This indicates the number of words that can be written to the Write FIFO before it becomes full.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
Returns:
The contents read from the Write FIFO Vacancy Register.
Note:
C-Style signature: u32 XHwIcap_GetWrFifoVacancy(InstancePtr)
#define XHWICAP_H_
#define XHwIcap_IntrClear ( InstancePtr,
IntrMask   ) 
Value:
XHwIcap_WriteReg((InstancePtr)->HwIcapConfig.BaseAddress,       \
                        XHI_IPISR_OFFSET, \
                XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, \
                XHI_IPISR_OFFSET) | ((IntrMask) & XHI_IPIXR_ALL_MASK))

This macro clears the specified interrupts in the Interrupt Status Register (IPISR).

Parameters:
InstancePtr is a pointer to the HwIcap instance.
IntrMask contains the interrupts to be cleared.
Returns:
None.
Note:
Signature: void XHwIcap_DisableIntr(XHwIcap *InstancePtr, u32 IntrMask)
#define XHwIcap_IntrDisable ( InstancePtr,
IntrMask   ) 
Value:
XHwIcap_WriteReg((InstancePtr)->HwIcapConfig.BaseAddress,       \
                        XHI_IPIER_OFFSET, \
        XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, \
                XHI_IPIER_OFFSET) & (~ (IntrMask & XHI_IPIXR_ALL_MASK)));\
                (InstancePtr)->IsPolled = TRUE;

This macro disables the specified interrupts in the Interrupt Enable Register. It is non-destructive in that the register is read and only the interrupts specified is changed.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
IntrMask is the bit-mask of the interrupts to be disabled. Bit positions of 1 will be disabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XHI_IPIXR_*_MASK bits defined in xhwicap_l.h.
Returns:
None.
Note:
Signature: void XHwIcap_IntrDisable(XHwIcap *InstancePtr, u32 IntrMask)
#define XHwIcap_IntrEnable ( InstancePtr,
IntrMask   ) 
Value:
XHwIcap_WriteReg((InstancePtr)->HwIcapConfig.BaseAddress,       \
                        XHI_IPIER_OFFSET, \
        (XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress, \
                XHI_IPIER_OFFSET) | ((IntrMask) & XHI_IPIXR_ALL_MASK))); \
                (InstancePtr)->IsPolled = FALSE;

This macro enables the specified interrupts in the Interrupt Enable Register. It is non-destructive in that the register is read and only the interrupts specified is changed.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
IntrMask is the bit-mask of the interrupts to be enabled. Bit positions of 1 will be enabled. Bit positions of 0 will keep the previous setting. This mask is formed by OR'ing XHI_IPIXR_*_MASK bits defined in xhwicap_l.h.
Returns:
None.
Note:
Signature: void XHwIcap_IntrEnable(XHwIcap *InstancePtr, u32 IntrMask)
#define XHwIcap_IntrGetEnabled ( InstancePtr   ) 
Value:
XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress,        \
                        XHI_IPIER_OFFSET)

This macro returns the interrupt status read from Interrupt Enable Register(IIER). Use the XHI_IPIXR_* constants defined in xhwicap_l.h to interpret the returned value.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
Returns:
The contents read from the Interrupt Enable Register.
Note:
C-Style signature: u32 XHwIcap_IntrGetEnabled(InstancePtr)
#define XHwIcap_IntrGetStatus ( InstancePtr   ) 
Value:
XHwIcap_ReadReg((InstancePtr)->HwIcapConfig.BaseAddress,        \
                                XHI_IPISR_OFFSET)

This macro returns the interrupt status read from Interrupt Status Register(IPISR). Use the XHI_IPIXR_* constants defined in xhwicap_l.h to interpret the returned value.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
Returns:
The contents read from the Interrupt Status Register.
Note:
C-Style signature: u32 XHwIcap_IntrGetStatus(InstancePtr)
#define XHwIcap_IntrGlobalDisable ( InstancePtr   ) 
Value:
XHwIcap_WriteReg((InstancePtr)->HwIcapConfig.BaseAddress,       \
                                XHI_GIER_OFFSET, 0x0)

This macro disables the global interrupt in the Global Interrupt Enable Register (GIER) so that the interrupt output from the HwIcap device is disabled.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
Returns:
None.
Note:
C-Style signature: void XHwIcap_IntrGlobalDisable(InstancePtr)
#define XHwIcap_IntrGlobalEnable ( InstancePtr   ) 
Value:
XHwIcap_WriteReg((InstancePtr)->HwIcapConfig.BaseAddress,       \
                                XHI_GIER_OFFSET, XHI_GIER_GIE_MASK)

This macro enables the global interrupt in the Global Interrupt Enable Register (GIER) so that the interrupt output from the HwIcap device is enabled. Interrupts enabled using XHwIcap_IntrEnable() will not occur until the global interrupt enable bit is set by using this macro.

Parameters:
InstancePtr is a pointer to the HwIcap instance.
Returns:
None.
Note:
C-Style signature: void XHwIcap_IntrGlobalEnable(InstancePtr)
#define XHwIcap_IsDeviceBusy ( InstancePtr   ) 
Value:
((XHwIcap_GetStatusReg(InstancePtr) & XHI_SR_DONE_MASK) ? \
                                FALSE : TRUE)

This macro checks if the last Read/Write to the ICAP device in the FPGA is completed.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
  • TRUE if the last Read/Write(Config) to the ICAP is NOT completed.
  • FALSE if the Read/Write(Config) to the ICAP is completed..
Note:
C-Style signature: int XHwIcap_IsDeviceBusy(XHwIcap *InstancePtr);
#define XHwIcap_IsTransferDone ( InstancePtr   )     ((InstancePtr->IsTransferInProgress) ? FALSE : TRUE)

This macro checks if the last Read/Write of the data to the Read/Write FIFO of the HwIcap device is completed.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
  • TRUE if the Read/Write to the FIFO's is completed.
  • FALSE if the Read/Write to the FIFO's is NOT completed..
Note:
C-Style signature: int XHwIcap_IsTransferDone(XHwIcap *InstancePtr);
#define XHwIcap_SetSizeReg ( InstancePtr,
Data   ) 
Value:
(XHwIcap_WriteReg(((InstancePtr)->HwIcapConfig.BaseAddress), \
                XHI_SZ_OFFSET, (Data)))

Set the number of words to be read from the Icap in the Size register.

The Size Register holds the number of 32 bit words to transfer from the the Icap to the Read FIFO of the HwIcap device.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Data is the size in words.
Returns:
None.
Note:
C-style Signature: void XHwIcap_SetSizeReg(XHwIcap *InstancePtr, u32 Data);
#define XHwIcap_StartConfig ( InstancePtr   ) 
Value:
(XHwIcap_WriteReg(((InstancePtr)->HwIcapConfig.BaseAddress), XHI_CR_OFFSET, \
        (XHwIcap_GetControlReg(InstancePtr) &                                 \
        (~ XHI_CR_READ_MASK)) | XHI_CR_WRITE_MASK))

Set the Control Register to initiate a configuration (write) to the device.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
None.
Note:
C-style Signature: void XHwIcap_StartConfig(XHwIcap *InstancePtr);
#define XHwIcap_StartReadBack ( InstancePtr   ) 
Value:
(XHwIcap_WriteReg(((InstancePtr)->HwIcapConfig.BaseAddress) , XHI_CR_OFFSET, \
        (XHwIcap_GetControlReg(InstancePtr) &                                 \
        (~ XHI_CR_WRITE_MASK)) | XHI_CR_READ_MASK))

Set the Control Register to initiate a ReadBack from the device.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
None.
Note:
C-style Signature: void XHwIcap_StartReadBack(XHwIcap *InstancePtr);

Typedef Documentation

typedef void(* XHwIcap_StatusHandler)(void *CallBackRef, u32 StatusEvent, u32 WordCount)

The handler data type allows the user to define a callback function to handle the asynchronous processing of the HwIcap driver. The application using this driver is expected to define a handler of this type to support interrupt driven mode. The handler executes in an interrupt context such that minimal processing should be performed.

Parameters:
CallBackRef is a callback reference passed in by the application layer when setting the callback functions, and passed back to the upper layer when the callback is invoked. Its type is unimportant to the driver component, so it is a void pointer.
StatusEvent indicates one or more status events that occurred. See the XHwIcap_SetInterruptHandler for details on the status events that can be passed in the callback.
WordCount indicates how many words of data were successfully transferred. This may be less than the number of words requested if there was an error.

Function Documentation

void XHwIcap_Abort ( XHwIcap InstancePtr  ) 

This function initiates the Abort Sequence by setting the Abort bit in the control register.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
None.
Note:
None.
int XHwIcap_CfgInitialize ( XHwIcap InstancePtr,
XHwIcap_Config ConfigPtr,
u32  EffectiveAddr 
)

This function initializes a specific XHwIcap instance. The IDCODE is read from the FPGA and based on the IDCODE the information about the resources in the FPGA is filled in the instance structure.

The HwIcap device will be in put in a reset state before exiting this function.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
ConfigPtr points to the XHwIcap device configuration structure.
EffectiveAddr is the device base address in the virtual memory address space. If the address translation is not used then the physical address is passed. Unexpected errors may occur if the address mapping is changed after this function is invoked.
Returns:
XST_SUCCESS else XST_FAILURE
Note:
None.

Set IcapWidth

Set IsLiteMode

int XHwIcap_CommandCapture ( XHwIcap InstancePtr  ) 

Sends a CAPTURE command to the ICAP port. This command captures all of the flip flop states so they will be available during readback. One can use this command instead of enabling the CAPTURE block in the design.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
XST_SUCCESS or XST_FAILURE
Note:
None.
int XHwIcap_CommandDesync ( XHwIcap InstancePtr  ) 

Sends a DESYNC command to the ICAP port.

Parameters:
InstancePtr - a pointer to the XHwIcap instance to be worked on
Returns:
XST_SUCCESS else XST_FAILURE
Note:
None.
int XHwIcap_DeviceRead ( XHwIcap InstancePtr,
u32 *  FrameBuffer,
u32  NumWords 
)

This function reads the specified number of words from the ICAP device in the polled mode. Interrupt mode is not supported in reading data from the ICAP device.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
FrameBuffer is a pointer to the memory where the frame read from the ICAP device is stored.
NumWords is the number of words (16 bit for S6 and 32 bit for all other devices) to write to the ICAP device.
Returns:
  • XST_SUCCESS if the specified number of words have been read from the ICAP device
  • XST_FAILURE if the device is busy with the last Read/Write or if the requested number of words have not been read from the ICAP device, or there is a timeout.
Note:
This is a blocking function.
int XHwIcap_DeviceReadFrame ( XHwIcap InstancePtr,
long  Top,
long  Block,
long  HClkRow,
long  MajorFrame,
long  MinorFrame,
u32 *  FrameBuffer 
)

Reads one frame from the device and puts it in memory specified by the user.

Parameters:
InstancePtr - a pointer to the XHwIcap instance to be worked on.
Top - top (0) or bottom (1) half of device
Block - Block Address (XHI_FAR_CLB_BLOCK, XHI_FAR_BRAM_BLOCK, XHI_FAR_BRAM_INT_BLOCK)
HClkRow - selects the HClk Row
MajorFrame - selects the column
MinorFrame - selects frame inside column
FrameBuffer is a pointer to the memory where the frame read from the device is stored
Returns:
XST_SUCCESS else XST_FAILURE.
Note:
This is a blocking call.
int XHwIcap_DeviceWrite ( XHwIcap InstancePtr,
u32 *  FrameBuffer,
u32  NumWords 
)

This function writes the given user data to the Write FIFO in both the polled mode and the interrupt mode and starts the transfer of the data to the ICAP device.

In the polled mode, this function will write the specified number of words into the FIFO before returning.

In the interrupt mode, this function will write the words upto the size of the Write FIFO and starts the transfer, then subsequent transfer of the data is performed by the interrupt service routine until the entire buffer has been transferred. The status callback function is called when the entire buffer has been sent. In order to use interrupts, it is necessary for the user to connect the driver interrupt handler, XHwIcap_IntrHandler(), to the interrupt system of the application and enable the interrupts associated with the Write FIFO. The user has to enable the interrupts each time this function is called using the XHwIcap_IntrEnable macro.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
FrameBuffer is a pointer to the data to be written to the ICAP device.
NumWords is the number of words (16 bit for S6 and 32 bit for all other devices)to write to the ICAP device.
Returns:
XST_SUCCESS or XST_FAILURE
Note:
This function is a blocking for the polled mode of operation and is non-blocking for the interrupt mode of operation. Use the function XHwIcap_DeviceWriteFrame for writing a frame of data to the ICAP device.

Icap Width of 32 does not use Fifo but declared to overcome compilation error. Size of 4 is used to overcome compiler warnings

int XHwIcap_DeviceWriteFrame ( XHwIcap InstancePtr,
long  Top,
long  Block,
long  HClkRow,
long  MajorFrame,
long  MinorFrame,
u32 *  FrameData 
)

Writes one frame from the specified buffer and puts it in the device (ICAP).

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Top - top (0) or bottom (1) half of device
Block - Block Address (XHI_FAR_CLB_BLOCK, XHI_FAR_BRAM_BLOCK, XHI_FAR_BRAM_INT_BLOCK)
HClkRow - selects the HClk Row
MajorFrame - selects the column
MinorFrame - selects frame inside column
FrameData is a pointer to the frame that is to be written to the device.
Returns:
XST_SUCCESS else XST_FAILURE.
Note:
This is a blocking function. This function is used in conjunction with the function XHwIcap_DeviceReadFrame. This function is used to write back the frame of data read using the XHwIcap_DeviceReadFrame.
void XHwIcap_FlushFifo ( XHwIcap InstancePtr  ) 

This function flushes the FIFOs in the device.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
None.
Note:
None.
int XHwIcap_GetClbBits ( XHwIcap InstancePtr,
long  Row,
long  Col,
const u8  Resource[][2],
u8  Value[],
long  NumBits 
)

Gets bits contained in a Center tile specified by the CLB row and col coordinates. The coordinate system lables the upper left CLB as (1,1).

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Row is the CLB row. (1,1) is the upper left CLB.
Col is the CLB col. (1,1) is the upper left CLB.
Resource is the Target bits (first dimension length will be the number of bits to set and must match the numBits parameter) (second dimension contains two value -- one for minor row and one for col information from within the Center tile targetted by the above row and col coords).
Value is the values to set each of the targets bits to. The size of this array must be euqal to NumBits.
NumBits is the number of Bits to change in this method.
Returns:
XST_SUCCESS, XST_BUFFER_TOO_SMALL or XST_INVALID_PARAM.
Note:
The source code for this function is not included. This function is delivered as .o file. Libgen uses the appropriate .o file for the target processor.
u32 XHwIcap_GetConfigReg ( XHwIcap InstancePtr,
u32  ConfigReg,
u32 *  RegData 
)

This function returns the value of the specified configuration register.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
ConfigReg is a constant which represents the configuration register value to be returned. Constants specified in xhwicap_i.h. Examples: XHI_IDCODE, XHI_FLR.
RegData is the value of the specified configuration register.
Returns:
XST_SUCCESS or XST_FAILURE
Note:
This is a blocking call.
void XHwIcap_IntrHandler ( void *  InstancePtr  ) 

The interrupt handler for HwIcap interrupts. This function must be connected by the user to an interrupt source.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
None.
Note:
The interrupts are being used only while writing data to the ICAP device. The reading of the data from the ICAP device is done in polled mode. In a worst case scenario the interrupt handler can be busy writing large amount of data to the Write FIFO.
XHwIcap_Config* XHwIcap_LookupConfig ( u16  DeviceId  ) 

Looks up the device configuration based on the unique device ID. A table contains the configuration info for each device in the system.

Parameters:
DeviceId contains the ID of the device for which the device configuration pointer is to be returned.
Returns:
  • A pointer to the configuration found.
  • NULL if the specified device ID was not found.
Note:
None.
void XHwIcap_Reset ( XHwIcap InstancePtr  ) 

This function forces the software reset of the complete HWICAP device. All the registers will return to the default value and the FIFO is also flushed as a part of this software reset.

Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
None.
Note:
None.
int XHwIcap_SelfTest ( XHwIcap InstancePtr  ) 

Run a self-test on the driver/device. The test

  • Writes to the Interrupt Enable Register and reads it back for comparison.
Parameters:
InstancePtr is a pointer to the XHwIcap instance.
Returns:
  • XST_SUCCESS if the value read from the register is the same as the value written.
  • XST_FAILURE otherwise
Note:
None.
int XHwIcap_SetClbBits ( XHwIcap InstancePtr,
long  Row,
long  Col,
const u8  Resource[][2],
const u8  Value[],
long  NumBits 
)

Sets bits contained in a Center tile specified by the CLB row and col coordinates. The coordinate system lables the upper left CLB as (1,1).

Parameters:
InstancePtr is a pointer to XHwIcap instance to be worked on
Row is the CLB row. (1,1) is the upper left CLB.
Col is the CLB col. (1,1) is the upper left CLB.
Resource is the Target bits (first dimension length will be the number of bits to set and must match the numBits parameter) (second dimension contains two value -- one for minor row and one for col information from within the Center tile targetted by the above row and col coords).
Value is the values to set each of the targets bits to. The size of this array must be euqal to NumBits.
NumBits is the number of Bits to change in this method.
Returns:
XST_SUCCESS, XST_BUFFER_TOO_SMALL or XST_INVALID_PARAM.
Note:
The source code for this function is not included. This function is delivered as .o file. Libgen uses the appropriate .o file for the target processor.
void XHwIcap_SetInterruptHandler ( XHwIcap InstancePtr,
void *  CallBackRef,
XHwIcap_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. The handler executes in an interrupt context, so it must minimize the amount of processing performed such as transferring data to a thread context. One of the following status events is passed to the status handler.

 
Parameters:
InstancePtr is a pointer to the XHwIcap instance.
CallBackRef is the upper layer callback reference passed back when the callback function is invoked.
FuncPtr is the pointer to the callback function.
Returns:
None.
Note:

The handler is called within interrupt context, so it should do its work quickly and queue potentially time-consuming work to a task-level thread.