MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- ----------------------------------------------- 1.00a va First release 1.00a ecm 06/01/07 Cleanup, new coding standard, check into XCS 1.01a ecm 08/19/08 Fixed the receive routine, FSL leg, was using SendID instead of the correct RecvID. Fixed CRs 466320, 466322, 476535, 476242, 476243 new rev 2.00a hm 04/09/09 Added support for mailbox v2.0, which has interrupts; Fixed CR 502464, which removed extra definitions that are not associated with the interface. Fixed the canonical definition so that each interface is considered as a device instance. 3.00a hbm 10/19/09 Migrated to HAL phase 1 to use xil_io. Removed _m from the function names. Renamed _mIsEmpty to _IsEmptyHw and _mIsFull to _IsFullHw. 3.02a bss 08/18/12 Added XMbox_GetStatus API for CR 676187
#include <string.h>
#include "xmbox.h"
#include "xil_assert.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) |
void | XMbox_SetSendThreshold (XMbox *InstancePtr, u32 Value) |
void | XMbox_SetReceiveThreshold (XMbox *InstancePtr, u32 Value) |
u32 | XMbox_GetStatus (XMbox *InstancePtr) |
|
Initializes a specific mailbox.
|
|
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.
|
|
Resets the mailbox FIFOs by empting the READ FIFO and making sure the Error Status is zero.
|
|
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.
|
|
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.
|
|
Returns Status register contents. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
|
|
Checks to see if there is data available to be read.
|
|
Checks to see if there is room in the write FIFO.
|
|
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.
|
|
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.
|
|
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.
|
|
Set the Receive Interrupt Threshold. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
|
|
Sets the Send Interrupt Threshold. This function can only be used for Non-FSL interface. If not, the function will fail in an assert.
|
|
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.
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.
|
|
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.
|