SDKZSPF LSI, SDKZSPF Datasheet - Page 73

no-image

SDKZSPF

Manufacturer Part Number
SDKZSPF
Description
Manufacturer
LSI
Datasheet

Specifications of SDKZSPF

Lead Free Status / Rohs Status
Supplier Unconfirmed
3.6 N-Intrinsics
ZSP_timer_stop(<timer>)
unsigned int ZSP_timer_read(<timer>)
The <timer> parameter must be TIMER0 or TIMER1. The <mode>
parameter must be SINGLE_SHOT or AUTO_RELOAD.
The following example illustrates how to use this interface to time a
section of code:
#include <stdio.h>
#include <timer_util.h>
main ()
{
}
N-Intrinsics provide support for DSP instructions. N-Intrinsics are
implemented as macros in the header file N_Intrinsic.h. The name
of an N-Intrinsic begins with an N_ , followed by a suffix that indicates the
operation’s data type: _s for int, _l for long, and _h for high-order int
of a long.
To use N-intrinsics, add the following line in each of your C files:
N-Intrinsics
Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved.
unsigned int timer;
int a[4000],sum,i;
ZSP_timer_mode(TIMER1,SINGLE_SHOT);
ZSP_timer_set(TIMER1,60000);
ZSP_timer_prescale(TIMER1,5);
ZSP_timer_start(TIMER1);
sum=0;
for (i=0; i<4000; i++)
ZSP_timer_stop(TIMER1);
timer = ZSP_timer_read(TIMER1);
printf("Elapsed %lu\n",((long)(60000 - timer))*5);
#include <N_Intrinsic.h>
sum+=a[i];
3-19