module ti.sysbios.family.shared.vayu.TimerSupport |
|
|
Vayu Timer Support
The Vayu Timer Support module works in conjunction with the DMTimer
module to manage the usage of the DMTimers by the various Vayu cores.
[
more ... ]
#include <ti/sysbios/family/shared/vayu/TimerSupport.h>
Functions common to all ITimerSupport modules |
Void | |
Functions common to all target modules |
|
|
Constants |
extern const Bits32 | |
DETAILS
The Vayu Timer Support module works in conjunction with the DMTimer
module to manage the usage of the DMTimers by the various Vayu cores.
This module provides a timer available mask. The application can modify
this available mask in the .cfg script to choose a different set of timers.
The default value of the timer
availMask depends on the target
the application is being built for. The defaults are shown below:
For Vayu or DRA7XX devices:
--------------------------------------------
| Target | Default availMask |
--------------------------------------------
| A15 | 0x0202 (GPTimer 2 & 10) |
| DSP | 0x0030 (GPTimer 5 & 6) |
| IPU(Dual-M4) | 0x050C (GPTimer 3,4,9 & 11) |
| ARP32 | 0x00C0 (GPTimer 7 & 8) |
--------------------------------------------
For TDA3XX devices:
--------------------------------------------
| Target | Default availMask |
--------------------------------------------
| DSP | 0x0003 (GPTimer 1 & 2) |
| IPU(Dual-M4) | 0x000C (GPTimer 3 & 4) |
| ARP32 | 0x00C0 (GPTimer 7 & 8) |
--------------------------------------------
NOTE
If the
availMask is changed, the interrupt sources
corresponding to the new Timer Ids may need to be mapped in
the interrupt crossbar module if they are not mapped by default.
See
Timer Mapping Tables
to determine the default interruptNumber/eventId assigned to
each DM Timer. In the Timer Mapping Table, an interrupt number
of -1 implies the timer's interrupt source is not connected to
the target cpu's interrupt controller. If you need to use a
timer with an interrupt number of -1, you will need to first select
an unused interrupt to use for the timer and then map the
timer's interrupt source to the target cpu's interrupt controller
using the
Interrupt Crossbar module.
Below is an example showing how to statically override the default
timer available mask in a configuration script for the DSP:
var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
var IntXbar = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
var TimerSupport = xdc.useModule('ti.sysbios.family.shared.vayu.TimerSupport');
// The new availability mask includes GP Timers 13, 14, 15 & 16.
// The interrupt sources for these timers is not connected to the
// DSP and need to be connected by the user.
TimerSupport.availMask = 0xF000;
// Connect GP Timer 13 to EventId 76 (XBAR Instance 45)
IntXbar.connectMeta(45, 339);
// Connect GP Timer 14 to EventId 77 (XBAR Instance 46)
IntXbar.connectMeta(46, 340);
// Connect GP Timer 15 to EventId 78 (XBAR Instance 47)
IntXbar.connectMeta(47, 341);
// Connect GP Timer 16 to EventId 81 (XBAR Instance 49)
IntXbar.connectMeta(49, 342);
// The DMTimer's timer mapping table shows that the intNum
// for GP Timer 13, 14, 15 & 16 is -1 implying the intNum
// has not been assigned by default. The below code utilizes
// the DMTimer module's timerSettings array to assign
// a default intNum to each of these timers.
Timer.timerSettings[12].intNum = 14;
Timer.timerSettings[13].intNum = 15;
Timer.timerSettings[14].intNum = 4;
Timer.timerSettings[15].intNum = 5;
var TimerParams = new Timer.Params();
TimerParams.period = 5000;
TimerParams.runMode = Timer.RunMode_ONESHOT;
TimerParams.periodType = Timer.PeriodType_MICROSECS;
TimerParams.arg = 1;
Timer.create(Timer.ANY, '&myIsr1', TimerParams);
TimerParams.arg = 2;
Timer.create(Timer.ANY, '&myIsr2', TimerParams);
Below is an example showing how to statically override the default
timer available mask in a configuration script for the A15:
var Timer = xdc.useModule('ti.sysbios.hal.Timer');
var DMTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
// Override the default hal timer proxy for the A15 target
Timer.TimerProxy = DMTimer;
var TimerSupport = xdc.module('ti.sysbios.family.shared.vayu.TimerSupport');
TimerSupport.availMask = 0x000F;
var TimerParams = new Timer.Params();
TimerParams.arg = 1;
TimerParams.period = 5000;
TimerParams.runMode = Timer.RunMode_ONESHOT;
TimerParams.periodType = Timer.PeriodType_MICROSECS;
Timer.create(Timer.ANY, '&myIsr', TimerParams);
config TimerSupport_availMask // module-wide |
|
Default available mask for dmtimers
extern const Bits32 TimerSupport_availMask;
DETAILS
Used to set Timer module's availMask.
The default value of the timer availMask depends on the target
the application is being built for. The defaults are shown below:
For Vayu or DRA7XX devices:
--------------------------------------------
| Target | Default availMask |
--------------------------------------------
| A15 | 0x0202 (GPTimer 2 & 10) |
| DSP | 0x0030 (GPTimer 5 & 6) |
| IPU(Dual-M4) | 0x050C (GPTimer 3,4,9 & 11) |
--------------------------------------------
For TDA3XX devices:
--------------------------------------------
| Target | Default availMask |
--------------------------------------------
| DSP | 0x0003 (GPTimer 1 & 2) |
| IPU(Dual-M4) | 0x050C (GPTimer 3 & 3) |
--------------------------------------------
TimerSupport_enable() // module-wide |
|
Void TimerSupport_enable(
UInt timerId,
Error_Block *
eb);
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool TimerSupport_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool TimerSupport_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 TimerSupport_Module_getMask();
// Returns the diagnostics mask for this module
Void TimerSupport_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
var TimerSupport = xdc.useModule('ti.sysbios.family.shared.vayu.TimerSupport');
module-wide config parameters
generated on Fri, 10 Jun 2016 23:29:33 GMT