PM5358 S/UNI-4x622 Driver Manual

 

 

Application Programming Interface

 

 

 

 

channel

: channel number

 

enable

: sets loop if non-zero, else clears loop

Outputs

None

 

Returns

Success = SUNI4x622_SUCCESS

 

Failure = SUNI4x622_ERR_INVALID_DEVICE_STATE

 

SUNI4x622_ERR_INVALID_DEV

 

 

SUNI4x622_ERR_INVALID_CHAN

Valid States

SUNI4x622_ACTIVE

Side Effects

Will inhibit the flow of active data

4.14 Callback Functions

The S/UNI-4x622 driver has the capability to callback to functions within the USER code when certain events occur. These events and their associated callback routine declarations are detailed below. There is no USER code action that is required by the driver for these callbacks – the USER is free to implement these callbacks in any manner or else they can be deleted from the driver.

The names given to the callback functions are given as examples only. The addresses of the callback functions invoked by the suni4x622DPR function are passed during the suni4x622Init call (inside a DIV). However the USER shall use the exact same prototype. The application is left responsible for releasing the passed DPV as soon as possible (to avoid running out of DPV buffers) by calling sysSuni4x622DPVBufferRtn either within the callback function or later inside the application code.

Notifying the Application of SOH Events: cbackSuni4x622SOH

This callback function is provided by the USER and is used by the DPR to report significant SOH section events back to the application. This function should be non-blocking. Typically, the callback routine sends a message to another task with the event identifier and other context information. The task that receives this message can then process this information according to the system requirements. Note: the callback function’s addresses are passed to the driver doing the suni4x622Init call. If the address of the callback function was passed as a NULL at initialization no callback will be made.

Prototype

Inputs

Outputs Returns

void cbackSuni4x622SOH(sSUNI4x622_USR_CTXT usrCtxt, sSUNI4x622_DPV *pdpv)

usrCtxt

: user context (from suni4x622Add)

pdpv

: (pointer to) DPV that describes this event

None

 

None

 

Proprietary and Confidential to PMC-Sierra, Inc.

104

Document ID: PMC-2010419, Issue 1

 

Page 104
Image 104
PMC-Sierra PM5358 S/UNI 4x622 manual Callback Functions, Notifying the Application of SOH Events cbackSuni4x622SOH