2014-09-12 16:01:33 +02:00
|
|
|
/*
|
2017-10-25 13:39:20 +02:00
|
|
|
* Licensed under the GNU General Public License version 2 with exceptions. See
|
|
|
|
* LICENSE file in the project root for full license information
|
2014-09-12 16:01:33 +02:00
|
|
|
*/
|
2015-05-07 17:43:02 +02:00
|
|
|
|
|
|
|
/** \file
|
2014-09-12 16:01:33 +02:00
|
|
|
* \brief
|
2015-05-07 17:43:02 +02:00
|
|
|
* Headerfile for esc_coe.c
|
2014-09-12 16:01:33 +02:00
|
|
|
*/
|
2015-05-07 17:43:02 +02:00
|
|
|
|
2014-09-12 16:01:33 +02:00
|
|
|
#ifndef __esc_coe__
|
|
|
|
#define __esc_coe__
|
|
|
|
|
2015-05-20 13:13:54 +02:00
|
|
|
#include <cc.h>
|
|
|
|
|
2017-10-25 14:41:07 +02:00
|
|
|
CC_PACKED_BEGIN
|
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;
|
2019-04-02 21:26:46 +02:00
|
|
|
uint16_t flags;
|
2015-05-07 17:43:02 +02:00
|
|
|
const char *name;
|
2019-07-10 11:19:11 +02:00
|
|
|
uint32_t value;
|
2015-05-07 17:43:02 +02:00
|
|
|
void *data;
|
|
|
|
} _objd;
|
2017-10-25 14:41:07 +02:00
|
|
|
CC_PACKED_END
|
2015-05-07 17:43:02 +02:00
|
|
|
|
2017-10-25 14:41:07 +02:00
|
|
|
CC_PACKED_BEGIN
|
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;
|
2017-10-25 14:41:07 +02:00
|
|
|
CC_PACKED_END
|
2015-05-07 17:43:02 +02:00
|
|
|
|
2019-01-20 15:35:23 +01:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const _objd * obj;
|
|
|
|
uint16_t offset;
|
|
|
|
} _SMmap;
|
|
|
|
|
2015-05-07 17:43:02 +02:00
|
|
|
#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
|
|
|
|
|
2019-01-20 15:35:23 +01:00
|
|
|
#define ATYPE_Rpre 0x01
|
|
|
|
#define ATYPE_Rsafe 0x02
|
|
|
|
#define ATYPE_Rop 0x04
|
|
|
|
#define ATYPE_Wpre 0x08
|
|
|
|
#define ATYPE_Wsafe 0x10
|
|
|
|
#define ATYPE_Wop 0x20
|
2015-05-07 17:43:02 +02:00
|
|
|
#define ATYPE_RXPDO 0x40
|
|
|
|
#define ATYPE_TXPDO 0x80
|
|
|
|
|
2019-01-20 15:35:23 +01:00
|
|
|
#define ATYPE_RO (ATYPE_Rpre | ATYPE_Rsafe | ATYPE_Rop)
|
|
|
|
#define ATYPE_RW (ATYPE_Wpre | ATYPE_Wsafe | ATYPE_Wop | ATYPE_RO)
|
|
|
|
#define ATYPE_RWpre (ATYPE_Wpre | ATYPE_RO)
|
|
|
|
|
2017-10-25 14:31:30 +02:00
|
|
|
#define TX_PDO_OBJIDX 0x1c13
|
|
|
|
#define RX_PDO_OBJIDX 0x1c12
|
|
|
|
|
2020-07-02 11:11:26 +02:00
|
|
|
#define COMPLETE_ACCESS_FLAG (1 << 15)
|
|
|
|
|
2014-09-12 16:01:33 +02:00
|
|
|
void ESC_coeprocess (void);
|
2019-01-20 15:35:23 +01:00
|
|
|
uint16_t sizeOfPDO (uint16_t index, int * nmappings, _SMmap * sm, int max_mappings);
|
2017-10-25 14:31:30 +02:00
|
|
|
void SDO_abort (uint16_t index, uint8_t subindex, uint32_t abortcode);
|
2019-01-20 15:35:23 +01:00
|
|
|
void COE_initDefaultValues (void);
|
|
|
|
|
|
|
|
void COE_pdoPack (uint8_t * buffer, int nmappings, _SMmap * sm);
|
|
|
|
void COE_pdoUnpack (uint8_t * buffer, int nmappings, _SMmap * sm);
|
|
|
|
uint8_t COE_maxSub (uint16_t index);
|
|
|
|
|
2020-06-22 15:01:06 +02:00
|
|
|
extern uint32_t ESC_download_post_objecthandler (uint16_t index, uint8_t subindex, uint16_t flags);
|
|
|
|
extern uint32_t ESC_download_pre_objecthandler (uint16_t index,
|
2019-01-30 11:07:46 +01:00
|
|
|
uint8_t subindex,
|
|
|
|
void * data,
|
|
|
|
size_t size,
|
2019-04-02 21:26:46 +02:00
|
|
|
uint16_t flags);
|
2020-06-22 15:01:06 +02:00
|
|
|
extern uint32_t ESC_upload_pre_objecthandler (uint16_t index,
|
|
|
|
uint8_t subindex,
|
|
|
|
void * data,
|
|
|
|
size_t size,
|
|
|
|
uint16_t flags);
|
|
|
|
extern uint32_t ESC_upload_post_objecthandler (uint16_t index, uint8_t subindex, uint16_t flags);
|
2015-05-07 17:43:02 +02:00
|
|
|
extern const _objectlist SDOobjects[];
|
2014-09-12 16:01:33 +02:00
|
|
|
|
|
|
|
#endif
|