/*
* ico_sync.h - contains internal defines for SYNC
*
* Copyright (c) 2012-2019 emotas embedded communication GmbH
*
*-------------------------------------------------------------------
* $Id: ico_sync.h 48618 2023-08-28 14:17:15Z boe $

*-------------------------------------------------------------------
*
*
*/

/**
* \file
* \brief dataty type header
*/

#ifndef ICO_SYNC_H
#define ICO_SYNC_H 1


#ifdef CO_EVENT_DYNAMIC_SYNC
# ifdef CO_EVENT_PROFILE_SYNC
#  define CO_EVENT_SYNC_CNT	(CO_EVENT_DYNAMIC_SYNC + CO_EVENT_PROFILE_SYNC)
# else /* CO_EVENT_PROFILE_SYNC */
#  define CO_EVENT_SYNC_CNT	(CO_EVENT_DYNAMIC_SYNC)
# endif /* CO_EVENT_PROFILE_SYNC */
#else /* CO_EVENT_DYNAMIC_SYNC */
# ifdef CO_EVENT_PROFILE_SYNC
#  define CO_EVENT_SYNC_CNT	(CO_EVENT_PROFILE_SYNC)
# endif /* CO_EVENT_PROFILE_SYNC */
#endif /* CO_EVENT_DYNAMIC_SYNC */

#if defined(CO_EVENT_STATIC_SYNC) || defined(CO_EVENT_SYNC_CNT)
# define CO_EVENT_SYNC   1
#endif /* defined(CO_EVENT_STATIC_SYNC) || defined(CO_EVENT_SYNC_CNT) */


#ifdef CO_EVENT_DYNAMIC_SYNC_FINISHED
# ifdef CO_EVENT_PROFILE_SYNC_FINISHED
#  define CO_EVENT_SYNC_FINISHED_CNT	(CO_EVENT_DYNAMIC_SYNC_FINISHED + CO_EVENT_PROFILE_SYNC_FINISHED)
# else /* CO_EVENT_PROFILE_SYNC_FINISHED */
#  define CO_EVENT_SYNC_FINISHED_CNT	(CO_EVENT_DYNAMIC_SYNC_FINISHED)
# endif /* CO_EVENT_PROFILE_SYNC_FINISHED */
#else /* CO_EVENT_DYNAMIC_SYNC_FINISHED */
# ifdef CO_EVENT_PROFILE_SYNC_FINISHED
#  define CO_EVENT_SYNC_FINISHED_CNT	(CO_EVENT_PROFILE_SYNC_FINISHED)
# endif /* CO_EVENT_PROFILE_SYNC_FINISHED */
#endif /* CO_EVENT_DYNAMIC_SYNC_FINISHED */

#if defined(CO_EVENT_STATIC_SYNC_FINISHED) || defined(CO_EVENT_SYNC_FINISHED_CNT)
# define CO_EVENT_SYNC_FINISHED   1
#endif /* defined(CO_EVENT_STATIC_SYNC_FINISHED) || defined(CO_EVENT_SYNC_FINISHED_CNT) */

/* datatypes */


/* function prototypes */

void	*icoSyncGetObjectAddr(UNSIGNED16 index);
RET_T	icoSyncObjChanged(UNSIGNED16 valIdx);
void	icoSyncReset(void);
void	icoSyncSetDefaultValue(void);
void	icoSyncHandler(UNSIGNED8 syncCounterVal);
RET_T	icoSyncCheckObjLimit_u8(UNSIGNED16 index, UNSIGNED8 value);
RET_T	icoSyncCheckObjLimit_u32(UNSIGNED16 index, UNSIGNED32 value);
void	icoSyncVarInit(void);

#endif /* ICO_SYNC_H */
