Code Block | ||
---|---|---|
| ||
OBJECT_DESCRIPTION_T g_tObjects[] =
{
...
{
.usIndex = 0x1602,
.bMaxNumOfSubObjs = ARRCNT(s_ab1601_Elements),
.bObjectCode = ODV3_OBJCODE_RECORD,
.usAccessFlags = 0,
.bIndicationFlags = 0,
.usDatatype = ECAT_OD_DTYPE_PDO_MAPPING,
.usAccessRights = ECAT_OD_READ_ALL,
/* no SimpleVar, therefore no ulMaxFieldUnits value */
.pszName = "3. RxPDO",
/* no SimpleVar, therefore no initial value */
.ptSi00 = &g_tSiObj_1602[0],
.ptSiBreak = &g_tSiObj_1602[ ARRCNT(g_tSiObj_1602) ],
},
...
{
.usIndex = 0x1C12,
.bMaxNumOfSubObjs = 3,
...
},
...
{
.usIndex = 0x2002,
.bMaxNumOfSubObjs = ARRCNT(g_tSiObj_2001) - 1,
.bObjectCode = ODV3_OBJCODE_RECORD,
.usAccessFlags = ODV3_ACCESS_FLAGS_RXPDO_MAPPABLE,
.bIndicationFlags = 0,
.usDatatype = ECAT_OD_DTYPE_UNSIGNED8,/**< \todo what exactly shall be used here */
.usAccessRights = ECAT_OD_READ_ALL,
/* no SimpleVar, therefore no ulMaxFieldUnits value */
.pszName = "Outputs",
/* no SimpleVar, therefore no initial value */
.ptSi00 = &g_tSiObj_2002[0],
.ptSiBreak = &g_tSiObj_2002[ ARRCNT(g_tSiObj_2002) ],
},
...
}
|
Code Block | ||
---|---|---|
| ||
static const uint32_t s_ab1602_Elements[] =
{
PDOMAPPING(0x2002, 1, 8),
};
static const uint8_t s_b1602_NumElements = ARRCNT(s_ab1602_Elements);
SUBOBJECT_DESCRIPTION_T g_tSiObj_1602[] =
{
{
.bSubIndex = 0,
.bIndicationFlags = 0,
.usAccessRights = ECAT_OD_READ_ALL,
.usDatatype = ECAT_OD_DTYPE_UNSIGNED8,
.ulMaxFieldUnits = 1,
.pszName = "Number of elements",
.pvInitialValue = &s_b1602_NumElements,
.ulInitialValueLength = sizeof(s_b1602_NumElements),
},
{
.bSubIndex = 1,
.bIndicationFlags = 0,
.usAccessRights = ECAT_OD_READ_ALL,
.usDatatype = ECAT_OD_DTYPE_UNSIGNED32,
.ulMaxFieldUnits = 1,
.pszName = 0,
.pvInitialValue = &s_ab1602_Elements[0],
.ulInitialValueLength = sizeof(s_ab1602_Elements[0]),
},
};
|
Code Block | ||
---|---|---|
| ||
static const uint16_t s_aus1C12_Entries[] = { 0x1600, 0x1601 , 0x1602 };
...
SUBOBJECT_DESCRIPTION_T tSiObj_1C12[] =
{
...
{
.bSubIndex = 3,
.bIndicationFlags = 0,
.usAccessRights = ECAT_OD_READ_ALL|ECAT_OD_WRITE_PREOP, /* for PDO Assignment*/
.usDatatype = ECAT_OD_DTYPE_UNSIGNED16,
.ulMaxFieldUnits = 1,
.pszName = 0,
.pvInitialValue = &s_aus1C12_Entries[2],
.ulInitialValueLength = sizeof(s_aus1C12_Entries[2]),
},
};
|