#include "xil_types.h"
#include "xil_assert.h"
#include "xstatus.h"
#include "xbram_hw.h"
Classes | |
struct | XBram_Config |
struct | XBram |
Defines | |
#define | XBRAM_H |
Functions | |
XBram_Config * | XBram_LookupConfig (u16 DeviceId) |
int | XBram_CfgInitialize (XBram *InstancePtr, XBram_Config *Config, u32 EffectiveAddr) |
int | XBram_SelfTest (XBram *InstancePtr, u8 IntMask) |
void | XBram_InterruptEnable (XBram *InstancePtr, u32 Mask) |
void | XBram_InterruptDisable (XBram *InstancePtr, u32 Mask) |
void | XBram_InterruptClear (XBram *InstancePtr, u32 Mask) |
u32 | XBram_InterruptGetEnabled (XBram *InstancePtr) |
u32 | XBram_InterruptGetStatus (XBram *InstancePtr) |
#define XBRAM_H |
int XBram_CfgInitialize | ( | XBram * | InstancePtr, | |
XBram_Config * | Config, | |||
u32 | EffectiveAddr | |||
) |
Initialize the XBram instance provided by the caller based on the given configuration data.
Nothing is done except to initialize the InstancePtr.
InstancePtr | is a pointer to an XBram instance. The memory the pointer references must be pre-allocated by the caller. Further calls to manipulate the driver through the XBram API must be made with this pointer. | |
Config | is a reference to a structure containing information about a specific BRAM device. This function initializes an InstancePtr object for a specific device specified by the contents of Config. This function can initialize multiple instance objects with the use of multiple calls giving different Config information on each call. | |
EffectiveAddr | is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, use Config->BaseAddress for this parameters, passing the physical address instead. |
void XBram_InterruptClear | ( | XBram * | InstancePtr, | |
u32 | Mask | |||
) |
Clear pending interrupts with the provided mask. This function should be called after the software has serviced the interrupts that are pending. This function will assert if the hardware device has not been built with interrupt capabilities.
InstancePtr | is the BRAM instance to operate on. | |
Mask | is the mask to clear pending interrupts for. Bit positions of 1 are cleared. This mask is formed by OR'ing bits from XBRAM_IR* bits which are contained in xbram_hw.h. |
void XBram_InterruptDisable | ( | XBram * | InstancePtr, | |
u32 | Mask | |||
) |
Disable interrupts. This function allows each specific interrupt to be disabled. This function will assert if the hardware device has not been built with interrupt capabilities.
InstancePtr | is the BRAM instance to operate on. | |
Mask | is the mask to disable. Bits set to 1 are disabled. This mask is formed by OR'ing bits from XBRAM_IR* bits which are contained in xbram_hw.h. |
void XBram_InterruptEnable | ( | XBram * | InstancePtr, | |
u32 | Mask | |||
) |
Enable interrupts. This function will assert if the hardware device has not been built with interrupt capabilities.
InstancePtr | is the BRAM instance to operate on. | |
Mask | is the mask to enable. Bit positions of 1 are enabled. This mask is formed by OR'ing bits from XBRAM_IR* bits which are contained in xbram_hw.h. |
u32 XBram_InterruptGetEnabled | ( | XBram * | InstancePtr | ) |
Returns the interrupt enable mask. This function will assert if the hardware device has not been built with interrupt capabilities.
InstancePtr | is the BRAM instance to operate on. |
u32 XBram_InterruptGetStatus | ( | XBram * | InstancePtr | ) |
Returns the status of interrupt signals. Any bit in the mask set to 1 indicates that the channel associated with the bit has asserted an interrupt condition. This function will assert if the hardware device has not been built with interrupt capabilities.
InstancePtr | is the BRAM instance to operate on. |
The interrupt status indicates the status of the device irregardless if the interrupts from the devices have been enabled or not through XBram_InterruptEnable().
XBram_Config* XBram_LookupConfig | ( | u16 | DeviceId | ) |
Lookup the device configuration based on the unique device ID. The table ConfigTable contains the configuration info for each device in the system.
DeviceId | is the device identifier to lookup. |
int XBram_SelfTest | ( | XBram * | InstancePtr, | |
u8 | IntMask | |||
) |
Run a self-test on the driver/device. Unless fault injection is implemented in hardware, this function only does a minimal test in which available registers (if any) are written and read.
With fault injection, all possible single-bit and double-bit errors are injected, and checked to the extent possible, given the implemented hardware.
InstancePtr | is a pointer to the XBram instance. | |
IntMask | is the interrupt mask to use. When testing with interrupts, this should be set to allow interrupt generation, otherwise it should be 0. |
Copyright © 1995-2014 Xilinx, Inc. All rights reserved.