1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-23 08:38:07 +02:00
ben-wpan/cntr/fw/cntr/cntr.h
Werner Almesberger 190e8f0082 Firmware support for CNTR version 3.
- common/io.h: describe the role of PROBE_TERM in version 3
- common/io.h (VERSION_ID): renamed to VERSION_ID1
- common/io.h (VERSION_ID2): added P2_0, and described version number
  encoding
- cntr/cntr.h (enum hw_type): added HW_TYPE_V3
- cntr/cntr.c (init_io): decode version 3, flash LED three times, and
  configure PROBE_TERM according to version
2010-11-06 17:03:33 -03:00

32 lines
813 B
C

/*
* cntr/cntr.h - CNTR global variables
*
* Written 2010 by Werner Almesberger
* Copyright 2010 Werner Almesberger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef CNTR_H
#define CNTR_H
/*
* Free-running 32 bit counter. The lower two bytes are from hardware Timer 0.
* The upper two bytes are maintained by software. At the maximum input clock
* frequency of 6 MHz, it wraps around every 11.9 minutes, leaving the host
* plenty of time to read it.
*/
extern uint8_t cntr[4];
extern enum hw_type {
HW_TYPE_V1 = 0,
HW_TYPE_V2 = 1,
HW_TYPE_V3 = 2,
} hw_type;
#endif /* !CNTR_H */