| clockps Vitis Drivers API Documentation

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

Data Structures | Macros | Functions | Variables
Overview

## 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...
#define | XCLOCK_ASSIGN_DIVIDERS_S08(ParentTypeVal, DivIndexVal, CtrlRegVal)
| Assign structure elements for dividers with control register shift of 8 bits. More...
#define | XCLOCK_ASSIGN_DIVIDERS_S16(ParentTypeVal, DivIndexVal, CtrlRegVal)
| Assign structure elements for dividers with control register shift of 16 bits. More...

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

## Variables
XClockPs_Config | XClockPs_ConfigTable [XPAR_XCLOCKPS_NUM_INSTANCES]
| This table contains configuration information for clocking device in the system. More...
XClockPs_Config | XClockPs_ConfigTable [XPAR_XCLOCKPS_NUM_INSTANCES]
| configuration table defined in xclockps_g.c More...

## Macro Definition Documentation

#define XCLOCK_ASSIGN_DIVIDERS_S08 | ( |  | ParentTypeVal,
|  |  | DivIndexVal,
|  |  | CtrlRegVal
| ) |  |

Value:
{ \
.Shift = 8, \
.IsInit = FALSE, \
.EnableCount = 0, \
.Parent = XCLOCK_GENERATE_PARENT_ID(ParentTypeVal, DivIndexVal), \
.CtrlReg = CtrlRegVal, \
.Rate = XCLOCK_INVALID_RATE, \
}
XCLOCK_GENERATE_PARENT_ID
#define XCLOCK_GENERATE_PARENT_ID(type, idx)
Parent ID for node parents.
Definition: xclockps.h:119

Assign structure elements for dividers with control register shift of 8 bits.

#define XCLOCK_ASSIGN_DIVIDERS_S16 | ( |  | ParentTypeVal,
|  |  | DivIndexVal,
|  |  | CtrlRegVal
| ) |  |

Value:
{ \
.Shift = 16, \
.IsInit = FALSE, \
.EnableCount = 0, \
.Parent = XCLOCK_GENERATE_PARENT_ID(ParentTypeVal, DivIndexVal), \
.CtrlReg = CtrlRegVal, \
.Rate = XCLOCK_INVALID_RATE, \
}
XCLOCK_GENERATE_PARENT_ID
#define XCLOCK_GENERATE_PARENT_ID(type, idx)
Parent ID for node parents.
Definition: xclockps.h:119

Assign structure elements for dividers with control register shift of 16 bits.

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

## Variable Documentation

XClockPs_Config XClockPs_ConfigTable[XPAR_XCLOCKPS_NUM_INSTANCES]

configuration table defined in xclockps_g.c

configuration table defined in xclockps_g.c

Referenced by XClock_LookupConfig().

XClockPs_Config XClockPs_ConfigTable[XPAR_XCLOCKPS_NUM_INSTANCES]

Initial value:
= {
{
(u16)XPAR_XCLOCKPS_DEVICE_ID,
}
}

This table contains configuration information for clocking device in the system.

configuration table defined in xclockps_g.c

Referenced by XClock_LookupConfig().