Getting Started with ADSP-BF537 EZ-KIT Lite
1-25
Programming ADSP-BF537 EZ-KIT Lite with Vi+
Listing 1-3. Exercise 1, Part 3
/*
* Getting Started With the ADSP-BF537 EZ-KIT Lite
* Part 1, Exercise 3
*/
#include <stdlib.h>
#include <stdio.h>
#include <ccblkfn.h>
#include <cdefbf537.h>
#include <sysreg.h>
#include <time.h>
#include <services/adi_pwr.h>
#define NUM_ITERATIONS
50000
#define ARRAY_LENGTH
128
/* Helper function to enable the real-time clock and reset it to
time "zero" */
#define WAIT_FOR_RTC_WRITE_COMPLETE()
{ while ( ! ( *pRTC_ISTAT & 0x8000 ) ); }
void start_real_time_clock ()
{
if ( !*pRTC_PREN )
{
*pRTC_PREN = 1;
WAIT_FOR_RTC_WRITE_COMPLETE();
}
*pRTC_STAT = 0;
WAIT_FOR_RTC_WRITE_COMPLETE();
}
/* Helper function to get the number of seconds since zero time.
* Only works up to one hour of time. */
unsigned int get_real_time_clock_in_seconds ()
{
www.BDTIC.com/ADI