Each of these functions are provided with a command ID, typically
specifying the parameter to control and a value for the parameter. (Note
that the general-purpose control function also is passed a timer ID specify-
ing the timer being controlled.) Commands to timers can be given
individually or collectively as a table.
The following fragment illustrates both methods.
ADI_TMR_CORE_CMD_VALUE_PAIR CoreTable [] = {
{ADI_TMR_CORE_CMD_SET_COUNT,
{ ADI_TMR_CORE_CMD_SET_PERIOD,
{ ADI_TMR_CORE_CMD_SET_SCALE,
{ ADI_TMR_CORE_CMD_SET_ACTIVE_MODE,
{ ADI_TMR_CORE_CMD_END,
};
Result = adi_tmr_CoreControl(ADI_TMR_CORE_CMD_TABLE, CoreTable);
Result = adi_tmr_GPControl(ADI_TMR_GP_TIMER_0,
Result = adi_tmr_GPControl(ADI_TMR_GP_TIMER_0,
Result = adi_tmr_GPControl(ADI_TMR_GP_TIMER_0,
Result = adi_tmr_GPControl(ADI_TMR_GP_TIMER_1,
Result = adi_tmr_GPControl(ADI_TMR_GP_TIMER_1,
Result = adi_tmr_GPControl(ADI_TMR_GP_TIMER_1,
Result = adi_tmr_WatchdogControl
Result = adi_tmr_WatchdogControl
VisualDSP++ 5.0 Device Drivers and System
Services Manual for Blackfin Processors
ADI_TMR_GP_CMD_SET_PERIOD,
ADI_TMR_GP_CMD_SET_WIDTH,
ADI_TMR_GP_CMD_SET_TIMER_MODE,
ADI_TMR_GP_CMD_SET_PERIOD,
ADI_TMR_GP_CMD_SET_WIDTH,
ADI_TMR_GP_CMD_SET_TIMER_MODE,
(ADI_TMR_WDOG_CMD_EVENT_SELECT, (void *)0x0);
(ADI_TMR_WDOG_CMD_SET_COUNT,
Timer Service
(void *)0x12345678 },
(void *)0xabcdef },
(void *)0x10 },
(void *)TRUE },
NULL
},
(void *)0x800000);
(void *)0x400000);
(void *)0x1);
(void *)0x800000);
(void *)0x400000);
(void *)0x1);
(void *)0x12345678);
8-11
Need help?
Do you have a question about the VisualDSP++ 5.0 and is the answer not in the manual?
Questions and answers