common: Common_v1_00_a

| common Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List

Data Structures | Macros | Typedefs | Functions | Variables
Common_v1_00_a

## 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
Deprecated 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
New simple 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

## Macro Definition Documentation

#define XASSERT_NONVOID | ( |  | expression | ) |

Value:
{ \
if (expression) \
{ \
XAssertStatus = XASSERT_NONE; \
} \
else \
{ \
XAssert(__FILE__, __LINE__); \
XAssertStatus = XASSERT_OCCURRED; \
return 0; \
} \
}
XAssert
void XAssert(char *File, int Line)
Implements assert.
Definition: xbasic_types.c:93
XAssertStatus
unsigned int XAssertStatus
This variable allows testing to be done easier with asserts.
Definition: xbasic_types.c:64

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.

Parameters

  expression | is the expression to evaluate. If it evaluates to false, the assert occurs.

Returns
  Returns 0 unless the XWaitInAssert variable is true, in which case no return is made and an infinite loop is entered.

Note
  None.

Referenced by XUtil_MemoryTest16(), XUtil_MemoryTest32(), XUtil_MemoryTest8(), XVersion_FromString(), and XVersion_IsEqual().

#define XASSERT_NONVOID_ALWAYS | ( |  | ) |

Value:
{ \
XAssert(__FILE__, __LINE__); \
XAssertStatus = XASSERT_OCCURRED; \
return 0; \
}
XAssert
void XAssert(char *File, int Line)
Implements assert.
Definition: xbasic_types.c:93
XAssertStatus
unsigned int XAssertStatus
This variable allows testing to be done easier with asserts.
Definition: xbasic_types.c:64

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.

Returns
  Returns void unless the XWaitInAssert variable is true, in which case no return is made and an infinite loop is entered.

Note
  None.

#define XASSERT_VOID | ( |  | expression | ) |

Value:
{ \
if (expression) \
{ \
XAssertStatus = XASSERT_NONE; \
} \
else \
{ \
XAssert(__FILE__, __LINE__); \
XAssertStatus = XASSERT_OCCURRED; \
return; \
} \
}
XAssert
void XAssert(char *File, int Line)
Implements assert.
Definition: xbasic_types.c:93
XAssertStatus
unsigned int XAssertStatus
This variable allows testing to be done easier with asserts.
Definition: xbasic_types.c:64

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.

Parameters

  expression | is the expression to evaluate. If it evaluates to false, the assert occurs.

Returns
  Returns void unless the XWaitInAssert variable is true, in which case no return is made and an infinite loop is entered.

Note
  None.

Referenced by XVersion_Copy(), and XVersion_ToString().

#define XASSERT_VOID_ALWAYS | ( |  | ) |

Value:
{ \
XAssert(__FILE__, __LINE__); \
XAssertStatus = XASSERT_OCCURRED; \
return; \
}
XAssert
void XAssert(char *File, int Line)
Implements assert.
Definition: xbasic_types.c:93
XAssertStatus
unsigned int XAssertStatus
This variable allows testing to be done easier with asserts.
Definition: xbasic_types.c:64

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.

Returns
  Returns void unless the XWaitInAssert variable is true, in which case no return is made and an infinite loop is entered.

Note
  None.

#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.

Parameters

  DestPtr | Destination address to copy data to.
  SrcPtr | Source address to copy data from.
  Bytes | Number of bytes to copy.

Returns
  None.

Note
  XENV_MEM_COPY is deprecated. Use memcpy() instead.

#define XENV_MEM_COPY | ( |  | DestPtr,
|  |  | SrcPtr,
|  |  | Bytes
| ) |  | memcpy(DestPtr, SrcPtr, Bytes)

Copies a non-overlapping block of memory.

Parameters

  DestPtr | Destination address to copy data to.
  SrcPtr | Source address to copy data from.
  Bytes | Number of bytes to copy.

Returns
  None.

#define XENV_MEM_COPY | ( |  | DestPtr,
|  |  | SrcPtr,
|  |  | Bytes
| ) |  | memcpy((void *) DestPtr, (const void *) SrcPtr, (size_t) Bytes)

Copies a non-overlapping block of memory.

Parameters

  DestPtr | Destination address to copy data to.
  SrcPtr | Source address to copy data from.
  Bytes | Number of bytes to copy.

Returns
  None.

Note
  The use of XENV_MEM_COPY is deprecated. Use memcpy() instead.
  This implementation MAY BREAK work if source and target memory area are overlapping.

#define XENV_MEM_FILL | ( |  | DestPtr,
|  |  | Data,
|  |  | Bytes
| ) |  | memset((void *) DestPtr, (int) Data, (size_t) Bytes)

Fills an area of memory with constant data.

Parameters

  DestPtr | Destination address to copy data to.
  Data | Value to set.
  Bytes | Number of bytes to copy.

Returns
  None.

Note
  XENV_MEM_FILL is deprecated. Use memset() instead.

#define XENV_MEM_FILL | ( |  | DestPtr,
|  |  | Data,
|  |  | Bytes
| ) |  | memset(DestPtr, Data, Bytes)

Fills an area of memory with constant data.

Parameters

  DestPtr | Destination address to copy data to.
  Data | Value to set.
  Bytes | Number of bytes to copy.

Returns
  None.

#define XENV_MEM_FILL | ( |  | DestPtr,
|  |  | Data,
|  |  | Bytes
| ) |  | memset((void *) DestPtr, (int) Data, (size_t) Bytes)

Fills an area of memory with constant data.

Parameters

  DestPtr | Destination address to copy data to.
  Data | Value to set.
  Bytes | Number of bytes to copy.

Returns
  None.

Note
  The use of XENV_MEM_FILL is deprecated. Use memset() instead.

#define XENV_TIME_STAMP_DELTA_MS | ( |  | Stamp1Ptr,
|  |  | Stamp2Ptr
| ) |  | (0)

This macro is not yet implemented and always returns 0.

Parameters

  Stamp1Ptr | is the first sampled time stamp.
  Stamp2Ptr | is the second sampled time stamp.

Returns
  0

Note

None.

#define XENV_TIME_STAMP_DELTA_MS | ( |  | Stamp1Ptr,
|  |  | Stamp2Ptr
| ) |  | (0)

This macro is not yet implemented and always returns 0.

Parameters

  Stamp1Ptr | is the first sampled time stamp.
  Stamp2Ptr | is the second sampled time stamp.

Returns
  0

Note

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.

Parameters

  Stamp1Ptr | is the first sampled time stamp.
  Stamp2Ptr | is the second sampled time stamp.

Returns
  0

Note

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.

Parameters

  Stamp1Ptr | is the first sampled time stamp.
  Stamp2Ptr | is the second sampled time stamp.

Returns
  0

Note
  None.

#define XENV_TIME_STAMP_DELTA_US | ( |  | Stamp1Ptr,
|  |  | Stamp2Ptr
| ) |  | (0)

This macro is not yet implemented and always returns 0.

Parameters

  Stamp1Ptr | is the first sampled time stamp.
  Stamp2Ptr | is the second sampled time stamp.

Returns
  0

Note

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.

Parameters

  Stamp1Ptr | is the first sampled time stamp.
  Stamp2Ptr | is the second sampled time stamp.

Returns
  0

Note

This macro must be implemented by the user.

#define XENV_TIME_STAMP_GET | ( |  | StampPtr | ) |

Value:
{ \
vxTimeBaseGet((UINT32*)&(StampPtr)->TimeBaseUpper, \
(UINT32*)&(StampPtr)->TimeBaseLower); \
}

Time is derived from the 64 bit PPC timebase register.

Parameters

  StampPtr | is the storage for the retrieved time stamp.

Returns
  None.

Note

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.

Parameters

  StampPtr | is the storage for the retrieved time stamp.

Returns
  None.

Note

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.

Parameters

  StampPtr | is the storage for the retrieved time stamp.

Returns
  None.

Note

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.

Parameters

  delay | Number of microseconds to delay.

Returns
  None.

#define XENV_USLEEP | ( |  | delay | ) | udelay(delay)

Delay the specified number of microseconds.

Parameters

  delay | Number of microseconds to delay.

Returns
  None.

Note
  XENV_USLEEP is deprecated. Use udelay() instead.

#define XENV_USLEEP | ( |  | delay | ) |

XENV_USLEEP(unsigned delay)

Delay the specified number of microseconds. Not implemented without OS support.

Parameters

  delay | Number of microseconds to delay.

Returns
  None.

#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.

Parameters

  x | is the 64 bit word.

Returns
  The lower 32 bits of the 64 bit word.

Note
  None.

#define XUINT64_MSW | ( |  | x | ) | ((x).Upper)

Return the most significant half of the 64 bit data type.

Parameters

  x | is the 64 bit word.

Returns
  The upper 32 bits of the 64 bit word.

Note
  None.

#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 Documentation

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

## Function Documentation

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.

Parameters

  File | is the name of the filename of the source
  Line | is the linenumber within File

Returns
  None.

Note
  None.

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.

Parameters

  Routine | is the callback to be invoked when an assert is taken

Returns
  None.

Note
  This function has no effect if NDEBUG is set

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.

Parameters

  NullParameter | is an arbitrary void pointer and not used.

Returns
  None.

Note
  None.

int XUtil_MemoryTest16 | ( | u16 * | Addr,
|  | u32 | Words,
|  | u16 | Pattern,
|  | u8 | Subtest
| ) |  |

Performs a destructive 16-bit wide memory test.

Parameters

  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.

Returns

- XST_MEMTEST_FAILED is returned for a failure
- XST_SUCCESS is returned for a pass

Note

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.

Parameters

  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.

Returns

- XST_MEMTEST_FAILED is returned for a failure
- XST_SUCCESS is returned for a pass

Note

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.

Parameters

  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.

Returns

- XST_MEMTEST_FAILED is returned for a failure
- XST_SUCCESS is returned for a pass

Note

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.

Parameters

  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.

Returns

None.

Note

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.

Parameters

  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.

Returns

A status, XST_SUCCESS, indicating the conversion was accomplished successfully, or XST_INVALID_VERSION indicating the version string format was not valid.

Note

None.

References XASSERT_NONVOID, and XVersion_Copy().

int XVersion_IsEqual | ( | XVersion * | InstancePtr,
|  | XVersion * | VersionPtr
| ) |  |

Determines if two versions are equal.

Parameters

  InstancePtr | points to the first version to be compared.
  VersionPtr | points to a second version to be compared.

Returns

TRUE if the versions are equal, FALSE otherwise.

Note

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.

Parameters

  InstancePtr | points to the version to pack.
  PackedVersionPtr | points to the packed version which will receive the new packed version.

Returns

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.

Note

None.

void XVersion_ToString | ( | XVersion * | InstancePtr,
|  | char * | StringPtr
| ) |  |

Converts a version to a null terminated string.

Parameters

  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.

Returns

The null terminated string is inserted at the location pointed to by StringPtr if the status indicates success.

Note

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.

Parameters

  InstancePtr | points to the version to unpack the packed version into.
  PackedVersion | contains the packed version to unpack.

Returns
  None.

Note
  None.

## Variable Documentation

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().