Macros | Functions
ethercatdc.c File Reference

Distributed Clock EtherCAT functions. More...

#include "oshw.h"
#include "osal.h"
#include "ethercattype.h"
#include "ethercatbase.h"
#include "ethercatmain.h"
#include "ethercatdc.h"
Include dependency graph for ethercatdc.c:

Go to the source code of this file.

Macros

#define PORTM0   0x01
 
#define PORTM1   0x02
 
#define PORTM2   0x04
 
#define PORTM3   0x08
 
#define SyncDelay   ((int32)100000000)
 

Functions

boolean ec_configdc (void)
 
void ec_dcsync0 (uint16 slave, boolean act, uint32 CyclTime, int32 CyclShift)
 
void ec_dcsync01 (uint16 slave, boolean act, uint32 CyclTime0, uint32 CyclTime1, int32 CyclShift)
 
boolean ecx_configdc (ecx_contextt *context)
 
void ecx_dcsync0 (ecx_contextt *context, uint16 slave, boolean act, uint32 CyclTime, int32 CyclShift)
 
void ecx_dcsync01 (ecx_contextt *context, uint16 slave, boolean act, uint32 CyclTime0, uint32 CyclTime1, int32 CyclShift)
 
static uint8 ecx_parentport (ecx_contextt *context, uint16 parent)
 
static int32 ecx_porttime (ecx_contextt *context, uint16 slave, uint8 port)
 
static uint8 ecx_prevport (ecx_contextt *context, uint16 slave, uint8 port)
 

Detailed Description

Distributed Clock EtherCAT functions.

Definition in file ethercatdc.c.

Macro Definition Documentation

◆ PORTM0

#define PORTM0   0x01

Definition at line 18 of file ethercatdc.c.

◆ PORTM1

#define PORTM1   0x02

Definition at line 19 of file ethercatdc.c.

◆ PORTM2

#define PORTM2   0x04

Definition at line 20 of file ethercatdc.c.

◆ PORTM3

#define PORTM3   0x08

Definition at line 21 of file ethercatdc.c.

◆ SyncDelay

#define SyncDelay   ((int32)100000000)

1st sync pulse delay in ns here 100ms

Definition at line 24 of file ethercatdc.c.

Function Documentation

◆ ec_configdc()

boolean ec_configdc ( void  )

Definition at line 444 of file ethercatdc.c.

◆ ec_dcsync0()

void ec_dcsync0 ( uint16  slave,
boolean  act,
uint32  CyclTime,
int32  CyclShift 
)

Definition at line 434 of file ethercatdc.c.

◆ ec_dcsync01()

void ec_dcsync01 ( uint16  slave,
boolean  act,
uint32  CyclTime0,
uint32  CyclTime1,
int32  CyclShift 
)

Definition at line 439 of file ethercatdc.c.

◆ ecx_configdc()

boolean ecx_configdc ( ecx_contextt context)

Locate DC slaves, measure propagation delays.

Parameters
[in]context= context struct
Returns
boolean if slaves are found with DC

Definition at line 252 of file ethercatdc.c.

◆ ecx_dcsync0()

void ecx_dcsync0 ( ecx_contextt context,
uint16  slave,
boolean  act,
uint32  CyclTime,
int32  CyclShift 
)

Set DC of slave to fire sync0 at CyclTime interval with CyclShift offset.

Parameters
[in]context= context struct
[in]slaveSlave number.
[in]actTRUE = active, FALSE = deactivated
[in]CyclTimeCycltime in ns.
[in]CyclShiftCyclShift in ns.

Definition at line 35 of file ethercatdc.c.

◆ ecx_dcsync01()

void ecx_dcsync01 ( ecx_contextt context,
uint16  slave,
boolean  act,
uint32  CyclTime0,
uint32  CyclTime1,
int32  CyclShift 
)

Set DC of slave to fire sync0 and sync1 at CyclTime interval with CyclShift offset.

Parameters
[in]context= context struct
[in]slaveSlave number.
[in]actTRUE = active, FALSE = deactivated
[in]CyclTime0Cycltime SYNC0 in ns.
[in]CyclTime1Cycltime SYNC1 in ns. This time is a delta time in relation to the SYNC0 fire. If CylcTime1 = 0 then SYNC1 fires a the same time as SYNC0.
[in]CyclShiftCyclShift in ns.

Definition at line 94 of file ethercatdc.c.

◆ ecx_parentport()

static uint8 ecx_parentport ( ecx_contextt context,
uint16  parent 
)
static

Definition at line 216 of file ethercatdc.c.

◆ ecx_porttime()

static int32 ecx_porttime ( ecx_contextt context,
uint16  slave,
uint8  port 
)
static

Definition at line 148 of file ethercatdc.c.

◆ ecx_prevport()

static uint8 ecx_prevport ( ecx_contextt context,
uint16  slave,
uint8  port 
)
static

Definition at line 173 of file ethercatdc.c.



soem
Author(s): Arthur Ketels and M.J.G. van den Molengraft
autogenerated on Mon Feb 28 2022 23:46:57