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