PROFINET Device4.1.1
 
Loading...
Searching...
No Matches

◆ PN_API_IOD_activateIsoIsrObj()

uint32_t PN_API_IOD_activateIsoIsrObj ( PN_API_IOD_Handle_t *const  pnHandle,
PN_API_IOD_cbIscoh_t  pIstCbf,
const uint32_t  nsDelayTime,
PN_API_IOD_IsoObjHndl_t *  pObjHandle 
)

Creates a new ISR isochronous object.

This function configures an ISR handler to be executed after a specified delay to NewCycle. The service scans for an available object, sets it up and returns an object handle. If multiple events are requested it is important to setup the event with the lower delaytime first.

Parameters
[in]pnHandleProfinet API Handle.
[in]pIstCbfPointer to callback function.
[in]nsDelayTimeDelay value added to new cycle in nsec.
[out]pObjHandleReturn handle to given address, used by PN_API_IOD_freeIsoObj().
Returns
result of the operation as uint32_t.
Return values
PN_API_OKSuccess.
PN_API_NOT_OKSomething went wrong.
PN_API_ERR_PARAMInvalid parameter.
Example
#include "pn_api_iod_isoch.h"
#include "pn_api_iod_startup.h"
//Implement PN_APP_IOD_cbIscoh() in the user application
PN_API_IOD_Handle_t* pnHandle = NULL;
uint32_t status;
pnHandle = PN_API_IOD_new();
//Prepare and call PN_API_IOD_startup()
...
status = PN_API_IOD_activateIsoIsrObj(pnHandle, PN_APP_IOD_cbIscoh, 0, &objHandle);
PN_API_IOD_Handle_t * PN_API_IOD_new(void)
Creates Profinet API handle.
uint32_t PN_API_IOD_activateIsoIsrObj(PN_API_IOD_Handle_t *const pnHandle, PN_API_IOD_cbIscoh_t pIstCbf, const uint32_t nsDelayTime, PN_API_IOD_IsoObjHndl_t *pObjHandle)
Creates a new ISR isochronous object.
struct PN_API_IOD_Handle PN_API_IOD_Handle_t
API handle instance which holds IO device's info.
Definition pn_api_iod_types.h:61