clockps
Xilinx SDK Drivers API Documentation
Xclock_v1_0

Data Structures

struct  XClock
 The XClockPs driver instance data. More...
 

Macros

#define XCLOCK_CLOCK_IS_CRITICAL   BIT(0)
 Clock is critical and will not be disabled. More...
 
#define XCLOCK_MAX_VALUE_UNSIGNED_TYPE(type)   (type)(~0)
 Gives the max value for unsigned type Note: Not to be used with signed types. More...
 
#define XCLOCK_GENERATE_PARENT_ID(type, idx)   ((u16)((u16)(type << 8) | (u8)(idx)))
 Parent ID for node parents. More...
 
#define XCLOCK_VALIDATE_INDEX(type, index)
 This macro checks if index is valid. More...
 
#define XCLOCK_VALIDATE_INDEX_WARN(type, index)
 This macro checks for valid index and returns no failure status. More...
 

Functions

XClockPs_Config * XClock_LookupConfig (u16 DeviceId)
 Lookup the device configuration based on the unique device ID. More...
 

Macro Definition Documentation

◆ XCLOCK_CLOCK_IS_CRITICAL

#define XCLOCK_CLOCK_IS_CRITICAL   BIT(0)

#include <xclockps.h>

Clock is critical and will not be disabled.

◆ XCLOCK_GENERATE_PARENT_ID

#define XCLOCK_GENERATE_PARENT_ID (   type,
  idx 
)    ((u16)((u16)(type << 8) | (u8)(idx)))

#include <xclockps.h>

Parent ID for node parents.

Parent ID is combination of parent type and node indices. Most significant 8 bits represent type of parent and least significant 8 bits represents the node index in nodes database

◆ XCLOCK_MAX_VALUE_UNSIGNED_TYPE

#define XCLOCK_MAX_VALUE_UNSIGNED_TYPE (   type)    (type)(~0)

#include <xclockps.h>

Gives the max value for unsigned type Note: Not to be used with signed types.

◆ XCLOCK_VALIDATE_INDEX

#define XCLOCK_VALIDATE_INDEX (   type,
  index 
)

#include <xclockps.h>

Value:
do { \
if (MAX_##type < index) { \
return XST_INVALID_PARAM; \
} \
} while (0)

This macro checks if index is valid.

type corresponds to node type and can have either of below:

  • IP
  • OP
  • PLL
  • MUX
  • GATE
  • DIVIDER
  • FIXEDFACTOR

The macro assumes the index to have unsigned data type and ignores lower bound checks.

◆ XCLOCK_VALIDATE_INDEX_WARN

#define XCLOCK_VALIDATE_INDEX_WARN (   type,
  index 
)

#include <xclockps.h>

Value:
do { \
if (MAX_##type < index) { \
xil_printf("Warning: Index %d out of bound for %s\n", \
index, #type); \
return; \
} \
} while (0)

This macro checks for valid index and returns no failure status.

The macro assumes the index to have unsigned data type and ignores lower bound checks.

Function Documentation

◆ XClock_LookupConfig()

XClockPs_Config* XClock_LookupConfig ( u16  DeviceId)

#include <xclockps.h>

Lookup the device configuration based on the unique device ID.

The table contains the configuration info for each device in the system.

Parameters
DeviceIdis the unique device ID of the device being looked up.
Returns
A pointer to the configuration table entry corresponding to the given device ID, or NULL if no match is found.
Note
None.