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 ... ]
C synopsis target-domain sourced in ti/sysbios/family/c64p/EventCombiner.xdc
#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 Assert_Id 
extern const Bits32 
extern const Error_Id 
 
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(&params);

  // 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, &params, &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

C synopsis target-domain
#define EventCombiner_NUM_EVENTS (Int)128
 
 
typedef EventCombiner_FuncPtr

Event Combiner dispatcher function type definition

C synopsis target-domain
typedef Void (*EventCombiner_FuncPtr)(UArg);
 
 
config EventCombiner_A_invalidEventId  // module-wide

Assert raised when an invalid event id number is specified

C synopsis target-domain
extern const Assert_Id EventCombiner_A_invalidEventId;
 
 
config EventCombiner_EVTMASK  // module-wide

Holds the initialization values for the C64+ EVTMASK registers (0-3)

C synopsis target-domain
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

C synopsis target-domain
extern const Error_Id EventCombiner_E_unpluggedEvent;
 
 
EventCombiner_disableEvent()  // module-wide

Disables 'evt' from contributing to its combined event group

C synopsis target-domain
Void EventCombiner_disableEvent(UInt evt);
 
ARGUMENTS
evt — event id
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

C synopsis target-domain
Void EventCombiner_dispatch(UInt evt);
 
ARGUMENTS
evt — event id
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'

C synopsis target-domain
Void EventCombiner_dispatchPlug(UInt evt, EventCombiner_FuncPtr fxn, UArg arg, Bool unmask);
 
ARGUMENTS
evt — event id
fxn — function to call
arg — argument to the function
unmask — whether to enable the event or not
DETAILS
This function plugs the dispatch table with the specified fxn and attrs. It does not map the corresponding combined event group to a 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

C synopsis target-domain
Void EventCombiner_enableEvent(UInt evt);
 
ARGUMENTS
evt — event id
DETAILS
It accomplishes this by setting the corresponding bit in the C64+ EVTMASK array to 0 (to unmask it).
Module-Wide Built-Ins

C synopsis target-domain
Types_ModuleId EventCombiner_Module_id();
// Get this module's unique id
 
Bool EventCombiner_Module_startupDone();
// Test if this module has completed startup
 
IHeap_Handle EventCombiner_Module_heap();
// 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
 
Configuration settings sourced in ti/sysbios/family/c64p/EventCombiner.xdc
var EventCombiner = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
module-wide constants & types
 
        obj.unmask = Bool  ...
        obj.fxn = Void(*)(UArg)  ...
        obj.arg = UArg  ...
module-wide config parameters
        msg: "A_invalidEventId: Invalid event Id specified"
    };
        msg: "E_unpluggedEvent: Event# %d is unplugged"
    };
 
module-wide functions
 
 
const EventCombiner.NUM_EVENTS

C64+ supports 128 events

Configuration settings
const EventCombiner.NUM_EVENTS = 128;
 
C SYNOPSIS
 
metaonly struct EventCombiner.EventObj

Event Configuration Object

Configuration settings
var obj = new EventCombiner.EventObj;
 
    obj.unmask = Bool  ...
    obj.fxn = Void(*)(UArg)  ...
    obj.arg = UArg  ...
 
DETAILS
unmask - Boolean value that specifies if an event should be unmasked in the C64+ EVTMASK registers. fxn - function to call when this event occurs. arg - arg to fxn.
 
config EventCombiner.A_invalidEventId  // module-wide

Assert raised when an invalid event id number is specified

Configuration settings
EventCombiner.A_invalidEventId = Assert.Desc {
    msg: "A_invalidEventId: Invalid event Id specified"
};
 
C SYNOPSIS
 
config EventCombiner.EVTMASK  // module-wide

Holds the initialization values for the C64+ EVTMASK registers (0-3)

Configuration settings
EventCombiner.EVTMASK = Bits32[4] undefined;
 
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.
C SYNOPSIS
 
config EventCombiner.E_unpluggedEvent  // module-wide

Error raised when an unplug Event is executed

Configuration settings
EventCombiner.E_unpluggedEvent = Error.Desc {
    msg: "E_unpluggedEvent: Event# %d is unplugged"
};
 
C SYNOPSIS
 
metaonly config EventCombiner.common$  // module-wide

Common module configuration parameters

Configuration settings
EventCombiner.common$ = Types.Common$ undefined;
 
DETAILS
All modules have this configuration parameter. Its name contains the '$' character to ensure it does not conflict with configuration parameters declared by the module. This allows new configuration parameters to be added in the future without any chance of breaking existing modules.
 
metaonly config EventCombiner.eventGroupHwiNum  // module-wide

Configures the mapping of a C64+ combined event group to an interrupt

Configuration settings
EventCombiner.eventGroupHwiNum = Int[4] undefined;
 
DETAILS
There is one element per combined event group (0-3).
 
metaonly config EventCombiner.events  // module-wide

For holding configuration values for all C64+ events

Configuration settings
EventCombiner.events = EventCombiner.EventObj[EventCombiner.NUM_EVENTS] undefined;
 
DETAILS
Array elements can be configured in the program configuration script.
 
metaonly EventCombiner.dispatchEventGroup()  // module-wide

Configuration method for assigning the eventGroupHwiNum array

Configuration settings
EventCombiner.dispatchEventGroup(UInt evt, UInt hwiVec) returns Void
 
ARGUMENTS
evt — event id
hwiVec — the Hwi vector to use
DETAILS
It accomplishes the same thing as directly setting eventGroupHwiNum[0-3].
generated on Fri, 10 Jun 2016 23:28:58 GMT