User guide

CIF Peripheral Model - SimpleTimer
106 CoMET Version 5.9 – Tutorial
return;
/*
** Setup the next match.
*/
SetupNextMatch(pCallbackData->IP, pCallbackData->regMTRN);
}
CODE ENDS
Modifying the Task Initialization Function
The Task Initialization function runs once, after the Module Initialization function. In this
function we obtain and store handles, set up data structures and perform other initialization
functions.
Search for the function SimpleTimerInitTaskInstance.
To seach, choose Edit/Find or press Ctrl-F.
Get and store handles for master port views
The master ports are the interrupt ports the device will drive to request match interrupts.
Find the appropriate section in the task initialization function. The section is similar to the
following:
/*
** Get and store the handles for the Master Port views
** (for output ports).
** Again, we have only 1 task's views to store.
*/
/*
IP->OutputName = AmpiLogicInitMasterPortView("OutputName", "All");
*/
Add the following code, replacing the commented-out IP->OutputName lines:
CODE BEGINS
IP->MatchInterrupt[MATCH1_IX] =
AmpiLogicInitMasterPortView("MatchInterrupt1", "All");
IP->MatchInterrupt[MATCH2_IX] =
AmpiLogicInitMasterPortView("MatchInterrupt2", "All");
CODE ENDS
Get and store handles for slave port views
CoMET automatically generates code for the ports it creates by default: Bus, BusClock, and
Reset. The remaining slave port is the TimerClock port.
Find the appropriate section in the task initialization function. The section is similar to the
following:
/*
** Get and store the handles for the Slave Port views
** (for input ports).
** Again, we have only 1 task's views to store.
*/