aboutsummaryrefslogtreecommitdiff
path: root/Client/ThirdParty/libfixmath/benchmarks/interface-arm.c
blob: d0e9969b573e752ba906ea873480ebd11bf272f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "interface.h"
#include <stdint.h>
#include <stdio.h>

// This targets an ARM Cortex M3 core using QEmu LM3S6965 emulation.
#define STBASE 0xE000E000
#define STCTRL (*(volatile uint32_t*)(0x010 + STBASE))
#define STRELOAD (*(volatile uint32_t*)(0x014 + STBASE))
#define STCURRENT (*(volatile uint32_t*)(0x018 + STBASE))


void interface_init()
{
    STRELOAD = 0x00FFFFFF;
    STCTRL = 5;
}

void start_timing()
{
     STCURRENT = 0;
}

uint16_t end_timing()
{
     return 0x00FFFFFF - STCURRENT - 4;
}