module ti.sysbios.family.c64p.EventCombiner |
|
|
|
Event Combiner Manager module
The event combiner allows the user to combine up to 32 system events
into a single combined event. The events 0, 1, 2, and 3 are the events
associated with the event combiner. Using the EventCombiner module
along with the Hwi module, allows the user to route a combined event
to any of the 12 maskable CPU interrupts available on GEM. The
EventCombiner supports up to 128 system events. Users can specify
a function and an argument for each system event and can choose to
enable whichever system events they want.
[
more ... ]
#include <ti/sysbios/family/c64p/EventCombiner.h>
Functions |
Void | |
Void | |
Void | |
Void | |
Functions common to all target modules |
|
|
Defines |
#define | |
Typedefs |
typedef Void | |
Constants |
extern const Bits32 | |
| |
DETAILS
The event combiner allows the user to combine up to 32 system events
into a single combined event. The events 0, 1, 2, and 3 are the events
associated with the event combiner. Using the EventCombiner module
along with the Hwi module, allows the user to route a combined event
to any of the 12 maskable CPU interrupts available on GEM. The
EventCombiner supports up to 128 system events. Users can specify
a function and an argument for each system event and can choose to
enable whichever system events they want.
An example of using the EventCombiner during runtime to plug the ISR
handlers for events 65 and 66 on the same Hwi:
Hwi_Params params;
Error_Block eb;
// Initialize the error block
Error_init(&eb);
// Plug the function and argument for event 65 then enable it
EventCombiner_dispatchPlug(65, &myEvent65Fxn, 0, TRUE);
// Plug the function and argument for event 66 then enable it
EventCombiner_dispatchPlug(66, &myEvent66Fxn, 1, TRUE);
// Initialize the Hwi parameters
Hwi_Params_init(¶ms);
// The eventId must be set to the combined event for event 65 or 66.
// The combined event is event 2 for both. If the combined events are
// different, then another Hwi must be used for the other combined event
params.eventId = 65 / 32;
// The arg must be set to params.eventId.
params.arg = params.eventId;
// Enable the interrupt.
params.enableInt = TRUE;
// Events 65 and 66 are on the same combined event so create a single Hwi.
// Create the Hwi on interrupt 7 then specify 'EventCombiner_dispatch'
// as the function.
Hwi_create(7, &EventCombiner_dispatch, ¶ms, &eb);
An example of using the EventCombiner during static creation to plug the
ISR handlers for events 31 and 63 on different Hwis:
// Use EventCombiner module
var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
// Plug function and argument for event 31 then enable it.
EventCombiner.events[31].fxn = '&myEvent31Fxn';
EventCombiner.events[31].arg = 31;
EventCombiner.events[31].unmask = true;
// Plug function and argument for event 63 then enable it.
EventCombiner.events[63].fxn = '&myEvent63Fxn';
EventCombiner.events[63].arg = 63;
EventCombiner.events[63].unmask = true;
// Map event 0 (combine events 0-31) to vector 8
EventCombiner.eventGroupHwiNum[0] = 8;
// Map event 1 (combine events 32-63) to vector 9
EventCombiner.eventGroupHwiNum[1] = 9;
Calling Context
Function | Hwi | Swi | Task | Main | Startup |
disableEvent | Y | Y | Y | Y | Y |
dispatch | Y | N | N | N | N |
dispatchPlug | Y | Y | Y | Y | Y |
enableEvent | Y | Y | Y | Y | Y |
Definitions:
- Hwi: API is callable from a Hwi thread.
- Swi: API is callable from a Swi thread.
- Task: API is callable from a Task thread.
- Main: API is callable during any of these phases:
- In your module startup after this module is started (e.g. EventCombiner_Module_startupDone() returns TRUE).
- During xdc.runtime.Startup.lastFxns.
- During main().
- During BIOS.startupFxns.
- Startup: API is callable during any of these phases:
- During xdc.runtime.Startup.firstFxns.
- In your module startup before this module is started (e.g. EventCombiner_Module_startupDone() returns FALSE).
|
const EventCombiner_NUM_EVENTS |
|
C64+ supports 128 events
#define EventCombiner_NUM_EVENTS (Int)128
typedef EventCombiner_FuncPtr |
|
Event Combiner dispatcher function type definition
typedef Void (*EventCombiner_FuncPtr)(UArg);
config EventCombiner_EVTMASK // module-wide |
|
Holds the initialization values for the C64+ EVTMASK registers (0-3)
extern const Bits32 EventCombiner_EVTMASK[4];
DETAILS
It is assigned values based on the 'unmask' member of the 'events'
configuration array. It can also be assigned manually in the program
configuration script.
config EventCombiner_E_unpluggedEvent // module-wide |
|
Error raised when an unplug Event is executed
extern const Error_Id EventCombiner_E_unpluggedEvent;
EventCombiner_disableEvent() // module-wide |
|
Disables 'evt' from contributing to its combined event group
Void EventCombiner_disableEvent(UInt evt);
DETAILS
It accomplishes this by setting the corresponding
bit in the C64+ EVTMASK array to 1 (to mask it).
EventCombiner_dispatch() // module-wide |
|
The Event Combiner dispatcher
Void EventCombiner_dispatch(UInt evt);
DETAILS
It is mostly used internally, but can be used directly by the user.
EventCombiner_dispatchPlug() // module-wide |
|
Used to configure a dispatcher entry for 'evt'
DETAILS
The parameters correspond to the same ones for static configuration
in EventObj. dispatchPlug does not map the corresponding combined
event group to an Hwi interrupt - such an action needs to be
performed either using the event combiner configuration or using the Hwi
module.
EventCombiner_enableEvent() // module-wide |
|
Enables 'evt' to contribute to its combined event group
Void EventCombiner_enableEvent(UInt evt);
DETAILS
It accomplishes this by setting the corresponding
bit in the C64+ EVTMASK array to 0 (to unmask it).
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool EventCombiner_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool EventCombiner_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 EventCombiner_Module_getMask();
// Returns the diagnostics mask for this module
Void EventCombiner_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
module-wide constants & types
obj.
fxn =
Void(*)(UArg) ...
module-wide config parameters
msg: "E_unpluggedEvent: Event# %d is unplugged"
};
module-wide functions
generated on Thu, 20 Nov 2014 17:11:03 GMT