EtherCAT Slave  1.04.01
ecSlvCiA402.c

CiA402 Application implementation.

Author
KUNBUS GmbH
Date
2021-05-18
/*-----------------------------------------------------------------------------------------
------
------ Includes
------
-----------------------------------------------------------------------------------------*/
#include <ecSlvApi.h>
#include <ecApiDef.h>
#include "ecSlvCiA402.h"
#include "ESL_cia402Obd.h"
#include "ESL_cia402Demo.h"
#include "project.h"
#include <ESL_os.h>
#include <ESL_BOARD_config.h>
#include <ESL_vendor.h>
#include <ESL_phyLibTlk110.h>
#include <ESL_gpioHelper.h>
#include <ESL_foeDemo.h>
#include <ESL_soeDemo.h>
#include <ESL_eeprom.h>
#if (defined HAVEDISPLAY) && (HAVEDISPLAY==1)
#include <oled_drv.h>
#endif
#include <ecSlvApi.h>
#if !(defined MBXMEM)
#define MBXMEM
#endif
/*-----------------------------------------------------------------------------------------
------
------ local variables and constants
------
-----------------------------------------------------------------------------------------*/
#define I2C_IOEXP_ADDR 0x60 // The I2C address for GPIO expander
#define RXPDOMAP_INDEX 0x1600
#define TXPDOMAP_INDEX 0x1A00
#define AXIS_ONE 0
#define AXIS_TWO 1
#define AXIS_THREE 2
static void EC_SLV_APP_applicationRun(void* pAppCtxt_p);
static EC_API_EError_t EC_SLV_APP_populateCiA402Functions(EC_SLV_APP_Sapplication_t* pApplicationInstance_p);
static EC_API_EError_t EC_SLV_APP_populateTxPDO(EC_SLV_APP_Sapplication_t* pApplicationInstance_p, EC_API_SLV_SPdo_t* pPdo_p, uint8_t axis_p);
/*-----------------------------------------------------------------------------------------
------
------ application specific functions
------
-----------------------------------------------------------------------------------------*/
#if (defined HAVEDISPLAY) && (HAVEDISPLAY==1)
void oled_init(void)
{
/* Oled Init */
const char oled_line1[] = "Kunbus GmbH";
const char oled_line2[] = "EtherCAT DTK Demo";
Board_oledInit();
clear();
setline(0);
setOrientation(1);
printstr((int8_t *)oled_line1);
setline(1);
setOrientation(1);
printstr((int8_t *)oled_line2);
scrollDisplayRight();
}
void oled_run(uint8_t i8uState)
{
const char oled_line1[] = "EtherCAT DTK Demo";
clear();
setline(0);
setOrientation(1);
printstr((int8_t *)oled_line1);
setline(1);
setOrientation(1);
char line2[] = "State: ";
char buffer[7];
sprintf(buffer, "%d ", i8uState);
strcat(line2, buffer);
printstr((int8_t *)line2);
scrollDisplayRight();
}
#endif
static EC_API_EError_t EC_SLV_APP_populateSlaveInfo(EC_SLV_APP_Sapplication_t* pApplicationInstance_p)
{
if (!pApplicationInstance_p)
{
goto Exit;
}
ptSlave = pApplicationInstance_p->ptEcSlvApi;
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setVendorId (ptSlave, ECAT_VENDORID);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setRevisionNumber(ptSlave, ECAT_REVISION);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setSerialNumber (ptSlave, 0x00000000);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setProductCode (ptSlave, ECAT_PRODUCTCODE_CIA402);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setProductName (ptSlave, ECAT_PRODUCTNAME_CIA402);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setGroupType (ptSlave, "EtherCAT Toolkit");
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setHwVersion (ptSlave, "R01");
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setSwVersion (ptSlave, "1.04.01");
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
/* Former Project.h */
error = (EC_API_EError_t)EC_API_SLV_setPDOSize(ptSlave, KBEC_MAX_PD_LEN, KBEC_MAX_PD_LEN);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_setPDICfg(ptSlave, ESC_EE_PDI_CONTROL, ESC_EE_PDI_CONFIG);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
ET1100_BOOT_MBXOUT_START, ET1100_BOOT_MBXOUT_DEF_LENGTH,
ET1100_BOOT_MBXIN_START, ET1100_BOOT_MBXIN_DEF_LENGTH);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
ET1100_MBXOUT_START, ET1100_MBXOUT_DEF_LENGTH,
ET1100_MBXIN_START, ET1100_MBXIN_DEF_LENGTH);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
0, ET1100_MBXOUT_START, ET1100_MBXOUT_DEF_LENGTH,
ET1100_MBXOUT_CONTROLREG, ET1100_MBXOUT_ENABLE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
1, ET1100_MBXIN_START, ET1100_MBXIN_DEF_LENGTH,
ET1100_MBXIN_CONTROLREG, ET1100_MBXIN_ENABLE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
2, ET1100_OUTPUT_START, ET1100_OUTPUT_DEF_LENGTH,
ET1100_OUTPUT_CONTROLREG, ET1100_OUTPUT_ENABLE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
3, ET1100_INPUT_START, ET1100_INPUT_DEF_LENGTH,
ET1100_INPUT_CONTROLREG, ET1100_INPUT_ENABLE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
Exit:
return error;
}
static EC_API_EError_t EC_SLV_APP_populateCiA402Functions(EC_SLV_APP_Sapplication_t* pApplicationInstance_p)
{
if (!pApplicationInstance_p)
{
goto Exit;
}
ptSlave = pApplicationInstance_p->ptEcSlvApi;
EC_API_SLV_CiA402_setAxisNumber (ptSlave, AXES_NUMBER);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) CiA402 Object Dictionary error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
Exit:
return error;
}
static EC_API_EError_t EC_SLV_APP_populateRxPDO(EC_SLV_APP_Sapplication_t* pApplicationInstance_p, EC_API_SLV_SPdo_t* pPdo_p, uint8_t axis_p)
{
uint16_t rxIndex = RXPDOMAP_INDEX + axis_p;
if (!pApplicationInstance_p)
{
goto Exit;
}
ptSlave = pApplicationInstance_p->ptEcSlvApi;
error = (EC_API_EError_t)EC_API_SLV_PDO_create(ptSlave, "RxPDO", rxIndex, &pPdo_p);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Create PDO 0x%04x error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, rxIndex, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, OBD_CONTROLWORD_INDEX(axis_p), 0, &pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 001", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 002", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, OBD_TARGET_POSITION_INDEX(axis_p), 0, &pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 003", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, OBD_TARGET_VELOCITY_INDEX(axis_p), 0, &pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 004", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, OBD_TARGET_TORQUE_INDEX(axis_p), 0, &pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 005", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
Exit:
return error;
}
static EC_API_EError_t EC_SLV_APP_populateTxPDO(EC_SLV_APP_Sapplication_t* pApplicationInstance_p, EC_API_SLV_SPdo_t* pPdo_p, uint8_t axis_p)
{
uint16_t txIndex = TXPDOMAP_INDEX + axis_p;
if (!pApplicationInstance_p)
{
goto Exit;
}
ptSlave = pApplicationInstance_p->ptEcSlvApi;
error = (EC_API_EError_t)EC_API_SLV_PDO_create(ptSlave, "TxPDO", txIndex, &pPdo_p);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create PDO for axis %d error code: 0x%08x\r\n", axis_p);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_CoE_getObjectEntry(ptSlave, OBD_STATUSWORD_INDEX(axis_p), 0, &pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 001", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 002", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("PDO 0x1A00 Entry 2 Error code: 0x%08x\r\n", error);
goto Exit;
}
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 003", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("PDO 0x1A00 Entry 2 Error code: 0x%08x\r\n", error);
goto Exit;
}
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 004", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("PDO 0x1A00 Entry 2 Error code: 0x%08x\r\n", error);
goto Exit;
}
if (error != EC_API_eERR_NONE)
{
OSAL_printf("%s:%d (%s) Variable Error code: 0x%08x\r\n", __FILE__, __LINE__, __FUNCTION__, error);
goto Exit;
}
error = (EC_API_EError_t)EC_API_SLV_PDO_createEntry(ptSlave, pPdo_p, "SubIndex 005", pObjEntry);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("PDO 0x1A00 Entry 2 Error code: 0x%08x\r\n", error);
goto Exit;
}
Exit:
return error;
}
#if !(defined DPRAM_REMOTE) && !(defined FBTL_REMOTE)
static OSAL_FUNC_UNUSED void EC_SLV_APP_boardPhyReset(void* pCtxt_p, uint8_t phyIdx_p, bool reset_p)
{
EC_SLV_APP_Sapplication_t* pApplicationInstance = (EC_SLV_APP_Sapplication_t*)pCtxt_p;
uint8_t module = (uint8_t)~0;
uint8_t pin = (uint8_t)~0;
switch(phyIdx_p)
{
case 0:
#if (defined APP_PHY00_RESET_MODULE) && (defined APP_PHY00_RESET_PIN)
{
module = APP_PHY00_RESET_MODULE;
pin = APP_PHY00_RESET_PIN;
}
#endif
#if (defined APP_PHY10_RESET_MODULE) && (defined APP_PHY10_RESET_PIN)
{
module = APP_PHY10_RESET_MODULE;
pin = APP_PHY10_RESET_PIN;
}
#endif
break;
case 1:
#if (defined APP_PHY01_RESET_MODULE) && (defined APP_PHY01_RESET_PIN)
{
module = APP_PHY01_RESET_MODULE;
pin = APP_PHY01_RESET_PIN;
}
#endif
#if (defined APP_PHY11_RESET_MODULE) && (defined APP_PHY11_RESET_PIN)
{
module = APP_PHY11_RESET_MODULE;
pin = APP_PHY11_RESET_PIN;
}
#endif
break;
default:
return;
}
if ((uint8_t)-1 == pin || (uint8_t)-1 == module)
{
OSAL_printf("Invalid PHY config %u\r\n", phyIdx_p);
OSAL_error(__FILE__, __LINE__, OSAL_STACK_PHYDETECT_ERROR, true, 0);
}
if (reset_p)
{
OSAL_printf("Phy Reset: %u.%u\r\n", module, pin);
ESL_GPIO_write(pApplicationInstance->gpioHandle, (ESL_GPIO_EModule_t)module, (ESL_GPIO_EPin_t)pin, ESL_GPIO_enPINSTATE_LOW);
}
else
{
OSAL_printf("Phy UnReset: %u.%u\r\n", module, pin);
ESL_GPIO_write(pApplicationInstance->gpioHandle, (ESL_GPIO_EModule_t)module, (ESL_GPIO_EPin_t)pin, ESL_GPIO_enPINSTATE_HIGH);
}
}
#endif
static void EC_SLV_APP_appBoardStatusLed(void* pCallContext_p, void* pLedContext_p, bool runLed_p, bool errLed_p)
{
EC_SLV_APP_Sapplication_t* pApplicationInstance = (EC_SLV_APP_Sapplication_t*)pCallContext_p;
uint8_t runMod = ~0;
uint8_t runPin = ~0;
uint8_t errMod = ~0;
uint8_t errPin = ~0;
OSALUNREF_PARM(pLedContext_p);
if (NULL == pApplicationInstance)
{
goto Exit;
}
#if (defined GPIO_LEDRG0_BANK) && (defined GPIO_LEDRG0_PIN) && (defined GPIO_LEDLR0_BANK) && (defined GPIO_LEDLR0_PIN)
{
runMod = GPIO_LEDRG0_BANK; runPin = GPIO_LEDRG0_PIN;
errMod = GPIO_LEDLR0_BANK; errPin = GPIO_LEDLR0_PIN;
}
#endif
#if (defined GPIO_LEDRG1_BANK) && (defined GPIO_LEDRG1_PIN) && (defined GPIO_LEDLR1_BANK) && (defined GPIO_LEDLR1_PIN)
{
runMod = GPIO_LEDRG1_BANK; runPin = GPIO_LEDRG1_PIN;
errMod = GPIO_LEDLR1_BANK; errPin = GPIO_LEDLR1_PIN;
}
#endif
if ((uint8_t)-1 == runMod || (uint8_t)-1 == runPin)
{
OSAL_printf("Run LED config invalid \r\n");
OSAL_error(__FILE__, __LINE__, OSAL_STACK_INIT_ERROR, true, 0);
}
if ((uint8_t)-1 == errMod || (uint8_t)-1 == errPin)
{
OSAL_printf("Error LED config invalid \r\n");
OSAL_error(__FILE__, __LINE__, OSAL_STACK_INIT_ERROR, true, 0);
}
ESL_GPIO_write(pApplicationInstance->gpioHandle, (ESL_GPIO_EModule_t)runMod, (ESL_GPIO_EPin_t)runPin, runLed_p?ESL_GPIO_enPINSTATE_HIGH:ESL_GPIO_enPINSTATE_LOW);
ESL_GPIO_write(pApplicationInstance->gpioHandle, (ESL_GPIO_EModule_t)errMod, (ESL_GPIO_EPin_t)errPin, errLed_p?ESL_GPIO_enPINSTATE_HIGH:ESL_GPIO_enPINSTATE_LOW);
Exit:
return;
}
static EC_API_EError_t EC_SLV_APP_populateBoardFunctions(EC_SLV_APP_Sapplication_t* pApplicationInstance)
{
if (!pApplicationInstance)
{
goto Exit;
}
EC_API_SLV_cbRegisterBoardStatusLed(pApplicationInstance->ptEcSlvApi, pApplicationInstance
,EC_SLV_APP_appBoardStatusLed
,&pApplicationInstance->selectedPruInstance);
Exit:
return error;
}
void EC_SLV_APP_initBoardFunctions(EC_SLV_APP_Sapplication_t *pAppInstance_p)
{
if (!pAppInstance_p)
{
goto Exit;
}
/* open gpio instance */
pAppInstance_p->gpioHandle = ESL_GPIO_init();
#if !(defined DPRAM_REMOTE) && !(defined FBTL_REMOTE)
/* configure Phy Reset Pin */
#if (defined APP_PHY00_RESET_PIN) && (defined APP_PHY00_RESET_MODULE) && (defined APP_PHY01_RESET_PIN) && (defined APP_PHY01_RESET_MODULE)
{
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, APP_PHY00_RESET_MODULE, APP_PHY00_RESET_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, APP_PHY01_RESET_MODULE, APP_PHY01_RESET_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
}
#endif
#if (defined APP_PHY10_RESET_PIN) && (defined APP_PHY10_RESET_MODULE) && (defined APP_PHY11_RESET_PIN) && (defined APP_PHY11_RESET_MODULE)
{
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, APP_PHY10_RESET_MODULE, APP_PHY10_RESET_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, APP_PHY11_RESET_MODULE, APP_PHY11_RESET_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
}
#endif
#else
OSALUNREF_PARM(pAppInstance_p);
#endif
/* configure LED Pin */
#if (defined GPIO_LEDRG0_BANK) && (defined GPIO_LEDRG0_PIN) && (defined GPIO_LEDLR0_BANK) && (defined GPIO_LEDLR0_PIN)
{
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, GPIO_LEDRG0_BANK, GPIO_LEDRG0_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, GPIO_LEDLR0_BANK, GPIO_LEDLR0_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
}
#endif
#if (defined GPIO_LEDRG1_BANK) && (defined GPIO_LEDRG1_PIN) && (defined GPIO_LEDLR1_BANK) && (defined GPIO_LEDLR1_PIN)
{
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, GPIO_LEDRG1_BANK, GPIO_LEDRG1_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
ESL_GPIO_setConfigMode(pAppInstance_p->gpioHandle, GPIO_LEDLR1_BANK, GPIO_LEDLR1_PIN, ESL_GPIO_enDIRECTION_MODE_OUTPUT, ESL_GPIO_enIRQ_MODE_NONE);
}
#endif
ESL_GPIO_apply(pAppInstance_p->gpioHandle);
#if !(defined DPRAM_REMOTE) && !(defined FBTL_REMOTE)
/* configure Phy Reset Pin */
#if (defined APP_PHY00_RESET_PIN) && (defined APP_PHY00_RESET_MODULE) && (defined APP_PHY01_RESET_PIN) && (defined APP_PHY01_RESET_MODULE)
{
EC_SLV_APP_boardPhyReset(pAppInstance_p, 0, false);
EC_SLV_APP_boardPhyReset(pAppInstance_p, 1, false);
}
#endif
#if (defined APP_PHY10_RESET_PIN) && (defined APP_PHY10_RESET_MODULE) && (defined APP_PHY11_RESET_PIN) && (defined APP_PHY11_RESET_MODULE)
{
EC_SLV_APP_boardPhyReset(pAppInstance_p, 0, false);
EC_SLV_APP_boardPhyReset(pAppInstance_p, 1, false);
}
#endif
#endif
Exit:
return;
}
void EC_SLV_APP_registerStacklessBoardFunctions(EC_SLV_APP_Sapplication_t *pAppInstance_p)
{
if (!pAppInstance_p)
{
goto Exit;
}
#if !(defined DPRAM_REMOTE) && !(defined FBTL_REMOTE)
#if !(defined TIESC_PHYADDR_0) && !(defined TIESC_PHYADDR_1) && !(defined TIESC_PHYADDR_2) && !(defined TIESC_PHYADDR_3)
#error "EtherCAT without PHY is useless"
#endif
#if (defined TIESC_PHYADDR_0) && (defined TIESC_PHYADDR_1)
{
EC_API_SLV_registerPhy(0, TIESC_PHYADDR_0, TIESC_LINK0_POLINVERT, TIESC_LINK0_USERXLINK);
EC_API_SLV_registerPhy(1, TIESC_PHYADDR_1, TIESC_LINK1_POLINVERT, TIESC_LINK1_USERXLINK);
}
#endif
#if (defined TIESC_PHYADDR_2) && (defined TIESC_PHYADDR_3)
{
EC_API_SLV_registerPhy(0, TIESC_PHYADDR_2, TIESC_LINK2_POLINVERT, TIESC_LINK2_USERXLINK);
EC_API_SLV_registerPhy(1, TIESC_PHYADDR_3, TIESC_LINK3_POLINVERT, TIESC_LINK3_USERXLINK);
}
#endif
#if (defined TIESC_PHYADDR_4) && (defined TIESC_PHYADDR_5)
{
EC_API_SLV_registerPhy(0, TIESC_PHYADDR_4, TIESC_LINK4_POLINVERT, TIESC_LINK4_USERXLINK);
EC_API_SLV_registerPhy(1, TIESC_PHYADDR_5, TIESC_LINK5_POLINVERT, TIESC_LINK5_USERXLINK);
}
#endif
EC_API_SLV_cbRegisterPhyLibDetect(EC_SLV_APP_TLK110_phyLibDetect, pAppInstance_p);
EC_API_SLV_cbRegisterPhyReset(EC_SLV_APP_boardPhyReset, pAppInstance_p);
#endif
Exit:
return;
}
void EC_SLV_APP_dumpVersions(void)
{
uint32_t dwVersion = 0;
uint32_t dwStrVersRd = 0;
char strVersion[200] = {0};
char strGit[200] = {0};
dwVersion = EC_API_SLV_getVersion();
OSAL_printf("\r\n*********************************************************************\r\n");
OSAL_printf("Numeric Version: 0x%08X\r\n", dwVersion);
if (0 == EC_API_SLV_getVersionStr(sizeof(strVersion), strVersion, &dwStrVersRd))
{
OSAL_printf("Friendly Version: <%s>\r\n", strVersion);
}
if (0 == EC_API_SLV_getVersionId(sizeof(strGit), strGit, &dwStrVersRd))
{
OSAL_printf("Source Id: <%s>\r\n", strGit);
}
OSAL_printf("*********************************************************************\r\n");
}
{
if (!pAppInstance_p)
{
goto Exit;
}
// Initialize DTK
pAppInstance_p->ptEcSlvApi = EC_API_SLV_new();
if (!pAppInstance_p->ptEcSlvApi)
{
OSAL_error(__FILE__, __LINE__, OSAL_CONTAINER_NOMEMORY, true, 0);
goto Exit;
}
error = EC_SLV_APP_populateBoardFunctions(pAppInstance_p);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Populate board functions Error code: 0x%08x\r\n", error);
goto Exit;
}
error = EC_SLV_APP_populateSlaveInfo(pAppInstance_p);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create Slave Info Error code: 0x%08x\r\n", error);
goto Exit;
}
error = EC_SLV_APP_populateCiA402Functions(pAppInstance_p);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create slave information error code: 0x%08x\r\n", error);
return;
}
//RxPDO: Master to Slave COM
error = EC_SLV_APP_populateRxPDO(pAppInstance_p, pAppInstance_p->ptRxPdo1600, AXIS_ONE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create RxPDO error code: 0x%08x\r\n", error);
return;
}
error = EC_SLV_APP_populateRxPDO(pAppInstance_p, pAppInstance_p->ptRxPdo1601, AXIS_TWO);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create RxPDO error code: 0x%08x\r\n", error);
return;
}
error = EC_SLV_APP_populateRxPDO(pAppInstance_p, pAppInstance_p->ptRxPdo1602, AXIS_THREE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create RxPDO error code: 0x%08x\r\n", error);
return;
}
//TxPDO: Slave to Master COM
error = EC_SLV_APP_populateTxPDO(pAppInstance_p, pAppInstance_p->ptTxPdo1A00, AXIS_ONE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create TxPDO error code: 0x%08x\r\n", error);
return;
}
error = EC_SLV_APP_populateTxPDO(pAppInstance_p, pAppInstance_p->ptTxPdo1A01, AXIS_TWO);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create TxPDO error code: 0x%08x\r\n", error);
return;
}
error = EC_SLV_APP_populateTxPDO(pAppInstance_p, pAppInstance_p->ptTxPdo1A02, AXIS_THREE);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Create TxPDO error code: 0x%08x\r\n", error);
return;
}
#if !(defined DPRAM_REMOTE) && !(defined FBTL_REMOTE)
EC_API_SLV_cbRegisterFlashInit (pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptEcSlvApi, EC_SLV_APP_EEP_initFlash);
EC_API_SLV_EEPROM_cbRegisterWrite (pAppInstance_p->ptEcSlvApi, OSPIFLASH_APP_STARTMAGIC, EC_SLV_APP_EEP_writeEeprom);
EC_API_SLV_EEPROM_cbRegisterLoad (pAppInstance_p->ptEcSlvApi, OSPIFLASH_APP_STARTMAGIC, EC_SLV_APP_EEP_loadEeprom);
EC_API_SLV_cbRegisterUserApplicationRun (pAppInstance_p->ptEcSlvApi, pAppInstance_p->ptEcSlvApi, EC_SLV_APP_applicationRun, pAppInstance_p);
#else
OSAL_SCHED_startTask(EC_SLV_APP_usrAppRunWrapper, pAppInstance_p, OSAL_TASK_ePRIO_Idle
,(uint8_t*)EC_SLV_APP_appRunWrapTaskStack_g, APPRWRAP_TASK_SIZE_BYTE, 0, "AppRun");
#endif
error = (EC_API_EError_t)EC_API_SLV_init(pAppInstance_p->ptEcSlvApi);
if (error != EC_API_eERR_NONE)
{
OSAL_printf("Slave Init Error Code: 0x%08x\r\n", error);
return;
}
EC_API_SLV_run(pAppInstance_p->ptEcSlvApi);
Exit:
return;
}
void EC_SLV_APP_applicationDeInit(EC_SLV_APP_Sapplication_t* pAppInstance_p)
{
if (pAppInstance_p)
{
EC_API_SLV_delete(pAppInstance_p->ptEcSlvApi);
pAppInstance_p->ptEcSlvApi = NULL;
}
}
void EC_SLV_APP_applicationRun(void* pAppRunCtxt_p)
{
OSALUNREF_PARM(pAppRunCtxt_p);
}
EC_API_SLV_setProductName
uint32_t EC_API_SLV_setProductName(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pProductName_p)
Set device product name.
Definition: ecSlvApi_ParamStub.c:276
EC_API_SLV_setGroupType
uint32_t EC_API_SLV_setGroupType(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pGroupType_p)
Set device group type.
Definition: ecSlvApi_ParamStub.c:323
EC_API_SLV_ePRUICSS_INSTANCE_TWO
@ EC_API_SLV_ePRUICSS_INSTANCE_TWO
Definition: ecSlvApi.h:70
EC_API_SLV_cbRegisterUserApplicationRun
void EC_API_SLV_cbRegisterUserApplicationRun(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBUsrApplicationRun_t cbFunc_p, void *pApplCtxt_p)
This is the function to register a function which runs application run handler.
Definition: ecSlvApi_ESMStub.c:120
EC_API_SLV_getVersionStr
uint32_t EC_API_SLV_getVersionStr(uint32_t bufLen_p, char *pBuffer_p, uint32_t *pUsedLen_p)
Get version string.
Definition: ecSlvApiStub.c:180
EC_API_SLV_eDT_SERVO_DRIVE
@ EC_API_SLV_eDT_SERVO_DRIVE
The device supports CiA402 for a servo drive.
Definition: ecSlvApi.h:101
OBD_MODES_OF_OPERATION_DISPLAY_INDEX
#define OBD_MODES_OF_OPERATION_DISPLAY_INDEX(x)
Definition: ecApiDef.h:550
OBD_MODES_OF_OPERATION_INDEX
#define OBD_MODES_OF_OPERATION_INDEX(x)
Definition: ecApiDef.h:549
EC_API_EError_t
enum EC_API_EError EC_API_EError_t
OBD_TARGET_POSITION_INDEX
#define OBD_TARGET_POSITION_INDEX(x)
Definition: ecApiDef.h:573
EC_API_SLV_delete
uint32_t EC_API_SLV_delete(EC_API_SLV_SHandle_t *pEcSlaveApi_p)
This is the function to delete a created adapter.
Definition: ecSlvApiStub.c:628
EC_API_SLV_cbRegisterPhyLibDetect
void EC_API_SLV_cbRegisterPhyLibDetect(EC_API_SLV_CBExtPhyLibDetect_t cbFunc_p, void *pContext_p)
Register an application specific Phy Library.
Definition: ecSlvApi_BoardStub.c:162
EC_API_SLV_cbRegisterPhyReset
void EC_API_SLV_cbRegisterPhyReset(EC_API_SLV_CBBoardPhyReset_t cbFunc_p, void *pContext_p)
This is the function to register Phy Reset Function.
Definition: ecSlvApi_BoardStub.c:78
OBD_STATUSWORD_INDEX
#define OBD_STATUSWORD_INDEX(x)
Definition: ecApiDef.h:541
EC_SLV_APP_Sapplication::ptRxPdo1601
EC_API_SLV_SPdo_t * ptRxPdo1601
Definition: ecSlvSimple.h:90
EC_API_SLV_setSyncManConfig
uint32_t EC_API_SLV_setSyncManConfig(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint8_t syncManIdx_p, uint16_t offset_p, uint16_t size_p, uint8_t control_p, uint8_t enable_p)
Set SyncManager Configuration.
Definition: ecSlvApi_ParamStub.c:654
EC_API_SLV_setBootStrapMailbox
uint32_t EC_API_SLV_setBootStrapMailbox(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint16_t rxOffset_p, uint16_t rxSize_p, uint16_t txOffset_p, uint16_t txSize_p)
Set Bootstrap Mailbox Configuration.
Definition: ecSlvApi_ParamStub.c:557
EC_SLV_APP_Sapplication::ptTxPdo1A01
EC_API_SLV_SPdo_t * ptTxPdo1A01
Definition: ecSlvSimple.h:92
EC_API_SLV_cbRegisterStartInputHandler
void EC_API_SLV_cbRegisterStartInputHandler(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBStartInputHandler_t cbFunc_p)
This is the function to register a function which starts the input handler.
Definition: ecSlvApi_ESMStub.c:256
EC_API_SLV_registerPhy
bool EC_API_SLV_registerPhy(uint8_t phyIdx_p, uint8_t phyAddr_p, bool invertLinkPolarity_p, bool useRxLinkPin_p)
Register a phy for stack usage.
Definition: ecSlvApi_BoardStub.c:121
EC_API_SLV_setHwVersion
uint32_t EC_API_SLV_setHwVersion(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pHardwareVersion_p)
Set device hardware version.
Definition: ecSlvApi_ParamStub.c:370
EC_API_SLV_setSerialNumber
uint32_t EC_API_SLV_setSerialNumber(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint32_t serialNumber_p)
Set default serial number.
Definition: ecSlvApi_ParamStub.c:229
EC_SLV_APP_Sapplication
Definition: ecSlvSimple.h:56
EC_API_SLV_SHandle_t
struct EC_API_SLV_SHandle EC_API_SLV_SHandle_t
EC_API_SLV_SHandle_t describes the EtherCAT Slave API.
Definition: ecSlvApi.h:134
EC_API_SLV_cbRegisterBoardStatusLed
void EC_API_SLV_cbRegisterBoardStatusLed(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBBoardStatusLed_t cbFunc_p, void *pLedContext_p)
Register Board Status LED callback.
Definition: ecSlvApi_BoardStub.c:271
EC_SLV_APP_Sapplication::ptRxPdo1602
EC_API_SLV_SPdo_t * ptRxPdo1602
Definition: ecSlvCiA402.h:91
EC_SLV_APP_Sapplication::gpioHandle
void * gpioHandle
Definition: ecSlvSimple.h:69
EC_API_SLV_CiA402_registerApplication
void EC_API_SLV_CiA402_registerApplication(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CiA402_CBUsrApplApplication_t cbFunc_p)
CiA402 Servo Drive application.
Definition: ecSlvApi_CiA402Stub.c:223
EC_SLV_APP_cia402ObjectDictionary
uint32_t EC_SLV_APP_cia402ObjectDictionary(void *pContext_p)
Generate CiA402 Objects.
Definition: ESL_cia402Obd.c:80
EC_API_SLV_EEPROM_cbRegisterLoad
void EC_API_SLV_EEPROM_cbRegisterLoad(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBEepromLoad_t cbFunc_p)
Register a function lo load the eeprom content.
Definition: ecSlvApiStub.c:1523
EC_API_SLV_SPdo_t
struct EC_API_SLV_SPdo EC_API_SLV_SPdo_t
TPdo is used to describe the RxPDOs and TxPDOs.
Definition: ecSlvApi.h:125
EC_API_SLV_setPDICfg
uint32_t EC_API_SLV_setPDICfg(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint16_t pdiControl_p, uint16_t pdiConfig_p)
Set PDI Configuration.
Definition: ecSlvApi_ParamStub.c:508
EC_SLV_APP_Sapplication::ptTxPdo1A00
EC_API_SLV_SPdo_t * ptTxPdo1A00
Definition: ecSlvSimple.h:91
EC_API_SLV_CoE_getObjectEntry
uint32_t EC_API_SLV_CoE_getObjectEntry(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint16_t index_p, uint8_t subIndex_p, EC_API_SLV_SCoE_ObjEntry_t **pObjectEntry_p)
This function returns object entries from the Object Dictionary.
Definition: ecSlvApi_CoEStub.c:325
EC_SLV_APP_applicationInit
void EC_SLV_APP_applicationInit(EC_SLV_APP_Sapplication_t *pAppInstance_p)
Initialize slave application example.
Definition: ecSlvCiA402.c:946
EC_SLV_APP_Sapplication::selectedPruInstance
uint32_t selectedPruInstance
Definition: ecSlvSimple.h:57
EC_API_SLV_run
uint32_t EC_API_SLV_run(EC_API_SLV_SHandle_t *pEcSlaveApi_p)
This is the function to run the EtherCAT Slave API.
Definition: ecSlvApiStub.c:726
EC_API_eERR_INVALID
@ EC_API_eERR_INVALID
Definition: ecApiError.h:73
EC_API_SLV_setSwVersion
uint32_t EC_API_SLV_setSwVersion(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pSoftwareVersion_p)
Set device Software Version.
Definition: ecSlvApi_ParamStub.c:417
OBD_CONTROLWORD_INDEX
#define OBD_CONTROLWORD_INDEX(x)
Definition: ecApiDef.h:540
EC_API_SLV_getVersionId
uint32_t EC_API_SLV_getVersionId(uint32_t bufLen_p, char *pBuffer_p, uint32_t *pUsedLen_p)
Get Version Id (Shasum)
Definition: ecSlvApiStub.c:229
OBD_POSITION_ACTUAL_VALUE_INDEX
#define OBD_POSITION_ACTUAL_VALUE_INDEX(x)
Definition: ecApiDef.h:554
EC_API_SLV_cbRegisterFlashInit
void EC_API_SLV_cbRegisterFlashInit(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBInitFlash_t cbFunc_p)
Initialize flash memory block.
Definition: ecSlvApiStub.c:1610
EC_API_SLV_PDO_create
uint32_t EC_API_SLV_PDO_create(EC_API_SLV_SHandle_t *pEcSlaveApi_p, char *pName_p, uint16_t mapIndex_p, EC_API_SLV_SPdo_t **pOutPdo_p)
Creates an empty PDO.
Definition: ecSlvApi_ProcDataStub.c:86
EC_API_SLV_setVendorId
uint32_t EC_API_SLV_setVendorId(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint32_t vendorId_p)
Set device vendor ID. Used by the EEPROM and Object Dictionary.
Definition: ecSlvApi_ParamStub.c:86
EC_API_SLV_SCoE_ObjEntry_t
struct EC_API_SLV_SCoE_ObjEntry EC_API_SLV_SCoE_ObjEntry_t
TSdoEntry describes an OBD Object Entry.
Definition: ecSlvApi.h:128
OBD_TORQUE_ACTUAL_VALUE_INDEX
#define OBD_TORQUE_ACTUAL_VALUE_INDEX(x)
Definition: ecApiDef.h:571
EC_API_SLV_ePRUICSS_INSTANCE_THREE
@ EC_API_SLV_ePRUICSS_INSTANCE_THREE
Definition: ecSlvApi.h:71
OBD_TARGET_TORQUE_INDEX
#define OBD_TARGET_TORQUE_INDEX(x)
Definition: ecApiDef.h:568
EC_API_SLV_setPDOSize
uint32_t EC_API_SLV_setPDOSize(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint32_t maxPdOutSize_p, uint32_t maxPdInSize_p)
Set ProcessData Size Limits.
Definition: ecSlvApi_ParamStub.c:463
EC_SLV_APP_Sapplication::ptEcSlvApi
EC_API_SLV_SHandle_t * ptEcSlvApi
Definition: ecSlvSimple.h:94
EC_API_SLV_setRevisionNumber
uint32_t EC_API_SLV_setRevisionNumber(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint32_t revisionNumber_p)
Set device revision number. Used by the EEPROM and Object Dictionary.
Definition: ecSlvApi_ParamStub.c:182
EC_API_SLV_CiA402_setAxisNumber
void EC_API_SLV_CiA402_setAxisNumber(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint8_t axisNo_p)
Set number of servo axis. A Cia402 Device might support multiple axes.
Definition: ecSlvApi_CiA402Stub.c:310
EC_API_SLV_setProductCode
uint32_t EC_API_SLV_setProductCode(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint32_t productCode_p)
Set device product code. Used by the EEPROM and Object Dictionary.
Definition: ecSlvApi_ParamStub.c:134
EC_SLV_APP_setObdValues
void EC_SLV_APP_setObdValues(void *pCtxt_p)
Set default values for CiA 402 object dictionary.
Definition: ESL_cia402Demo.c:356
EC_API_SLV_PDO_createEntry
uint32_t EC_API_SLV_PDO_createEntry(EC_API_SLV_SHandle_t *pEcSlaveApi_p, EC_API_SLV_SPdo_t *pPdo_p, char *pName_p, EC_API_SLV_SCoE_ObjEntry_t *pObjectEntry_p)
This function maps an object entry from the Object Dictionary as a PDO.
Definition: ecSlvApi_ProcDataStub.c:271
OBD_TARGET_VELOCITY_INDEX
#define OBD_TARGET_VELOCITY_INDEX(x)
Definition: ecApiDef.h:622
EC_API_SLV_CiA402_registerLocalError
void EC_API_SLV_CiA402_registerLocalError(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CiA402_CBUsrApplLocalError_t cbFunc_p)
Register a local error function, triggered if CiA402 state machine changes into an error state.
Definition: ecSlvApi_CiA402Stub.c:267
EC_SLV_APP_Sapplication::ptRxPdo1600
EC_API_SLV_SPdo_t * ptRxPdo1600
Definition: ecSlvSimple.h:89
OBD_VELOCITY_ACTUAL_VALUE_INDEX
#define OBD_VELOCITY_ACTUAL_VALUE_INDEX(x)
Definition: ecApiDef.h:562
EC_SLV_APP_cia402Application
void EC_SLV_APP_cia402Application(void *pCtxt_p)
CiA402 Application function.
Definition: ESL_cia402Demo.c:745
EC_API_SLV_setStandardMailbox
uint32_t EC_API_SLV_setStandardMailbox(EC_API_SLV_SHandle_t *pEcSlaveApi_p, uint16_t rxOffset_p, uint16_t rxSize_p, uint16_t txOffset_p, uint16_t txSize_p)
Set Standard Mailbox Configuration.
Definition: ecSlvApi_ParamStub.c:606
EC_SLV_APP_startInputHandler
EC_API_SLV_EUserRetCodes_t EC_SLV_APP_startInputHandler(void *ctxt, uint16_t *pIntMask)
Get cycle time information.
Definition: ESL_cia402Demo.c:247
EC_API_SLV_ePRUICSS_INSTANCE_ONE
@ EC_API_SLV_ePRUICSS_INSTANCE_ONE
Definition: ecSlvApi.h:69
EC_API_SLV_CiA402_registerSetDictValues
void EC_API_SLV_CiA402_registerSetDictValues(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CiA402_CBUsrApplSetDictValues_t cbFunc_p)
Register a function which sets the default values of the CiA402 related objects.
Definition: ecSlvApi_CiA402Stub.c:131
EC_API_eERR_NONE
@ EC_API_eERR_NONE
Definition: ecApiError.h:66
EC_SLV_APP_Sapplication::ptTxPdo1A02
EC_API_SLV_SPdo_t * ptTxPdo1A02
Definition: ecSlvCiA402.h:94
EC_API_SLV_new
EC_API_SLV_SHandle_t * EC_API_SLV_new(void)
This is the function to create a new EtherCAT Slave device instance.
Definition: ecSlvApiStub.c:536
EC_API_SLV_setDeviceType
uint32_t EC_API_SLV_setDeviceType(EC_API_SLV_SHandle_t *pEcSlaveApi_p, EC_API_SLV_EDevType_t devType_p)
Define EtherCAT Device Type. Identifies the slave as a standard slave, an EtherCAT servo drive suppor...
Definition: ecSlvApiStub.c:1437
EC_API_SLV_init
uint32_t EC_API_SLV_init(EC_API_SLV_SHandle_t *pEcSlaveApi_p)
This is the function to initialize the EtherCAT Slave API.
Definition: ecSlvApiStub.c:679
EC_SLV_APP_cia402LocalError
void EC_SLV_APP_cia402LocalError(void *ctxt, uint16_t ErrorCode)
Local Error function handler.
Definition: ESL_cia402Demo.c:631
EC_API_SLV_EEPROM_cbRegisterWrite
void EC_API_SLV_EEPROM_cbRegisterWrite(EC_API_SLV_SHandle_t *pEcSlaveApi_p, void *pContext_p, EC_API_SLV_CBEepromWrite_t cbFunc_p)
Register a function lo store the eeprom content.
Definition: ecSlvApiStub.c:1568