#if COS_DS302_NV > 0
#endif
#if COS_DS401_DI > 0
#endif
#if COS_DS401_DO > 0
#endif
#if COS_DICT_MAN > 0
#endif
#if COS_SAFETY_SUPPORT == 1
#endif
#if COS_SDO_CLIENT > 0
#include "cos_sdo_cln.h"
#endif
#if COS_DICT_OBJ_1008 == 1
#endif
#if COS_DICT_OBJ_1009 == 1
#endif
#if COS_DICT_OBJ_100A == 1
#endif
#if COS_PDO_RCV_NUMBER > 0
#ifdef __C51__
static uint8_t xdata aubRcvPdoDataT[8];
#else
static uint8_t aubRcvPdoDataT[8];
#endif
#endif
#if COS_PDO_TRM_NUMBER > 0
#ifdef __C51__
static uint8_t xdata aubTrmPdoDataT[8];
#else
static uint8_t aubTrmPdoDataT[8];
#endif
#endif
#if (COS_PDO_RCV_NUMBER > 0) && (COS_PDO_MAPPING == 0)
{
{ 0x6200, 0x01, 0x08 },
{ 0x6200, 0x02, 0x08 },
{ 0x6200, 0x03, 0x08 },
{ 0x6200, 0x04, 0x08 },
{ 0x0000, 0x00, 0x00 },
{ 0x5210, 0x01, 0x10 },
{ 0x5210, 0x02, 0x10 },
{ 0x5210, 0x03, 0x10 },
{ 0x5210, 0x04, 0x10 },
{ 0x0000, 0x00, 0x00 }
};
#endif
#if (COS_PDO_TRM_NUMBER > 0) && (COS_PDO_MAPPING == 0)
{
{ 0x7130, 0x01, 0x10 },
{ 0x7130, 0x02, 0x10 },
{ 0x7130, 0x03, 0x10 },
{ 0x7130, 0x04, 0x10 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x6000, 0x01, 0x08 },
{ 0x6000, 0x02, 0x08 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x6030, 0x00, 0x10 },
{ 0x6040, 0x00, 0x10 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x6030, 0x00, 0x10 },
{ 0x6040, 0x00, 0x10 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 },
{ 0x0000, 0x00, 0x00 }
};
#endif
#if COS_DS302_NV > 0
void Cos302_NetVarPdoRcvHandler(uint32_t ulMapEntryV)
{
uint8_t ubDataIndexT;
ubDataIndexT = (uint8_t)(ulMapEntryV >> 8);
#if COS_PDO_RCV_NUMBER > 0
if ((ulMapEntryV & 0x0FFF0000) == 0x04C00000)
{
if (tsCos302_NetVarG.aubOut[ubDataIndexT] != 0)
{
}
}
else if ((ulMapEntryV & 0x0FFF0000) == 0x05800000)
{
if (tsCos302_NetVarG.auwOut[ubDataIndexT] != 0)
{
}
}
else if ((ulMapEntryV & 0x0FFF0000) == 0x06800000)
{
if (tsCos302_NetVarG.aulOut[ubDataIndexT] != 0)
{
}
}
#endif
}
void Cos302_NetVarPdoTrmHandler(uint32_t ulMapEntryV)
{
uint8_t ubDataIndexT;
ubDataIndexT = (uint8_t)(ulMapEntryV >> 8);
#if COS_PDO_TRM_NUMBER > 0
if ((ulMapEntryV & 0x0FFF0000) == 0x00400000)
{
tsCos302_NetVarG.aubIn[ubDataIndexT]++;
}
else if ((ulMapEntryV & 0x0FFF0000) == 0x01000000)
{
tsCos302_NetVarG.auwIn[ubDataIndexT]++;
}
else if ((ulMapEntryV & 0x0FFF0000) == 0x02000000)
{
tsCos302_NetVarG.aulIn[ubDataIndexT]++;
}
#endif
}
#endif
#if COS_PDO_MAPPING > 0
#if COS_PDO_RCV_NUMBER > 0
{
if (ulMapEntryV == 0x20020008)
{
}
}
#endif
#if COS_PDO_TRM_NUMBER > 0
{
if (ulMapEntryV == 0x20040020)
{
}
else
{
}
}
#endif
#endif
{
uint8_t ubBitrateT = 0;
#if COS_LSS_SUPPORT > 0
if (ubBitrateT == 0)
{
}
#endif
{
}
return (ubBitrateT);
}
{
uint8_t ubAddrT = 0;
ubAddrT = 10;
#if COS_LSS_SUPPORT > 0
if (ubAddrT == 0)
{
McNvmRead(eNVM_305_NODE_ID_U08, &ubAddrT, 1);
}
if (ubAddrT > 127) ubAddrT = 127;
#else
#endif
return (ubAddrT);
}
{
#if COS_DICT_OBJ_1010 > 0
uint16_t uwNvmReadCrcT;
uint16_t uwNvmCalcCrcT;
uint32_t ulValueT;
#endif
uint32_t ulProductCodeT = 0;
#if COS_DICT_OBJ_1010 > 0
tvStatusT =
McNvmRead(eNVM_CHECKSUM_U16, (uint8_t *) &uwNvmReadCrcT, 2);
if (tvStatusT == eNVM_ERR_OK)
{
if (uwNvmCalcCrcT == uwNvmReadCrcT)
{
ulProductCodeT = ulValueT;
}
}
#endif
return (ulProductCodeT);
}
{
#if COS_DICT_OBJ_1010 > 0
uint16_t uwNvmReadCrcT;
uint16_t uwNvmCalcCrcT;
uint32_t ulValueT;
#endif
uint32_t ulSerialNumberT = 0;
#if COS_DICT_OBJ_1010 > 0
tvStatusT =
McNvmRead(eNVM_CHECKSUM_U16, (uint8_t *) &uwNvmReadCrcT, 2);
if (tvStatusT == eNVM_ERR_OK)
{
if (uwNvmCalcCrcT == uwNvmReadCrcT)
{
ulSerialNumberT = ulValueT;
}
}
#endif
return (ulSerialNumberT);
}
{
}
{
}
{
switch (ubCallerResultV)
{
break;
break;
break;
break;
default:
break;
}
}
#if COS_DS402 > 0
{
}
#endif
{
}
{
}
{
}
{
#if COS_PDO_TRM_NUMBER > 0
CosPdoSend(0);
#endif
#if COS_PDO_TRM_NUMBER > 1
CosPdoSend(1);
#endif
#if COS_PDO_TRM_NUMBER > 2
CosPdoSend(2);
#endif
#if COS_PDO_TRM_NUMBER > 3
CosPdoSend(3);
#endif
}
{
}
{
}
{
#if COS_PDO_TRM_NUMBER > 0
#endif
#if COS_PDO_TRM_NUMBER > 1
#endif
#if COS_PDO_TRM_NUMBER > 2
#endif
#if COS_PDO_TRM_NUMBER > 3
#endif
#if COS_PDO_RCV_NUMBER > 0
#endif
#if COS_PDO_RCV_NUMBER > 1
#endif
#if COS_PDO_RCV_NUMBER > 2
#endif
#if COS_PDO_RCV_NUMBER > 3
#endif
}
#if COS_PDO_RCV_NUMBER > 0
{
uint8_t ubDlcT;
&aubRcvPdoDataT[0], 0, 8);
&ubDlcT);
}
#endif
#if COS_PDO_TRM_NUMBER > 0
{
aubTrmPdoDataT[0] = 0x2F;
aubTrmPdoDataT[1] = 0x01;
aubTrmPdoDataT[2] = 0x20;
aubTrmPdoDataT[3] = 0x00;
aubTrmPdoDataT[4] = 0x01;
aubTrmPdoDataT[5] = 0x00;
aubTrmPdoDataT[6] = 0x00;
aubTrmPdoDataT[7] = 0x00;
&aubTrmPdoDataT[0], 0, 8);
8);
}
#endif
#if COS_SAFETY_SUPPORT == 1
{
static uint8_t aubSrdoDataS[8];
}
#endif
#if COS_SAFETY_SUPPORT == 1
{
static uint8_t aubSrdoDataS[8] = { 0x00, 0x01, 0x55, 0x55, 0xAA, 0xAA, 0xCC, 0xCC};
aubSrdoDataS[0]++;
}
#endif
#if COS_SDO_BLOCK > 0
uint8_t
CosSdoBlkDownFinal(uint16_t uwIndexV, uint8_t ubSubIndexV, uint32_t ulObjectSizeV)
{
(void) uwIndexV;
(void) ubSubIndexV;
(void) ulObjectSizeV;
}
#endif
#if COS_SDO_BLOCK > 0
{
(void) uwIndexV;
(void) ubSubIndexV;
(void) ulObjectSizeV;
}
#endif
#if COS_SDO_BLOCK > 0
{
uint32_t ulObjSizeT = 0;
(void) uwIndexV;
(void) ubSubIndexV;
return (ulObjSizeT);
}
#endif
#if COS_SDO_CLIENT > 0
void CosSdoClnEventObjectReady( uint8_t ubNodeIdV, CoObject_ts * ptsCoObjV, uint32_t * pulAbortV)
{
}
#endif
#if COS_SDO_CLIENT > 0
void CosSdoClnEventTimeout(uint8_t ubNodeIdV, CoObject_ts * ptsCoObjV)
{
}
#endif
{
}
{
}
{
{
if ((ptsTimeStampV->
uwDays) > 0)
{
}
}
}
@ eCP_BITRATE_500K
Definition canpie.h:677
@ eCP_BITRATE_50K
Definition canpie.h:657
@ eCP_BITRATE_1M
Definition canpie.h:687
CANopen Slave Stack - CiA 301 objects .
uint32_t ulIdx1018_RevisionNumC
Identity object - revision number (Index 1018h)
uint8_t aubIdx100A_SwVersionC[]
Device software version (Index 100Ah)
uint8_t aubIdx1009_HwVersionC[]
Device hardware version (Index 1009h)
uint8_t ubIdx1018_SubNumberC
Identity object (Index 1018h)
uint32_t ulIdx1018_VendorIdC
Identity object - vendor ID (Index 1018h)
uint8_t aubIdx1008_DeviceNameC[]
Device name string (Index 1008h)
CANopen Slave Stack - CiA 302 Additional application layer functions .
Object Dictionary for CiA 401 (Digital Inputs) .
Object Dictionary for CiA 401 (Digital Outputs) .
@ eCosSdo_WRITE_OK
Definition cos_defs.h:315
#define COS_VERSION_MINOR
Definition cos_defs.h:97
@ eCosBuf_PDO1_RCV
Definition cos_defs.h:208
@ eCosBuf_PDO1_TRM
Definition cos_defs.h:213
@ eCOS_ERR_NONE
Definition cos_defs.h:504
@ eCOS_ERR_PARM_LOAD
Definition cos_defs.h:537
@ eCOS_ERR_VALUE_NODE_ID
Definition cos_defs.h:519
@ eCOS_ERR_CAN_INIT
Definition cos_defs.h:507
#define COS_VERSION_MAJOR
Definition cos_defs.h:87
CANopen Slave Stack - Dictionary .
CANopen Slave Stack - Emergency functions (EMCY) .
@ eEMCY_301_CAN_LIFEGUARD
Definition cos_emcy.h:386
Status_tv CosEmcyErrorSet(uint8_t ubErrConditionV, uint8_t *pubCustomerCodeV)
CANopen Slave Stack - Management functions .
uint8_t CosMgrGetNodeId(void)
void CosMgrOnBootUp(void)
void CosMgrOnStart(uint8_t ubCallerResultV)
uint32_t CosMgrGetProductCode(void)
uint32_t CosMgrGetSerialNumber(void)
void CosMgrProfileUpdate(uint16_t uwIndexV, uint8_t ubSubIndexV)
Update parameter of device profile.
void CosMgrOnBusOff(void)
Handle Bus-Off condition.
uint8_t CosMgrGetBitrate(void)
Get module bit-rate.
CANopen Slave Stack - Manufacturer specific objects .
void CosMob_PdoTrmHandler(uint32_t ulMapEntryV)
Demo implementation of callback handler for a mapping entry.
void CosMob_PdoRcvHandler(uint32_t ulMapEntryV)
Demo implementation of callback handler for a mapping entry.
CANopen Slave Stack - Network management functions (NMT) .
void CosNmtServiceOnHeartbeatEvent(void)
void CosNmtServiceOnError(void)
void CosNmtServiceOnPreOperational(void)
void CosNmtServiceOnStop(void)
void CosNmtServiceOnGuardingEvent(void)
void CosNmtServiceOnStart(void)
CANopen Slave Stack - Non-volatile memory support.
@ eNVM_301_OBJ_1018_2_U32
Definition cos_nvm.h:101
@ eNVM_301_OBJ_1018_4_U32
Definition cos_nvm.h:105
@ eNVM_305_BITRATE_U08
Definition cos_nvm.h:160
CANopen Slave Stack - Process Data Objects (PDO) .
CosPdoCom_ts atsTrmPdoComG[]
void CosPdoTrmDataUpdate(uint8_t ubPdoNumberV)
@ ePDO_TYPE_SYNC_1
Definition cos_pdo.h:160
@ ePDO_TYPE_EVENT_PROFILE
Definition cos_pdo.h:190
void CosPdoComSetup(void)
Setup application specific PDO communication parameter.
void CosPdoRcvDataUpdate(uint8_t ubPdoNumberV)
CosPdoCom_ts atsRcvPdoComG[]
CANopen Slave Stack - Functional safety .
void CosSafetySrdoRcvDataUpdate(uint8_t ubSrdoNumberV)
enum CosSafetyState_e CosSafetySrdoSetData(uint8_t ubSrdoNumberV, uint8_t *pubSrcDataV)
enum CosSafetyState_e CosSafetySrdoGetData(uint8_t ubSrdoNumberV, uint8_t *pubDestDataV)
void CosSafetySrdoTrmDataUpdate(uint8_t ubSrdoNumberV)
CANopen Slave Stack - Service Data Objects (SDO) .
uint32_t CosSdoBlkUpObjectSize(uint16_t uwIndexV, uint8_t ubSubIndexV)
Retrieve Object Size.
uint8_t CosSdoBlkDownFinal(uint16_t uwIndexV, uint8_t ubSubIndexV, uint32_t ulObjectSizeV)
uint8_t CosSdoSegFinal(uint8_t ubReqCodeV, uint16_t uwIndexV, uint8_t ubSubIndexV)
Handler for segmented SDO write.
uint8_t CosSdoBlkDownObjectSize(uint16_t uwIndexV, uint8_t ubSubIndexV, uint32_t ulObjectSizeV)
CANopen Slave Stack - Synchronisation functions (SYNC) .
void CosSyncEventRcvPdo(void)
Handle RPDOs on SYNC reception.
CANopen Slave Stack - Timing functions .
void CosTmrTimeStampConsume(CosTimeOfDay_ts *ptsTimeStampV)
uint16_t CosTmrCalcTicks(uint16_t uwReqTimingV)
CpStatus_tv CpCoreBufferGetData(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubDestDataV, uint8_t ubStartPosV, uint8_t ubSizeV)
Get data from message buffer.
CpStatus_tv CpCoreBufferSetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t ubDlcV)
Set DLC of specified buffer.
CpStatus_tv CpCoreBufferSetData(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubSrcDataV, uint8_t ubStartPosV, uint8_t ubSizeV)
Set data of message buffer.
CpStatus_tv CpCoreBufferGetDlc(CpPort_ts *ptsPortV, uint8_t ubBufferIdxV, uint8_t *pubDlcV)
Get DLC of specified buffer.
int32_t Status_tv
Data type for status value.
Definition mc_compiler.h:268
#define CPP_PARM_UNUSED(x)
Definition mc_compiler.h:260
uint16_t McNvmBuildChecksum(NvmAddr_tv tvStartAddressV, NvmSize_tv tvDataCountV)
Build Checksum.
Status_tv McNvmRead(NvmAddr_tv tvAddressV, uint8_t *pubDataV, NvmSize_tv tvSizeV)
Read data.
uint16_t uwEventTick
Definition cos_pdo.h:254
uint32_t ulIdentifier
Definition cos_pdo.h:219
uint16_t uwEventTime
Definition cos_pdo.h:248
uint8_t ubTransType
Definition cos_pdo.h:224
PDO mapping parameter (static mapping)
Definition cos_pdo.h:301
Time of day.
Definition cos_time.h:87
uint32_t ulMilliseconds
Definition cos_time.h:91
uint16_t uwDays
Definition cos_time.h:96