Software Drivers
Main Page | Data Structures | File List | Data Fields | Globals

xmbox.h File Reference


Detailed Description


Data Structures

struct  XMbox_Config
struct  XMbox

Functions

int XMbox_CfgInitialize (XMbox *InstancePtr, XMbox_Config *ConfigPtr, u32 EffectiveAddress)
int XMbox_Read (XMbox *InstancePtr, u32 *BufferPtr, u32 RequestedBytes, u32 *BytesRecvdPtr)
void XMbox_ReadBlocking (XMbox *InstancePtr, u32 *BufferPtr, u32 RequestedBytes)
int XMbox_Write (XMbox *InstancePtr, u32 *BufferPtr, u32 RequestedBytes, u32 *BytesSentPtr)
void XMbox_WriteBlocking (XMbox *InstancePtr, u32 *BufferPtr, u32 RequestedBytes)
u32 XMbox_IsEmpty (XMbox *InstancePtr)
u32 XMbox_IsFull (XMbox *InstancePtr)
int XMbox_Flush (XMbox *InstancePtr)


Function Documentation

int XMbox_CfgInitialize XMbox InstancePtr,
XMbox_Config ConfigPtr,
u32  EffectiveAddress
 

Initializes a specific mailbox.

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
CfgPtr is the device configuration structure containing required HW build data.
EffectiveAddr is the Physical address of the hardware in a Virtual Memory operating system environment. It is the Base Address in a stand alone environment.
Returns:
  • XST_SUCCESS if initialization was successful

Note:
None.

int XMbox_Flush XMbox InstancePtr  ) 
 

Resets the mailbox FIFOs by empting the READ FIFO and making sure the Error Status is zero.

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
Returns:
  • XST_SUCCESS on success.
    • XST_FAILURE if there are any outstanding errors.

Note:
data from read FIFO is thrown away.

u32 XMbox_IsEmpty XMbox InstancePtr  ) 
 

Checks to see if there is data available to be read

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
Returns:
FALSE if there is data to be read, TRUE is there isn't
Note:
None.

u32 XMbox_IsFull XMbox InstancePtr  ) 
 

Checks to see if there is room in the write FIFO

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
Returns:
FALSE if there is room in write FIFO, TRUE is there isn't
Note:
None.

int XMbox_Read XMbox InstancePtr,
u32 *  BufferPtr,
u32  RequestedBytes,
u32 *  BytesRecvdPtr
 

Reads requested bytes from the mailbox referenced by InstancePtr,into the buffer pointed to by the provided pointer. The number of bytes must be a multiple of 4 (bytes). If not, the call will fail in an ASSERT

This function is non blocking.

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
BufferPtr is the buffer to read the mailbox contents into, aligned to a word boundary.
RequestedBytes is the number of bytes of data requested.
BytesRecvdPtr is the memory that is updated with the number of bytes of data actually read.
Returns:
On success, the number of bytes read is returned through the pointer. The call may return with fewer bytes placed in the buffer than requested (not including zero). This is not necessarily an error condition and indicates the amount of data that was currently available in the mailbox.

  • XST_SUCCESS on success.
  • XST_NO_DATA ifthere was no data in the mailbox.

Note:

void XMbox_ReadBlocking XMbox InstancePtr,
u32 *  BufferPtr,
u32  RequestedBytes
 

Reads requested bytes from the mailbox referenced by InstancePtr,into the buffer pointed to by the provided pointer. The number of bytes must be a multiple of 4 (bytes). If not, the call will fail in an ASSERT

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
BufferPtr is the buffer to read the mailbox contents into, aligned to a word boundary.
RequestedBytes is the number of bytes of data requested.
Returns:
None, The call blocks until the number of bytes requested are available.

Note:

int XMbox_Write XMbox InstancePtr,
u32 *  BufferPtr,
u32  RequestedBytes,
u32 *  BytesSentPtr
 

Writes the requested bytes from the buffer pointed to by the provided pointer into the mailbox referenced by InstancePtr.The number of bytes must be a multiple of 4 (bytes). If not, the call will fail in an ASSERT

This function is non blocking.

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
BufferPtr is the source data buffer, aligned to a word boundary.
RequestedBytes is the number of bytes requested to be written
BytesRecvdPtr points to memory which is updated with the actual number of bytes written, return value.
Returns:
On success, the number of bytes successfully written into the destination mailbox is returned in the provided pointer. The call may return with zero. This is not necessarily an error condition and indicates that the mailbox is currently full.

  • XST_SUCCESS on success.
  • XST_FIFO_NO_ROOM if the fifo was full.

Note:
The provided buffer pointed to by BufferPtr must be aligned to a word boundary.

void XMbox_WriteBlocking XMbox InstancePtr,
u32 *  BufferPtr,
u32  RequestedBytes
 

Writes the requested bytes from the buffer pointed to by the provided pointer into the mailbox referenced by InstancePtr.The number of bytes must be a multiple of 4 (bytes). If not, the call will fail in an ASSERT

Parameters:
InstancePtr is a pointer to the XMbox instance to be worked on.
BufferPtr is the source data buffer, aligned to a word boundary.
RequestedBytes is the number of bytes requested to be written
Nbytes points to memory which is updated with the actual number of bytes written
Returns:
None, The call blocks until the number of bytes requested are written.

Note:
The provided buffer pointed to by BufferPtr must be aligned to a word boundary.