SOES/soes/esc_coe.h

114 lines
3.4 KiB
C
Raw Normal View History

/*
* SOES Simple Open EtherCAT Slave
*
* Copyright (C) 2007-2013 Arthur Ketels
*
* SOES is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* SOES is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* As a special exception, if other files instantiate templates or use macros
* or inline functions from this file, or you compile this file and link it
* with other works to produce a work based on this file, this file does not
* by itself cause the resulting work to be covered by the GNU General Public
* License. However the source code for this file must still be made available
* in accordance with section (3) of the GNU General Public License.
*
* This exception does not invalidate any other reasons why a work based on
* this file might be covered by the GNU General Public License.
*
* The EtherCAT Technology, the trade name and logo "EtherCAT" are the intellectual
* property of, and protected by Beckhoff Automation GmbH.
*/
2015-05-07 17:43:02 +02:00
/** \file
* \brief
2015-05-07 17:43:02 +02:00
* Headerfile for esc_coe.c
*/
2015-05-07 17:43:02 +02:00
#ifndef __esc_coe__
#define __esc_coe__
2015-05-20 13:13:54 +02:00
#include <cc.h>
2015-05-18 16:54:09 +02:00
typedef struct CC_PACKED
2015-05-07 17:43:02 +02:00
{
2015-05-21 10:41:13 +02:00
uint16_t subindex;
uint16_t datatype;
uint16_t bitlength;
uint16_t access;
2015-05-07 17:43:02 +02:00
const char *name;
2015-05-21 10:41:13 +02:00
uint32_t value;
2015-05-07 17:43:02 +02:00
void *data;
} _objd;
2015-05-18 16:54:09 +02:00
typedef struct CC_PACKED
2015-05-07 17:43:02 +02:00
{
2015-05-21 10:41:13 +02:00
uint16_t index;
uint16_t objtype;
uint8_t maxsub;
uint8_t pad1;
2015-05-07 17:43:02 +02:00
const char *name;
const _objd *objdesc;
} _objectlist;
#define OBJH_READ 0
#define OBJH_WRITE 1
#define OTYPE_DOMAIN 0x0002
#define OTYPE_DEFTYPE 0x0005
#define OTYPE_DEFSTRUCT 0x0006
#define OTYPE_VAR 0x0007
#define OTYPE_ARRAY 0x0008
#define OTYPE_RECORD 0x0009
#define DTYPE_BOOLEAN 0x0001
#define DTYPE_INTEGER8 0x0002
#define DTYPE_INTEGER16 0x0003
#define DTYPE_INTEGER32 0x0004
#define DTYPE_UNSIGNED8 0x0005
#define DTYPE_UNSIGNED16 0x0006
#define DTYPE_UNSIGNED32 0x0007
#define DTYPE_REAL32 0x0008
#define DTYPE_VISIBLE_STRING 0x0009
#define DTYPE_OCTET_STRING 0x000A
#define DTYPE_UNICODE_STRING 0x000B
#define DTYPE_INTEGER24 0x0010
#define DTYPE_UNSIGNED24 0x0016
#define DTYPE_INTEGER64 0x0015
#define DTYPE_UNSIGNED64 0x001B
#define DTYPE_REAL64 0x0011
#define DTYPE_PDO_MAPPING 0x0021
#define DTYPE_IDENTITY 0x0023
#define DTYPE_BIT1 0x0030
#define DTYPE_BIT2 0x0031
#define DTYPE_BIT3 0x0032
#define DTYPE_BIT4 0x0033
#define DTYPE_BIT5 0x0034
#define DTYPE_BIT6 0x0035
#define DTYPE_BIT7 0x0036
#define DTYPE_BIT8 0x0037
#define ATYPE_RO 0x07
2015-05-07 17:43:02 +02:00
#define ATYPE_RW 0x3F
#define ATYPE_RWpre 0x0F
#define ATYPE_RXPDO 0x40
#define ATYPE_TXPDO 0x80
void ESC_coeprocess (void);
2015-05-21 10:41:13 +02:00
uint16_t sizeTXPDO (void);
uint16_t sizeRXPDO (void);
2015-05-21 10:41:13 +02:00
extern void ESC_objecthandler (uint16_t index, uint8_t subindex);
2015-05-07 17:43:02 +02:00
extern const _objectlist SDOobjects[];
extern const _objd SDO1C12[];
extern const _objd SDO1C13[];
#endif