clockps: Xclock_v1_0

| clockps Xilinx SDK Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Data Structures | Macros | Functions
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

#define XCLOCK_CLOCK_IS_CRITICAL BIT(0)

Clock is critical and will not be disabled.

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

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

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

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

#define XCLOCK_VALIDATE_INDEX | ( |  | type,
|  |  | index
| ) |  |

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.

#define XCLOCK_VALIDATE_INDEX_WARN | ( |  | type,
|  |  | index
| ) |  |

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

XClockPs_Config* XClock_LookupConfig | ( | u16 | DeviceId | ) |

Lookup the device configuration based on the unique device ID.

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

Parameters

  DeviceId | is 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.

References XClockPs_ConfigTable.