#include "xstatus.h"
#include "xmbox_hw.h"
Classes | |
struct | XMbox_Config |
struct | XMbox |
Defines | |
#define | XMBOX_H |
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) |
void | XMbox_SetInterruptEnable (XMbox *InstancePtr, u32 Mask) |
u32 | XMbox_GetInterruptEnable (XMbox *InstancePtr) |
u32 | XMbox_GetInterruptStatus (XMbox *InstancePtr) |
void | XMbox_ClearInterrupt (XMbox *InstancePtr, u32 Mask) |
u32 | XMbox_GetStatus (XMbox *InstancePtr) |
void | XMbox_SetSendThreshold (XMbox *InstancePtr, u32 Value) |
void | XMbox_SetReceiveThreshold (XMbox *InstancePtr, u32 Value) |
XMbox_Config * | XMbox_LookupConfig (u16 DeviceId) |
#define XMBOX_H |
int XMbox_CfgInitialize | ( | XMbox * | InstancePtr, | |
XMbox_Config * | ConfigPtr, | |||
u32 | EffectiveAddress | |||
) |
Initializes a specific mailbox.
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. |
void XMbox_ClearInterrupt | ( | XMbox * | InstancePtr, | |
u32 | Mask | |||
) |
Clears pending interrupts with the provided mask. This function should be called after the software has serviced the interrupts that are pending. This function clears the corresponding bits of the Interrupt Status Register. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. | |
Mask | is a logical OR of XMB_IX_* constants found in xmbox_hw.h. |
int XMbox_Flush | ( | XMbox * | InstancePtr | ) |
Resets the mailbox FIFOs by empting the READ FIFO and making sure the Error Status is zero.
InstancePtr | is a pointer to the XMbox instance to be worked on. |
u32 XMbox_GetInterruptEnable | ( | XMbox * | InstancePtr | ) |
Retrieves the interrupt enable for the mailbox. AND the result of this function with XMB_IX_* to determine which interrupts of this mailbox are enabled. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. |
u32 XMbox_GetInterruptStatus | ( | XMbox * | InstancePtr | ) |
Retrieve the interrupt status for the mailbox. AND the results of this function with XMB_IX_* to determine which interrupts are currently pending to the processor. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. |
u32 XMbox_GetStatus | ( | XMbox * | InstancePtr | ) |
Returns Status register contents. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. |
u32 XMbox_IsEmpty | ( | XMbox * | InstancePtr | ) |
Checks to see if there is data available to be read.
InstancePtr | is a pointer to the XMbox instance to be worked on. |
u32 XMbox_IsFull | ( | XMbox * | InstancePtr | ) |
Checks to see if there is room in the write FIFO.
InstancePtr | is a pointer to the XMbox instance to be worked on. |
XMbox_Config* XMbox_LookupConfig | ( | u16 | DeviceId | ) |
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.
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. |
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.
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.
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. |
void XMbox_SetInterruptEnable | ( | XMbox * | InstancePtr, | |
u32 | Mask | |||
) |
Sets the interrupt enable register for this mailbox. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. | |
Mask | is a logical OR of XMB_IX_* constants found in xmbox_hw.h. |
void XMbox_SetReceiveThreshold | ( | XMbox * | InstancePtr, | |
u32 | Value | |||
) |
Set the Receive Interrupt Threshold. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. | |
Value | is a value to set for the RIT. Only lower Log2(FIFO Depth) bits are used. |
void XMbox_SetSendThreshold | ( | XMbox * | InstancePtr, | |
u32 | Value | |||
) |
Sets the Send Interrupt Threshold. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
InstancePtr | is a pointer to the instance to be worked on. | |
Value | is a value to set for the SIT. Only lower Log2(FIFO Depth) bits are used. |
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.
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. |
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.
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.
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. |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.