summaryrefslogtreecommitdiff
path: root/dds_io_pub/diasio.h
blob: d8a752f2d3e97c5d50de6521b9382f431378c826 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//------------------------------------------------------------------------------
//  All rights reserved to Trumpf GmbH + Co., Germany
//------------------------------------------------------------------------------

#ifndef TCDIASUSER_H
#define TCDIASUSER_H

// -- required headers ---------------------------------------------------------
#include <linux/ioctl.h>
#include "tctypdef.h"

/*
 * Ioctl definitions
 */

/* Use 'j' as magic number */
#define D_TCDIAS_IOC_MAGIC  'j'

#define D_TCDIASIOC_IOADRESSELESEN        _IOWR( D_TCDIAS_IOC_MAGIC, 0, TyuInt32 )
#define D_TCDIASIOC_MEMLAENGE             _IOR( D_TCDIAS_IOC_MAGIC, 1, TysInt32 )
#define D_TCDIASIOC_MEMOFFSET             _IOR( D_TCDIAS_IOC_MAGIC, 2, TyuInt32 )
#define D_TCDIASIOC_AUTOSTART             _IOWR( D_TCDIAS_IOC_MAGIC, 3, TyuInt32 )
#define D_TCDIASIOC_INTERRUPTBETRIEB      _IOWR( D_TCDIAS_IOC_MAGIC, 4, TyuInt32 )
#define D_TCDIASIOC_BEENDEN               _IO( D_TCDIAS_IOC_MAGIC, 5 )
#define D_TCDIASIOC_BEENDENAUFHEBEN       _IO( D_TCDIAS_IOC_MAGIC, 6 )
#define D_TCDIAS_IOC_MAXNR 7


static const TyuInt32 S_AdresseLS7166 = 0;
static const TyuInt32 S_AdresseLS7166Status = 1;
static const TyuInt32 S_Adresse7Seg1 = 2;
static const TyuInt32 S_Adresse7Seg2 = 3;
static const TyuInt32 S_AdresseOut = 4;
static const TyuInt32 S_AdresseIn = 5;
static const TyuInt32 S_AdresseWatchdog = 0x0c;

static const TyuInt32 S_AdresseStatus = 6;
static const TyuInt32 S_AdresseADStart = 7;
static const TyuInt32 S_AdresseMultiplexer = 8;
static const TyuInt32 S_AdresseFreigabe = 9;
static const TyuInt32 S_AdresseRevisionLogik = 0x0e;
static const TyuInt32 S_AdresseRevisionKarte = 0x0f;

//zweiter Adressblock
static const TyuInt32 S_AdresseFrequenzzaehlerLW = 0;
static const TyuInt32 S_AdresseFrequenzzaehlerHW = 2;
static const TyuInt32 S_AdresseIndexRevisionZaehler = 4;
static const TyuInt32 S_AdresseAD = 6;
static const TyuInt32 S_AdresseDA0 = 8;
static const TyuInt32 S_AdresseDA1 = 0x0a;
static const TyuInt32 S_AdresseDA2 = 0x0c;
static const TyuInt32 S_AdresseDA3 = 0x0e;
// -- exported global variables - declarations (should be empty)----------------

class DIASIO{
	
public:
	DIASIO();
	~DIASIO();
	void set(TyuInt16 value);
	TyuInt16 get();
	static int m_Bereich1;
	static int m_Bereich2;
	static int m_Bereich3;
	static bool stop_wd;
	
private:
	int m_Deviceio;
	static unsigned int instance;
	pthread_t watchdog;
	
	void init();
};

#endif