Root/cntr/fw/cntr/cntr.h

1/*
2 * cntr/cntr.h - CNTR global variables
3 *
4 * Written 2010 by Werner Almesberger
5 * Copyright 2010 Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef CNTR_H
14#define CNTR_H
15
16/*
17 * Free-running 32 bit counter. The lower two bytes are from hardware Timer 0.
18 * The upper two bytes are maintained by software. At the maximum input clock
19 * frequency of 6 MHz, it wraps around every 11.9 minutes, leaving the host
20 * plenty of time to read it.
21 */
22
23extern uint8_t cntr[4];
24
25extern enum hw_type {
26    HW_TYPE_V1 = 0,
27    HW_TYPE_V2 = 1,
28    HW_TYPE_V3 = 2,
29} hw_type;
30
31#endif /* !CNTR_H */
32

Archive Download this file



interactive