Subversion Repositories shark

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/*****************************************************************************
2
* Filename:    Timer.h                                                       *
3
* Author:      Ziglioli Marco (Doctor Stein)                                 *
4
* Date:        23/03/2001                                                    *
5
* Last update:                                                               *
6
* Description: Header file for routines used to configure and manage General *
7
*              Purpouse Timer Conter on PCI6025E board                       *
8
*----------------------------------------------------------------------------*
9
* Notes:       I only need time measurament, other features like events      *
10
*              count position sensing or signal generation are not           *
11
*              implemented yet                                               *
12
*****************************************************************************/
13
 
14
/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
15
 *
16
 * Copyright (C) 2001 Marco Ziglioli
17
 *
18
 * This program is free software; you can redistribute it and/or modify
19
 * it under the terms of the GNU General Public License as published by
20
 * the Free Software Foundation; either version 2 of the License, or
21
 * (at your option) any later version.
22
 *
23
 * This program is distributed in the hope that it will be useful,
24
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
 * GNU General Public License for more details.
27
 *
28
 * You should have received a copy of the GNU General Public License
29
 * along with this program; if not, write to the Free Software
30
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
31
 *
32
 */
33
 
34
 
35
#ifndef  _PCI6025_TIMER_H_
36
#define  _PCI6025_TIMER_H_
37
 
38
#include <drivers/pci6025e/pci6025e.h>
39
#include <drivers/pci6025e/regconst.h>
80 pj 40
#include "ll/sys/cdefs.h"
2 pj 41
 
80 pj 42
__BEGIN_DECLS
43
 
2 pj 44
#define C0     0
45
#define C1     1
46
 
47
WORD  g0_command, g0_mode, g0_input_select, g0_autoincrement,
48
      g1_command, g1_mode, g1_input_select, g1_autoincrement;
49
 
50
void  reset_counter_0(void);
51
void  reset_counter_1(void);
52
void  arm_counter_0(void);
53
void  arm_counter_1(void);
54
void  disarm_counter_0(void);
55
void  disarm_counter_1(void);
56
 
57
void  TIM_reset(BYTE);
58
void  TIM_arm(BYTE);
59
void  TIM_disarm(BYTE);
60
 
61
DWORD TIM_readCounter(BYTE);
62
DWORD TIM_readHWSaveReg(BYTE);
63
 
64
void  TIM_eventCounting(BYTE, BYTE, BYTE, BYTE, DWORD);
65
void  TIM_bufferedEventCounting(BYTE, BYTE, BYTE, BYTE, DWORD);
66
void  TIM_timeMeasurement(BYTE, BYTE, BYTE, BYTE, BYTE, DWORD);
67
void  TIM_bufferedTimeMeasurement(BYTE, BYTE, BYTE, BYTE, DWORD);
80 pj 68
 
69
__END_DECLS
2 pj 70
#endif
71
/*--------------------------------------------------------------------------*/