source: trunk/Cosy/candrv/vmodican.h@ 10026

Last change on this file since 10026 was 8843, checked in by tbretz, 17 years ago
*** empty log message ***
File size: 1.6 KB
Line 
1#ifndef COSY_VmodIcan
2#define COSY_VmodIcan
3
4#ifdef __CINT__
5//#include <TROOT.h>
6typedef UShort_t WORD_t;
7typedef Byte_t BYTE_t;
8struct Message;
9struct FastMessage;
10#else
11#include "gendef.h"
12#include "dpm.h"
13#endif
14
15#ifndef MARS_MThread
16#include "MThread.h"
17#endif
18
19#ifndef COSY_Interface
20#include "interface.h"
21#endif
22
23typedef struct timeval timeval_t;
24
25class CanOpen;
26
27class VmodIcan : public Interface, public MThread
28{
29private:
30 int fd; // file descriptor for can module
31
32 // Specific tp the VmodIcan module
33 int Ioctl(int msg, void *arg);
34
35 void SetBaudRate(int rate);
36 void EnableCanBusConnection();
37 int EnableFastCan(int rbuffers, int wbuffers);
38 void DisableCanBusConnection();
39 int EnableFifo();
40 int Reset();
41 void SetTermination(int strate=1);
42 int StdHost2NewStyle(int rbuffers, int wbuffers, int wbuffers_hi, int wbuffers_low);
43 void DisableAllCobIds();
44
45 void PrintMsg(Message *m);
46
47 int Send(Message *pm);
48 int SendHi(Message *pm);
49 int SendLo(Message *pm);
50 int Send(FastMessage *pm);
51
52 void Close();
53 int Open(const char *devname); /* pathname of device */
54
55 // Receiver
56 int Receive(Message *pm);
57 //int ReceiveFast(FastMessage *pm);
58 Int_t Thread();
59
60 void Start() { RunThread(); }
61 void Stop() { CancelThread(); }
62
63public:
64 VmodIcan(CanOpen *rx, const char *dev, const int baud);
65 virtual ~VmodIcan();
66
67 // Sending interface inherited from Interface
68 void EnableCobId(WORD_t cobid, int flag=TRUE);
69 void SendCanFrame(WORD_t cobid, BYTE_t m[8], BYTE_t rtr=0);
70
71 ClassDef(VmodIcan, 0) // hardware interface to the vmodican can module (Janz)
72};
73
74#endif
Note: See TracBrowser for help on using the repository browser.