![]() |
common
Xilinx SDK Drivers API Documentation
|
Data Structures | |
struct | XENV_TIME_STAMP |
A structure that contains a time stamp used by other time stamp macros defined below. More... | |
Macros | |
#define | XNULL NULL |
Xilinx NULL, TRUE and FALSE legacy support. More... | |
#define | XCOMPONENT_IS_READY 0x11111111 |
component has been initialized More... | |
#define | XCOMPONENT_IS_STARTED 0x22222222 |
component has been started More... | |
#define | XUINT64_MSW(x) ((x).Upper) |
Return the most significant half of the 64 bit data type. More... | |
#define | XUINT64_LSW(x) ((x).Lower) |
Return the least significant half of the 64 bit data type. More... | |
#define | XASSERT_VOID(expression) |
This assert macro is to be used for functions that do not return anything (void). More... | |
#define | XASSERT_NONVOID(expression) |
This assert macro is to be used for functions that do return a value. More... | |
#define | XASSERT_VOID_ALWAYS() |
Always assert. More... | |
#define | XASSERT_NONVOID_ALWAYS() |
Always assert. More... | |
#define | XENV_MEM_COPY(DestPtr, SrcPtr, Bytes) memcpy(DestPtr, SrcPtr, Bytes) |
Copies a non-overlapping block of memory. More... | |
#define | XENV_MEM_FILL(DestPtr, Data, Bytes) memset(DestPtr, Data, Bytes) |
Fills an area of memory with constant data. More... | |
#define | XENV_TIME_STAMP_GET(StampPtr) |
Time is derived from the 64 bit PPC timebase register. More... | |
#define | XENV_TIME_STAMP_DELTA_US(Stamp1Ptr, Stamp2Ptr) (0) |
This macro is not yet implemented and always returns 0. More... | |
#define | XENV_TIME_STAMP_DELTA_MS(Stamp1Ptr, Stamp2Ptr) (0) |
This macro is not yet implemented and always returns 0. More... | |
#define | XENV_USLEEP(delay) udelay(delay) |
Delay the specified number of microseconds. More... | |
#define | XENV_MEM_COPY(DestPtr, SrcPtr, Bytes) memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes) |
Copies a non-overlapping block of memory. More... | |
#define | XENV_MEM_FILL(DestPtr, Data, Bytes) memset((void *) DestPtr, (int) Data, (size_t) Bytes) |
Fills an area of memory with constant data. More... | |
#define | XENV_TIME_STAMP_GET(StampPtr) |
Time is derived from the 64 bit PPC timebase register. More... | |
#define | XENV_TIME_STAMP_DELTA_US(Stamp1Ptr, Stamp2Ptr) (0) |
This macro is not yet implemented and always returns 0. More... | |
#define | XENV_TIME_STAMP_DELTA_MS(Stamp1Ptr, Stamp2Ptr) (0) |
This macro is not yet implemented and always returns 0. More... | |
#define | XENV_USLEEP(delay) |
XENV_USLEEP(unsigned delay) More... | |
#define | XENV_MEM_COPY(DestPtr, SrcPtr, Bytes) memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes) |
Copies a non-overlapping block of memory. More... | |
#define | XENV_MEM_FILL(DestPtr, Data, Bytes) memset((void *) DestPtr, (int) Data, (size_t) Bytes) |
Fills an area of memory with constant data. More... | |
#define | XENV_TIME_STAMP_GET(StampPtr) |
Time is derived from the 64 bit PPC timebase register. More... | |
#define | XENV_TIME_STAMP_DELTA_US(Stamp1Ptr, Stamp2Ptr) (0) |
This macro is not yet implemented and always returns 0. More... | |
#define | XENV_TIME_STAMP_DELTA_MS(Stamp1Ptr, Stamp2Ptr) (0) |
This macro is not yet implemented and always returns 0. More... | |
#define | XENV_USLEEP(delay) sysUsDelay(delay) |
Delay the specified number of microseconds. More... | |
Typedefs | |
typedef void(* | XInterruptHandler )(void *InstancePtr) |
This data type defines an interrupt handler for a device. More... | |
typedef void(* | XExceptionHandler )(void *InstancePtr) |
This data type defines an exception handler for a processor. More... | |
typedef void(* | XAssertCallback )(char *FilenamePtr, int LineNumber) |
This data type defines a callback to be invoked when an assert occurs. More... | |
typedef int | XENV_TIME_STAMP |
A structure that contains a time stamp used by other time stamp macros defined below. More... | |
typedef int | XENV_TIME_STAMP |
A structure that contains a time stamp used by other time stamp macros defined below. More... | |
Functions | |
void | XAssert (char *File, int Line) |
Implements assert. More... | |
void | XAssertSetCallback (XAssertCallback Routine) |
Sets up a callback function to be invoked when an assert occurs. More... | |
void | XNullHandler (void *NullParameter) |
Null handler function. More... | |
int | XUtil_MemoryTest32 (u32 *Addr, u32 Words, u32 Pattern, u8 Subtest) |
Performs a destructive 32-bit wide memory test. More... | |
int | XUtil_MemoryTest16 (u16 *Addr, u32 Words, u16 Pattern, u8 Subtest) |
Performs a destructive 16-bit wide memory test. More... | |
int | XUtil_MemoryTest8 (u8 *Addr, u32 Words, u8 Pattern, u8 Subtest) |
Performs a destructive 8-bit wide memory test. More... | |
void | XVersion_UnPack (XVersion *InstancePtr, u16 PackedVersion) |
Unpacks a packed version into the specified version. More... | |
int | XVersion_Pack (XVersion *InstancePtr, u16 *PackedVersionPtr) |
Packs a version into the specified packed version. More... | |
int | XVersion_IsEqual (XVersion *InstancePtr, XVersion *VersionPtr) |
Determines if two versions are equal. More... | |
void | XVersion_ToString (XVersion *InstancePtr, char *StringPtr) |
Converts a version to a null terminated string. More... | |
int | XVersion_FromString (XVersion *InstancePtr, char *StringPtr) |
Initializes a version from a null terminated string. More... | |
void | XVersion_Copy (XVersion *InstancePtr, XVersion *VersionPtr) |
Copies the contents of a version to another version. More... | |
Variables | |
unsigned int | XAssertStatus |
This variable allows testing to be done easier with asserts. More... | |
int | XWaitInAssert = TRUE |
This variable allows the assert functionality to be changed for testing such that it does not wait infinitely. More... | |
unsigned int | XAssertStatus |
This variable allows testing to be done easier with asserts. More... | |
Legacy types | |
typedef unsigned char | Xuint8 |
unsigned 8-bit More... | |
typedef char | Xint8 |
signed 8-bit More... | |
typedef unsigned short | Xuint16 |
unsigned 16-bit More... | |
typedef short | Xint16 |
signed 16-bit More... | |
typedef unsigned long | Xuint32 |
unsigned 32-bit More... | |
typedef long | Xint32 |
signed 32-bit More... | |
typedef float | Xfloat32 |
32-bit floating point More... | |
typedef double | Xfloat64 |
64-bit double precision FP More... | |
typedef unsigned long | Xboolean |
boolean (XTRUE or XFALSE) More... | |
New types | |
typedef Xuint32 | u32 |
typedef Xuint16 | u16 |
typedef Xuint8 | u8 |
Memory subtests | |
#define | XUT_ALLMEMTESTS 0 |
See the detailed description of the subtests in the file description. More... | |
#define | XUT_INCREMENT 1 |
#define | XUT_WALKONES 2 |
#define | XUT_WALKZEROS 3 |
#define | XUT_INVERSEADDR 4 |
#define | XUT_FIXEDPATTERN 5 |
#define | XUT_MAXTEST XUT_FIXEDPATTERN |
#define XASSERT_NONVOID | ( | expression | ) |
This assert macro is to be used for functions that do return a value.
This in conjunction with the XWaitInAssert boolean can be used to accommodate tests so that asserts which fail allow execution to continue.
expression | is the expression to evaluate. If it evaluates to false, the assert occurs. |
Referenced by XUtil_MemoryTest16(), XUtil_MemoryTest32(), XUtil_MemoryTest8(), XVersion_FromString(), and XVersion_IsEqual().
#define XASSERT_NONVOID_ALWAYS | ( | ) |
Always assert.
This assert macro is to be used for functions that do return a value. Use for instances where an assert should always occur.
#define XASSERT_VOID | ( | expression | ) |
This assert macro is to be used for functions that do not return anything (void).
This in conjunction with the XWaitInAssert boolean can be used to accommodate tests so that asserts which fail allow execution to continue.
expression | is the expression to evaluate. If it evaluates to false, the assert occurs. |
Referenced by XVersion_Copy(), and XVersion_ToString().
#define XASSERT_VOID_ALWAYS | ( | ) |
Always assert.
This assert macro is to be used for functions that do not return anything (void). Use for instances where an assert should always occur.
#define XCOMPONENT_IS_READY 0x11111111 |
component has been initialized
#define XCOMPONENT_IS_STARTED 0x22222222 |
component has been started
#define XENV_MEM_COPY | ( | DestPtr, | |
SrcPtr, | |||
Bytes | |||
) | memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes) |
Copies a non-overlapping block of memory.
DestPtr | Destination address to copy data to. |
SrcPtr | Source address to copy data from. |
Bytes | Number of bytes to copy. |
#define XENV_MEM_COPY | ( | DestPtr, | |
SrcPtr, | |||
Bytes | |||
) | memcpy(DestPtr, SrcPtr, Bytes) |
Copies a non-overlapping block of memory.
DestPtr | Destination address to copy data to. |
SrcPtr | Source address to copy data from. |
Bytes | Number of bytes to copy. |
#define XENV_MEM_COPY | ( | DestPtr, | |
SrcPtr, | |||
Bytes | |||
) | memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes) |
Copies a non-overlapping block of memory.
DestPtr | Destination address to copy data to. |
SrcPtr | Source address to copy data from. |
Bytes | Number of bytes to copy. |
#define XENV_MEM_FILL | ( | DestPtr, | |
Data, | |||
Bytes | |||
) | memset((void *) DestPtr, (int) Data, (size_t) Bytes) |
Fills an area of memory with constant data.
DestPtr | Destination address to copy data to. |
Data | Value to set. |
Bytes | Number of bytes to copy. |
#define XENV_MEM_FILL | ( | DestPtr, | |
Data, | |||
Bytes | |||
) | memset(DestPtr, Data, Bytes) |
Fills an area of memory with constant data.
DestPtr | Destination address to copy data to. |
Data | Value to set. |
Bytes | Number of bytes to copy. |
#define XENV_MEM_FILL | ( | DestPtr, | |
Data, | |||
Bytes | |||
) | memset((void *) DestPtr, (int) Data, (size_t) Bytes) |
Fills an area of memory with constant data.
DestPtr | Destination address to copy data to. |
Data | Value to set. |
Bytes | Number of bytes to copy. |
#define XENV_TIME_STAMP_DELTA_MS | ( | Stamp1Ptr, | |
Stamp2Ptr | |||
) | (0) |
This macro is not yet implemented and always returns 0.
Stamp1Ptr | is the first sampled time stamp. |
Stamp2Ptr | is the second sampled time stamp. |
None.
#define XENV_TIME_STAMP_DELTA_MS | ( | Stamp1Ptr, | |
Stamp2Ptr | |||
) | (0) |
This macro is not yet implemented and always returns 0.
Stamp1Ptr | is the first sampled time stamp. |
Stamp2Ptr | is the second sampled time stamp. |
This macro must be implemented by the user
#define XENV_TIME_STAMP_DELTA_MS | ( | Stamp1Ptr, | |
Stamp2Ptr | |||
) | (0) |
This macro is not yet implemented and always returns 0.
Stamp1Ptr | is the first sampled time stamp. |
Stamp2Ptr | is the second sampled time stamp. |
This macro must be implemented by the user.
#define XENV_TIME_STAMP_DELTA_US | ( | Stamp1Ptr, | |
Stamp2Ptr | |||
) | (0) |
This macro is not yet implemented and always returns 0.
Stamp1Ptr | is the first sampled time stamp. |
Stamp2Ptr | is the second sampled time stamp. |
#define XENV_TIME_STAMP_DELTA_US | ( | Stamp1Ptr, | |
Stamp2Ptr | |||
) | (0) |
This macro is not yet implemented and always returns 0.
Stamp1Ptr | is the first sampled time stamp. |
Stamp2Ptr | is the second sampled time stamp. |
This macro must be implemented by the user.
#define XENV_TIME_STAMP_DELTA_US | ( | Stamp1Ptr, | |
Stamp2Ptr | |||
) | (0) |
This macro is not yet implemented and always returns 0.
Stamp1Ptr | is the first sampled time stamp. |
Stamp2Ptr | is the second sampled time stamp. |
This macro must be implemented by the user.
#define XENV_TIME_STAMP_GET | ( | StampPtr | ) |
Time is derived from the 64 bit PPC timebase register.
StampPtr | is the storage for the retrieved time stamp. |
Signature: void XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
#define XENV_TIME_STAMP_GET | ( | StampPtr | ) |
Time is derived from the 64 bit PPC timebase register.
StampPtr | is the storage for the retrieved time stamp. |
Signature: void XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
This macro must be implemented by the user.
#define XENV_TIME_STAMP_GET | ( | StampPtr | ) |
Time is derived from the 64 bit PPC timebase register.
StampPtr | is the storage for the retrieved time stamp. |
Signature: void XENV_TIME_STAMP_GET(XTIME_STAMP *StampPtr)
This macro must be implemented by the user.
#define XENV_USLEEP | ( | delay | ) | sysUsDelay(delay) |
Delay the specified number of microseconds.
delay | Number of microseconds to delay. |
#define XENV_USLEEP | ( | delay | ) | udelay(delay) |
Delay the specified number of microseconds.
delay | Number of microseconds to delay. |
#define XENV_USLEEP | ( | delay | ) |
Delay the specified number of microseconds. Not implemented without OS support.
delay | Number of microseconds to delay. |
#define XNULL NULL |
Xilinx NULL, TRUE and FALSE legacy support.
Deprecated.
#define XUINT64_LSW | ( | x | ) | ((x).Lower) |
Return the least significant half of the 64 bit data type.
x | is the 64 bit word. |
#define XUINT64_MSW | ( | x | ) | ((x).Upper) |
Return the most significant half of the 64 bit data type.
x | is the 64 bit word. |
#define XUT_ALLMEMTESTS 0 |
See the detailed description of the subtests in the file description.
Referenced by XUtil_MemoryTest16(), XUtil_MemoryTest32(), and XUtil_MemoryTest8().
typedef void(* XAssertCallback)(char *FilenamePtr, int LineNumber) |
This data type defines a callback to be invoked when an assert occurs.
The callback is invoked only when asserts are enabled
typedef unsigned long Xboolean |
boolean (XTRUE or XFALSE)
typedef int XENV_TIME_STAMP |
A structure that contains a time stamp used by other time stamp macros defined below.
This structure is processor dependent.
typedef int XENV_TIME_STAMP |
A structure that contains a time stamp used by other time stamp macros defined below.
This structure is processor dependent.
typedef void(* XExceptionHandler)(void *InstancePtr) |
This data type defines an exception handler for a processor.
The argument points to the instance of the component
typedef float Xfloat32 |
32-bit floating point
typedef double Xfloat64 |
64-bit double precision FP
typedef short Xint16 |
signed 16-bit
typedef long Xint32 |
signed 32-bit
typedef char Xint8 |
signed 8-bit
typedef void(* XInterruptHandler)(void *InstancePtr) |
This data type defines an interrupt handler for a device.
The argument points to the instance of the component
typedef unsigned short Xuint16 |
unsigned 16-bit
typedef unsigned long Xuint32 |
unsigned 32-bit
typedef unsigned char Xuint8 |
unsigned 8-bit
void XAssert | ( | char * | File, |
int | Line | ||
) |
Implements assert.
Currently, it calls a user-defined callback function if one has been set. Then, it potentially enters an infinite loop depending on the value of the XWaitInAssert variable.
File | is the name of the filename of the source |
Line | is the linenumber within File |
References XWaitInAssert.
void XAssertSetCallback | ( | XAssertCallback | Routine | ) |
Sets up a callback function to be invoked when an assert occurs.
If there was already a callback installed, then it is replaced.
Routine | is the callback to be invoked when an assert is taken |
void XNullHandler | ( | void * | NullParameter | ) |
Null handler function.
This follows the XInterruptHandler signature for interrupt handlers. It can be used to assign a null handler (a stub) to an interrupt controller vector table.
NullParameter | is an arbitrary void pointer and not used. |
int XUtil_MemoryTest16 | ( | u16 * | Addr, |
u32 | Words, | ||
u16 | Pattern, | ||
u8 | Subtest | ||
) |
Performs a destructive 16-bit wide memory test.
Addr | is a pointer to the region of memory to be tested. |
Words | is the length of the block. |
Pattern | is the constant used for the constant pattern test, if 0, 0xDEADBEEF is used. |
Subtest | is the test selected. See xutil.h for possible values. |
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundary of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.
References XASSERT_NONVOID, and XUT_ALLMEMTESTS.
int XUtil_MemoryTest32 | ( | u32 * | Addr, |
u32 | Words, | ||
u32 | Pattern, | ||
u8 | Subtest | ||
) |
Performs a destructive 32-bit wide memory test.
Addr | is a pointer to the region of memory to be tested. |
Words | is the length of the block. |
Pattern | is the constant used for the constant pattern test, if 0, 0xDEADBEEF is used. |
Subtest | is the test selected. See xutil.h for possible values. |
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundary of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.
References XASSERT_NONVOID, and XUT_ALLMEMTESTS.
int XUtil_MemoryTest8 | ( | u8 * | Addr, |
u32 | Words, | ||
u8 | Pattern, | ||
u8 | Subtest | ||
) |
Performs a destructive 8-bit wide memory test.
Addr | is a pointer to the region of memory to be tested. |
Words | is the length of the block. |
Pattern | is the constant used for the constant pattern test, if 0, 0xDEADBEEF is used. |
Subtest | is the test selected. See xutil.h for possible values. |
Used for spaces where the address range of the region is smaller than the data width. If the memory range is greater than 2 ** width, the patterns used in XUT_WALKONES and XUT_WALKZEROS will repeat on a boundary of a power of two making it more difficult to detect addressing errors. The XUT_INCREMENT and XUT_INVERSEADDR tests suffer the same problem. Ideally, if large blocks of memory are to be tested, break them up into smaller regions of memory to allow the test patterns used not to repeat over the region tested.
References XASSERT_NONVOID, and XUT_ALLMEMTESTS.
void XVersion_Copy | ( | XVersion * | InstancePtr, |
XVersion * | VersionPtr | ||
) |
Copies the contents of a version to another version.
InstancePtr | points to the version which is the source of data for the copy operation. |
VersionPtr | points to another version which is the destination of the copy operation. |
None.
None.
References XASSERT_VOID.
Referenced by XVersion_FromString(), and XVersion_ToString().
int XVersion_FromString | ( | XVersion * | InstancePtr, |
char * | StringPtr | ||
) |
Initializes a version from a null terminated string.
Since the string may not be a format which is compatible with the version, an error could occur.
InstancePtr | points to the version which is to be initialized. |
StringPtr | points to a null terminated string which will be converted to a version. The format of the string must match the version string format which is X.YYX where X = 0 - 9, YY = 00 - 99, Z = a - z. |
A status, XST_SUCCESS, indicating the conversion was accomplished successfully, or XST_INVALID_VERSION indicating the version string format was not valid.
None.
References XASSERT_NONVOID, and XVersion_Copy().
int XVersion_IsEqual | ( | XVersion * | InstancePtr, |
XVersion * | VersionPtr | ||
) |
Determines if two versions are equal.
InstancePtr | points to the first version to be compared. |
VersionPtr | points to a second version to be compared. |
TRUE if the versions are equal, FALSE otherwise.
None.
References XASSERT_NONVOID.
int XVersion_Pack | ( | XVersion * | InstancePtr, |
u16 * | PackedVersionPtr | ||
) |
Packs a version into the specified packed version.
Versions are packed into the configuration ROM to reduce the amount storage.
InstancePtr | points to the version to pack. |
PackedVersionPtr | points to the packed version which will receive the new packed version. |
A status, XST_SUCCESS, indicating the packing was accomplished successfully, or an error, XST_INVALID_VERSION, indicating the specified input version was not valid such that the pack did not occur
The packed version pointed to by PackedVersionPtr is modified with the new packed version if the status indicates success.
None.
void XVersion_ToString | ( | XVersion * | InstancePtr, |
char * | StringPtr | ||
) |
Converts a version to a null terminated string.
InstancePtr | points to the version to convert. |
StringPtr | points to the string which will be the result of the conversion. This does not need to point to a null terminated string as an input, but must point to storage which is an adequate amount to hold the result string. |
The null terminated string is inserted at the location pointed to by StringPtr if the status indicates success.
It is necessary for the caller to have already allocated the storage to contain the string. The amount of memory necessary for the string is specified in the version header file.
References XASSERT_VOID, and XVersion_Copy().
void XVersion_UnPack | ( | XVersion * | InstancePtr, |
u16 | PackedVersion | ||
) |
Unpacks a packed version into the specified version.
Versions are packed into the configuration ROM to reduce the amount storage. A packed version is a binary format as opposed to a non-packed version which is implemented as a string.
InstancePtr | points to the version to unpack the packed version into. |
PackedVersion | contains the packed version to unpack. |
unsigned int XAssertStatus |
This variable allows testing to be done easier with asserts.
An assert sets this variable such that a driver can evaluate this variable to determine if an assert occurred.
unsigned int XAssertStatus |
This variable allows testing to be done easier with asserts.
An assert sets this variable such that a driver can evaluate this variable to determine if an assert occurred.
int XWaitInAssert = TRUE |
This variable allows the assert functionality to be changed for testing such that it does not wait infinitely.
Use the debugger to disable the waiting during testing of asserts.
Referenced by XAssert().