Xpm_GetEventCounter - 2020.2 English

OS and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2020-11-24
Version
2020.2 English

Reads the counter value for the requested counter ID.

This is used to read the number of events that has been counted for the requsted event ID. This can only be called after a call to Xpm_SetUpAnEvent.

Note: None.

Prototype

u32 Xpm_GetEventCounter(u32 EventHandlerId, u32 *CntVal);

Parameters

The following table lists the Xpm_GetEventCounter function arguments.

Table 1. Xpm_GetEventCounter Arguments
Name Description
Event Counter ID. The counter ID is the same that was earlier returned through a call to Xpm_SetUpAnEvent. Cortex-R5 supports only 3 counters. The valid values are 0, 1, or 2.
Pointer to a 32 bit unsigned int type. This is used to return the event counter value.

Returns

  • XST_SUCCESS if successful.
  • XST_FAILURE if the passed Counter ID is invalid (i.e. greater than 2).