/*
 * SystemStsConfig.h
 *
 *  Created on: Jan 5, 2025
 *      Author: tummalanr
 */

#ifndef USER_ADDONS_SYSTEMSTSCONFIG_H_
#define USER_ADDONS_SYSTEMSTSCONFIG_H_

#include    "AppSharedMemory.h"


#include    "SharedMemoryGlobal.h"



#define                 IO_INSTANCE_MAX                 0u                                   //IO Module Warning Status Bits Data size
#define                 IO_FAULTSTS_SIZE                2u                                  //IO Module Fault Status Bits Data size


//gSysConfigSts_DataRDWRSynchEvent Group Bits
#define                 System_StatusConfig_RDWREvnt_BIT             (0x000001u)

#pragma pack(1)
typedef struct
{
    uint8_t                 Discovered_ModulesType;
    uint8_t                 Discovered_ModulesMapId;

}system_discoveredmapids;
#pragma pack()



typedef union
{
      uint8_t     ModulePosition;           //0x01 ~ 0x09
      uint8_t     Discovered_ModulesMapId;  //DiscoveredMapped Id
      uint16_t    InstanceId;               //Instance Id = Discovered_ModulesMapId(0x02 -DO) | ModulePosition(0x01)  == 0x0201
}moduleIdInstanceId;


extern system_discoveredmapids     io_discmapids[IO_INSTANCE_MAX];

extern uint8_t     app_dip_maxinsts;          //max no of insts i.e data size in dip cyclic data as per discovery.
extern uint8_t     app_dop_maxinsts;          //max no of insts i.e data size in dop cyclic data as per discovery.

extern AppRET_T    Get_ModuleDiscoveryInfo(void);

//SHMSysCfgStsDataSyncTasks.c
extern system_discoverystatusinfo  app_sys_discvrystsinfo;

#endif /* USER_ADDONS_SYSTEMSTSCONFIG_H_ */
