For standalone applications, an agent uses the XPm_Register_Notifier ()
function of the XilPM client library to get
notifications for any specific event(s). If an agent is no longer interested in
receiving notifications about events related to the node that the callback was
previously registered, use XPm_Register_Notifier()
for
de-registration.
The caller initializes the notifier object before invoking the XPm_RegisterNotifier()
with the following parameters.
- node
- ID of the node, such as device node, power node, or error event node, for which notifications are received.
- event
- Event ID or error event mask. Specify the event ID, if device node or power node IDs are provided as the node parameter. If the node parameter has an error event node ID, then specify the error event mask.
- wake: true:
- Wake up on event, false: do not wake up (only notify if awake), no buffering/queuing.
- callback
- Pointer to the custom callback function to be called when the notification is available. The callback executes from interrupt context, so you must take special care when implementing the callback. Callback is optional and can be set to NULL.
If any event related to a device or a power node occurs, the agent gets the data in the following format as the payload.
Reserved [12-15] | Event Mask [8-11] | NodeID [4-7] | Callback Type [0-3] |
Node state [12-15] | Event ID [8-11] | NodeID [4-7] | Callback Type [0-3] |
Once the agent catches the notification check for the callback type. If the
callback type is PM_NOTIFY_CB, the agent calls XPm_NotifyCb()
.
For more information on the error event node ID, error event mask, and APIs, refer to the OS and Libraries Document Collection (UG643).