// Initialization
// Generated by CANopen Architect Professional 7.10.5820 on 11/05/2020 09:16:30
// Generated from project C:\Users\Olaf\Desktop\IMXRT1064-EVK-CanFD-Demo\ThirdParty\MCUXpressoSDK\mco_config\EDS\CANopen_NXP_SDK_Device.cax
// Generated from EDS 'CANopen_NXP_SDK_Accel' 05-11-2020 09:15AM by Pf
// Use with MicroCANopen Plus CANopen stack
// For more information visit www.esacademy.com and www.microcanopen.com

// Check for warnings below before using this file

#ifndef _STACKINITH_
#define _STACKINITH_

#define FILE_VERSION 1
#define FILE_REVISION 1
#define DESCRIPTION "CANopen Library for NXP SDK - CiA 401 generic IO Example"

// CAN bitrate definitions as defined in CiA305
#ifndef CIA305_CAN_BITRATE_1000
#define CIA305_CAN_BITRATE_1000 0
#endif
#ifndef CIA305_CAN_BITRATE_800
#define CIA305_CAN_BITRATE_800  1
#endif
#ifndef CIA305_CAN_BITRATE_500
#define CIA305_CAN_BITRATE_500  2
#endif
#ifndef CIA305_CAN_BITRATE_250
#define CIA305_CAN_BITRATE_250  3
#endif
#ifndef CIA305_CAN_BITRATE_125
#define CIA305_CAN_BITRATE_125  4
#endif
#ifndef CIA305_CAN_BITRATE_50
#define CIA305_CAN_BITRATE_50   6
#endif
#ifndef CIA305_CAN_BITRATE_20
#define CIA305_CAN_BITRATE_20   7
#endif
#ifndef CIA305_CAN_BITRATE_10
#define CIA305_CAN_BITRATE_10   8
#endif
#ifndef CIA305_CAN_BITRATE_AUTO
#define CIA305_CAN_BITRATE_AUTO 9
#endif

// CAN bitrates supported by this device
#define CAN_BITRATE_SUPPORTED ( \
  (1U << CIA305_CAN_BITRATE_1000) | \
  (1U << CIA305_CAN_BITRATE_500 ) | \
  (1U << CIA305_CAN_BITRATE_250 ) | \
  (1U << CIA305_CAN_BITRATE_125 )   \
)

// Default CAN bitrate (kbps)
#define CAN_BITRATE_DCF 500


#ifdef MCO_USE_HANDLE
#define INITPDOS_CALLS \
MCO_InitRPDO(handle, 1, 0x00000183, 4, P222200_Counter); \
MCO_InitRPDO(handle, 2, 0x00000283, 6, P641101_Pos_X); \
MCO_InitTPDOFull(handle, 1, NODEID+0xC0000180, 0, 100, 255, 4, P600001_DigInput8_1); \
MCO_InitTPDOFull(handle, 2, NODEID+0xC0000280, 500, 20, 255, 4, P640101_AnalogInput16_1); \

#else
#define INITPDOS_CALLS \
MCO_InitRPDO(1, 0x00000183, 4, P222200_Counter); \
MCO_InitRPDO(2, 0x00000283, 6, P641101_Pos_X); \
MCO_InitTPDOFull(1, NODEID+0xC0000180, 0, 100, 255, 4, P600001_DigInput8_1); \
MCO_InitTPDOFull(2, NODEID+0xC0000280, 500, 20, 255, 4, P640101_AnalogInput16_1); \

#endif

#ifdef MCO_USE_HANDLE
#define INITHBCONSUMER_CALLS \
MCOP_InitHBConsumer(handle, 1, 0x01, 1000); \
MCOP_InitHBConsumer(handle, 2, 0x02, 0); \
MCOP_InitHBConsumer(handle, 3, 0x03, 0); \

#else
#define INITHBCONSUMER_CALLS \
MCOP_InitHBConsumer(1, 0x01, 1000); \
MCOP_InitHBConsumer(2, 0x02, 0); \
MCOP_InitHBConsumer(3, 0x03, 0); \

#endif

#ifdef MCO_USE_HANDLE
#define INITEMCYCONSUMER_CALLS \

#else
#define INITEMCYCONSUMER_CALLS \

#endif

#endif // _STACKINITH_
