use cc.h
parent
b5af557184
commit
6fb9c84107
|
@ -38,6 +38,12 @@ typedef int32_t int32;
|
|||
#define etohl(x) (x)
|
||||
#endif
|
||||
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
#define EC_LITTLE_ENDIAN
|
||||
#else
|
||||
#define EC_BIG_ENDIAN
|
||||
#endif
|
||||
|
||||
#ifdef ESC_DEBUG
|
||||
#define DPRINT(...) rprintp ("esc_foe: "__VA_ARGS__) /* TODO */
|
||||
#else
|
||||
|
|
33
soes/esc.h
33
soes/esc.h
|
@ -38,9 +38,10 @@
|
|||
#ifndef __esc__
|
||||
#define __esc__
|
||||
|
||||
#include <cc.h>
|
||||
|
||||
/* storage modifier for data stored in flashmemory */
|
||||
#define FLASHSTORE const
|
||||
#define PACKED __attribute__((__packed__))
|
||||
|
||||
#define ESCREG_ADDRESS 0x0010
|
||||
#define ESCREG_DLSTATUS 0x0110
|
||||
|
@ -239,10 +240,8 @@
|
|||
#define FOE_WAIT_FOR_FINAL_ACK 2
|
||||
#define FOE_WAIT_FOR_DATA 3
|
||||
|
||||
#define EC_LITTLE_ENDIAN
|
||||
|
||||
// Attention! this struct is always little-endian
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 PSA;
|
||||
uint16 Length;
|
||||
|
@ -301,7 +300,7 @@ typedef struct PACKED
|
|||
} _ESCsm;
|
||||
|
||||
/* Attention! this struct is always little-endian */
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 PSA;
|
||||
uint16 Length;
|
||||
|
@ -311,14 +310,14 @@ typedef struct PACKED
|
|||
uint8 ActPDI;
|
||||
} _ESCsm2;
|
||||
|
||||
typedef FLASHSTORE struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 PSA;
|
||||
uint16 Length;
|
||||
uint8 Command;
|
||||
} _ESCsmCompact;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 ALevent;
|
||||
uint16 ALstatus;
|
||||
|
@ -359,7 +358,7 @@ typedef struct PACKED
|
|||
_ESCsm SM[4];
|
||||
} _ESCvar;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 length;
|
||||
uint16 address;
|
||||
|
@ -381,18 +380,18 @@ typedef struct PACKED
|
|||
#endif
|
||||
} _MBXh;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
_MBXh header;
|
||||
uint8 b[MBXDSIZE];
|
||||
} _MBX;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 numberservice;
|
||||
} _COEh;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
#if defined(EC_LITTLE_ENDIAN)
|
||||
uint8 opcode:7;
|
||||
|
@ -408,14 +407,14 @@ typedef struct PACKED
|
|||
uint16 fragmentsleft;
|
||||
} _INFOh;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
_MBXh mbxheader;
|
||||
uint16 type;
|
||||
uint16 detail;
|
||||
} _MBXerr;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
_MBXh mbxheader;
|
||||
_COEh coeheader;
|
||||
|
@ -425,7 +424,7 @@ typedef struct PACKED
|
|||
uint32 size;
|
||||
} _COEsdo;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
_MBXh mbxheader;
|
||||
_COEh coeheader;
|
||||
|
@ -437,7 +436,7 @@ typedef struct PACKED
|
|||
char name;
|
||||
} _COEobjdesc;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
_MBXh mbxheader;
|
||||
_COEh coeheader;
|
||||
|
@ -451,7 +450,7 @@ typedef struct PACKED
|
|||
char name;
|
||||
} _COEentdesc;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint8 opcode;
|
||||
uint8 reserved;
|
||||
|
@ -466,7 +465,7 @@ typedef struct PACKED
|
|||
#define FOEHSIZE (sizeof(_FOEh))
|
||||
#define FOE_DATA_SIZE (MBXSIZEBOOT - (MBXHSIZE+FOEHSIZE))
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
_MBXh mbxheader;
|
||||
_FOEh foeheader;
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
#ifndef __esc_coe__
|
||||
#define __esc_coe__
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 subindex;
|
||||
uint16 datatype;
|
||||
|
@ -48,7 +48,7 @@ typedef struct PACKED
|
|||
void *data;
|
||||
} _objd;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
uint16 index;
|
||||
uint16 objtype;
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
* property of, and protected by Beckhoff Automation GmbH.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** \file
|
||||
* \brief
|
||||
* Headerfile for esc_foe.c
|
||||
* Headerfile for esc_foe.c
|
||||
*/
|
||||
|
||||
#ifndef __esc_foe__
|
||||
|
@ -73,7 +73,7 @@ typedef struct foe_cfg
|
|||
foe_writefile_cfg_t * files;
|
||||
} foe_cfg_t;
|
||||
|
||||
typedef struct PACKED
|
||||
typedef struct CC_PACKED
|
||||
{
|
||||
/** Current FoE state, ex. Waiting for ACK, Waiting for DATA */
|
||||
uint8 foestate;
|
||||
|
|
Loading…
Reference in New Issue