629
|
1 |
/*
|
|
2 |
This file is part of CanFestival, a library implementing CanOpen Stack.
|
|
3 |
|
|
4 |
Copyright (C): Cosateq GmbH & Co.KG
|
|
5 |
http://www.cosateq.com/
|
|
6 |
http://www.scale-rt.com/
|
|
7 |
|
|
8 |
See COPYING file for copyrights details.
|
|
9 |
|
|
10 |
This library is free software; you can redistribute it and/or
|
|
11 |
modify it under the terms of the GNU Lesser General Public
|
|
12 |
License as published by the Free Software Foundation; either
|
|
13 |
version 2.1 of the License, or (at your option) any later version.
|
|
14 |
|
|
15 |
This library is distributed in the hope that it will be useful,
|
|
16 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
18 |
Lesser General Public License for more details.
|
|
19 |
|
|
20 |
You should have received a copy of the GNU Lesser General Public
|
|
21 |
License along with this library; if not, write to the Free Software
|
|
22 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
23 |
*/
|
|
24 |
|
|
25 |
/*
|
|
26 |
CAN driver interface for CO-PCICAN card.
|
|
27 |
*/
|
|
28 |
|
|
29 |
#ifndef _CO_PCICANOPS_
|
|
30 |
#define _CO_PCICANOPS_
|
|
31 |
|
|
32 |
#define NUM_CAN_CHANNELS 4
|
|
33 |
|
|
34 |
#define CMDQ_OPC_ENTER_RUN_MODE 0x01
|
|
35 |
#define CMDQ_OPC_ENTER_CONFIG_MODE 0x02
|
|
36 |
#define CMDQ_OPC_SET_CONFIG_CHANNEL 0xA2
|
|
37 |
|
|
38 |
typedef struct
|
|
39 |
{
|
|
40 |
unsigned char opcode;
|
|
41 |
unsigned long param[15];
|
|
42 |
} co_pcican_config_t;
|
|
43 |
|
|
44 |
typedef struct
|
|
45 |
{
|
|
46 |
unsigned char channelnum;
|
|
47 |
unsigned long type;
|
|
48 |
unsigned long size;
|
|
49 |
unsigned long id;
|
|
50 |
unsigned char data[8];
|
|
51 |
unsigned long timestamp_lo;
|
|
52 |
unsigned long timestamp_hi;
|
|
53 |
} co_pcican_message_t;
|
|
54 |
|
|
55 |
/*=============================================================================
|
|
56 |
supported operations
|
|
57 |
===========================================================================*/
|
|
58 |
#define CAN_CONFIG 2
|
|
59 |
#define CAN_WRITE 3
|
|
60 |
#define CAN_READ 4
|
|
61 |
|
|
62 |
/*=============================================================================
|
|
63 |
directions
|
|
64 |
===========================================================================*/
|
|
65 |
#define RX 0
|
|
66 |
#define TX 1
|
|
67 |
|
|
68 |
/*=============================================================================
|
|
69 |
supported types
|
|
70 |
===========================================================================*/
|
|
71 |
#define MSG_EXT 0x00000001
|
|
72 |
#define MSG_RTR 0x00000002
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
#endif
|
|
77 |
|