Browse Source

[Clean][DW25/DS60-210/AH-Luxury][All]

2020.09.04 / Folus Wen

Actions:
1. Remove unsed project.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 4 years ago
parent
commit
e57f808d62
70 changed files with 0 additions and 18735 deletions
  1. BIN
      EVSE/Projects/AH-Luxury/Apps/4gModem
  2. 0 467
      EVSE/Projects/AH-Luxury/Apps/4gModem.c
  3. BIN
      EVSE/Projects/AH-Luxury/Apps/EventLogging
  4. 0 218
      EVSE/Projects/AH-Luxury/Apps/EventLogging.c
  5. 0 109
      EVSE/Projects/AH-Luxury/Apps/FWMaker.c
  6. BIN
      EVSE/Projects/AH-Luxury/Apps/FactoryConfig
  7. 0 173
      EVSE/Projects/AH-Luxury/Apps/FactoryConfig.c
  8. BIN
      EVSE/Projects/AH-Luxury/Apps/InternalComm
  9. 0 200
      EVSE/Projects/AH-Luxury/Apps/InternalComm.c
  10. 0 74
      EVSE/Projects/AH-Luxury/Apps/Makefile
  11. BIN
      EVSE/Projects/AH-Luxury/Apps/Ocpp16
  12. 0 333
      EVSE/Projects/AH-Luxury/Apps/Ocpp16.c
  13. 0 248
      EVSE/Projects/AH-Luxury/Apps/PsuComm.c
  14. 0 69
      EVSE/Projects/AH-Luxury/Apps/UpdateRootfs.c
  15. BIN
      EVSE/Projects/AH-Luxury/Apps/ccs
  16. 0 59
      EVSE/Projects/AH-Luxury/Apps/ccs.c
  17. BIN
      EVSE/Projects/AH-Luxury/Apps/main
  18. 0 651
      EVSE/Projects/AH-Luxury/Apps/main.c
  19. BIN
      EVSE/Projects/AH-Luxury/Images/MLO
  20. BIN
      EVSE/Projects/AH-Luxury/Images/am335x-evm.dtb
  21. BIN
      EVSE/Projects/AH-Luxury/Images/ramdisk.gz
  22. BIN
      EVSE/Projects/AH-Luxury/Images/u-boot.img
  23. BIN
      EVSE/Projects/AH-Luxury/Images/zImage
  24. BIN
      EVSE/Projects/DS60-210/Apps/4gModem
  25. 0 467
      EVSE/Projects/DS60-210/Apps/4gModem.c
  26. 0 218
      EVSE/Projects/DS60-210/Apps/EventLogging.c
  27. 0 109
      EVSE/Projects/DS60-210/Apps/FWMaker.c
  28. BIN
      EVSE/Projects/DS60-210/Apps/FactoryConfig
  29. 0 173
      EVSE/Projects/DS60-210/Apps/FactoryConfig.c
  30. 0 200
      EVSE/Projects/DS60-210/Apps/InternalComm.c
  31. 0 70
      EVSE/Projects/DS60-210/Apps/Makefile
  32. 0 333
      EVSE/Projects/DS60-210/Apps/Ocpp16.c
  33. 0 248
      EVSE/Projects/DS60-210/Apps/PsuComm.c
  34. 0 69
      EVSE/Projects/DS60-210/Apps/UpdateRootfs.c
  35. 0 2803
      EVSE/Projects/DS60-210/Apps/define.h
  36. BIN
      EVSE/Projects/DS60-210/Apps/main
  37. 0 659
      EVSE/Projects/DS60-210/Apps/main.c
  38. BIN
      EVSE/Projects/DS60-210/Images/MLO
  39. BIN
      EVSE/Projects/DS60-210/Images/am335x-evm.dtb
  40. BIN
      EVSE/Projects/DS60-210/Images/ramdisk.gz
  41. BIN
      EVSE/Projects/DS60-210/Images/u-boot-spl.bin
  42. BIN
      EVSE/Projects/DS60-210/Images/u-boot.img
  43. BIN
      EVSE/Projects/DS60-210/Images/zImage
  44. BIN
      EVSE/Projects/DW25/Apps/4gModem
  45. 0 467
      EVSE/Projects/DW25/Apps/4gModem.c
  46. 0 218
      EVSE/Projects/DW25/Apps/EventLogging.c
  47. 0 109
      EVSE/Projects/DW25/Apps/FWMaker.c
  48. BIN
      EVSE/Projects/DW25/Apps/FactoryConfig
  49. 0 173
      EVSE/Projects/DW25/Apps/FactoryConfig.c
  50. 0 200
      EVSE/Projects/DW25/Apps/InternalComm.c
  51. 0 70
      EVSE/Projects/DW25/Apps/Makefile
  52. 0 333
      EVSE/Projects/DW25/Apps/Ocpp16.c
  53. 0 248
      EVSE/Projects/DW25/Apps/PsuComm.c
  54. 0 69
      EVSE/Projects/DW25/Apps/UpdateRootfs.c
  55. 0 2803
      EVSE/Projects/DW25/Apps/define.h
  56. BIN
      EVSE/Projects/DW25/Apps/main
  57. 0 659
      EVSE/Projects/DW25/Apps/main.c
  58. BIN
      EVSE/Projects/DW25/Images/MLO
  59. BIN
      EVSE/Projects/DW25/Images/am335x-evm.dtb
  60. BIN
      EVSE/Projects/DW25/Images/ramdisk.gz
  61. BIN
      EVSE/Projects/DW25/Images/u-boot.img
  62. BIN
      EVSE/Projects/DW25/Images/zImage
  63. 0 210
      Makefile
  64. 0 666
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[AH-Luxury]am335x-evm.dts
  65. 0 711
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DS60-210]am335x-evm.dts
  66. 0 712
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DW25]am335x-evm.dts
  67. 0 731
      board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[Economic]am335x-evm.dts
  68. 0 802
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[AH-Luxury]am335x-evm.dts
  69. 0 802
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[DS60-210]am335x-evm.dts
  70. 0 802
      board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[DW25]am335x-evm.dts

BIN
EVSE/Projects/AH-Luxury/Apps/4gModem


+ 0 - 467
EVSE/Projects/AH-Luxury/Apps/4gModem.c

@@ -1,467 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <netinet/in.h>
-#include <unistd.h>
-#include "define.h"
-
-//#define debug		
-#define CheckModemInterval		30	//sec
-#define CheckSimInterval			10 	//sec
-#define CheckConnectionInterval		5 	//sec
-#define DisconnInterval				60 	//sec
-
-
-
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct FanModuleData			*ShmFanModuleData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	
-    	return 1;
-}
-
-
-int Check4GModem()
-{
-	//return 0: No 4G modem equipped
-	//return 1: Qutel 4G modem equipped
-	//return 2: ublox 4G modem equipped
-	
-	int Rtn1,Rtn2;
-	
-	//check Qutel 4G modem
-	Rtn1=Rtn2=-1;
-	Rtn1=access("/dev/ttyUSB0",R_OK);
-	if(Rtn1==0)
-	{
-		Rtn2=access("/dev/ttyUSB2",R_OK);
-		if(Rtn2==0)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[4gModem]Check4GModem: Qutel 4G modem be found");
-			#endif	
-			return 1;
-		}
-	}	
-	//check ublox 4G modem
-	Rtn1=Rtn2=-1;
-	Rtn1=access("/dev/ttyACM0",R_OK);
-	if(Rtn1==0)
-	{
-		Rtn2=access("/dev/ttyACM2",R_OK);
-		if(Rtn2==0)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[4gModem]Check4GModem: ublox 4G modem be found");
-			#endif	
-			return 2;
-		}
-	}	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[4gModem]Check4GModem: No 4G modem be found");
-	#endif	
-	return 0;	
-}
-
-int InitComPort(unsigned char ModemModel)
-{
-	int UsbFd;
-	struct termios tios;
-	
-	if(ModemModel==1)	//Qutel 4G modem equipped
-		UsbFd = open("/dev/ttyUSB2", O_RDWR|O_NOCTTY);
-	else if(ModemModel==2)	//ublox 4G modem equipped
-		UsbFd = open("/dev/ttyACM2", O_RDWR|O_NOCTTY);
-	else
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitComPort: Unknow ModemModel ");
-		#endif		
-		return -1;
-	}	
-	
-	if(UsbFd<0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitComPort:  UsbFd open failed");
-		#endif	
-		return -1;
-	}	
-	ioctl (UsbFd, TCGETS, &tios);
-	tios.c_cflag = B115200 | CS8 | CLOCAL | CREAD;
-	tios.c_lflag = 0;
-	tios.c_iflag = 0;
-	tios.c_oflag = 0;
-  	tios.c_cc[VMIN]=0;   
-	tios.c_cc[VTIME]=100; 
-	tios.c_lflag=0;  
-	tcflush(UsbFd, TCIFLUSH);
-	ioctl (UsbFd, TCSETS, &tios);
-	return UsbFd;
-	
-}
-
-void GetModelName(int Fd, unsigned char *ModelName)
-{
-	//AT command processing
-}
-
-void GetModelVersion(int Fd, unsigned char *ModelVersion)
-{
-	//AT command processing
-}
-
-void GetModelImei(int Fd, unsigned char *ModelImei)
-{
-	//AT command processing
-}
-
-void GetSimImsi(int Fd, unsigned char *SimImsi)
-{
-	//AT command processing
-}
-
-unsigned char GetModemMode(int Fd)
-{
-	int Mode;
-	//AT command processing
-	return Mode;
-}
-
-int GetSignalRssi(int Fd)
-{
-	int RssiValue;
-	//AT command processing
-	return RssiValue;
-}
-
-int GetPPP0Info(unsigned char *IPaddress)
-{
-    	int fd,rd=0;
-	unsigned int address;
-	char buf[128],addr[32],*sptr,*eptr;
-	
-
-    	system("ifconfig ppp0 | grep \"inet addr:\" > /mnt/GetPPP0Info");
-	fd = open("/mnt/GetPPP0Info", O_RDONLY);
-    	if(fd<0)
-   	{
-    		system("rm -f /mnt/GetPPP0Info");
-	        return 0;
-    	}
-    
-    	memset(addr,0,sizeof(addr));
-    	memset(buf,0,sizeof(buf));
-    	rd=read(fd,buf,sizeof(buf));	
-    	if(rd<=0)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-   	}
-    	close(fd);
-    	if((sptr=strstr(buf,"inet addr:"))==NULL)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-    	}
-    	sptr+=strlen("inet addr:");
-    	if((eptr=strstr(buf,"  P-t-P:"))==NULL)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-    	}
-    	memset(IPaddress,0,strlen(IPaddress));
-    	strncpy(IPaddress,sptr,eptr-sptr);   
-    	#ifdef SystemLogMessage	
-	{
-		unsigned char Buffer[128];
-		memset(Buffer,0,sizeof(Buffer));
-		sprintf(Buffer,"[4gModem]GetPPP0Info: 4G IP Address = %s",IPaddress);
-		StoreLogMsg(Buffer);
-	}
-	#endif		
-    	return 1;
-}
-int  Load4gConfiguration()
-{
-	unsigned char CopyTmp[128];
-	
-	if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn)<=0)
-		return 0;
-	system("cat /dev/null > /root/ppp/auto-apn.conf");
-	system("chmod 777 /root/ppp/auto-apn.conf");  
-	system("cat /dev/null > /etc/ppp/options"); 
-	system("chmod 777 /etc/ppp/options"); 
-	system("cat /dev/null > /etc/ppp/pap-secrets"); 
-	system("chmod 777 /etc/ppp/pap-secrets"); 
-	system("cat /dev/null > /etc/ppp/chap-secrets"); 
-	system("chmod 777 /etc/ppp/chap-secrets"); 
-	memset(CopyTmp,0,sizeof(CopyTmp));
-	sprintf(CopyTmp,"echo \"APN=\"%s\"\" > /root/ppp/auto-apn.conf",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
-	system(CopyTmp);
-	system("echo \"ACCOUNT=\" >> /root/ppp/auto-apn.conf");
-	system("echo \"PASSWORD=\" >> /root/ppp/auto-apn.conf");
-	
-	if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId)>0)
-	{	
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"name %s \" > /etc/ppp/options",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
-		system(CopyTmp);
-		
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"%s * %s \" > /etc/ppp/pap-secrets",
-		ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,
-		((strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd)>0)?ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : " "));
-		system(CopyTmp);
-
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"%s * %s \" > /etc/ppp/chap-secrets",
-		ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,
-		((strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd)>0)?ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : " "));
-		system(CopyTmp);
-	}	
-	return 1;
-}
-void ResetModem()
-{
-	//power cycle modem by GPIO
-}
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	unsigned char ModuleModel=0;//0: None, 1: Qutel, 2: ublox SARA-U201
-	int UsbFd=-1;
-	unsigned int StartTime,EndTime,Tmp; 
-	unsigned char TmpIpAddr[16];
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	ResetModem();
-	
-ReCheckModem:    
-	//ResetModem();
-	UsbFd=-1;
-	ModuleModel=0;
-	Load4gConfiguration();
-
-	while(1)
-	{
-		ModuleModel=Check4GModem();
-		if(ModuleModel<=0)
-		{
-			sleep(CheckModemInterval);
-			continue;
-		}	
-		if(UsbFd>0)
-			close(UsbFd);
-		UsbFd=InitComPort(ModuleModel);
-		if(UsbFd<0)
-		{
-			sleep(CheckModemInterval);
-			continue;
-		}
-		/**** Record some modem information and dial up if SIM card ready ****/
-		memset(&ShmSysConfigAndInfo->SysConfig.TelecomInterface,0,sizeof(struct TeleConfigData));
-		while(1)
-		{
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModelName)<=0)
-				GetModelName(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModelName);
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSoftwareVer)<=0)
-				GetModelVersion(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSoftwareVer);	
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei)<=0)
-				GetModelImei(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);		
-			GetSimImsi(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);		
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi)<=0)
-			{	
-				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
-				sleep(CheckSimInterval);	
-				if(Check4GModem()<=0)
-					goto ReCheckModem;
-			}
-			else
-			{
-				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=1;
-				if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn)<=0)
-				{
-					sleep(DisconnInterval);
-					goto ReCheckModem;		
-				}
-				system("killall 4GDetection");	
-				sleep(2);
-				if(ModuleModel==1)
-					system("/root/ppp/4GDetection /dev/ttyUSB0 &");	
-				else if(ModuleModel==2)
-					system("/root/ppp/4GDetection /dev/ttyACM0 &");
-				break;	
-			}			
-		}
-		/***** Periodically check RSSI and connection*****/
-		StartTime=time((time_t*)NULL);
-		EndTime=time((time_t*)NULL);
-		while(1)
-		{
-			if((time((time_t*)NULL)-StartTime)>=CheckConnectionInterval)
-			{	
-				//check IP address 
-				memset(TmpIpAddr,0,sizeof(TmpIpAddr));
-				if(GetPPP0Info(TmpIpAddr)<=0)
-				{
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn=0;
-					if((time((time_t*)NULL)-EndTime)>=DisconnInterval)
-						goto ReCheckModem; 
-				}	
-				else
-				{
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn=1;
-					if(strstr(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr)==NULL)
-					{
-						#ifdef SystemLogMessage	
-						{
-							unsigned char Buffer[128];
-							memset(Buffer,0,sizeof(Buffer));
-							sprintf(Buffer,"[4gModem]main:  4G IP Address changed from %s to %s",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr);
-							StoreLogMsg(Buffer);
-						}
-						#endif		
-						memset(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,0,sizeof(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress));
-						strcpy(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr);
-						system("route del default");
-						system("route add default dev ppp0");
-					}
-					EndTime=time((time_t*)NULL);
-				}	
-				//check RSSI
-				Tmp=GetSignalRssi(UsbFd);
-				if(abs(Tmp-ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi)>=5)
-				{
-					#ifdef SystemLogMessage	
-					{
-						unsigned char Buffer[128];
-						memset(Buffer,0,sizeof(Buffer));
-						sprintf(Buffer,"[4gModem]main: RSSI changed from %d to %d",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi,Tmp);
-						StoreLogMsg(Buffer);
-					}
-					#endif		
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=Tmp;
-				}	
-				//check Mode
-				Tmp=GetModemMode(UsbFd);
-				if(Tmp!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode)
-				{
-					#ifdef SystemLogMessage	
-					{
-						unsigned char Buffer[128];
-						memset(Buffer,0,sizeof(Buffer));
-						sprintf(Buffer,"[4gModem]main: Modem mode changed from %d to %d",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode,Tmp);
-						StoreLogMsg(Buffer);
-					}
-					#endif
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=Tmp;
-				}	
-				StartTime=time((time_t*)NULL);
-			}
-		}
-	}//main while loop
-}
-
-

BIN
EVSE/Projects/AH-Luxury/Apps/EventLogging


+ 0 - 218
EVSE/Projects/AH-Luxury/Apps/EventLogging.c

@@ -1,218 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "../../define.h"
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int StoreEventLogMsg(unsigned char *EventCodeString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/EventLog/[%04d.%02d]EventLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			EventCodeString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",Buf);
-	#endif
-}		
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-    	return 1;
-}
-
-int main(int argc,char *argv[])
-{
-	int ByteCount,BitCount;
-	unsigned char tmp, EventCodeTmp[7];
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	
-	while(1)
-	{
-		//check Fault Status
-		for(ByteCount=0;ByteCount<4;ByteCount++)
-		{
-			if(ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[ByteCount] != ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,FaultStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-		//check Alarm Status
-		for(ByteCount=0;ByteCount<8;ByteCount++)
-		{
-			if(ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount] != ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,AlarmStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-		//check Info Status
-		for(ByteCount=0;ByteCount<8;ByteCount++)
-		{
-			if(ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[ByteCount] != ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,InfoStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-	}//main while loop 
-}
-
-

+ 0 - 109
EVSE/Projects/AH-Luxury/Apps/FWMaker.c

@@ -1,109 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <net/if.h> /*struct ifreq*/
-#include <linux/sockios.h> /*SIOCGIFINDEX*/
-#include <linux/socket.h>
-#include <errno.h> 
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <fcntl.h>
-#include <sys/mman.h>
-
-//./FWMaker 172.16.24.126
-int main(int argc,char *argv[])
-{
-	unsigned char *MemBuf,*MemBuf2,buf[64];
-    int fd,rd=0,wrd=0,tmp=0,rd2=0;
-    unsigned int CheckSum=0;
-
-
-
-	memset(buf,0,64);
-	sprintf(buf,"tftp -gr uImage -l /mnt/uImage %s",argv[1]);   
-	system(buf);
-	memset(buf,0,64);
-	sprintf(buf,"tftp -gr rootfs_nor.img -l /mnt/rootfs_nor.img %s",argv[1]);   
-	system(buf);
-
-	if((MemBuf=malloc(0x100000D))==NULL)
-	{
-		printf("Allocate MemBuf memory error\n");
-		return 0;
-	}	
-	memset(MemBuf, 0xff, 0x100000D);
-	fd = open("/mnt/uImage", O_RDWR);
-	if (fd > 0) 
-	{
-	    if((rd=read(fd,MemBuf,0x100000D))<=0)
-	    {
-			printf("/mnt/uImage read Error\n");
-			free(MemBuf);
-			close(fd);
-			return 0;
-	    }   
-	    close(fd);
-	    for(tmp=0;tmp<rd;tmp++)
-	    	CheckSum+=MemBuf[tmp];
-	    strncpy(MemBuf+rd,"DELTADCOK",9);	
-	   *(MemBuf+rd+9)=CheckSum>>24;
-	    *(MemBuf+rd+10)=CheckSum>>16;
-	    *(MemBuf+rd+11)=CheckSum>>8;
-	     *(MemBuf+rd+12)=CheckSum;
-	   // memcpy(MemBuf+rd+9,&CheckSum,4);	
-	    fd = open("/mnt/DcoKImage", O_CREAT|O_RDWR);
-	    wrd=write(fd, MemBuf, rd+13);
-	    if(wrd!=(rd+13))
-	    	printf("write error wrd=0x%x, rd=0x%x\n",wrd,rd+13);
-	   else 
-	   		printf("/mnt/DcoKImage OK\n"); 	
-	    
-	}
-	else	
-	{	
-		free(MemBuf);
-		printf("/mnt/uImage open Error\n");
-		return 0;
-	}
-	
-	
-	memset(MemBuf, 0xff, 0x100000D);
-	CheckSum=rd=0;
-	fd = open("/mnt/rootfs_nor.img", O_RDWR);
-	if (fd > 0) 
-	{
-	    if((rd=read(fd,MemBuf,0x100000D))<=0)
-	    {
-			printf("/mnt/rootfs_nor.img read Error\n");
-			free(MemBuf);
-			close(fd);
-			return 0;
-	    }   
-	    close(fd);
-	    for(tmp=0;tmp<rd;tmp++)
-	    	CheckSum+=MemBuf[tmp];
-	    strncpy(MemBuf+rd,"DELTADCOF",9);	
-	    *(MemBuf+rd+9)=CheckSum>>24;
-	    *(MemBuf+rd+10)=CheckSum>>16;
-	    *(MemBuf+rd+11)=CheckSum>>8;
-	     *(MemBuf+rd+12)=CheckSum;
-	    //memcpy(MemBuf+rd+9,&CheckSum,4);	
-	    fd = open("/mnt/DcoFImage", O_CREAT|O_RDWR);
-	    wrd=write(fd, MemBuf, rd+13);
-	    if(wrd!=(rd+13))
-	    	printf("write error wrd=0x%x, rd=0x%x\n",wrd,rd+13);
-	   else 
-	   		printf("/mnt/DcoFImage OK\n"); 	
-	    
-	}
-	else	
-	{	
-		free(MemBuf);
-		printf("/mnt/rootfs_nor.img open Error\n");
-		return 0;
-	}
-	
-}

BIN
EVSE/Projects/AH-Luxury/Apps/FactoryConfig


+ 0 - 173
EVSE/Projects/AH-Luxury/Apps/FactoryConfig.c

@@ -1,173 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "../../define.h"
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-
-/**************************************************************************************/
-/************This task will create Factory default confgiuration file *****************/
- /***********and store it into mtdblock 10,11,12                               ****************/
-/**************************************************************************************/
-
-int main(int argc,char *argv[])
-{
-	struct SysConfigData 	SysConfig;
-	unsigned int i,Chk;
-	unsigned char *ptr; 
-	int fd,wrd;
-	
-	ptr=malloc(sizeof(struct SysConfigData));
-	if(ptr==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: malloc for SysConfigData NG");
-		#endif			
-		return 0;
-	}	
-	memset(ptr,0,sizeof(struct SysConfigData));
-	memset(&SysConfig,0,sizeof(struct SysConfigData));
-	
-	//Set default configuration
-	strcpy(SysConfig.Eth0Interface.EthIpAddress,"192.168.0.10");
-	strcpy(SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
-	strcpy(SysConfig.Eth0Interface.EthGatewayAddress,"192.168.0.254");
-	strcpy(SysConfig.Eth1Interface.EthIpAddress,"192.168.1.10");
-	strcpy(SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
-	strcpy(SysConfig.Eth1Interface.EthGatewayAddress,"192.168.1.254");
-	SysConfig.BackendConnTimeout=300; //300 seconds
-	
-	//copy default configuration to pointer
-	memcpy(ptr,&SysConfig,sizeof(struct SysConfigData));
-	
-	//calculate CRC
-	Chk=0;
-	for(i=0;i<(sizeof(struct SysConfigData)-4);i++)
-	{
-		Chk+=*(ptr+i);
-	}
-	SysConfig.Checksum=Chk;
-	
-	fd = open("/mnt/FactoryDefaultConfig.bin", O_RDWR|O_CREAT);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /mnt/FactoryDefaultConfig.bin NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}   
-
-	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));
-	close(fd);
-	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /mnt/FactoryDefaultConfig.bin NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}
-	
-	fd = open("/dev/mtdblock12", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock12 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock12 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock11", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock11 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock11 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock10 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock10 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	free(ptr);
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[FactoryConfig]main: FactoryConfig OK");
-	#endif	
-}

BIN
EVSE/Projects/AH-Luxury/Apps/InternalComm


+ 0 - 200
EVSE/Projects/AH-Luxury/Apps/InternalComm.c

@@ -1,200 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "../../define.h"
-
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct FanModuleData			*ShmFanModuleData;
-struct RelayModuleData			*ShmRelayModuleData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-   	//creat ShmFanModuleData
-   	 if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmFanModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmFanModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
-   	 //creat ShmRelayModuleData
-   	 if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmRelayModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmRelayModuleData NG");
-		#endif		
-		return 0;
-   	 }
-    	return 1;
-}
-
-int InitComPort()
-{
-	int fd;
-	struct termios tios;
-	
-	fd = open("/dev/ttyS4", O_RDWR);
-	if(fd<=0)
-	{ 
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitComPort: open /dev/ttyS4 NG");
-		#endif	
-		return -1;
-	}
-	ioctl (fd, TCGETS, &tios);
-	tios.c_cflag = B115200| CS8 | CLOCAL | CREAD; 
-	tios.c_lflag = 0;
-	tios.c_iflag = 0; 
-	tios.c_oflag = 0;
-	tios.c_cc[VMIN]=0;    
-	tios.c_cc[VTIME]=1000; 
-	tios.c_lflag=0;  
-	tcflush(fd, TCIFLUSH);
-	ioctl (fd, TCSETS, &tios);
-	return fd;
-}
-
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	int Uart4Fd;
-
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	Uart4Fd=InitComPort();
-	if(Uart4Fd<0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]main:InitComPort NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	
-	while(1)
-	{
-		//processing
-	}//main while loop
-}
-
-

+ 0 - 74
EVSE/Projects/AH-Luxury/Apps/Makefile

@@ -1,74 +0,0 @@
--include ../../../../Rules.make
-export PATH=/bin:/sbin:/usr/bin:$(SDK_PATH_TARGET)/usr/bin:$PATH
-
-#define library variable
-Internal485ProtocolLib = -L ../../../Modularization/Internal485Protocol -lInternal485Protocol
-PsuCommProtocolLib = -L ../../../Modularization/PsuCommProtocol -lPsuCommProtocol
-
-all: CopyFile apps
-#apps: MainTask PsuCommTask InternalCommTask 4gModemTask FactoryConfigTask EvCommTask UpdateRootfsTask LcmControlTask FWMakerTask PrimaryCommTask OcppBackendTask ErrorHandle
-apps: MainTask FactoryConfigTask
-
-MainTask:
-	rm -f main; $(CC) main.c -lm -o main
-#	cp -f main ../Images/root
-	
-PsuCommTask:
-	rm -f PsuComm; $(CC) PsuComm.c ${PsuCommProtocolLib} -lm -o PsuComm
-	cp -f PsuComm ../Images/root	
-	
-InternalCommTask:
-	rm -f InternalComm; $(CC) InternalComm.c ${Internal485ProtocolLib} -lm -o InternalComm	
-	cp -f InternalComm ../Images/root
-
-WiFiModemTask:
-	rm -f WiFiModem; $(CC) WiFiModem.c -o WiFiModem	
-	cp -f WiFiModem ../Images/root
-		
-4gModemTask:
-	rm -f 4gModem; $(CC) 4gModem.c -o 4gModem		
-	cp -f 4gModem ../Images/root
-	
-FactoryConfigTask:
-	rm -f FactoryConfig; $(CC) FactoryConfig.c -o FactoryConfig	
-	cp -f FactoryConfig ../Images/root		
-	
-EvCommTask:
-	rm -f EvComm; $(CC) EvComm.c -lm -o EvComm	
-	cp -f EvComm ../Images/root
-	
-UpdateRootfsTask:
-	rm -f UpdateRootfs; $(CC) UpdateRootfs.c -o UpdateRootfs		 
-	cp -f UpdateRootfs ../Images/root	
-
-LcmControlTask:
-	rm -f LcmControl; $(CC) LcmControl.c -o LcmControl
-	cp -f LcmControl ../Images/root			
-
-PrimaryCommTask:
-	rm -f PrimaryComm; $(CC) PrimaryComm.c -o PrimaryComm
-	cp -f PrimaryComm ../Images/root	
-
-Ocpp16Task:
-	rm -f Ocpp16; $(CC) Ocpp16.c -I ../../../GPL/libwebsockets-v2.1-stable/release/include -L ../../../GPL/libwebsockets-v2.1-stable/release/lib -lwebsockets -o Ocpp16
-	cp -f Ocpp16 ../Images/root
-	
-EventLoggingTask:
-	rm -f EventLogging; $(CC) EventLogging.c -o EventLogging	
-	cp -f EventLogging ../Images/root	
-		
-FWMakerTask:
-	rm -f FWMaker; $(CC) FWMaker.c -o FWMaker	
-	cp -f FWMaker ../Images/root
-	
-ccsTask:
-	rm -f ccs; $(CC) ccs.c -o ccs	
-	cp -f ccs ../Images/root	
-	
-CopyFile: 
-	rm -rfv ../Images/root
-	mkdir -p ../Images/root
-
-
-
-	

BIN
EVSE/Projects/AH-Luxury/Apps/Ocpp16


+ 0 - 333
EVSE/Projects/AH-Luxury/Apps/Ocpp16.c

@@ -1,333 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <libwebsockets.h>
-#include <lws_config.h>
-#include "../../define.h"
-
-#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct OCPP16Data 			*ShmOCPP16Data;
-
-
-struct lws *wsi;
-struct lws_context *context;
-
-unsigned char *SendBuffer;
-int SendBufLen=(1024*3);
-int ConnectionEstablished=0;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmOCPP16Data
-   	 if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmOCPP16Data NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmOCPP16Data NG");
-		#endif		
-		return 0;
-   	 }
-   	memset(ShmOCPP16Data,0,sizeof(struct PsuData));
-    	return 1;
-}
-
-
-int SendData(struct lws *wsi) 
-{
-    int n;
-    int len;
-    unsigned char *out = NULL;
-
-    len = strlen(SendBuffer);
-    out = (char *)malloc(sizeof(char)*(LWS_SEND_BUFFER_PRE_PADDING + len + LWS_SEND_BUFFER_POST_PADDING));
-    memcpy (out + LWS_SEND_BUFFER_PRE_PADDING, SendBuffer, len );
-   
-    n = lws_write(wsi, out + LWS_SEND_BUFFER_PRE_PADDING, len, LWS_WRITE_TEXT);
-   
-    free(out);
-    return n;
-}
-
-static int OCPP16Callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len)
-{	
-
-	#ifdef Debug
-	printf("OCPP16Callback:reason=%d\n",reason);
-	#endif
-	switch (reason) 
-	{
-		case LWS_CALLBACK_CLIENT_ESTABLISHED://3
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLIENT_ESTABLISHED");
-			#endif		
-			//connected
-			ConnectionEstablished=1;
-			break;
-		case LWS_CALLBACK_CLIENT_CONNECTION_ERROR://1
-			#ifdef Debug
-			printf("OCPP16Callback:LWS_CALLBACK_CLIENT_CONNECTION_ERROR:%s\n",in);
-			#endif
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLIENT_CONNECTION_ERROR");
-			#endif		
-			//disconnected
-			ConnectionEstablished=0;
-			break;
-		case LWS_CALLBACK_CLOSED://4
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLOSED");
-			#endif
-			//disconnected
-			ConnectionEstablished=0;
-			break;
-		case LWS_CALLBACK_CLIENT_WRITEABLE://10
-			//sif(need to send message and its relevant data already store into SendBuffer)
-				SendData(wsi);
-			break;
-		case LWS_CALLBACK_CLIENT_RECEIVE://8
-			((char *)in)[len] = '\0';
-			#ifdef Debug
-			printf("OCPP16Callback:LWS_CALLBACK_CLIENT_RECEIVE : rx %d '%s'\n", (int)len, (char *)in);
-			#endif
-			//parsing received message and do something
-			break;
-		default:
-			break;
-	}
-
-	return 0;
-}
-
-static struct lws_protocols protocols[] = {
-
-	{
-		"ocpp1.6",		
-		OCPP16Callback,
-		10240,	
-		10240,
-	},
-	{
-		"ocpp1.6",		
-		OCPP16Callback,
-		10240,	
-		10240,
-	},
-	{
-		NULL, NULL, 0		/* End of list */
-	}
-};
-
-int ConnectWsServer()
-{	
-	struct lws_context_creation_info ContextInfo;
-	struct lws_client_connect_info ConnInfo;
-	int use_ssl=0;
-	
-	if(context!=NULL)
-		lws_context_destroy(context);
-	memset(&ContextInfo, 0, sizeof(struct lws_context_creation_info));
-	ContextInfo.port=CONTEXT_PORT_NO_LISTEN;
-	ContextInfo.iface=NULL;
-	ContextInfo.ssl_private_key_password=NULL; 
-	ContextInfo.ssl_cert_filepath=NULL; 
-	ContextInfo.ssl_private_key_filepath=NULL; 
-	ContextInfo.ssl_ca_filepath="/root/cacert.pem"; 
-	ContextInfo.ssl_cipher_list=NULL; //use default one
-	ContextInfo.gid=-1;
-	ContextInfo.uid=-1;
-	//if(security connection)
-	//	ContextInfo.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
-	ContextInfo.protocols=protocols;
-	ContextInfo.timeout_secs= 30;
-	//if(ping pong enabled)
-		//ContextInfo.ws_ping_pong_interval= 15;//0 for none, else interval in seconds 
-	ContextInfo.ws_ping_pong_interval= 0;	
-	context = lws_create_context(&ContextInfo);
-	if (context == NULL) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]ConnectWsServer: lws_create_context NG");
-		#endif	
-		return 0;
-	}
-	memset(&ConnInfo,0,sizeof(struct lws_client_connect_info));
-	ConnInfo.context = context;
-
-	// fill up below information
-	//ConnInfo.address=ServerIpAddress;
-	//ConnInfo.port = ServerSrcPort;
-	//ConnInfo.path=ServerPath;
-	//ConnInfo.host=ServerHost;
-	//ConnInfo.origin=ServerOrigin;
-
-	/* ws://192.168.1.1:9091/greenlots/ocpp*/
-	ConnInfo.address = "192.168.1.1";
-	ConnInfo.port = 9091;
-	ConnInfo.path="/ocpp/T123456789";
-	ConnInfo.host = "192.168.1.1:9091";
-	ConnInfo.origin = "192.168.1.1:9091";	
-
-	use_ssl = LCCSCF_USE_SSL | LCCSCF_ALLOW_SELFSIGNED | LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
-	//if(security connection)
-	//	ConnInfo.ssl_connection = use_ssl;
-	//else
-		ConnInfo.ssl_connection=0;
-
-	ConnInfo.protocol = protocols[1].name;
-	ConnInfo.ietf_version_or_minus_one=-1;
-	wsi=lws_client_connect_via_info(&ConnInfo);						 
-	if (!wsi) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]ConnectWsServer: lws_client_connect_via_info NG");
-		#endif	
-		return 0;
-	}
-	return 1;
-}
-
-int main(int argc,char *argv[])
-{
-	unsigned int StartTime=0;
-	/**************** Initialization **********/		
-	/*if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}*/	
-  	if((SendBuffer=malloc(SendBufLen))==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]main: malloc(SendBufLen) NG");
-		#endif	
-		sleep(5);
-		return 0;	
-	}	
-	while(ConnectionEstablished==0)
-	{
-		if((time((time_t*)NULL)-StartTime)>=60)
-		{
-			#ifdef debug
-			printf("[OCPP16:]main:Execute ConnectWsServer1\n");
-			#endif
-			ConnectWsServer();
-			StartTime=time((time_t*)NULL);
-		}	
-		lws_service(context, 10000);//timeout_ms	
-	}
-	memset(SendBuffer,0,SendBufLen);
-	sprintf(SendBuffer,"[2,\"%s\",\"%s\",{\"chargePointVendor\":\"%s\",\"chargePointModel\":\"%s\",\"chargePointSerialNumber\":\"%s\",\"chargeBoxSerialNumber\":\"%s\",\"firmwareVersion\":\"%s\",\"imsi\":\"%s\"}]",
-					"11112222",
-					"BootNotification",
-					"CpVendor",
-					"CpModel",
-					"CpSN",
-					"CbSN",
-					"CpFwVersion",
-					"CpImsi");
-	lws_callback_on_writable(wsi);
-	while(1)
-	{
-		//prcessing
-		lws_service(context, 500);//500 timeout_ms 	
-	};
-	
-
-	free(SendBuffer);
-}

+ 0 - 248
EVSE/Projects/AH-Luxury/Apps/PsuComm.c

@@ -1,248 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <net/if.h>
-#include <linux/can.h>
-#include <linux/can/raw.h>
-#include <unistd.h>
-#include "../../define.h"
-
-//#define Debug
-
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct PsuData 				*ShmPsuData ;
-pid_t						CANReceiverPid;
-int 							CanFd;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-   	 //creat ShmPsuData
-   	 if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmPsuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmPsuData NG");
-		#endif		
-		return 0;
-   	 }
-   	memset(ShmPsuData,0,sizeof(struct PsuData));
-    	return 1;
-}
-
-int InitCanBus()
-{
-	int 					s0,nbytes;
-	struct timeval			tv;
-	struct ifreq 			ifr0;
-	struct sockaddr_can	addr0;
-	
-	system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");				  
-	system("/sbin/ip link set can1 up");
-	
-	s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
-	
-	tv.tv_sec = 0; 
-    	tv.tv_usec = 10000; 
-   	 if (setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct	timeval)) < 0) 
-    	{
-	       	#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVTIMEO NG");
-		#endif		
-    	}
-    	nbytes=40960;
-    	if (setsockopt(s0, SOL_SOCKET,  SO_RCVBUF, &nbytes, sizeof(int)) < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVBUF NG");
-		#endif	
-	}
-    	nbytes=40960;
-    	if (setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0) 
-    	{
-       		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_SNDBUF NG");
-		#endif	
-    	}
-    
-   	strcpy(ifr0.ifr_name, "can1" );
-	ioctl(s0, SIOCGIFINDEX, &ifr0); /* ifr.ifr_ifindex gets filled with that device's index */
-	addr0.can_family = AF_CAN;
-	addr0.can_ifindex = ifr0.ifr_ifindex;
-	bind(s0, (struct sockaddr *)&addr0, sizeof(addr0));
-	return s0;
-}
-
-
-/**************************************************************/
-/************** Receiving Task*******************************/
-/*************************************************************/
-void CANReceiver(int fd)
-{
-	pid_t tmp=0;
-	struct can_frame frame;
-	struct timeb StartTime,EndTime;
-	int nbytes;
-	unsigned char FanspeedGetTime=0;
-	
-	if(CANReceiverPid==0)
-	{
-		tmp=fork();
-		if(tmp>0)
-		{
-			CANReceiverPid=tmp;	
-			{
-				unsigned char buf[64];
-				memset(buf,0,sizeof(buf));
-				sprintf(buf,"renice -20 -p %d",tmp);
-				system(buf);
-			}
-			return;
-		}
-	}
-	
-	while(1)
-	{
-		memset(&frame,0,sizeof(struct can_frame));
-		nbytes = read(fd, &frame, sizeof(struct can_frame));
-		//handle received packet
-	}
-}
-
-/**************************************************************/
-/************** main function***********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	int CanFd;
-	struct can_frame frame;
-
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	CanFd=InitCanBus();
-	CANReceiverPid=0;
-	CANReceiver(CanFd);
-
-	//main loop
-	while(1)
-	{
-		//processing
-	}
-	
-EndProcess:	
-	if(CANReceiverPid>0)
-	{
-		char Buf[32];
-		memset(Buf,0,32);
-		sprintf(Buf,"kill %d",CANReceiverPid);
-		system(Buf);
-	}
-	close(CanFd); 
-	system("/sbin/ip link set can1 down");
-	system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");
-	system("/sbin/ip link set can1 up");
-	system("/sbin/ip link set can1 down");
-	system("killall PsuComm");
-}

+ 0 - 69
EVSE/Projects/AH-Luxury/Apps/UpdateRootfs.c

@@ -1,69 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include "../../define.h"
-
-
-int main(int argc,char *argv[])
-{
-	unsigned int MaxLen=25*1024*1024, ImageLen=0;
-	unsigned char *ptr; 
-	int fd,wrd;
-	
-	ptr=malloc(MaxLen);
-	if(ptr==NULL)
-	{
-		printf("UpdateRootfs NG - can not malloc\n");
-		return 0;
-	}	
-	memset(ptr,0xFF,MaxLen);
-	
-	fd = open(argv[1], O_RDONLY);
-	if(fd < 0)
-	{
-		printf("UpdateRootfs NG - can not open rootfs\n");
-		free(ptr);
-		return 0;
-	}
-    	ImageLen=read(fd,ptr,MaxLen);
-	close(fd);	
-	printf("ImageLen=0x%x\n",ImageLen);
-	if(ImageLen<(24*1024*1024))
-	{
-		printf("ImageLen size mismatch\n");
-		free(ptr);
-		return 0;
-	}	
-	fd = open("/dev/mtdblock8", O_RDWR);
-	if (fd < 0) 
-	{
-		printf("UpdateRootfs NG - can not open mtdblock8\n");
-		free(ptr);
-		return 0;
-    	}
-    	wrd=write(fd, ptr, ImageLen);   
-    	close(fd);
-   	if(wrd!=ImageLen)
-	{	
-		printf("UpdateRootfs NG - wrd(0x%x) != ImageLen(0x%x)\n",wrd,ImageLen);
-		free(ptr);
-		return 0;
-	}	
-	free(ptr);
-	printf("UpdateRootfs OK\n");
-}

BIN
EVSE/Projects/AH-Luxury/Apps/ccs


+ 0 - 59
EVSE/Projects/AH-Luxury/Apps/ccs.c

@@ -1,59 +0,0 @@
-// raw_sock.c
-#include<stdio.h>
-#include<stdlib.h>
-#include<string.h>
-#include<netinet/ip.h>
-#include<sys/socket.h>
-#include<arpa/inet.h>
-#include <unistd.h>
-
-int main() {
-    // Structs that contain source IP addresses
-    struct sockaddr_in source_socket_address, dest_socket_address;
-
-    int packet_size;
-	struct timeval			tv;
-    // Allocate string buffer to hold incoming packet data
-    unsigned char *buffer = (unsigned char *)malloc(65536);
-    // Open the raw socket
-    int sock = socket (PF_INET, SOCK_RAW, IPPROTO_TCP);
-    tv.tv_sec = 0; 
-    	tv.tv_usec = 10000; 
-   	 if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct	timeval)) < 0) 
-    	{
-	       	#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVTIMEO NG");
-		#endif		
-    	}
-    if(sock == -1)
-    {
-        //socket creation failed, may be because of non-root privileges
-        printf("Failed to create socket\n");
-        return 1;
-    }
-    while(1) {
-      // recvfrom is used to read data from a socket
-      packet_size = recvfrom(sock , buffer , 65536 , 0 , NULL, NULL);
-      if (packet_size == -1) 
-      {
-		printf("Failed to get packets\n");
-		sleep(5);
-        	continue;
-      }
- 	printf("get packets, packet_size=%d\n",packet_size);
-      struct iphdr *ip_packet = (struct iphdr *)buffer;
-
-      memset(&source_socket_address, 0, sizeof(source_socket_address));
-      source_socket_address.sin_addr.s_addr = ip_packet->saddr;
-      memset(&dest_socket_address, 0, sizeof(dest_socket_address));
-      dest_socket_address.sin_addr.s_addr = ip_packet->daddr;
-
-      printf("Incoming Packet: \n");
-      printf("Packet Size (bytes): %d\n",ntohs(ip_packet->tot_len));
-      printf("Source Address: %s\n", (char *)inet_ntoa(source_socket_address.sin_addr));
-      printf("Destination Address: %s\n", (char *)inet_ntoa(dest_socket_address.sin_addr));
-      printf("Identification: %d\n\n", ntohs(ip_packet->id));
-    }
-
-    return 0;
-}

BIN
EVSE/Projects/AH-Luxury/Apps/main


+ 0 - 651
EVSE/Projects/AH-Luxury/Apps/main.c

@@ -1,651 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "../../define.h"
-
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct PsuData 				*ShmPsuData ;
-struct CHAdeMOData			*ShmCHAdeMOData;
-struct CcsData				*ShmCcsData;
-struct PrimaryMcuData			*ShmPrimaryMcuData;
-struct FanModuleData			*ShmFanModuleData;
-struct RelayModuleData			*ShmRelayModuleData;
-struct OCPP16Data				*ShmOCPP16Data;
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-
-/**************************************************************************************/
-/**************************Create all share memory *********************************/
-/**************************************************************************************/
-int CreatShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmSysConfigAndInfo,0,sizeof(struct SysConfigAndInfo));
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmStatusCodeData,0,sizeof(struct StatusCodeData));
-   	 //creat ShmPsuData
-   	 if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmPsuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmPsuData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmPsuData,0,sizeof(struct PsuData));
-   	 //creat ShmCHAdeMOData
-   	 if ((MeterSMId = shmget(ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmCHAdeMOData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmCHAdeMOData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmCHAdeMOData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmCHAdeMOData,0,sizeof(struct CHAdeMOData));
-   	 //creat ShmCcsData
-   	 if ((MeterSMId = shmget(ShmCcsCommKey, sizeof(struct CcsData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmCcsData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmCcsData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmCcsData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmCcsData,0,sizeof(struct CcsData));
-   	//creat ShmPrimaryMcuData
-   	 if ((MeterSMId = shmget(ShmPrimaryMcuKey, sizeof(struct PrimaryMcuData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmPrimaryMcuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPrimaryMcuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmPrimaryMcuData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmPrimaryMcuData,0,sizeof(struct PrimaryMcuData));
-   	 //creat ShmFanModuleData
-   	 if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmFanModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmFanModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
-   	 //creat ShmRelayModuleData
-   	 if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmRelayModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmRelayModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmRelayModuleData,0,sizeof(struct RelayModuleData));
-   	  //creat ShmOCPP16Data
-   	 if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmOCPP16Data NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmOCPP16Data NG");
-		#endif		
-		return 0;
-   	 }
-   	// memset(ShmOCPP16Data,0,sizeof(struct OCPP16Data));
-    	return 1;
-}
-
-/**************************************************************************************/
-/****************Following functions are CSU initialization***************************/
-/**************************************************************************************/
-void InitGPIO()
-{
-	/*****************0~3, 4 bank, bank x 32+ num*********************/
-	/***************************************************************/
-	/*************** INPUT PIN ***************************************/
-	/***************************************************************/
-	/*SECOND_BREAKER_feedback.:GPIO0_28:input => H:OFF; L: ON*/
-	system("echo 28 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio28/direction");
-	/*GFD Alarm1:GPIO2_20:input => H: Normal operation; L: GFD alarm*/
-	system("echo 84 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio84/direction");
-	/*GFD Alarm2:GPIO2_19:input => H: Normal operation; L: GFD alarm*/
-	system("echo 83 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio83/direction");
-	/*AC Drop:GPIO2_18:input => H: Normal operation; L: AC drop*/
-	system("echo 82 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio82/direction");
-	/*Emergency Stop:GPIO2_7:input => H: Normal operation; L: Emergency stop*/
-	system("echo 71 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio71/direction");
-	/*Main breaker SPD:GPIO0_27:input => H: Normal SPD operation; L: Interrupt from SPD*/
-	system("echo 27 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio27/direction");
-	/*MAIN_BREAKER_feedback:GPIO1_15:input =>H: OFF; L: ON*/
-	system("echo 47 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio47/direction");
-	/*GUN1 Permission (signal J):GPIO0_29:input => H: No EV permission; L: Permitted */
-	system("echo 29 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio29/direction");
-	/*GUN1 Proximity detection:GPIO1_28:input => H: Gun unconnected; L: Gun connected*/
-	system("echo 60 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio60/direction");
-	/*GUN1 LOCK CHECK - CHAdeMO :GPIO2_23:input => H: Gun unlock; L: Gun locked*/
-	system("echo 87 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio87/direction");
-	/*Input contactor feedback.:GPIO3_20:input:H: ON; L: OFF*/
-	system("echo 116 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio116/direction");
-	/*DOOR_Sensor: GPIO1_14:input:H: Door close; L: Door open */
-	system("echo 46 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio46/direction");
-	
-	/***************************************************************/
-	/*************** OUTPUT PIN ************************************/
-	/***************************************************************/
-	/*all system module power switch:GPIO0_16:output => H: power off all modules; L: power on all module*/
-	system("echo 16 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio16/direction");
-	system("echo 0 > /sys/class/gpio/gpio16/value");
-	/*Input contactor Drive: GPIO2_9:output =>H: ON; L: OFF*/
-	system("echo 73 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio73/direction");
-	system("echo 0 > /sys/class/gpio/gpio73/value");
-	/*EV1 12V Enable (CHAdeMO1 D1): GPIO0_19:output=>H: Enable 12V for EV (ON); L: Disable 12V for EV (OFF)*/
-	system("echo 19 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio19/direction");
-	system("echo 0 > /sys/class/gpio/gpio19/value");
-	/*EV1 GND Enable (CHAdeMO1 D2): GPIO2_12:output=>H: Enable GND for EV(ON); L: Disable GND for EV(OFF) */
-	system("echo 76 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio76/direction");
-	system("echo 0 > /sys/class/gpio/gpio76/value");
-	/*GUN1_MPU_Permission :GPIO0_11:output => Low: CHAdeMO1 signal J be controled by EV, High:signal J always low (charging permitted)*/
-	system("echo 11 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio11/direction");
-	system("echo 0 > /sys/class/gpio/gpio11/value");
-	/*CHAdeMO GUN1 lock:GPIO2_10:output => H: Lock gun; L: Unlock gun*/
-	system("echo 74 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio74/direction");
-	system("echo 0 > /sys/class/gpio/gpio74/value");
-	/*CHILLER ENABLE:GPIO1_31:output => H: Enable chiller; L: Disable chiller*/
-	system("echo 63 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio63/direction");
-	system("echo 0 > /sys/class/gpio/gpio63/value");
-	/*Buzzer:GPIO3_18:output => H: buzz; L:silent*/
-	system("echo 114 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio114/direction");
-	system("echo 0 > /sys/class/gpio/gpio114/value");
-	/*RS485_DE	GPIO2_13:output=>H: Transmit RS485 data; L: Receive RS485 data*/
-	system("echo 77 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio77/direction");
-	system("echo 0 > /sys/class/gpio/gpio77/value");
-	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]InitGPIO: Initial GPIO OK");
-	#endif	
-
-}
-
-int LoadSysConfigAndInfo(struct SysConfigData *ptr)
-{
-	int fd,wrd;
-	struct SysConfigData *buf;
-	unsigned char *PtrBuf;
-	unsigned int ChkSum,ChkSumOrg;
-	
-	if((buf=malloc(sizeof(struct SysConfigData)))==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo:malloc buffer NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	memset(buf, 0, sizeof(struct SysConfigData));
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		free(buf);
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo:open mtdblock10 NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}
-    	wrd=read(fd, buf,sizeof(struct SysConfigData));
-	close(fd);
-	if(wrd!=(sizeof(struct SysConfigData)))
-	{
-		free(buf);
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo: read SysConfigData data NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	PtrBuf=(unsigned char *)buf;
-	ChkSum=0;
-	for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-	{
-		ChkSum+=PtrBuf[wrd];
-	}
-	ChkSumOrg=buf->Checksum;
-	
-	if(ChkSum!=ChkSumOrg)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo: Primary SysConfigData checksum NG, read backup");
-		#endif	
-		fd = open("/dev/mtdblock11", O_RDWR);
-		if (fd < 0) 
-		{
-			free(buf);
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: open mtdblock11 (backup) NG,rebooting..");
-			#endif	
-			if(ShmStatusCodeData!=NULL)
-			{
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-			}	
-			sleep(5);
-			system("reboot -f");
-			sleep(5);
-			system("reboot -f");
-	    	}
-	    	memset(buf, 0, sizeof(struct SysConfigData));
-   		wrd=read(fd, buf,sizeof(struct SysConfigData));
-    		close(fd);
-		if(wrd!=sizeof(struct SysConfigData))
-		{
-			free(buf);
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: read backup SysConfigData data NG,rebooting..");
-			#endif	
-			if(ShmStatusCodeData!=NULL)
-			{
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-			}	
-			sleep(5);
-			system("reboot -f");
-			sleep(5);
-			system("reboot -f");
-		}	
-		PtrBuf=(unsigned char *)buf;
-		ChkSum=0;
-		for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-		{
-			ChkSum+=PtrBuf[wrd];
-		}
-		ChkSumOrg=buf->Checksum;
-		if(ChkSum!=ChkSumOrg)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: backup SysConfigData checksum NG, read Factory default");
-			#endif	
-			fd = open("/dev/mtdblock12", O_RDWR);
-			if (fd < 0) 
-			{
-				free(buf);
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: open mtdblock12 (Factory default) NG,rebooting..");
-				#endif	
-				if(ShmStatusCodeData!=NULL)
-				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-				}	
-				sleep(5);
-				system("reboot -f");
-				sleep(5);
-				system("reboot -f");
-	    		}
-	    		memset(buf, 0, sizeof(struct SysConfigData));
-   			wrd=read(fd, buf,sizeof(struct SysConfigData));
-    			close(fd);
-			if(wrd!=sizeof(struct SysConfigData))
-			{
-				free(buf);
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: read factory default  SysConfigData data NG,rebooting..");
-				#endif	
-				if(ShmStatusCodeData!=NULL)
-				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-				}	
-				sleep(5);
-				system("reboot -f");
-				sleep(5);
-				system("reboot -f");
-			}	
-			PtrBuf=(unsigned char *)buf;
-			ChkSum=0;
-			for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-			{
-				ChkSum+=PtrBuf[wrd];
-			}
-			ChkSumOrg=buf->Checksum;
-			if(ChkSum!=ChkSumOrg)
-			{
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: factory default  SysConfigData checksum NG, restore factory default");
-				#endif	
-				goto DefaultShm;
-			}	
-		}	
-	}	
-	//load OK
-	memcpy((struct SysConfigData *)ptr,(struct SysConfigData *)buf,sizeof(struct SysConfigData));	
-	free(buf);
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]LoadSysConfigAndInfo: Load SysConfigData OK");
-	#endif	
-	return 1;
-    
-DefaultShm:
-	system("cd /root;./FactoryConfig");
-	system("sync");
-	sleep(5);
-	system("reboot -f");
-	sleep(5);
-	system("reboot -f");
-}
-
-void InitEthernet()
-{
-	char tmpbuf[256];
-	unsigned int address;
-	
-	//Init Eth0 for internet 
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up",
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
-	system(tmpbuf);
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"route add default gw %s eth0 ",
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
-    	system(tmpbuf);		
-    	
-    	//Init Eth1 for administrator tool 
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"/sbin/ifconfig eth1 %s netmask %s up",
-	ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,
-	ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
-	system(tmpbuf);
-    	
-    	//Run DHCP client if enabled
-	system("killall udhcpc");
-	system("rm -rf /etc/resolv.conf");	
-	system("echo nameserver 8.8.8.8 > /etc/resolv.conf");		//Google DNS server
-	system("echo nameserver 180.76.76.76 > /etc/resolv.conf");	//Baidu DNS server 
-	if(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0)
-		system("/sbin/udhcpc -i eth0 -s /root/simple.script > /dev/null &");	
-		
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]InitEthernet: Initial Ethernet OK");
-	#endif		
-}	
-
-int Initialization()
-{
-	InitGPIO();
-	LoadSysConfigAndInfo(&ShmSysConfigAndInfo->SysConfig);
-	InitEthernet();
-	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]Initialization: Initialization OK");
-	#endif		
-}
-
-int SpawnTask()
-{
-	system("/root/EventLogging &");
-	system("/root/LcmControl &");
-	system("/root/InternalComm &");
-	system("/root/PrimaryComm &");
-	system("/root/EvComm &");
-	system("/root/OcppBackend &");
-	/*
-	if 4G model 
-		system("/root/4gModem &");
-	else if WiFi model 
-		system("/root/WiFiModem &");
-	*/
-	
-}
-
-
-int StoreUsrConfigData(struct SysConfigData *UsrData)
-{
-	int fd,wrd;
-	unsigned int i,Chk;
-	unsigned char *ptr; 
-	
-	Chk=0;
-	ptr=(unsigned char *)UsrData;
-	for(i=0;i<sizeof(struct SysConfigData)-4;i++)
-	{
-		Chk+=*(ptr+i);
-	}
-	UsrData->Checksum=Chk;
-	
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock10 NG");
-		#endif		
-		return 0;
-	}
-   	wrd=write(fd, UsrData, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock10 NG");
-		#endif	
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock11", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock11(backup) NG");
-		#endif	
-		return 0;
-    	}
-    	wrd=write(fd, UsrData, sizeof(struct SysConfigData));   
-    	close(fd);
-   	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock11(backup) NG");
-		#endif	
-		return 0;
-	}	
-	return 1;
-}
-
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/	
-
-int main(int argc,char *argv[])
-{
-	int Rtn=0;
-	unsigned int StartTime;	
-	struct timeb StartChargingTime,CurrentChargingTime,ChargingLoopTime;
-	float ChargingPower,ChargingEnergy;
-	
-	//Create all share memory
-	if(CreatShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]main:CreatShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	
-	//CSU Initialization 
-	Initialization();
-	
-	//task spawn
-	//SpawnTask();
-
-	/**************************************************************/
-	/************** main Loop********************************/
-	/*****************************************************************/
-	
-	while(1)
-	{
-		
-	}//main while
-}

BIN
EVSE/Projects/AH-Luxury/Images/MLO


BIN
EVSE/Projects/AH-Luxury/Images/am335x-evm.dtb


BIN
EVSE/Projects/AH-Luxury/Images/ramdisk.gz


BIN
EVSE/Projects/AH-Luxury/Images/u-boot.img


BIN
EVSE/Projects/AH-Luxury/Images/zImage


BIN
EVSE/Projects/DS60-210/Apps/4gModem


+ 0 - 467
EVSE/Projects/DS60-210/Apps/4gModem.c

@@ -1,467 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <netinet/in.h>
-#include <unistd.h>
-#include "define.h"
-
-//#define debug		
-#define CheckModemInterval		30	//sec
-#define CheckSimInterval			10 	//sec
-#define CheckConnectionInterval		5 	//sec
-#define DisconnInterval				60 	//sec
-
-
-
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct FanModuleData			*ShmFanModuleData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	
-    	return 1;
-}
-
-
-int Check4GModem()
-{
-	//return 0: No 4G modem equipped
-	//return 1: Qutel 4G modem equipped
-	//return 2: ublox 4G modem equipped
-	
-	int Rtn1,Rtn2;
-	
-	//check Qutel 4G modem
-	Rtn1=Rtn2=-1;
-	Rtn1=access("/dev/ttyUSB0",R_OK);
-	if(Rtn1==0)
-	{
-		Rtn2=access("/dev/ttyUSB2",R_OK);
-		if(Rtn2==0)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[4gModem]Check4GModem: Qutel 4G modem be found");
-			#endif	
-			return 1;
-		}
-	}	
-	//check ublox 4G modem
-	Rtn1=Rtn2=-1;
-	Rtn1=access("/dev/ttyACM0",R_OK);
-	if(Rtn1==0)
-	{
-		Rtn2=access("/dev/ttyACM2",R_OK);
-		if(Rtn2==0)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[4gModem]Check4GModem: ublox 4G modem be found");
-			#endif	
-			return 2;
-		}
-	}	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[4gModem]Check4GModem: No 4G modem be found");
-	#endif	
-	return 0;	
-}
-
-int InitComPort(unsigned char ModemModel)
-{
-	int UsbFd;
-	struct termios tios;
-	
-	if(ModemModel==1)	//Qutel 4G modem equipped
-		UsbFd = open("/dev/ttyUSB2", O_RDWR|O_NOCTTY);
-	else if(ModemModel==2)	//ublox 4G modem equipped
-		UsbFd = open("/dev/ttyACM2", O_RDWR|O_NOCTTY);
-	else
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitComPort: Unknow ModemModel ");
-		#endif		
-		return -1;
-	}	
-	
-	if(UsbFd<0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitComPort:  UsbFd open failed");
-		#endif	
-		return -1;
-	}	
-	ioctl (UsbFd, TCGETS, &tios);
-	tios.c_cflag = B115200 | CS8 | CLOCAL | CREAD;
-	tios.c_lflag = 0;
-	tios.c_iflag = 0;
-	tios.c_oflag = 0;
-  	tios.c_cc[VMIN]=0;   
-	tios.c_cc[VTIME]=100; 
-	tios.c_lflag=0;  
-	tcflush(UsbFd, TCIFLUSH);
-	ioctl (UsbFd, TCSETS, &tios);
-	return UsbFd;
-	
-}
-
-void GetModelName(int Fd, unsigned char *ModelName)
-{
-	//AT command processing
-}
-
-void GetModelVersion(int Fd, unsigned char *ModelVersion)
-{
-	//AT command processing
-}
-
-void GetModelImei(int Fd, unsigned char *ModelImei)
-{
-	//AT command processing
-}
-
-void GetSimImsi(int Fd, unsigned char *SimImsi)
-{
-	//AT command processing
-}
-
-unsigned char GetModemMode(int Fd)
-{
-	int Mode;
-	//AT command processing
-	return Mode;
-}
-
-int GetSignalRssi(int Fd)
-{
-	int RssiValue;
-	//AT command processing
-	return RssiValue;
-}
-
-int GetPPP0Info(unsigned char *IPaddress)
-{
-    	int fd,rd=0;
-	unsigned int address;
-	char buf[128],addr[32],*sptr,*eptr;
-	
-
-    	system("ifconfig ppp0 | grep \"inet addr:\" > /mnt/GetPPP0Info");
-	fd = open("/mnt/GetPPP0Info", O_RDONLY);
-    	if(fd<0)
-   	{
-    		system("rm -f /mnt/GetPPP0Info");
-	        return 0;
-    	}
-    
-    	memset(addr,0,sizeof(addr));
-    	memset(buf,0,sizeof(buf));
-    	rd=read(fd,buf,sizeof(buf));	
-    	if(rd<=0)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-   	}
-    	close(fd);
-    	if((sptr=strstr(buf,"inet addr:"))==NULL)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-    	}
-    	sptr+=strlen("inet addr:");
-    	if((eptr=strstr(buf,"  P-t-P:"))==NULL)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-    	}
-    	memset(IPaddress,0,strlen(IPaddress));
-    	strncpy(IPaddress,sptr,eptr-sptr);   
-    	#ifdef SystemLogMessage	
-	{
-		unsigned char Buffer[128];
-		memset(Buffer,0,sizeof(Buffer));
-		sprintf(Buffer,"[4gModem]GetPPP0Info: 4G IP Address = %s",IPaddress);
-		StoreLogMsg(Buffer);
-	}
-	#endif		
-    	return 1;
-}
-int  Load4gConfiguration()
-{
-	unsigned char CopyTmp[128];
-	
-	if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn)<=0)
-		return 0;
-	system("cat /dev/null > /root/ppp/auto-apn.conf");
-	system("chmod 777 /root/ppp/auto-apn.conf");  
-	system("cat /dev/null > /etc/ppp/options"); 
-	system("chmod 777 /etc/ppp/options"); 
-	system("cat /dev/null > /etc/ppp/pap-secrets"); 
-	system("chmod 777 /etc/ppp/pap-secrets"); 
-	system("cat /dev/null > /etc/ppp/chap-secrets"); 
-	system("chmod 777 /etc/ppp/chap-secrets"); 
-	memset(CopyTmp,0,sizeof(CopyTmp));
-	sprintf(CopyTmp,"echo \"APN=\"%s\"\" > /root/ppp/auto-apn.conf",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
-	system(CopyTmp);
-	system("echo \"ACCOUNT=\" >> /root/ppp/auto-apn.conf");
-	system("echo \"PASSWORD=\" >> /root/ppp/auto-apn.conf");
-	
-	if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId)>0)
-	{	
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"name %s \" > /etc/ppp/options",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
-		system(CopyTmp);
-		
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"%s * %s \" > /etc/ppp/pap-secrets",
-		ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,
-		((strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd)>0)?ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : " "));
-		system(CopyTmp);
-
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"%s * %s \" > /etc/ppp/chap-secrets",
-		ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,
-		((strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd)>0)?ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : " "));
-		system(CopyTmp);
-	}	
-	return 1;
-}
-void ResetModem()
-{
-	//power cycle modem by GPIO
-}
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	unsigned char ModuleModel=0;//0: None, 1: Qutel, 2: ublox SARA-U201
-	int UsbFd=-1;
-	unsigned int StartTime,EndTime,Tmp; 
-	unsigned char TmpIpAddr[16];
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	ResetModem();
-	
-ReCheckModem:    
-	//ResetModem();
-	UsbFd=-1;
-	ModuleModel=0;
-	Load4gConfiguration();
-
-	while(1)
-	{
-		ModuleModel=Check4GModem();
-		if(ModuleModel<=0)
-		{
-			sleep(CheckModemInterval);
-			continue;
-		}	
-		if(UsbFd>0)
-			close(UsbFd);
-		UsbFd=InitComPort(ModuleModel);
-		if(UsbFd<0)
-		{
-			sleep(CheckModemInterval);
-			continue;
-		}
-		/**** Record some modem information and dial up if SIM card ready ****/
-		memset(&ShmSysConfigAndInfo->SysConfig.TelecomInterface,0,sizeof(struct TeleConfigData));
-		while(1)
-		{
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModelName)<=0)
-				GetModelName(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModelName);
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSoftwareVer)<=0)
-				GetModelVersion(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSoftwareVer);	
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei)<=0)
-				GetModelImei(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);		
-			GetSimImsi(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);		
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi)<=0)
-			{	
-				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
-				sleep(CheckSimInterval);	
-				if(Check4GModem()<=0)
-					goto ReCheckModem;
-			}
-			else
-			{
-				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=1;
-				if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn)<=0)
-				{
-					sleep(DisconnInterval);
-					goto ReCheckModem;		
-				}
-				system("killall 4GDetection");	
-				sleep(2);
-				if(ModuleModel==1)
-					system("/root/ppp/4GDetection /dev/ttyUSB0 &");	
-				else if(ModuleModel==2)
-					system("/root/ppp/4GDetection /dev/ttyACM0 &");
-				break;	
-			}			
-		}
-		/***** Periodically check RSSI and connection*****/
-		StartTime=time((time_t*)NULL);
-		EndTime=time((time_t*)NULL);
-		while(1)
-		{
-			if((time((time_t*)NULL)-StartTime)>=CheckConnectionInterval)
-			{	
-				//check IP address 
-				memset(TmpIpAddr,0,sizeof(TmpIpAddr));
-				if(GetPPP0Info(TmpIpAddr)<=0)
-				{
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn=0;
-					if((time((time_t*)NULL)-EndTime)>=DisconnInterval)
-						goto ReCheckModem; 
-				}	
-				else
-				{
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn=1;
-					if(strstr(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr)==NULL)
-					{
-						#ifdef SystemLogMessage	
-						{
-							unsigned char Buffer[128];
-							memset(Buffer,0,sizeof(Buffer));
-							sprintf(Buffer,"[4gModem]main:  4G IP Address changed from %s to %s",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr);
-							StoreLogMsg(Buffer);
-						}
-						#endif		
-						memset(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,0,sizeof(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress));
-						strcpy(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr);
-						system("route del default");
-						system("route add default dev ppp0");
-					}
-					EndTime=time((time_t*)NULL);
-				}	
-				//check RSSI
-				Tmp=GetSignalRssi(UsbFd);
-				if(abs(Tmp-ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi)>=5)
-				{
-					#ifdef SystemLogMessage	
-					{
-						unsigned char Buffer[128];
-						memset(Buffer,0,sizeof(Buffer));
-						sprintf(Buffer,"[4gModem]main: RSSI changed from %d to %d",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi,Tmp);
-						StoreLogMsg(Buffer);
-					}
-					#endif		
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=Tmp;
-				}	
-				//check Mode
-				Tmp=GetModemMode(UsbFd);
-				if(Tmp!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode)
-				{
-					#ifdef SystemLogMessage	
-					{
-						unsigned char Buffer[128];
-						memset(Buffer,0,sizeof(Buffer));
-						sprintf(Buffer,"[4gModem]main: Modem mode changed from %d to %d",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode,Tmp);
-						StoreLogMsg(Buffer);
-					}
-					#endif
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=Tmp;
-				}	
-				StartTime=time((time_t*)NULL);
-			}
-		}
-	}//main while loop
-}
-
-

+ 0 - 218
EVSE/Projects/DS60-210/Apps/EventLogging.c

@@ -1,218 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int StoreEventLogMsg(unsigned char *EventCodeString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/EventLog/[%04d.%02d]EventLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			EventCodeString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",Buf);
-	#endif
-}		
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-    	return 1;
-}
-
-int main(int argc,char *argv[])
-{
-	int ByteCount,BitCount;
-	unsigned char tmp, EventCodeTmp[7];
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	
-	while(1)
-	{
-		//check Fault Status
-		for(ByteCount=0;ByteCount<4;ByteCount++)
-		{
-			if(ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[ByteCount] != ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,FaultStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-		//check Alarm Status
-		for(ByteCount=0;ByteCount<8;ByteCount++)
-		{
-			if(ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount] != ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,AlarmStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-		//check Info Status
-		for(ByteCount=0;ByteCount<8;ByteCount++)
-		{
-			if(ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[ByteCount] != ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,InfoStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-	}//main while loop 
-}
-
-

+ 0 - 109
EVSE/Projects/DS60-210/Apps/FWMaker.c

@@ -1,109 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <net/if.h> /*struct ifreq*/
-#include <linux/sockios.h> /*SIOCGIFINDEX*/
-#include <linux/socket.h>
-#include <errno.h> 
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <fcntl.h>
-#include <sys/mman.h>
-
-//./FWMaker 172.16.24.126
-int main(int argc,char *argv[])
-{
-	unsigned char *MemBuf,*MemBuf2,buf[64];
-    int fd,rd=0,wrd=0,tmp=0,rd2=0;
-    unsigned int CheckSum=0;
-
-
-
-	memset(buf,0,64);
-	sprintf(buf,"tftp -gr uImage -l /mnt/uImage %s",argv[1]);   
-	system(buf);
-	memset(buf,0,64);
-	sprintf(buf,"tftp -gr rootfs_nor.img -l /mnt/rootfs_nor.img %s",argv[1]);   
-	system(buf);
-
-	if((MemBuf=malloc(0x100000D))==NULL)
-	{
-		printf("Allocate MemBuf memory error\n");
-		return 0;
-	}	
-	memset(MemBuf, 0xff, 0x100000D);
-	fd = open("/mnt/uImage", O_RDWR);
-	if (fd > 0) 
-	{
-	    if((rd=read(fd,MemBuf,0x100000D))<=0)
-	    {
-			printf("/mnt/uImage read Error\n");
-			free(MemBuf);
-			close(fd);
-			return 0;
-	    }   
-	    close(fd);
-	    for(tmp=0;tmp<rd;tmp++)
-	    	CheckSum+=MemBuf[tmp];
-	    strncpy(MemBuf+rd,"DELTADCOK",9);	
-	   *(MemBuf+rd+9)=CheckSum>>24;
-	    *(MemBuf+rd+10)=CheckSum>>16;
-	    *(MemBuf+rd+11)=CheckSum>>8;
-	     *(MemBuf+rd+12)=CheckSum;
-	   // memcpy(MemBuf+rd+9,&CheckSum,4);	
-	    fd = open("/mnt/DcoKImage", O_CREAT|O_RDWR);
-	    wrd=write(fd, MemBuf, rd+13);
-	    if(wrd!=(rd+13))
-	    	printf("write error wrd=0x%x, rd=0x%x\n",wrd,rd+13);
-	   else 
-	   		printf("/mnt/DcoKImage OK\n"); 	
-	    
-	}
-	else	
-	{	
-		free(MemBuf);
-		printf("/mnt/uImage open Error\n");
-		return 0;
-	}
-	
-	
-	memset(MemBuf, 0xff, 0x100000D);
-	CheckSum=rd=0;
-	fd = open("/mnt/rootfs_nor.img", O_RDWR);
-	if (fd > 0) 
-	{
-	    if((rd=read(fd,MemBuf,0x100000D))<=0)
-	    {
-			printf("/mnt/rootfs_nor.img read Error\n");
-			free(MemBuf);
-			close(fd);
-			return 0;
-	    }   
-	    close(fd);
-	    for(tmp=0;tmp<rd;tmp++)
-	    	CheckSum+=MemBuf[tmp];
-	    strncpy(MemBuf+rd,"DELTADCOF",9);	
-	    *(MemBuf+rd+9)=CheckSum>>24;
-	    *(MemBuf+rd+10)=CheckSum>>16;
-	    *(MemBuf+rd+11)=CheckSum>>8;
-	     *(MemBuf+rd+12)=CheckSum;
-	    //memcpy(MemBuf+rd+9,&CheckSum,4);	
-	    fd = open("/mnt/DcoFImage", O_CREAT|O_RDWR);
-	    wrd=write(fd, MemBuf, rd+13);
-	    if(wrd!=(rd+13))
-	    	printf("write error wrd=0x%x, rd=0x%x\n",wrd,rd+13);
-	   else 
-	   		printf("/mnt/DcoFImage OK\n"); 	
-	    
-	}
-	else	
-	{	
-		free(MemBuf);
-		printf("/mnt/rootfs_nor.img open Error\n");
-		return 0;
-	}
-	
-}

BIN
EVSE/Projects/DS60-210/Apps/FactoryConfig


+ 0 - 173
EVSE/Projects/DS60-210/Apps/FactoryConfig.c

@@ -1,173 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-
-/**************************************************************************************/
-/************This task will create Factory default confgiuration file *****************/
- /***********and store it into mtdblock 10,11,12                               ****************/
-/**************************************************************************************/
-
-int main(int argc,char *argv[])
-{
-	struct SysConfigData 	SysConfig;
-	unsigned int i,Chk;
-	unsigned char *ptr; 
-	int fd,wrd;
-	
-	ptr=malloc(sizeof(struct SysConfigData));
-	if(ptr==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: malloc for SysConfigData NG");
-		#endif			
-		return 0;
-	}	
-	memset(ptr,0,sizeof(struct SysConfigData));
-	memset(&SysConfig,0,sizeof(struct SysConfigData));
-	
-	//Set default configuration
-	strcpy(SysConfig.Eth0Interface.EthIpAddress,"192.168.0.10");
-	strcpy(SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
-	strcpy(SysConfig.Eth0Interface.EthGatewayAddress,"192.168.0.254");
-	strcpy(SysConfig.Eth1Interface.EthIpAddress,"192.168.1.10");
-	strcpy(SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
-	strcpy(SysConfig.Eth1Interface.EthGatewayAddress,"192.168.1.254");
-	SysConfig.BackendConnTimeout=300; //300 seconds
-	
-	//copy default configuration to pointer
-	memcpy(ptr,&SysConfig,sizeof(struct SysConfigData));
-	
-	//calculate CRC
-	Chk=0;
-	for(i=0;i<(sizeof(struct SysConfigData)-4);i++)
-	{
-		Chk+=*(ptr+i);
-	}
-	SysConfig.Checksum=Chk;
-	
-	fd = open("/mnt/FactoryDefaultConfig.bin", O_RDWR|O_CREAT);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /mnt/FactoryDefaultConfig.bin NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}   
-
-	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));
-	close(fd);
-	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /mnt/FactoryDefaultConfig.bin NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}
-	
-	fd = open("/dev/mtdblock12", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock12 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock12 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock11", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock11 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock11 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock10 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock10 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	free(ptr);
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[FactoryConfig]main: FactoryConfig OK");
-	#endif	
-}

+ 0 - 200
EVSE/Projects/DS60-210/Apps/InternalComm.c

@@ -1,200 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct FanModuleData			*ShmFanModuleData;
-struct RelayModuleData			*ShmRelayModuleData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-   	//creat ShmFanModuleData
-   	 if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmFanModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmFanModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
-   	 //creat ShmRelayModuleData
-   	 if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmRelayModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmRelayModuleData NG");
-		#endif		
-		return 0;
-   	 }
-    	return 1;
-}
-
-int InitComPort()
-{
-	int fd;
-	struct termios tios;
-	
-	fd = open("/dev/ttyS4", O_RDWR);
-	if(fd<=0)
-	{ 
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitComPort: open /dev/ttyS4 NG");
-		#endif	
-		return -1;
-	}
-	ioctl (fd, TCGETS, &tios);
-	tios.c_cflag = B115200| CS8 | CLOCAL | CREAD; 
-	tios.c_lflag = 0;
-	tios.c_iflag = 0; 
-	tios.c_oflag = 0;
-	tios.c_cc[VMIN]=0;    
-	tios.c_cc[VTIME]=1000; 
-	tios.c_lflag=0;  
-	tcflush(fd, TCIFLUSH);
-	ioctl (fd, TCSETS, &tios);
-	return fd;
-}
-
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	int Uart4Fd;
-
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	Uart4Fd=InitComPort();
-	if(Uart4Fd<0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]main:InitComPort NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	
-	while(1)
-	{
-		//processing
-	}//main while loop
-}
-
-

+ 0 - 70
EVSE/Projects/DS60-210/Apps/Makefile

@@ -1,70 +0,0 @@
--include ../../../../Rules.make
-export PATH=/bin:/sbin:/usr/bin:$(SDK_PATH_TARGET)/usr/bin:$PATH
-
-#define library variable
-Internal485ProtocolLib = -L ../../../Modularization/Internal485Protocol -lInternal485Protocol
-PsuCommProtocolLib = -L ../../../Modularization/PsuCommProtocol -lPsuCommProtocol
-
-all: CopyFile apps
-#apps: MainTask PsuCommTask InternalCommTask 4gModemTask FactoryConfigTask EvCommTask UpdateRootfsTask LcmControlTask FWMakerTask PrimaryCommTask OcppBackendTask EventLoggingTask
-apps: MainTask FactoryConfigTask
-
-MainTask:
-	rm -f main; $(CC) main.c -lm -o main
-	cp -f main ../Images/root
-	
-PsuCommTask:
-	rm -f PsuComm; $(CC) PsuComm.c ${PsuCommProtocolLib} -lm -o PsuComm
-	cp -f PsuComm ../Images/root	
-	
-InternalCommTask:
-	rm -f InternalComm; $(CC) InternalComm.c ${Internal485ProtocolLib} -lm -o InternalComm	
-	cp -f InternalComm ../Images/root
-
-WiFiModemTask:
-	rm -f WiFiModem; $(CC) WiFiModem.c -o WiFiModem	
-	cp -f WiFiModem ../Images/root
-		
-4gModemTask:
-	rm -f 4gModem; $(CC) 4gModem.c -o 4gModem		
-	cp -f 4gModem ../Images/root
-	
-FactoryConfigTask:
-	rm -f FactoryConfig; $(CC) FactoryConfig.c -o FactoryConfig	
-	cp -f FactoryConfig ../Images/root		
-	
-EvCommTask:
-	rm -f EvComm; $(CC) EvComm.c -lm -o EvComm	
-	cp -f EvComm ../Images/root
-	
-UpdateRootfsTask:
-	rm -f UpdateRootfs; $(CC) UpdateRootfs.c -o UpdateRootfs		 
-	cp -f UpdateRootfs ../Images/root	
-
-LcmControlTask:
-	rm -f LcmControl; $(CC) LcmControl.c -o LcmControl
-	cp -f LcmControl ../Images/root			
-
-PrimaryCommTask:
-	rm -f PrimaryComm; $(CC) PrimaryComm.c -o PrimaryComm
-	cp -f PrimaryComm ../Images/root	
-
-Ocpp16Task:
-	rm -f Ocpp16; $(CC) Ocpp16.c -I ../../../GPL/libwebsockets-v2.1-stable/release/include -L ../../../GPL/libwebsockets-v2.1-stable/release/lib -lwebsockets -o Ocpp16
-	cp -f Ocpp16 ../Images/root
-	
-EventLoggingTask:
-	rm -f EventLogging; $(CC) EventLogging.c -o EventLogging	
-	cp -f EventLogging ../Images/root	
-		
-FWMakerTask:
-	rm -f FWMaker; $(CC) FWMaker.c -o FWMaker	
-	cp -f FWMaker ../Images/root
-	
-CopyFile: 
-	rm -rfv ../Images/root
-	mkdir -p ../Images/root
-
-
-
-	

+ 0 - 333
EVSE/Projects/DS60-210/Apps/Ocpp16.c

@@ -1,333 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <libwebsockets.h>
-#include <lws_config.h>
-#include "define.h"
-
-#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct OCPP16Data 			*ShmOCPP16Data;
-
-
-struct lws *wsi;
-struct lws_context *context;
-
-unsigned char *SendBuffer;
-int SendBufLen=(1024*3);
-int ConnectionEstablished=0;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmOCPP16Data
-   	 if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmOCPP16Data NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmOCPP16Data NG");
-		#endif		
-		return 0;
-   	 }
-   	memset(ShmOCPP16Data,0,sizeof(struct PsuData));
-    	return 1;
-}
-
-
-int SendData(struct lws *wsi) 
-{
-    int n;
-    int len;
-    unsigned char *out = NULL;
-
-    len = strlen(SendBuffer);
-    out = (char *)malloc(sizeof(char)*(LWS_SEND_BUFFER_PRE_PADDING + len + LWS_SEND_BUFFER_POST_PADDING));
-    memcpy (out + LWS_SEND_BUFFER_PRE_PADDING, SendBuffer, len );
-   
-    n = lws_write(wsi, out + LWS_SEND_BUFFER_PRE_PADDING, len, LWS_WRITE_TEXT);
-   
-    free(out);
-    return n;
-}
-
-static int OCPP16Callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len)
-{	
-
-	#ifdef Debug
-	printf("OCPP16Callback:reason=%d\n",reason);
-	#endif
-	switch (reason) 
-	{
-		case LWS_CALLBACK_CLIENT_ESTABLISHED://3
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLIENT_ESTABLISHED");
-			#endif		
-			//connected
-			ConnectionEstablished=1;
-			break;
-		case LWS_CALLBACK_CLIENT_CONNECTION_ERROR://1
-			#ifdef Debug
-			printf("OCPP16Callback:LWS_CALLBACK_CLIENT_CONNECTION_ERROR:%s\n",in);
-			#endif
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLIENT_CONNECTION_ERROR");
-			#endif		
-			//disconnected
-			ConnectionEstablished=0;
-			break;
-		case LWS_CALLBACK_CLOSED://4
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLOSED");
-			#endif
-			//disconnected
-			ConnectionEstablished=0;
-			break;
-		case LWS_CALLBACK_CLIENT_WRITEABLE://10
-			//if(need to send message and its relevant data already store into SendBuffer)
-				SendData(wsi);
-			break;
-		case LWS_CALLBACK_CLIENT_RECEIVE://8
-			((char *)in)[len] = '\0';
-			#ifdef Debug
-			printf("OCPP16Callback:LWS_CALLBACK_CLIENT_RECEIVE : rx %d '%s'\n", (int)len, (char *)in);
-			#endif
-			//parsing received message and do something
-			break;
-		default:
-			break;
-	}
-
-	return 0;
-}
-
-static struct lws_protocols protocols[] = {
-
-	{
-		"ocpp1.6",		
-		OCPP16Callback,
-		10240,	
-		10240,
-	},
-	{
-		"ocpp1.6",		
-		OCPP16Callback,
-		10240,	
-		10240,
-	},
-	{
-		NULL, NULL, 0		/* End of list */
-	}
-};
-
-int ConnectWsServer()
-{	
-	struct lws_context_creation_info ContextInfo;
-	struct lws_client_connect_info ConnInfo;
-	int use_ssl=0;
-	
-	if(context!=NULL)
-		lws_context_destroy(context);
-	memset(&ContextInfo, 0, sizeof(struct lws_context_creation_info));
-	ContextInfo.port=CONTEXT_PORT_NO_LISTEN;
-	ContextInfo.iface=NULL;
-	ContextInfo.ssl_private_key_password=NULL; 
-	ContextInfo.ssl_cert_filepath=NULL; 
-	ContextInfo.ssl_private_key_filepath=NULL; 
-	ContextInfo.ssl_ca_filepath="/root/cacert.pem"; 
-	ContextInfo.ssl_cipher_list=NULL; //use default one
-	ContextInfo.gid=-1;
-	ContextInfo.uid=-1;
-	//if(security connection)
-	//	ContextInfo.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
-	ContextInfo.protocols=protocols;
-	ContextInfo.timeout_secs= 30;
-	//if(ping pong enabled)
-		//ContextInfo.ws_ping_pong_interval= 15;//0 for none, else interval in seconds 
-	ContextInfo.ws_ping_pong_interval= 0;	
-	context = lws_create_context(&ContextInfo);
-	if (context == NULL) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]ConnectWsServer: lws_create_context NG");
-		#endif	
-		return 0;
-	}
-	memset(&ConnInfo,0,sizeof(struct lws_client_connect_info));
-	ConnInfo.context = context;
-
-	// fill up below information
-	//ConnInfo.address=ServerIpAddress;
-	//ConnInfo.port = ServerSrcPort;
-	//ConnInfo.path=ServerPath;
-	//ConnInfo.host=ServerHost;
-	//ConnInfo.origin=ServerOrigin;
-
-	/* ws://192.168.1.1:9091/greenlots/ocpp*/
-	ConnInfo.address = "192.168.1.1";
-	ConnInfo.port = 9091;
-	ConnInfo.path="/ocpp/T123456789";
-	ConnInfo.host = "192.168.1.1:9091";
-	ConnInfo.origin = "192.168.1.1:9091";	
-
-	use_ssl = LCCSCF_USE_SSL | LCCSCF_ALLOW_SELFSIGNED | LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
-	//if(security connection)
-	//	ConnInfo.ssl_connection = use_ssl;
-	//else
-		ConnInfo.ssl_connection=0;
-
-	ConnInfo.protocol = protocols[1].name;
-	ConnInfo.ietf_version_or_minus_one=-1;
-	wsi=lws_client_connect_via_info(&ConnInfo);						 
-	if (!wsi) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]ConnectWsServer: lws_client_connect_via_info NG");
-		#endif	
-		return 0;
-	}
-	return 1;
-}
-
-int main(int argc,char *argv[])
-{
-	unsigned int StartTime=0;
-	/**************** Initialization **********/		
-	/*if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}*/	
-  	if((SendBuffer=malloc(SendBufLen))==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]main: malloc(SendBufLen) NG");
-		#endif	
-		sleep(5);
-		return 0;	
-	}	
-	while(ConnectionEstablished==0)
-	{
-		if((time((time_t*)NULL)-StartTime)>=60)
-		{
-			#ifdef debug
-			printf("[OCPP16:]main:Execute ConnectWsServer1\n");
-			#endif
-			ConnectWsServer();
-			StartTime=time((time_t*)NULL);
-		}	
-		lws_service(context, 10000);//timeout_ms	
-	}
-	memset(SendBuffer,0,SendBufLen);
-	sprintf(SendBuffer,"[2,\"%s\",\"%s\",{\"chargePointVendor\":\"%s\",\"chargePointModel\":\"%s\",\"chargePointSerialNumber\":\"%s\",\"chargeBoxSerialNumber\":\"%s\",\"firmwareVersion\":\"%s\",\"imsi\":\"%s\"}]",
-					"11112222",
-					"BootNotification",
-					"CpVendor",
-					"CpModel",
-					"CpSN",
-					"CbSN",
-					"CpFwVersion",
-					"CpImsi");
-	lws_callback_on_writable(wsi);
-	while(1)
-	{
-		//prcessing
-		lws_service(context, 500);//500 timeout_ms 	
-	};
-	
-
-	free(SendBuffer);
-}

+ 0 - 248
EVSE/Projects/DS60-210/Apps/PsuComm.c

@@ -1,248 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <net/if.h>
-#include <linux/can.h>
-#include <linux/can/raw.h>
-#include <unistd.h>
-#include "define.h"
-
-//#define Debug
-
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct PsuData 				*ShmPsuData ;
-pid_t						CANReceiverPid;
-int 							CanFd;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-   	 //creat ShmPsuData
-   	 if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmPsuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmPsuData NG");
-		#endif		
-		return 0;
-   	 }
-   	memset(ShmPsuData,0,sizeof(struct PsuData));
-    	return 1;
-}
-
-int InitCanBus()
-{
-	int 					s0,nbytes;
-	struct timeval			tv;
-	struct ifreq 			ifr0;
-	struct sockaddr_can	addr0;
-	
-	system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");				  
-	system("/sbin/ip link set can1 up");
-	
-	s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
-	
-	tv.tv_sec = 0; 
-    	tv.tv_usec = 10000; 
-   	 if (setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct	timeval)) < 0) 
-    	{
-	       	#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVTIMEO NG");
-		#endif		
-    	}
-    	nbytes=40960;
-    	if (setsockopt(s0, SOL_SOCKET,  SO_RCVBUF, &nbytes, sizeof(int)) < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVBUF NG");
-		#endif	
-	}
-    	nbytes=40960;
-    	if (setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0) 
-    	{
-       		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_SNDBUF NG");
-		#endif	
-    	}
-    
-   	strcpy(ifr0.ifr_name, "can1" );
-	ioctl(s0, SIOCGIFINDEX, &ifr0); /* ifr.ifr_ifindex gets filled with that device's index */
-	addr0.can_family = AF_CAN;
-	addr0.can_ifindex = ifr0.ifr_ifindex;
-	bind(s0, (struct sockaddr *)&addr0, sizeof(addr0));
-	return s0;
-}
-
-
-/**************************************************************/
-/************** Receiving Task*******************************/
-/*************************************************************/
-void CANReceiver(int fd)
-{
-	pid_t tmp=0;
-	struct can_frame frame;
-	struct timeb StartTime,EndTime;
-	int nbytes;
-	unsigned char FanspeedGetTime=0;
-	
-	if(CANReceiverPid==0)
-	{
-		tmp=fork();
-		if(tmp>0)
-		{
-			CANReceiverPid=tmp;	
-			{
-				unsigned char buf[64];
-				memset(buf,0,sizeof(buf));
-				sprintf(buf,"renice -20 -p %d",tmp);
-				system(buf);
-			}
-			return;
-		}
-	}
-	
-	while(1)
-	{
-		memset(&frame,0,sizeof(struct can_frame));
-		nbytes = read(fd, &frame, sizeof(struct can_frame));
-		//handle received packet
-	}
-}
-
-/**************************************************************/
-/************** main function***********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	int CanFd;
-	struct can_frame frame;
-
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	CanFd=InitCanBus();
-	CANReceiverPid=0;
-	CANReceiver(CanFd);
-
-	//main loop
-	while(1)
-	{
-		//processing
-	}
-	
-EndProcess:	
-	if(CANReceiverPid>0)
-	{
-		char Buf[32];
-		memset(Buf,0,32);
-		sprintf(Buf,"kill %d",CANReceiverPid);
-		system(Buf);
-	}
-	close(CanFd); 
-	system("/sbin/ip link set can1 down");
-	system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");
-	system("/sbin/ip link set can1 up");
-	system("/sbin/ip link set can1 down");
-	system("killall PsuComm");
-}

+ 0 - 69
EVSE/Projects/DS60-210/Apps/UpdateRootfs.c

@@ -1,69 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include "define.h"
-
-
-int main(int argc,char *argv[])
-{
-	unsigned int MaxLen=25*1024*1024, ImageLen=0;
-	unsigned char *ptr; 
-	int fd,wrd;
-	
-	ptr=malloc(MaxLen);
-	if(ptr==NULL)
-	{
-		printf("UpdateRootfs NG - can not malloc\n");
-		return 0;
-	}	
-	memset(ptr,0xFF,MaxLen);
-	
-	fd = open(argv[1], O_RDONLY);
-	if(fd < 0)
-	{
-		printf("UpdateRootfs NG - can not open rootfs\n");
-		free(ptr);
-		return 0;
-	}
-    	ImageLen=read(fd,ptr,MaxLen);
-	close(fd);	
-	printf("ImageLen=0x%x\n",ImageLen);
-	if(ImageLen<(24*1024*1024))
-	{
-		printf("ImageLen size mismatch\n");
-		free(ptr);
-		return 0;
-	}	
-	fd = open("/dev/mtdblock8", O_RDWR);
-	if (fd < 0) 
-	{
-		printf("UpdateRootfs NG - can not open mtdblock8\n");
-		free(ptr);
-		return 0;
-    	}
-    	wrd=write(fd, ptr, ImageLen);   
-    	close(fd);
-   	if(wrd!=ImageLen)
-	{	
-		printf("UpdateRootfs NG - wrd(0x%x) != ImageLen(0x%x)\n",wrd,ImageLen);
-		free(ptr);
-		return 0;
-	}	
-	free(ptr);
-	printf("UpdateRootfs OK\n");
-}

+ 0 - 2803
EVSE/Projects/DS60-210/Apps/define.h

@@ -1,2803 +0,0 @@
-#ifndef	DEFINE_H_
-#define	DEFINE_H_
-
-/**************************************************************************************/
-/*********************************NAND Flash mapping *****************************/
-/**************************************************************************************/
-/* 
-  sector size	512 KiB
-  Page size       4096 b
-  OOB size        224 b
-  Erase size    	524288 b
--------------------------------------------------------------------------------------------------------------------------------
-Segment 					Physical address 			Size 
--------------------------------------------------------------------------------------------------------------------------------
-MLO						0x00000000-0x0007FFFF		512 KB
-Primary u-boot 			0x00080000-0x0017FFFF		1 MB
-Environment 				0x00180000-0x001FFFFF		512 KB
-Secondary u-boot	 		0x00200000-0x002FFFFF		1 MB
-Primary dtb				0x00300000-0x0037FFFF		512 KB
-Secondary dtb				0x00380000-0x003FFFFF		512 KB
-Primary kernel				0x00400000-0x00DFFFFF		10 MB
-Secondary Kernel 			0x00E00000-0x017FFFFF		10 MB
-Primary root file system		0x01800000-0x029FFFFF		24 MB
-Secondary root file system	0x03000000-0x047FFFFF		24 MB
-Primary user configuration 	0x04800000-0x004DFFFF		6 MB
-Secondary user configuration	0x04E00000-0x0053FFFF		6 MB
-Factory default configuration	0x05400000-0x0059FFFF		6 MB
-Storage					0x05A00000-0x7FFFFFFF		1958 MB
-*/
-
-/**************************************************************************************/
-/*********************************System Limitation**********************************/
-/**************************************************************************************/
-/*Rating outout power and current*/
-#define RATED_POWER		60		//kW
-#define RATED_CURRENT		350		//Amp, it depend on the capacity of charging connector
-
-/*relevant to Quantity */
-#define MAX_PSU_QUANTITY	62		
-#define CHAdeMO_QUANTITY	1
-#define CCS_QUANTITY		1
-#define GB_QUANTITY		1
-
-
-/*SystemLog message*/
-#define SystemLogMessage			//for engineer to do analysis
-
-/**************************************************************************************/
-/**************************share memory key information***************************/
-/**************************************************************************************/
-#define ShmSysConfigAndInfoKey	1001
-#define ShmPsuKey				1002
-#define ShmCHAdeMOCommKey	1003	
-#define ShmCcsCommKey		1004	
-#define ShmStatusCodeKey		1005	
-#define ShmPrimaryMcuKey		1006
-#define ShmFanBdKey			1007
-#define ShmRelayBdKey			1008
-#define ShmOcppModuleKey		1009
-
-/**************************************************************************************/
-/****structure SysConfigData => shall store the data to NAND flash****************/
-/****structure SysInfoData => shall NOT store the data to NAND flash***************/
-/****according to System Configuration and Information Table.xlsx Rev.0.2 *******/
-/**************************************************************************************/
-
-struct EthConfigData 
-{
-	unsigned char		EthDhcpClient;			//0: enable,1: disable
-	unsigned char		EthMacAddress[18];			//default: Null		
-	unsigned char		EthIpAddress[16];			//Eth0 default:192.168.0.10	,Eth1 default:192.168.1.10				
-	unsigned char		EthSubmaskAddress[16];		//Eth0 default:255.255.255.0	,Eth1 default:255.255.255.0			
-	unsigned char		EthGatewayAddress[16];		//Eth0 default:192.168.0.254	,Eth1 default:192.168.1.254	
-};
-
-struct WifiConfigData 
-{
-	unsigned char		WifiMode;				//0: disable, 1: Infrastructure client, 2: Infrastructure server, 3: Ad-Hoc		
-	unsigned char		WifiSsid[256];				//default: Null		
-	unsigned char		WifiPassword[256];			//default: Null
-	int				WifiRssi;					//dbm		
-	unsigned char		WifiDhcpServer;			//0: enable, 1: disable	
-	unsigned char		WifiDhcpClient;			//0: enable, 1: disable		
-	unsigned char		WifiMacAddress[18];		//default: Null		
-	unsigned char		WifiIpAddress[16];			//default:192.168.2.10		
-	unsigned char		WifiSubmaskAddress[16];		//default:255.255.255.0			
-	unsigned char		WifiGatewayAddress[16];	//default:192.168.2.254	
-	unsigned char 		WifiNetworkConn;			//0: disconnected, 1: connected		
-};
-
-struct TeleConfigData 
-{	
-	unsigned char		TelcomModelName[64];		//default: Null		
-	unsigned char		TelcomSoftwareVer[64];		//default: Null		
-	unsigned char		TelcomApn[256];			//default: Null		
-	int				TelcomRssi;				//dbm	
-	unsigned char		TelcomChapPapId[256];		//default: Null		
-	unsigned char		TelcomChapPapPwd[256];	//default: Null		
-	unsigned char		TelcomModemImei[16];		//default: Null		
-	unsigned char		TelcomSimImsi[16];			//default: Null			
-	unsigned char		TelcomSimStatus;			//0: no SIM card is found, 1: valid SIM card, 2: invalid SIM card	
-	unsigned char		TelcomModemMode;		//0: No services, 1: CDMA, 2: GSM/GPRS, 3: WCDMA, 4: GSM/WCDMA, 5: TD_SCDMA mode, 6: Unknow
-	unsigned char		TelcomIpAddress[16];		//default: Null		
-	unsigned char 		TelcomNetworkConn;		//0: disconnected, 1: connected		
-};
-
-struct SysConfigData 
-{
-	/**************System***************/
-	unsigned char			ModelName[64];			//charger model name
-	unsigned char			SerialNumber[64];			//charger system serial number								
-	unsigned char			SystemId[128];				//charger system ID
-	unsigned char			SystemDateTime[32];		//charger system date and time
-	unsigned char			AuthorisationMode;			//0: Phihong RFID tag,  1: OCPP backend,  2: Phihong backend,  3: free mode
-	unsigned char	   		DefaultLanguage;			//
-	unsigned char   		RfidCardNumEndian;		//0: little endian,  1: big endian	
-	unsigned short			AcPlugInTimes;				//0~65535
-	unsigned short			GbPlugInTimes;			//0~65535
-	unsigned short			Ccs1PlugInTime;			//0~65535
-	unsigned short			Ccs2PlugInTimes;			//0~65535
-	unsigned short			ChademoPlugInTimes;		//0~65535
-	/**************Charging***************/
-	unsigned short	   		MaxChargingEnergy;		//0: no limit,	1 ~ 65535	kWh		
-	unsigned short	   		MaxChargingPower;		//0: rating value, 1 ~ RATING_POWER	kW"		
-	unsigned short	   		MaxChargingCurrent;		//0: rating value, 1 ~ RATING_CURRENT	amp"		
-	unsigned short	   		MaxChargingDuration;		//0: no limit,	1 ~ 65535	minutes		
-	unsigned char   		PhaseLossPolicy;			//0: charging,  1: stop charging
-	unsigned char   		LocalWhiteCard[10][32];		//Max. card quantity is 10
-	unsigned char 			UserId[32];				//the user use this ID to trigger charging event, it can be RFID card number, OCPP IdTag, etc.
-	/**************Network***************/
-	unsigned char 			FtpServer[32];				//the ftp server for Phihong server to do data transimission								
-	struct EthConfigData 	Eth0Interface;
-	struct EthConfigData 	Eth1Interface;
-	struct WifiConfigData 	AthInterface;
-	struct TeleConfigData	TelecomInterface;		
-	/**************Backend***************/	
-	unsigned int 			BackendConnTimeout;		//default : 300s
-	unsigned char   		OfflinePolicy;				//0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
-	unsigned short	   		OfflineMaxChargeEnergy;	//0: same as MaxChargingEnergy, 1 ~ 65535 kWh	
-	unsigned short	   		OfflineMaxChargeDuration;	//0: same as MaxChargeDuration, 1 ~ 65535 minutes		
-	unsigned char 			OcppServerURL[512];		//http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"								
-	unsigned char 			ChargeBoxId[128];		
-	unsigned int 			Checksum;			//4 bytes checksum	
-};
-
-struct ChargingInfoData 
-{
-	float				MaximumChargingVoltage;	//0~6553.5 volt
-	float				AvailableChargingCurrent;	//0~6553.5 amp		
-	float				AvailableChargingPower;	//0~6553.5 kW		
-	float				PresentChargingVoltage	;	//0~6553.5 volt
-	float				PresentChargingCurrent;		//0~6553.5 amp		
-	float				PresentChargingPower;		//0~6553.5 kW		
-	float				PresentChargedEnergy;		//0~6553.5 kWh		
-	int				PresentChargedDuration;	// second		
-	int				RemainChargingDuration;	// second		
-	float				EvBatteryMaxVoltage;		// 0~6553.5 volt				
-	float				EvBatterytargetVoltage;		// 0~6553.5 volt				
-	int				EvBatterySoc;				// 0~100%		
-	unsigned char 		ConnectorPlugIn;			//0: unplug, 1: Plug-in	
-	float 			PilotVoltage;				
-	unsigned char 		PilotState;				//1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
-	unsigned char 		PilotDuty;					// 0~100%		
-};
-
-struct SysInfoData 
-{
-	/**************System***************/
-	unsigned char		SystemStatus;				//0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault		
-	unsigned char		FactoryConfiguration;		//0: normal, 1: trigger, charger will return the configuration to factory default if trigger
-	float 			InputVoltageR;			//0~655.35 volt		
-	float 			InputVoltageS;				//0~655.35 volt		
-	float 			InputVoltageT;				//0~655.35 volt		
-	unsigned int 		SystemFanRotaSpeed;		//0 ~ 65535 RPM		
-	unsigned int 		PsuFanRotaSpeed;			//0 ~ 65535 RPM		
-	unsigned char		AuxPower5V;				//0 ~ 255 volt		
-	unsigned char		AuxPower12V;				//0 ~ 255 volt		
-	unsigned char		AuxPower24V;				//0 ~ 255 volt		
-	unsigned char		AuxPower48V;				//0 ~ 255 volt	
-	unsigned char 		CsuHwRev[32];			//CSU board hardware version	
-	unsigned char 		CsuBootLoadFwRev[32];		//CSU board bootloader firmware version
-	unsigned char 		CsuKernelFwRev[32];		//CSU board OS kernel firmware version								
-	unsigned char 		CsuRootFsFwRev[32];		//CSU board root file system firmware version		
-	unsigned char 		CsuPrimFwRev[32];			//CSU board root file system firmware version								
-	unsigned char 		LcmHwRev[32];			//LCM module hardware version								
-	unsigned char 		LcmFwRev[32];			//LCM module firmware version						
-	unsigned char 		PsuHwRev[32];				//PSU hardware version						
-	unsigned char 		PsuPrimFwRev[32];			//PSU primary firmware version			
-	unsigned char 		PsuSecFwRev[32];			//PSU secondary firmware version	
-	unsigned char 		AuxPwrHwRev[32];			//Aux. power module hardware version	
-	unsigned char 		AuxPwrFwRev[32];			//Aux. power module firmware version	
-	unsigned char 		FanModuleHwRev[32];		//Fan  module hardware version	
-	unsigned char 		FanModuleFwRev[32];		//Fan  module firmware version		
-	unsigned char 		RelayModuleHwRev[32];		//Relay control  module hardware version	
-	unsigned char 		RelayModuleFwRev[32];		//Relay control  module firmware version		
-	unsigned char 		TelcomModemFwRev[32];	//the 3G/4G modem firmware version	
-	int			  	SystemAmbientTemp;		// -40 ~ 215 degree C
-	int			  	SystemCriticalTemp;		// -40 ~ 215 degree C
-	int			  	CcsConnectorTemp;		// -40 ~ 215 degree C
-	int			  	PsuAmbientTemp;			// -40 ~ 215 degree C
-	/**************Charging***************/
-	struct ChargingInfoData 	ChademoChargingData[CHAdeMO_QUANTITY];	
-	struct ChargingInfoData 	CcsChargingData[CCS_QUANTITY];
-	struct ChargingInfoData 	GbChargingData[GB_QUANTITY];
-	/**************Network***************/
-	unsigned char 		InternetConn;				//0: disconnected, 1: connected	
-	/**************Backend***************/	
-	unsigned char 		OcppConnStatus;			//0: disconnected, 1: connected	
-
-};
-
-struct SysConfigAndInfo 
-{
-	struct SysConfigData	SysConfig; 
-	struct SysInfoData		SysInfo; 
-};
-
-/**************************************************************************************/
-/**************************Alarm Share memory**************************************/
-/***************************************************************************************
-	Status Code	A			B				C									D	E	F	
-				0: Issue		1: From EVSE 		1: Fault (unrecoverable)					001 ~ 999 serial number			
-			    								e.g., hardware broken, system latch				
-				1: Recovered	2: From EV		2: Alarm (recoverable)				
-			   								e.g., OTP, OVP				
-							3: From Backend	3: Information 				
-			  								e.g., swipe card to stop charging		
-			  								
-according to XXX.Revxx			  										
-***************************************************************************************/
-/**************************************************************************************/
-char FaultStatusCode[32][6]= 
-{
-	"011001",	//CHAdeMO output fuse blew		
-	"011002",	//CCS output fuse blew		
-	"011003",	//GB output fuse blew		
-	"011004",	//RCD/CCID self-test fail		
-	"011005",	//AC input contactor 1 welding 		
-	"011006",	//AC input contactor 1 driving fault 		
-	"011007",	//AC input contactor 2 welding 		
-	"011008",	//AC input contactor 2 driving fault  		
-	"011009",	//AC output relay welding		
-	"011010",	//AC output relay  driving fault		
-	"011011",	//CHAdeMO output relay welding		
-	"011012",	//CHAdeMO output relay driving fault		
-	"011013",	//CCS output relay welding		
-	"011014",	//CCS output relay driving fault		
-	"011015",	//GB output relay welding		
-	"011016",	//GB output relay driving fault		
-	"011017",	//AC connector temperature sensor broken		
-	"011018",	//CHAdeMO connector temperature sensor broken		
-	"011019",	//CCS connector temperature sensor broken		
-	"011020",	//GB connector temperature sensor broken		
-	"011021",	//WiFi module broken		
-	"011022",	//3G/4G module broken		
-	"011023",	//Aux. power module broken		
-	"011024",	//Relay control module /smart box broken		
-	"011025",	//CHAdeMO connector lock fail		
-	"011026",	//GB connector lock fail		
-	"011027",	//AC connector lock fail		
-	"011028",	//CHAdeMO module broken		
-	"011029",	//CCS module broken		
-	"011030",	//GBT module broken		
-	"011031",	//PSU module broken		
-	"011032"	//Reserved
-};
-
-struct FaultCodeData
-{
-	unsigned char PreviousFaultVal[4];
-	union
-	{
-		unsigned char FaultVal[4];
-		struct
-		{
-			//FaultVal[0]
-		    	unsigned char ChademoOutputFuseBlew:1;				//bit 0 
-			unsigned char CcsOutputFuseBlew:1;					//bit 1
-			unsigned char GbOutputFuseBlew:1;   					//bit 2
-			unsigned char RcdSelfTestFail:1;						//bit 3		              
-			unsigned char AcInputContactor1Welding:1;			//bit 4 		          
-			unsigned char AcInputContactor1DrivingFault:1;			//bit 5  		  
-			unsigned char AcInputContactor2Welding:1;			//bit 6 		          
-			unsigned char AcInputContactor2DrivingFault:1;			//bit 7  
-			//FaultVal[1]		
-			unsigned char AcOutputRelayWelding:1;				//bit 0 
-			unsigned char AcOutputRelayDrivingFault:1;				//bit 1
-			unsigned char ChademoOutputRelayWelding:1;			//bit 2
-			unsigned char ChademoOutputRelayDrivingFault	:1;		//bit 3		              
-			unsigned char CcsOutputRelayWelding:1;				//bit 4 		          
-			unsigned char CcsOutputRelayDrivingFault:1;			//bit 5  		  
-			unsigned char GbOutputRelayWelding:1;				//bit 6 		          
-			unsigned char GbOutputRelayDrivingFault:1;				//bit 7    
-			//FaultVal[2]		
-			unsigned char AcConnectorTempSensorBroken:1;			//bit 0 
-			unsigned char ChademoConnectorTempSensorBroken:1;	//bit 1
-			unsigned char CcsConnectorTempSensorBroken:1;		//bit 2
-			unsigned char GbConnectorTempSensorBroken:1;			//bit 3		              
-			unsigned char WiFiModuleBroken:1;					//bit 4 		          
-			unsigned char Telecom4GModuleBroken:1;				//bit 5  		  
-			unsigned char AuxPowerModuleBroken:1;				//bit 6 		          
-			unsigned char RelayControlModuleBroken :1;			//bit 7 	
-	             	 //FaultVal[3]		
-			unsigned char ChademoConnectorLockFail:1;			//bit 0 
-			unsigned char GbConnectorLockFail:1;					//bit 1
-			unsigned char AcConnectorLockFail:1;					//bit 2
-			unsigned char ChademoModuleBroken:1;				//bit 3		              
-			unsigned char CcsModuleBroken:1;					//bit 4 		          
-			unsigned char GbModuleBroken:1;						//bit 5  		  
-			unsigned char PsuModuleBroken:1;						//bit 6 		          
-			unsigned char :1;									//bit 7		reserved
-		}bits;
-	}FaultEvents;        
-};          
-
-char AlarmStatusCode[64][6]=
-{
-	"012200",	//System L1 input OVP		                            
-	"012201",	//System L2 input OVP		                            
-	"012202",	//System L3 input OVP		                            
-	"012203",	//System L1 input UVP		                            
-	"012204",	//System L2 input UVP		                            
-	"012205",	//System L3 input UVP		                            
-	"012206",	//PSU L1 input OVP		                                
-	"012207",	//PSU L2 input OVP		                                
-	"012208",	//PSU L3 input OVP		                                
-	"012209",	//PSU L1 input UVP		                                
-	"012210",	//PSU L2 input UVP		                                
-	"012211",	//PSU L3 input UVP		                                
-	"012212",	//System L1 input drop		                            
-	"012213",	//System L2 input drop		                            
-	"012214",	//System L3 input drop		                            
-	"012215",	//System AC output OVP		                            
-	"012216",	//System AC output OCP		                            
-	"012217",	//System CHAdeMO output OVP		                        
-	"012218",	//System CHAdeMO output OCP		                        
-	"012219",	//System CCS output OVP		                            
-	"012220",	//System CCS output OCP		                            
-	"012221",	//System GB output OVP		                            
-	"012222",	//System GB output OCP		                            
-	"012223",	//System ambient/inlet OTP		                        
-	"012224",	//System critical point OTP		                        
-	"012225",	//PSU ambient/inlet OTP		                            
-	"012226",	//PSU critical point OTP		                        
-	"012227",	//Aux. power module OTP		                            
-	"012228",	//Relay board/smart box OTP		                        
-	"012229",	//CHAdeMO connector OTP		                            
-	"012230",	//CCS connector OTP		                                
-	"012231",	//GB connector OTP		                                
-	"012232",	//AC connector OTP		                                
-	"012233",	//RCD/CCID trip		                                    
-	"012234",	//CHAdeMO GFD trip		                                
-	"012235",	//CCS GFD trip		                                    
-	"012236",	//GB GFD trip		                                    
-	"012237",	//SPD trip		                                        
-	"012238",	//Main power breaker trip		                        
-	"012239",	//Aux. power breaker trip		                        
-	"012240",	//PSU communication fail		                        
-	"012241",	//WiFi module communication fail		                
-	"012242",	//3G/4G module communication fail		                
-	"012243",	//RFID module communication fail		                
-	"012244",	//Bluetooth module communication fail		            
-	"012245",	//LCM module communication fail		                    
-	"012246",	//Aux. power module communication fail		            
-	"012247",	//Relay control boaed/smart box communication fail		
-	"012248",	//CCS module communication fail		                    
-	"012249",	//CHAdeMO module communication fail		                
-	"012250",	//GBT module communication fail		                    
-	"012251",	//Emergency stop		                                
-	"012252",	//Door open		                                        
-	"012253",	//System fan decay		                                
-	"012254",	//Fail to create share memory 
-	"012255",	//CSU initialization failed
-	"012256",	//Reserved
-	"012257",	//Reserved
-	"012258",	//Reserved
-	"012259",	//Reserved
-	"012260",	//Reserved
-	"012261",	//Reserved
-	"012262",	//Reserved
-	"012263"	//Reserved
-};   
-struct AlarmCodeData
-{
-	unsigned char PreviousAlarmVal[8];
-	union
-	{    
-		unsigned char AlarmVal[8];
-		struct
-		{
-			//AlarmVal[0]
-		    	unsigned char SystemL1InputOVP:1;					//bit 0 
-			unsigned char SystemL2InputOVP:1;					//bit 1
-			unsigned char SystemL3InputOVP:1;   					//bit 2
-			unsigned char SystemL1InputUVP:1;					//bit 3		              
-			unsigned char SystemL2InputUVP:1;					//bit 4 		          
-			unsigned char SystemL3InputUVP:1;					//bit 5  		  
-			unsigned char PsuL1InputOVP:1;						//bit 6 		          
-			unsigned char PsuL2InputOVP:1;						//bit 7  
-			//AlarmVal[1]		
-			unsigned char PsuL3InputOVP:1;						//bit 0 
-			unsigned char PsuL1InputUVP:1;						//bit 1
-			unsigned char PsuL2InputUVP:1;						//bit 2
-			unsigned char PsuL3InputUVP	:1;						//bit 3		              
-			unsigned char SystemL1InputDrop:1;					//bit 4 		          
-			unsigned char SystemL2InputDrop:1;					//bit 5  		  
-			unsigned char SystemL3InputDrop:1;					//bit 6 		          
-			unsigned char SystemAcOutputOVP:1;					//bit 7    
-			//AlarmVal[2]		
-			unsigned char SystemAcOutputOCP:1;					//bit 0 
-			unsigned char SystemChademoOutputOVP:1;			//bit 1
-			unsigned char SystemChademoOutputOCP:1;			//bit 2
-			unsigned char SystemCcsOutputOVP:1;					//bit 3		              
-			unsigned char SystemCcsOutputOCP:1;					//bit 4 		          
-			unsigned char SystemGbOutputOVP:1;					//bit 5  		  
-			unsigned char SystemGbOutputOCP:1;					//bit 6 		          
-			unsigned char SystemAmbientOTP :1;					//bit 7 	
-	             	 //AlarmVal[3]		
-			unsigned char SystemCriticalPointOTP:1;				//bit 0 
-			unsigned char PsuAmbientOTP:1;						//bit 1
-			unsigned char PsuCriticalPointOTP:1;					//bit 2
-			unsigned char AuxPowerModuleOTP:1;					//bit 3		              
-			unsigned char RelayBoardOTP:1;						//bit 4 		          
-			unsigned char ChademoConnectorOTP:1;				//bit 5  		  
-			unsigned char CcsConnectorOTP:1;					//bit 6 		          
-			unsigned char GbConnectorOTP:1;					//bit 7		
-			 //AlarmVal[4]			
-			unsigned char AcConnectorOTP:1;						//bit 0 
-			unsigned char RcdTrip:1;								//bit 1
-			unsigned char ChademoGfdTrip:1;						//bit 2
-			unsigned char CcsGfdTrip:1;							//bit 3		              
-			unsigned char GbGfdTrip:1;							//bit 4 		          
-			unsigned char SpdTrip:1;								//bit 5  		  
-			unsigned char MainPowerBreakerTrip:1;					//bit 6 		          
-			unsigned char AuxPowerBreakerTrip:1;					//bit 7			
-			//AlarmVal[5]			
-			unsigned char PsuCommunicationFail:1;				//bit 0 
-			unsigned char WiFiModuleCommFail:1;					//bit 1
-			unsigned char Telecom4GModuleCommFail:1;			//bit 2
-			unsigned char RfidModuleCommFail:1;					//bit 3		              
-			unsigned char BluetoothModuleCommFail:1;				//bit 4 		          
-			unsigned char LcmModuleCommFail:1;					//bit 5  		  
-			unsigned char AuxPowerModuleCommFail:1;			//bit 6 		          
-			unsigned char RelayBoardCommFail:1;					//bit 7			
-			//AlarmVal[6]			
-			unsigned char CcsModuleCommFail:1;					//bit 0 
-			unsigned char ChademoModuleCommFail:1;			//bit 1
-			unsigned char GbModuleCommFail:1;					//bit 2
-			unsigned char EmergencyStopTrip:1;					//bit 3		              
-			unsigned char DoorOpen:1;							//bit 4 		          
-			unsigned char SystemFanDecay:1;						//bit 5  		  
-			unsigned char FailToCreateShareMemory:1;				//bit 6  		  
-			unsigned char CsuInitFailed:1;							//bit 7  		
-			//AlarmVal[7]			  
-			unsigned char :8;									//reserved				
-		}bits;
-	}AlarmEvents;        
-};          
-
-char InfoStatusCode[64][6]=
-{
-	//Information comes from EVSE 
-	"013600",	//Normal stop charging by user		                
-	"013601",	//Charging Time's up		                        
-	"013602",	//Replace system air filter 		                
-	"013603",	//Reach to CHAdeMO max. plugging times.		        
-	"013604",	//Reach to CCS max. plugging times.		            
-	"013605",	//Reach to GB max. plugging times.		            
-	"013606",	//Reach to AC max. plugging times.		            
-	"013607",	//CSU fimrware update fail		            
-	"013608",	//CHAdeMO Module fimrware update fail	
-	"013609",	//CCS Module fimrware update fail	
-	"013610",	//GB Module fimrware update fail		                
-	"013611",	//Aux. power module fimrware update fail		    
-	"013612",	//Relay control module fimrware update fail		    
-	"013613",	//LCM module fimrware update fail		            
-	"013614",	//Bluetooth module fimrware update fail		        
-	"013615",	//WiFi module fimrware update fail		            
-	"013616",	//3G/4G module fimrware update fail		            
-	"013617",	//SMR fimrware update fail		                    
-	"013618",	//RFID module fimrware update fail		            
-	"013619",	//configured by USB flash drive		                
-	"013620",	//configured by backend		                        
-	"013621",	//configured by webpage		                    
-	"013622",	//disconnected from Internet through Ethernet		
-	"013623",	//disconnected from Internet through WiFi		    
-	"013624",	//disconnected from Internet through 3G/4G		    
-	"013625",	//disconnected from AP through WiFi		            
-	"013626",	//disconnected from APN through 3G/4G		  
-	"013627",	//Reserved
-	"013628",	//Reserved
-	"013629",	//Reserved
-	"013630",	//Reserved
-	"013631",	//Reserved    
-	//Information comes from EV
-	"023700",	//CHAdeMO EV communication Fail		           
-	"023701",	//CCS EV communication Fail		               
-	"023702",	//GB EV communication Fail		               
-	"023703",	//AC: pilot fault		                       
-	"023704",	//CHAdeMO:  battery malfunction		           
-	"023705",	//CHAdeMO:  no charging permission		       
-	"023706",	//CHAdeMO:  battery incompatibility		       
-	"023707",	//CHAdeMO:  battery OVP		                   
-	"023708",	//CHAdeMO:  battery UVP		                   
-	"023709",	//CHAdeMO:  battery OTP		                   
-	"023710",	//CHAdeMO:  battery current difference		   
-	"023711",	//CHAdeMO:  battery voltage difference		   
-	"023712",	//CHAdeMO:  shift position		               
-	"023713",	//CHAdeMO:  battery other fault		           
-	"023714",	//CHAdeMO:  charging system error		       
-	"023715",	//CHAdeMO:  EV normal stop	
-	"023716",	//Reserved
-	"023717",	//Reserved
-	"023718",	//Reserved
-	"023719",	//Reserved
-	"023720",	//Reserved
-	"023721",	//Reserved	
-	"023722",	//Reserved	
-	"023723",	//Reserved	
-	 //Information comes from Backend              
-	"033900",	//disconnected from backend through Ethernet		
-	"033901",	//disconnected from backend through WiFi		    
-	"033902",	//disconnected from backend through 3G/4G		    
-	"033903",	//Remote start charging by backend		            
-	"033904",	//Remote stop charging by backend		            
-	"033905",	//Remote reset by backend		                                   
-	"033906",	//Reserved                      	
-	"033907",	//Reserved                      	                   	
-};   
-struct InfoCodeData
-{
-	unsigned char PreviousInfoVal[8];
-	union
-	{    
-		unsigned char InfoVal[8];
-		struct
-		{
-			//InfoVal[0]
-		    	unsigned char NormalStopChargingByUser:1;				//bit 0 
-			unsigned char ChargingTimesUp:1;						//bit 1
-			unsigned char ReplaceSystemAirFilter:1; 					//bit 2
-			unsigned char ReachChademoMaxPluggingTimes:1;		//bit 3		              
-			unsigned char ReachCcsMaxPluggingTimes:1;			//bit 4 		          
-			unsigned char ReachGbMaxPluggingTimes:1;			//bit 5  		  
-			unsigned char ReachAcMaxPluggingTimes:1;				//bit 6 		          
-			unsigned char CsuFimrwareUpdateFail:1;				//bit 7  
-			//InfoVal[1]		
-			unsigned char ChademoModuleFimrwareUpdateFail:1;	//bit 0 
-			unsigned char CcsModuleFimrwareUpdateFail:1;			//bit 1
-			unsigned char GbModuleFimrwareUpdateFail:1;			//bit 2
-			unsigned char AuxPowerModuleFimrwareUpdateFail:1;		//bit 3		              
-			unsigned char RelayBoardFimrwareUpdateFail:1;			//bit 4 		          
-			unsigned char LcmModuleFimrwareUpdateFail:1;			//bit 5  		  
-			unsigned char BluetoothModuleFimrwareUpdateFail:1;		//bit 6 		          
-			unsigned char WiFiModuleFimrwareUpdateFail:1;			//bit 7    
-			//InfoVal[2]		
-			unsigned char Telocom4GModuleFimrwareUpdateFail:1;	//bit 0 
-			unsigned char PsuFimrwareUpdateFail:1;				//bit 1
-			unsigned char RfidModuleFimrwareUpdateFail:1;			//bit 2
-			unsigned char ConfiguredByUsbFlashDrive:1;				//bit 3		              
-			unsigned char ConfiguredByBackend:1;					//bit 4 		          
-			unsigned char ConfiguredByWebpage:1;				//bit 5  		  
-			unsigned char InternetDisconnectViaEthernet:1;			//bit 6 		          
-			unsigned char InternetDisconnectViaWiFi :1;				//bit 7 	
-	             	 //InfoVal[3]		
-			unsigned char InternetDisconnectVia4Gi:1;				//bit 0 
-			unsigned char ApDisconnectViaWiFi:1;					//bit 1
-			unsigned char ApnDisconnectVia4Gi:1;					//bit 2
-			unsigned char :5;									//bit 3~7 reserved		              
-			 //InfoVal[4]			
-			unsigned char ChademoEvCommFail:1;				//bit 0 
-			unsigned char CcsEvCommFail:1;						//bit 1
-			unsigned char GbEvCommFail:1;						//bit 2
-			unsigned char PilotFault:1;							//bit 3		              
-			unsigned char ChademoBatteryMalfun:1;				//bit 4 		          
-			unsigned char ChademoNoPermission:1;				//bit 5  		  
-			unsigned char ChademoBatteryIncompatibility:1;			//bit 6 		          
-			unsigned char ChademoBatteryOVP:1;					//bit 7			
-			//InfoVal[5]			
-			unsigned char ChademoBatteryUVP:1;					//bit 0 
-			unsigned char ChademoBatteryOTP:1;					//bit 1
-			unsigned char ChademoBatteryCurrentDiff:1;			//bit 2
-			unsigned char ChademoBatteryVoltageDiff:1;			//bit 3		              
-			unsigned char ChademoShiftPosition:1;					//bit 4 		          
-			unsigned char ChademoBatteryOtherFault:1;			//bit 5  		  
-			unsigned char ChademoChargingSystemError:1;			//bit 6 		          
-			unsigned char ChademoEvNormalStop:1;				//bit 7			
-			//InfoVal[6]			 	  
-			unsigned char :8;									//bit 0~7 reserved				
-			//InfoVal[7]			
-			unsigned char BackendDisconnectedViaEthernet:1;		//bit 0 
-			unsigned char BackendDisconnectViaWiFi:1;				//bit 1
-			unsigned char BackendDisconnectVia4G:1;				//bit 2
-			unsigned char BackendRemoteStart:1;					//bit 3		              
-			unsigned char BackendRemoteStop:1;					//bit 4 		          
-			unsigned char BackendRemoteReset:1;					//bit 5  		  
-			unsigned char :2;									//bit 6~7 reserved		
-		}bits;
-	}InfoEvents;        
-};          
-            
-struct StatusCodeData
-{           
-	struct FaultCodeData	FaultCode;	
-	struct AlarmCodeData	AlarmCode;
-	struct InfoCodeData	InfoCode;
-};          
-/**************************************************************************************/
-/**************************PSU Share memory***************************************/
-/**************************************************************************************/
-            
-/*Following are the information for each PSU module*/
-struct PsuModuleData 
-{           
-	unsigned char 		AssignID;	
-	unsigned char 		PhysicalID;		
-	unsigned char 		GroupID;					
-	unsigned char 		FwVersion[12];							
-	unsigned char 		StateMachine;			//0: Identification,  1:Operation,  2: Alarm,  3: Failure,  s4:Upgrade
-	unsigned char 		OutputPowerSwitch;	//0: D.D normal OFF,  1: D.D emergency OFF,  2: D.D ON
-	unsigned short 	FanSpeed;			//RPM
-	unsigned short 	InputVoltageL1;		//abcd=abc.d volt
-	unsigned short 	InputVoltageL2;		//abcd=abc.d volt	
-	unsigned short 	InputVoltageL3;		//abcd=abc.d volt
-	unsigned short 	PresentOutputVoltage;	//abcd=abc.d volt
-	unsigned short 	PresentOutputCurrent;	//abcd=abc.d volt
-	unsigned short 	AvailableCurrent;		//abcd=abc.d Amps
-	unsigned int 		AvailablePower;		//Watt
-	unsigned char 		CriticalTemp1;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		CriticalTemp2;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		CriticalTemp3;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		InletTemp;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		OutletTemp;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned int 		AlarmCode;			//
-	unsigned int 		FaultCode;			//
-};
-
-/*Following are the information for each PSU Group*/
-struct PsuGroupData 
-{
-	unsigned char 			GroupPresentPsuQuantity;
-	unsigned char 			GroupOutputPowerSwitch;		//0: D.D normal OFF,  1: D.D emergency OFF,  2: D.D ON
-	unsigned short 		GroupTargetOutputVoltage;		//abcd=abc.d volt
-	unsigned short 		GroupTargetOutputCurrent;		//abcd=abc.d volt
-	unsigned short 		GroupAvailableCurrent;			//abcd=abc.d Amps
-	unsigned int 			GroupAvailablePower;			//Watt
-	unsigned short 		GroupPresentOutputVoltage; 	//abcd=abc.d volt
-	unsigned short 		GroupPresentOutputCurrent;		//abcd=abc.d Amps
-	struct PsuModuleData 	PsuModule[MAX_PSU_QUANTITY];
-};
-
-/*Following is the information for system all PSU*/
-struct PsuData 
-{
-	unsigned char 			SystemPresentPsuQuantity;
-	struct PsuGroupData 	PsuGroup[4];
-};
-
-/************************************************************************************/
-/**************************CHAdeMO protocol Share memory*********************/
-/**************************************************************************************/
-struct CHAdeMOEvData 
-{
-	unsigned char  SupportDynamicControl;	//110.0				
-										//					bit0=1:supported
-	unsigned char  SupportHighCurrent;		//110.0				
-										//					bit1=1:supported
-	unsigned char  MiniChargeCurrent;		//100.0				0~200(A) (unit:1A)
-										//					0x00: request for current equivalent to 1.5kW
-										//					0x01: no request
-										//					0x02: request of 1A and following are the same rule
-	unsigned short MaxiBatteryVoltage;		//100.5,100.4 			0~600(V) (unit:1V)
-	unsigned short MaxiChargingTime;			//101.2,101.1			10(sec.)~255(min.)	(Unit:sec)
-										//					Set 0xFF to 101.1 (Unit: 10sec) in case 101.2 (Unit: 1min) is used																							
-	unsigned char  EstimatChargingTime;		//101.3				0~254(min.)	(Unit:sec)
-										//					Display Only
-	unsigned short TotalBatteryCapacity;		//101.6,101.5 			0.1~6553.5(kWh)	(unit:0.1 kWh)									
-	unsigned char  ProtocolVersion;			//102.0				0~255	
-										//					0x02: CHAdeMO specification ver.1.2
-	unsigned short TargetBatteryVoltage;		//102.2,102.1 			0~600(V) (unit:1V)								
-	unsigned short  ChargingCurrentRequest;	//102.3				0~200(A) (unit:1A)
-										//110.2,110.1 			0~1023(A) (unit:1A)			
-	unsigned char  BatteryAlarm;				//102.4				>0:alarm
-										//					bit0=1:Battery overvoltage
-										//					bit1=1:Battery undervoltage
-										//					bit2=1:Battery current deviation error
-										//					bit3=1:High battery temperature
-										//					bit4=1:Battery voltage deviation error
-	unsigned char  EvDetection;				//102.5				
-										//					bit0=0:Vehicle charging disabled,	(stop charging)
-										//					bit0=1:Vehicle charging enabled,
-										//					bit1=0:¡§Parking¡¨ position
-										//					bit1=1:other position				(stop charging)
-										//					bit2=0:Charging system normal
-										//					bit2=1:Charging system error		(stop charging)
-										//					bit3=0:EV contactor close or during welding detection
-										//					bit3=1:EV contactor open or termination of welding detection (stop charging)	
-										//					bit4=0:No stop request before charging
-										//					bit4=1:Normal stop request before charging	(stop charging)		
-	unsigned char  SOC;					//102.6				0~100(%) (unit:%)				
-										//					Display Only		
-	unsigned char  Communicating;			//					it is true if receive EV CAN message within every 1500ms  																							
-};	
-
-struct CHAdeMOEvseData 
-{
-	unsigned char  SupportDynamicControl;	//118.0				
-										//					bit0=1:supported
-	unsigned char  SupportHighCurrent;		//118.0				
-										//					bit1=1:supported
-	unsigned short  AvailableOutputVoltage;	//108.2,108.1 			0~600(V) (unit:1V)
-	unsigned short  AvailableOutputCurrent;	//108.3				0~255(A) (unit:1A)
-										//118.2,118.1 			0~1023(A) (unit:1A)
-	unsigned short  ThresholdVoltage;			//108.5,108.4 			0~600(V) (unit:1V)
-	unsigned char   ConnectorTemperatureP;	//108.6				-40~215(degC) (unit:degC) //value 0=-40	[NISSAN customized]
-	unsigned char   ConnectorTemperatureN;	//108.7				-40~215(degC) (unit:degC) //value 0=-40	[NISSAN customized]
-	unsigned char   ProtocolVersion;			//109.0				0~255	
-										//					0x00: CHAdeMO specification 0.9 and earlier
-										//					0x01: CHAdeMO specification 0.9 and 0.9.1
-										//					0x02: CHAdeMO specification 1.0.0, 1.0.1, 1.1 and 1.2
-	unsigned short  PresentOutputVoltage;		//109.2,109.1	 		0~600(V) (unit:1V)
-	unsigned short   PresentOutputCurrent;		//109.3				0~255(A) (unit:1A)
-										//118.4,118.3			0~1023(A) (unit:1A)
-	unsigned char   EvseDetection;			//109.5				
-										//					bit0=0:not charging state now
-										//					bit0=1:charging state now
-										//					bit1=0:EVSE normal
-										//					bit1=1:EVSE error
-										//					bit2=0:Not Energizing state
-										//					bit2=1:Energizing state
-										//					bit3=0:No Battery incompatibility
-										//					bit3=1:Battery incompatibility
-										//					bit4=0:No Charging system error
-										//					bit4=1:Charging system error
-										//					bit5=0:No Charging stop control
-										//					bit5=1:Charging stop control
-	unsigned short RemainChargingTime;		//109.7,109.6			10(sec.)~255(min.)	(Unit:sec)
-										//					Set 0xFF to 109.6 (Unit: 10sec) in case 109.7 (Unit: 1min) is used	
-	unsigned char  HighPowerCondition;		//118.5				
-										//					bit0=0:Present charging current H¡¦118.3,H¡¦118.4¡¨ is less than or equal to rated current of a charging cable
-										//					bit0=1:Present charging current H¡¦118.3,H¡¦118.4¡¨ is exceeds to rated current of a charging cable
-										//					bit1=1:charging cable Cooling function Operating Installed
-										//					bit2=1:charging cable Current limiting function
-										//					bit3=1:charging connector Cooling function Operating
-										//					bit4=1:charging connector Current limiting function Installed
-										//					bit5=1:charging connector Over-temperature protection Installed	
-										//					bit6=1:Functional safety Applied
-	unsigned int 	MaxiGroupPower;			//					XXXXXXXX (Unit:Watt)depend on which group to be used		
-	unsigned int 	MaxiGroupCurrent;			//					XXXXXXXX (unit:1A)depend on which group to be used	
-	unsigned short  ApplyOutputVoltage;		// 					0~600(V) (unit:1V)							
-	unsigned short  ElapseChargingTime;		//					(Unit:sec)	
-	unsigned short  ElapseEnergy;				//					(Unit:10xkWh)																							
-};
-
-struct CHAdeMOData 
-{
-	struct CHAdeMOEvData 		ev[CHAdeMO_QUANTITY];
-	struct CHAdeMOEvseData 	evse[CHAdeMO_QUANTITY];
-};
-
-/************************************************************************************/
-/**************************CCS protocol Share memory***************************/
-/**************************DIN70121: 201412***************************************/
-/**************************ISO15118_2014: 2014************************************/
-/**************************ISO15118_2018: 2018************************************/
-/************************************************************************************/
-typedef enum boolean { FALSE, TRUE } BOOL; 
-enum ResponseCodeType_DIN70121		{ OK_DIN70121 = 0, OK_NewSessionEstablished_DIN70121 = 1, OK_OldSessionJoined_DIN70121 = 2, OK_CertificateExpiresSoon_DIN70121 = 3, 
-									   FAILED_DIN70121 = 4, FAILED_SequenceError_DIN70121 = 5, FAILED_ServiceIDInvalid_DIN70121 = 6, FAILED_UnknownSession_DIN70121 = 7,
-									   FAILED_ServiceSelectionInvalid_DIN70121 = 8, FAILED_PaymentSelectionInvalid_DIN70121 = 9, FAILED_CertificateExpired_DIN70121 = 10,
-									   FAILED_SignatureError_DIN70121 = 11, FAILED_NoCertificateAvailable_DIN70121 = 12, FAILED_CertChainError_DIN70121 = 13, FAILED_ChallengeInvalid_DIN70121 = 14,
-									   FAILED_ContractCanceled_DIN70121 = 15, FAILED_WrongChargeParameter_DIN70121 = 16, FAILED_PowerDeliveryNotApplied_DIN70121 = 17,
-									   FAILED_TariffSelectionInvalid_DIN70121 = 18, FAILED_ChargingProfileInvalid_DIN70121 = 19, FAILED_EVSEPresentVoltageToLow_DIN70121 = 20,
-									   FAILED_MeteringSignatureNotValid_DIN70121 = 21, FAILED_WrongEnergyTransferType_DIN70121 = 22};
-enum ResponseCodeType_ISO15118_2014	{ OK_ISO15118_2014 = 0, OK_NewSessionEstablished_ISO15118_2014 = 1, OK_OldSessionJoined_ISO15118_2014 = 2, OK_CertificateExpiresSoon_ISO15118_2014 = 3, 
-									   FAILED_ISO15118_2014 = 4, FAILED_SequenceError_ISO15118_2014 = 5, FAILED_ServiceIDInvalid_ISO15118_2014 = 6, FAILED_UnknownSession_ISO15118_2014 = 7,
-									   FAILED_ServiceSelectionInvalid_ISO15118_2014 = 8, FAILED_PaymentSelectionInvalid_ISO15118_2014 = 9, FAILED_CertificateExpired_ISO15118_2014 = 10,
-									   FAILED_SignatureError_ISO15118_2014 = 11, FAILED_NoCertificateAvailable_ISO15118_2014 = 12, FAILED_CertChainError_ISO15118_2014 = 13, FAILED_ChallengeInvalid_ISO15118_2014 = 14,
-									   FAILED_ContractCanceled_ISO15118_2014 = 15, FAILED_WrongChargeParameter_ISO15118_2014 = 16, FAILED_PowerDeliveryNotApplied_ISO15118_2014 = 17,
-									   FAILED_TariffSelectionInvalid_ISO15118_2014 = 18, FAILED_ChargingProfileInvalid_ISO15118_2014 = 19, FAILED_MeteringSignatureNotValid_ISO15118_2014 = 20,
-									   FAILED_NoChargeServiceSelected_ISO15118_2014 = 21, FAILED_WrongEnergyTransferMode_ISO15118_2014 = 22, FAILED_ContactorError_ISO15118_2014 = 23,
-									   FAILED_CertificateNotAllowedAtThisEVSE_ISO15118_2014 = 24, FAILED_CertificateRevoked_ISO15118_2014 = 25  };		
-enum ResponseCodeType_ISO15118_2018	{ OK_ISO15118_2018 = 0, OK_NewSessionEstablished_ISO15118_2018 = 1, OK_OldSessionJoined_ISO15118_2018 = 2, OK_CertificateExpiresSoon_ISO15118_2018 = 3, 
-									   OK_IsolationValid_ISO15118_2018 = 4, OK_IsolationWarning_ISO15118_2018 = 5, WARNING_CertificateExpired_ISO15118_2018 = 6, WARNING_NoCertificateAvailable_ISO15118_2018 = 7,
-									   WARNING_CertValidationError_ISO15118_2018 = 8, WARNING_CertVerificationError_ISO15118_2018 = 9, WARNING_ContractCanceled_ISO15118_2018 = 10,
-									   FAILED_ISO15118_2018 = 11, FAILED_SequenceError_ISO15118_2018 = 12, FAILED_ServiceIDInvalid_ISO15118_2018 = 13, FAILED_UnknownSession_ISO15118_2018 = 14,
-									   FAILED_ServiceSelectionInvalid_ISO15118_2018 = 15, FAILED_SignatureError_ISO15118_2018 = 16, FAILED_IdentificationSelectionInvalid_ISO15118_2018 = 17,
-									   FAILED_ChallengeInvalid_ISO15118_2018 = 18, FAILED_WrongChargeParameter_ISO15118_2018 = 19, FAILED_IsolationFault_ISO15118_2018 = 20,
-									   FAILED_PowerDeliveryNotApplied_ISO15118_2018 = 21, FAILED_TariffSelectionInvalid_ISO15118_2018 = 22, FAILED_ChargingProfileInvalid_ISO15118_2018 = 23,
-									   FAILED_MeteringSignatureNotValid_ISO15118_2018 = 24, FAILED_NoChargeServiceSelected_ISO15118_2018 = 25, FAILED_WrongEnergyTransferMode_ISO15118_2018 = 26,  
-									   FAILED_ContactorError_ISO15118_2018 = 27, FAILED_CertificateRevoked_ISO15118_2018 = 28, FAILED_CertificateNotYetValid_ISO15118_2018 = 29 };													   						   
-enum EVSENotificationType		 		{ None = 0, StopCharging = 1, ReNegotiation = 2};		
-enum ServiceCategoryType 				{ EVCharging = 0, Internet = 1, ContractCertificate = 2, OtherCustom = 3};
-enum PaymentOptionType 		      		{ Contract = 0, ExternalPayment = 1};
-/*enum EVSESupportedEnergyTransferType 	{ AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
-									  DC_combo_core = 4, DC_dual = 5, AC_core1p_DC_extended = 6, AC_single_DC_core = 7,
-									  AC_single_phase_three_phase_core_DC_extended = 8, AC_core3p_DC_extended = 9};*/
-enum EnergyTransferModeType			{ AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
-									  DC_combo_core = 4, DC_unique = 5};
-//enum identificationOptionType 			{ Contract = 0, ExternalIdentification = 1};						   
-enum unitSymbolType_DIN70121			{ h_DIN70121 = 0, m_DIN70121 = 1, s_DIN70121 = 2, A_DIN70121 = 3, Ah_DIN70121 = 4, V_DIN70121 = 5, VA_DIN70121 = 6, W_DIN70121 = 7, Ws_DIN70121 = 8, Wh_DIN70121 = 9};						   
-enum unitSymbolType_ISO15118_2014		{ h_ISO15118_2014 = 0, m_ISO15118_2014 = 1, s_ISO15118_2014 = 2, A_ISO15118_2014 = 3, V_ISO15118_2014 = 4, W_ISO15118_2014 = 5, Wh_ISO15118_2014 = 6};							   
-enum ProcessingType					{ Finished = 0, Ongoing = 1, Ongoing_WaitingForCustomerInteraction = 2};							   
-enum EVSEProcessingType_DIN70121		{ Finished_DIN70121 = 0, Ongoing_DIN70121 = 1};						   
-enum EVSEProcessingType_ISO15118_2014	{ Finished_ISO15118_2014 = 0, Ongoing_ISO15118_2014 = 1, Ongoing_WaitingForCustomerInteraction_ISO15118_2014=2 };		   
-enum DC_EVErrorCodeType 		  		{ NO_ERROR = 0, FAILED_RESSTemperatureInhibit = 1, FAILED_EVShiftPosition = 2, FAILED_ChargerConnectorLockFault = 3,
-									  FAILED_EVRESSMalfunction = 4, FAILED_ChargingCurrentdifferential = 5, FAILED_ChargingVoltageOutOfRange = 6,
-									  Reserved_A = 7, Reserved_B = 8, Reserved_C = 9, FAILED_ChargingSystemIncompatibility = 10, NoData = 11};
-enum IsolationLevelType_DIN70121 		{ Invalid_DIN70121 = 0, Valid_DIN70121 = 1, Warning_DIN70121 = 2, Fault_DIN70121 = 3};
-enum IsolationLevelType_ISO15118_2014		{ Invalid_ISO15118_2014 = 0, Valid_ISO15118_2014 = 1, Warning_ISO15118_2014 = 2, Fault_ISO15118_2014 = 3, No_IMD_ISO15118_2014	 = 4};
-enum DC_EVSEStatusCodeType			{ EVSE_NotReady = 0, EVSE_Ready = 1, EVSE_Shutdown = 2, EVSE_UtilityInterruptEvent = 3,
-						 			  EVSE_IsolationMonitoringActive = 4, EVSE_EmergencyShutdown = 5, EVSE_Malfunction = 6,
-						 			  Reserved_8 = 7, Reserved_9 = 8};
-enum ScheduleOriginType				{ EV = 0, SA = 1};		
-enum ChargeProgressType_ISO15118_2014	{start_ISO15118_2014 = 0, Stop_ISO15118_2014 = 1, Renegotiate_ISO15118_2014 = 2};		
-enum ChargeProgressType_ISO15118_2018	{start_ISO15118_2018 = 0, Renegotiate_ISO15118_2018 = 1, Standby_ISO15118_2018 = 2, Stop_ISO15118_2018 = 3};		
-enum evOperationType					{Charge = 0, Discharge = 1, Standby = 2};	
-enum mechanicalChargingDeviceStatusType {Home = 0, Moving = 1, EndPosition = 2};	
-enum EV_CP_StatusType					{A = 0, B = 1, C = 2, D = 3, E = 4, F = 5};	
-enum EV_Error_Status_CodeType			{ No_EV_Error = 0, EV_FAILED_EmergencyEvent = 1, EV_FAILED_Breaker = 2, EV_FAILED_RESSTemperatureInhibit = 3,
-						 			  EV_FAILED_RESS = 4, EV_FAILED_ChargingCurrentDifferential = 5, EV_FAILED_ChargingVoltageOutOfRange = 6,
-						 			  Reserved_by_ISO_1 = 7,  Reserved_by_ISO_2 = 8, Reserved_by_ISO_3 = 9, OEM1 = 10,
-						 			  OEM2 = 11,  OEM3 = 12, OEM4 = 13};
-enum IsolationStatusType				{ Invalid = 0, Safe = 1, Warning = 2, Fault = 3};
-enum ChargingSessionType				{ Terminate = 0, Pause = 1};
-enum CostKindType						{ relativePricePercentage = 0, RenewableGenerationPercentage = 1, CarbonDioxideEmission = 2};
-
-
-
-struct PhysicalValueType_DIN70121 				//The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
-{
-	int									Multiplier;			//range: -3..+3
-	enum unitSymbolType_DIN70121			Unit;		
-	short 								Value;
-}; 
-struct PhysicalValueType_ISO15118_2014			//The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
-{
-	int									Multiplier;			//range: -3..+3
-	enum unitSymbolType_ISO15118_2014		Unit;		
-	short 								Value;
-}; 
-struct PhysicalValueType_ISO15118_2018			//The final physical value is determined by: Value * 10 ^ Exponent [Unit]
-{
-	int									Exponent;		//range: -3..+3
-	short 								Value;
-}; 
-struct AppProtocolType 
-{
-	unsigned char	ProtocolNamespace[100];	
-	unsigned int	VersionNumberMajor;		
-	unsigned int	VersionNumberMinor;		
-	unsigned char	SchemaID;				
-	unsigned char	Priority;					//range 1..20
-}; 
-struct ACD_SSEnergyTransferModeType
-{
-	unsigned char	EVID[20];	
-}; 
-struct EVSEStatusType
-{
-	unsigned short				NotificationMaxDelay;	//in seconds
-	enum EVSENotificationType	EVSENotification;
-}; 
-struct ServiceIDListType
-{
-	unsigned short	ServiceID[10];	//refer to chapter 8.6.2.1 Table 192
-}; 
-struct PaymentOptionListType
-{
-	enum PaymentOptionType	PaymentOption[2];
-};
-struct ServiceTagType 
-{
-	unsigned short				ServiceID;
-	unsigned char				ServiceName[32];//Optional Element
-	enum ServiceCategoryType	ServiceCategory;
-	unsigned char				ServiceScope[32];//Optional Element
-}; 
-struct ServiceType_DIN70121 
-{
-	struct ServiceTagType		ServiceTag;
-	BOOL					FreeService;
-}; 
-struct ServiceType_ISO15118_2014
-{
-	unsigned short				ServiceID;
-	unsigned char				ServiceName[32];	//Optional
-	enum ServiceCategoryType	ServiceCategory;
-	unsigned char				ServiceScope[64];	//Optional
-	BOOL					FreeService;
-}; 
-/*struct ServiceType_ISO15118_2018
-{
-	unsigned short				ServiceID;
-	BOOL					FreeService;
-}; */
-struct SupportedEnergyTransferModeType
-{
-	enum EnergyTransferModeType	EnergyTransferMode[6];
-};
-struct ServiceChargeType 
-{
-	struct ServiceType_DIN70121				Services;
-	//enum EVSESupportedEnergyTransferType		EnergyTransferType;
-	enum EnergyTransferModeType			EnergyTransferType;
-}; 
-
-struct ChargeServiceType 
-{
-	struct ServiceType_ISO15118_2014			Services;
-	struct SupportedEnergyTransferModeType	SupportedEnergyTransferMode;
-}; 
-struct ServiceListType
-{
-	struct ServiceType_ISO15118_2014			Service[8];
-}; 
-struct IdentificationOptionListType	
-{
-	enum PaymentOptionType				IdentificationOption[2];
-}; 
-struct ParameterType
-{
-	unsigned char							Name[32];
-	struct PhysicalValueType_ISO15118_2014		PhysicalValue_ISO15118_2014;
-	struct PhysicalValueType_ISO15118_2018		PhysicalValue_ISO15118_2018;
-};
-struct ParameterSetType
-{
-	short 				ParameterSetID;
-	struct ParameterType	Parameter[16];
-};
-struct ServiceParameterListType
-{
-	struct ParameterSetType		ParameterSet[255];
-};
-struct WPT_SDlEnergyTransferModeType
-{
-	struct ServiceParameterListType	ServiceParameterList;
-};
-struct SelectedServiceType
-{
-	unsigned short			ServiceID;
-	short					ParameterSetID;
-};
-struct SelectedServiceListType	
-{
-	struct SelectedServiceType	SelectedService[16];
-};
-
-struct CertificateChainType
-{
-	unsigned char 				Id[32];				//Optional
-	unsigned char 				Certificate[800];		//check size again
-	unsigned char				SubCertificates[4][800];	//Optional, 	check size again
-};
-struct PNC_AReqIdentificationModeType
-{
-	unsigned char 			GenChallenge[16];					//DIN70121=> None,	ISO15118_2014=>None,	ISO15118_2018=>Optional 	
-	unsigned char 			Id[32];							//DIN70121=> None,	ISO15118_2014=>None,	ISO15118_2018=>Optional 	
-};
-struct AC_EVChargeParameterType 
-{
-	unsigned int 								DepartureTime;		//Optional
-	struct PhysicalValueType_ISO15118_2014			EAmount;
-	struct PhysicalValueType_ISO15118_2014			EVMaxVoltage;
-	struct PhysicalValueType_ISO15118_2014			EVMaxCurrent;
-	struct PhysicalValueType_ISO15118_2014			EVMinCurrent;
-}; 
-struct DC_EVStatusType_DIN70121
-{
-	BOOL						EVReady;
-	BOOL						EVCabinConditioning;
-	BOOL						EVRESSConiditioning;
-	enum DC_EVErrorCodeType		EVErrorCode;
-	unsigned char 					EVRESSSOC;		/*0-100 percentage*/	
-}; 
-struct DC_EVChargeParameterType_DIN70121	 
-{
-	struct DC_EVStatusType_DIN70121			DC_EVStatus;
-	struct PhysicalValueType_DIN70121			EVMaximumCurrentLimit;
-	struct PhysicalValueType_DIN70121			EVMaximumPowerLimit;			//Optional
-	struct PhysicalValueType_DIN70121			EVMaximumVoltageLimit;
-	struct PhysicalValueType_DIN70121			EVEnergyCapacity;				//Optional
-	struct PhysicalValueType_DIN70121			EVEnergyRequest;				//Optional
-	unsigned char							FullSOC;/*0-100 percentage*/		//Optional
-	unsigned char							BulkSOC;/*0-100 percentage*/	//Optional
-}; 
-struct DC_EVStatusType_ISO15118_2014 
-{
-	BOOL						EVReady;
-	enum DC_EVErrorCodeType		EVErrorCode;
-	unsigned char 					EVRESSSOC;		/*0-100 percentage*/	
-}; 
-struct DC_EVChargeParameterType_ISO15118_2014 
-{
-	unsigned int 								DepartureTime;				//Optional
-	struct DC_EVStatusType_ISO15118_2014			DC_EVStatus;
-	struct PhysicalValueType_ISO15118_2014 			EVMaximumCurrentLimit;
-	struct PhysicalValueType_ISO15118_2014			EVMaximumPowerLimit;			//Optional
-	struct PhysicalValueType_ISO15118_2014			EVMaximumVoltageLimit;
-	struct PhysicalValueType_ISO15118_2014			EVEnergyCapacity;				//Optional
-	struct PhysicalValueType_ISO15118_2014			EVEnergyRequest;				//Optional
-	unsigned char								FullSOC;/*0-100 percentage*/		//Optional
-	unsigned char								BulkSOC;/*0-100 percentage*/	//Optional
-}; 
-struct Dynamic_CPDReqControlModeType
-{
-	unsigned int 								DepartureTime;				
-};
-struct RelativeTimeIntervalType 
-{
-	unsigned int 	duration;			//Optional
-	unsigned int	start;
-}; 
-struct PMaxScheduleEntryType 
-{
-	struct RelativeTimeIntervalType	RelativeTimeInterval;
-	unsigned short					PMax;
-}; 
-struct PMaxScheduleType 
-{
-	unsigned short					PMaxScheduleID;			//no this itme in ISO15118_2014 
-	struct PMaxScheduleEntryType		PMaxScheduleEntry[1024];
-}; 
-struct CostType
-{
-	unsigned int 					amount;
-	enum CostKindType				costKind;
-	int 							amountMultiplier;		//Optional , range: -3..+3
-};
-struct ConsumptionCostType	
-{
-	struct CostType						Cost[3];
-	struct PhysicalValueType_ISO15118_2014		startValue;
-};
-struct SalesTariffEntryType	
-{
-	struct RelativeTimeIntervalType	RelativeTimeInterval;
-	unsigned char 					EPriceLevel;			//Optional
-	struct ConsumptionCostType		ConsumptionCost[3];	//Optional
-};
-struct SalesTariffType	
-{
-	unsigned char 					Id[32];					//Optional
-	short 						SalesTariffID;
-	unsigned char 					SalesTariffDescription[32];	//Optional
-	unsigned char 					NumEPriceLevels;			//Optional
-	struct SalesTariffEntryType			SalesTariffEntry[1024];
-};
-struct SAScheduleTupleType
-{
-	short 						SAScheduleTupleID;
-	struct PMaxScheduleType			PMaxSchedule;
-	struct SalesTariffType				SalesTariff;				//Optional
-};
-struct ScheduleListType
-{
-	enum ScheduleOriginType					ScheduleOrigin;
-	struct SAScheduleTupleType					ScheduleTuple[3];	
-};
-struct Scheduled_CPDReqControlModeType	
-{
-	enum ProcessingType						EVProcessing;
-	unsigned int 								DepartureTime;		//Optional
-	unsigned short 							MaxSupportingPoints;
-	struct ScheduleListType						ScheduleList;			//Optional
-};
-struct AC_CPDReqEnergyTransferModeType	
-{
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;
-};
-struct DC_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargePower;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			//Optional
-	unsigned char								TargetSOC;						//Optional
-	unsigned char								BulkSOC;							//Optional
-};
-struct BPT_AC_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;		
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;			
-};
-struct BPT_DC_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargePower;		
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargeCurrent;				
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;	
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			
-	unsigned char								TargetSOC;					//Optional
-	unsigned char								BulkSOC;						//Optional
-};	
-struct WPT_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumPower;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumPower;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;		//Optional
-};
-struct ACD_CPDReqEnergyTransferModeType	
-{
-	//cannot be found in standard
-};
-struct SAScheduleListType
-{
-	struct SAScheduleTupleType		SAScheduleTuple[3];
-};
-struct DC_EVSEStatusType_DIN70121 
-{
-	enum IsolationLevelType_DIN70121			EVSEIsolationStatus;			//Optional
-	enum DC_EVSEStatusCodeType			EVSEStatusCode;
-	unsigned int							NotificationMaxDelay;
-	enum EVSENotificationType				EVSENotification;
-}; 
-struct DC_EVSEChargeParameterType_DIN70121 
-{
-	struct DC_EVSEStatusType_DIN70121		DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121			EVSEMaximumCurrentLimit;
-	struct PhysicalValueType_DIN70121			EVSEMaximumPowerLimit;			//Optional
-	struct PhysicalValueType_DIN70121			EVSEMaximumVoltageLimit;
-	struct PhysicalValueType_DIN70121			EVSEMinimumCurrentLimit;
-	struct PhysicalValueType_DIN70121			EVSEMinimumVoltageLimit;
-	struct PhysicalValueType_DIN70121			EVSECurrentRegulationTolerance;		//Optional
-	struct PhysicalValueType_DIN70121			EVSEPeakCurrentRipple;
-	struct PhysicalValueType_DIN70121			EVSEEnergyToBeDelivered;			//Optional
-}; 
-struct AC_EVSEStatusType	
-{
-	BOOL							  		RCD;
-	unsigned short 							NotificationMaxDelay;
-	enum EVSENotificationType					EVSENotification;		//need to be confirmed
-}; 
-struct AC_EVSEChargeParameterType 
-{
-	struct AC_EVSEStatusType					AC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014			EVSENominalVoltage;
-	struct PhysicalValueType_ISO15118_2014			EVSEMaxCurrent;
-}; 
-struct DC_EVSEStatusType_ISO15118_2014
-{
-	unsigned short								NotificationMaxDelay;
-	enum EVSENotificationType					EVSENotification;
-	enum IsolationLevelType_ISO15118_2014			EVSEIsolationStatus;					//Optional
-	enum DC_EVSEStatusCodeType				DC_EVSEStatusCode;
-};
-struct DC_EVSEChargeParameterType_ISO15118_2014
-{
-	struct DC_EVSEStatusType_ISO15118_2014		DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014			EVSEMaximumCurrentLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSEMaximumPowerLimit;			
-	struct PhysicalValueType_ISO15118_2014			EVSEMaximumVoltageLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSEMinimumCurrentLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSEMinimumVoltageLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSECurrentRegulationTolerance;		//Optional
-	struct PhysicalValueType_ISO15118_2014			EVSEPeakCurrentRipple;
-	struct PhysicalValueType_ISO15118_2014			EVSEEnergyToBeDelivered;			//Optional
-}; 
-struct Scheduled_CPDResControlModeType	
-{
-	struct ScheduleListType						ScheduleList;
-};
-struct AC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent[3];
-	struct PhysicalValueType_ISO15118_2018			EVSENominalVoltage;
-	struct PhysicalValueType_ISO15118_2018			EVSENominalFrequency;
-};
-struct DC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargePower;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumVoltage;				
-};
-struct BPT_AC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent[3];		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumDischargeCurrent[3];			
-	struct PhysicalValueType_ISO15118_2018			EVSENominalVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVSENominalFrequency;			
-};
-struct BPT_DC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargePower;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumChargeCurrent;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumDischargeCurrent;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumVoltage;			
-};
-struct WPT_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumPower;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumPower;		
-};
-struct ACD_CPDResEnergyTransferModeType	
-{
-	//not found in ISO15118_2018
-};
-struct ProfileEntryType_DIN70121
-{
-	unsigned int 				ChargingProfileEntryStart;
-	short						ChargingProfileEntryMaxPower;
-};
-struct ChargingProfileType_DIN70121
-{
-	short 							SAScheduleTupleID;
-	struct ProfileEntryType_DIN70121		ProfileEntry[24];
-};
-struct DC_EVPowerDeliveryParameterType_DIN70121 
-{
-	struct DC_EVStatusType_DIN70121			DC_EVStatus;
-	BOOL								BulkChargingComplete;		//Optional
-	BOOL								ChargingComplete;
-}; 
-struct ProfileEntryType_ISO15118_2014 
-{
-	unsigned int 								ChargingProfileEntryStart;
-	struct PhysicalValueType_ISO15118_2018			ChargingProfileEntryMaxPower;
-	unsigned char 								ChargingProfileEntryMaxNumberOfPhasesInUse;	//Optional
-};
-struct ChargingProfileType_ISO15118_2014 
-{
-	struct ProfileEntryType_ISO15118_2014			ProfileEntry[24];
-};
-struct DC_EVPowerDeliveryParameterType_ISO15118_2014  
-{
-	struct DC_EVStatusType_ISO15118_2014 			DC_EVStatus;
-	BOOL									BulkChargingComplete;		//Optional
-	BOOL									ChargingComplete;
-}; 
-struct TimeInterval	
-{
-	unsigned int 								start;
-	unsigned int 								duration;				//Optional
-};
-struct PowerScheduleEntryType
-{
-	struct TimeInterval							TimeInterval;
-	struct PhysicalValueType_ISO15118_2018			Power[3];
-};
-struct EVPowerProfileType
-{
-	struct PowerScheduleEntryType				EVPowerProfileEntry[2048];
-};
-struct Scheduled_PDReqControlModeType
-{
-	unsigned char 								ScheduleTupleID;
-	struct EVPowerProfileType					EVPowerProfile;
-};
-struct BPT_Scheduled_PDReqControlModeType
-{
-	unsigned char 								ScheduleTupleID;
-	struct EVPowerProfileType					EVPowerProfile;			//Optional
-	enum evOperationType						EVOperation;
-};
-struct ListOfRootCertificateIDsType
-{
-	unsigned char 								RootCertificateID[20][40];
-};
-struct ContractSignatureEncryptedPrivateKeyType	
-{
-	unsigned char 								Id[32];
-};
-struct DiffieHellmanPublickeyType
-{
-	unsigned char 								Id[32];
-};
-struct ContractCertificateEncryptedPrivateKeyType
-{
-	unsigned char 								Id[32];
-};
-struct EVTechnicalStatusType
-{
-	BOOL									EV_Status_ReadyToCharge;
-	BOOL									EV_Status_ImmobilizationRequest;		//Optional
-	BOOL									EV_Status_Immobilized;
-	struct PhysicalValueType_ISO15118_2018			EV_Status_WLAN_Strength;
-	enum EV_CP_StatusType						EV_CP_Status;
-	unsigned char								EV_Status_RESSSOC;					//0~100%
-	enum EV_Error_Status_CodeType				EV_Error_Status_Code;	
-	BOOL									EVSE_Timeout;
-};
-struct MeterInfoType_ISO15118_2014		
-{
-	unsigned char								MeterID[32];
-	unsigned long 								MeterReading;						//Optional
-	unsigned char								SigMeterReading[64];				//Optional
-	short 									MeterStatus;						//Optional
-	short 									TMeter;							//Optional
-};
-struct Scheduled_MRReqControlModeType
-{
-	unsigned char 								ScheduleTupleID;
-};
-struct MeterInfoType_ISO15118_2018		
-{
-	unsigned char								MeterID[32];
-	unsigned long 								MeterReadingWhCharged;			//Optional
-	unsigned long 								MeterReadingWhDischarged;			//Optional
-	unsigned long 								MeterReadingVARhLeading;			//Optional
-	unsigned long 								MeterReadingVARhLagging;			//Optional
-	unsigned char								SignatureMeterReading[64];			//Optional
-	short 									MeterStatus;						//Optional
-	short 									TimeStampMeter;					//Optional
-	BOOL									ReceiptRequired;					//Optional
-};
-struct PnC_CLReqIdentificationModeType
-{
-	BOOL									MeteringReceiptRequested;
-};
-struct Dynamic_CSReqControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;
-};
-struct Scheduled_CSReqControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			//Optional
-	BOOL									Standby;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			//Optional
-};
-struct DisplayParametersType			
-{
-	unsigned short 							CurrentRange;
-	unsigned char	 							CurrentSOC;						//0~100%
-	unsigned char	 							MinimumSOC;						//0~100%
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToMaximumSOC;				
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToTargetSOC;		
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToBulkSOC;			
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToMinimumSOC;
-	BOOL									ChargingComplete;
-	BOOL									BulkChargingComplete;
-	BOOL									InletHot;			
-};		
-struct PnC_CLResIdentificationModeType
-{
-	struct MeterInfoType_ISO15118_2018			MeterInfo;		
-};
-struct Dynamic_CSResControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSETargetActivePower;
-};
-struct Scheduled_CDResControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargePower;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent;	//Optional
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumVoltage;			//Optional
-};
-struct LFA_EVFinePositioningSetupParametersType	
-{
-	unsigned char 								NumberOfSensors;
-	//NOT complete yet,  to be continue.....
-};
-
-/****SupportedAppProtocolRequest****/
-struct SupportedAppProtocolRequest_DIN70121 
-{
-	struct AppProtocolType	AppProtocol[20];			
-}; 
-struct SupportedAppProtocolRequest_ISO15118_2014 
-{
-	struct AppProtocolType	AppProtocol[20];			
-}; 
-struct SupportedAppProtocolRequest_ISO15118_2018 
-{
-	struct AppProtocolType	AppProtocol[20];			
-}; 
-/****SupportedAppProtocolResponse****/
-struct SupportedAppProtocolResponse_DIN70121 
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;			
-	unsigned char							SchemaID;				//Optional
-}; 
-struct SupportedAppProtocolResponse_ISO15118_2014 
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;	
-	unsigned char							SchemaID;				//Optional
-}; 
-struct SupportedAppProtocolResponse_ISO15118_2018
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;	
-	unsigned char							SchemaID;					//Optional
-}; 
-/****SessionSetupRequest****/
-struct SessionSetupRequest_DIN70121  
-{
-	unsigned char						EVCCID[8];						//the MAC address of the EVCC in Hex
-}; 
-struct SessionSetupRequest_ISO15118_2014 
-{
-	unsigned char						EVCCID[8];						//the MAC address of the EVCC in Hex
-}; 
-struct SessionSetupRequest_ISO15118_2018 
-{
-	unsigned char						EVCCID[8];						//the MAC address of the EVCC in Hex
-	struct ACD_SSEnergyTransferModeType	ACD_SSEnergyTransferMode;			//For ACD mandatory, optional for rest
-}; 
-/****SessionSetupResponse****/
-struct SessionSetupResponse_DIN70121   
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;		
-	unsigned char							EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	unsigned int							EVSETimeStamp;				//EPOCH format, Optional
-}; 
-struct SessionSetupResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;	
-	unsigned char							EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	unsigned int							EVSETimeStamp;				//EPOCH format, Optional
-}; 
-struct SessionSetupResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;	
-	unsigned char							EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	struct EVSEStatusType					EVSEStatus;					//Optional
-}; 
-/****ServiceDiscoveryRequest****/
-struct ServiceDiscoveryRequest_DIN70121    
-{
-	unsigned char				ServiceScope[32];		//Optional
-	enum ServiceCategoryType	ServiceCategory;		//Optional
-}; 
-struct ServiceDiscoveryRequest_ISO15118_2014 
-{
-	unsigned char				ServiceScope[32];		//Optional
-	enum ServiceCategoryType	ServiceCategory;		//Optional
-}; 
-struct ServiceDiscoveryRequest_ISO15118_2018  
-{
-	struct ServiceIDListType		SupportedServiceIDs;	//Optional
-}; 
-/****ServiceDiscoveryResponse****/
-struct ServiceDiscoveryResponse_DIN70121    
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;
-	struct PaymentOptionListType				PaymentOptions;				
-	struct ServiceChargeType				ChargeService_DIN70121;		
-}; 
-struct ServiceDiscoveryResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	struct PaymentOptionListType				PaymentOptions;				
-	struct ChargeServiceType				ChargeService;				
-	struct ServiceListType					ServiceList;					//Optional
-}; 
-struct ServiceDiscoveryResponse_ISO15118_2018  
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;		
-	struct EVSEStatusType					EVSEStatus;					//Optional
-	struct IdentificationOptionListType			IdentificationOptionList;			
-	struct ServiceListType					EnergyTransferServiceList;			
-	struct ServiceListType					VASList;						//Optional
-}; 
-/****ServiceDetailRequest****/
-//Only in ISO15118_2014 and ISO15118_2018
-struct ServiceDetailRequest_ISO15118_2014 
-{
-	unsigned short						ServiceID;								
-}; 
-struct ServiceDetailRequest_ISO15118_2018 
-{
-	unsigned short						ServiceID;						
-	struct WPT_SDlEnergyTransferModeType	WPT_SDlEnergyTransferMode;			
-}; 
-/****ServiceDetailResponse****/
-struct ServiceDetailResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	unsigned short							ServiceID;						
-	struct ServiceParameterListType 			ServiceParameterList;			
-}; 
-struct ServiceDetailResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	unsigned short							ServiceID;						
-	struct ServiceParameterListType 			ServiceParameterList;			
-	struct EVSEStatusType					EVSEStatus;					//Optional
-}; 
-/****ServiceAndPaymentSelectionRequest / ServiceSelectionRequest****/
-struct ServiceAndPaymentSelectionRequest_DIN70121	 
-{
-	enum PaymentOptionType		SelectedPaymentOption;		
-	struct SelectedServiceListType		SelectedServiceList;				
-}; 
-struct ServiceAndPaymentSelectionRequest_ISO15118_2014 
-{
-	enum PaymentOptionType		SelectedPaymentOption;		
-	struct SelectedServiceListType		SelectedServiceList;				
-}; 
-struct ServiceSelectionRequest_ISO15118_2018 
-{
-	enum PaymentOptionType			SelectedPaymentOption;		
-	struct SelectedServiceType			SelectedEnergyTransferService;	
-	struct SelectedServiceListType			SelectedVASList;				
-	enum ProcessingType				EVProcessing;						
-}; 
-/****ServiceAndPaymentSelectionResponse / ServiceSelectionResponse****/
-struct ServiceAndPaymentSelectionResponse_DIN70121	  
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;
-}; 
-struct ServiceAndPaymentSelectionResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-}; 
-struct ServiceSelectionResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	struct EVSEStatusType					EVSEStatus;					//Optional
-}; 
-/****PaymentDetailsRequest / IdentificationDetailsRequest****/
-struct PaymentDetailsRequest_ISO15118_2014 
-{
-	unsigned char 					eMAID[16];
-	struct CertificateChainType		ContractSignatureCertChain;
-};
-struct IdentificationDetailsRequest_ISO15118_2018  
-{
-	struct CertificateChainType		ContractSignatureCertChain;
-};
-/****PaymentDetailsResponse  / IdentificationDetailsResponse ****/
-struct PaymentDetailsResponse_ISO15118_2014 
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	unsigned char 							GenChallenge[16];
-	long 								EVSETimeStamp;
-};
-struct IdentificationDetailsResponse_ISO15118_2018   
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	struct EVSEStatusType					EVSEStatus;						//Optional
-	unsigned char 							GenChallenge[16];
-	enum ProcessingType					EVSEProcessing;			
-};
-/****ContractAuthenticationRequest / AuthorizationRequest****/
-struct ContractAuthenticationRequest_DIN70121	 
-{
-	//None
-}; 
-struct AuthorizationRequest_ISO15118_2014
-{
-	unsigned char 			GenChallenge[16];					//Optional
-	unsigned char 			Id[32];							//Optional
-}; 
-struct AuthorizationRequest_ISO15118_2018  
-{
-	struct PNC_AReqIdentificationModeType		PNC_AReqIdentificationMode;	//Optional
-};
-/****ContractAuthenticationResponse  / AuthorizationResponse****/
-struct ContractAuthenticationResponse_DIN70121	 
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;
-	enum EVSEProcessingType_DIN70121		EVSEProcessing;
-}; 
-struct AuthorizationResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	enum EVSEProcessingType_ISO15118_2014	EVSEProcessing;
-}; 
-struct AuthorizationResponse_ISO15118_2018   
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	enum ProcessingType					EVSEProcessing;
-	struct EVSEStatusType					EVSEStatus;						//Optional
-};
-/****ChargeParameterDiscoveryRequest****/
-struct ChargeParameterDiscoveryRequest_DIN70121	  
-{
-	enum EnergyTransferModeType					EVRequestedEnergyTransferType;			
-	struct DC_EVChargeParameterType_DIN70121		DC_EVChargeParameter;	
-}; 
-struct ChargeParameterDiscoveryRequest_ISO15118_2014 
-{
-	unsigned short										MaxEntriesSAScheduleTuple;			//Optional
-	enum EnergyTransferModeType						RequestedEnergyTransferMode;			
-	struct AC_EVChargeParameterType					AC_EVChargeParameter;			
-	struct DC_EVChargeParameterType_ISO15118_2014		DC_EVChargeParameter;	
-}; 
-struct ChargeParameterDiscoveryRequest_ISO15118_2018 
-{
-	struct Dynamic_CPDReqControlModeType			Dynamic_CPDReqControlMode;
-	struct Scheduled_CPDReqControlModeType			Scheduled_CPDReqControlMode;
-	struct AC_CPDReqEnergyTransferModeType			AC_CPDReqEnergyTransferMode;
-	struct DC_CPDReqEnergyTransferModeType			DC_CPDReqEnergyTransferMode;
-	struct BPT_AC_CPDReqEnergyTransferModeType		BPT_AC_CPDReqEnergyTransferMode;
-	struct BPT_DC_CPDReqEnergyTransferModeType		BPT_DC_CPDReqEnergyTransferMode;
-	struct WPT_CPDReqEnergyTransferModeType			WPT_CPDReqEnergyTransferMode;
-	struct ACD_CPDReqEnergyTransferModeType			ACD_CPDReqEnergyTransferMode;
-}; 
-/****ChargeParameterDiscoveryResponse****/
-struct ChargeParameterDiscoveryResponse_DIN70121	  
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	enum EVSEProcessingType_DIN70121					EVSEProcessing;
-	struct SAScheduleListType 							SAScheduleList;
-	struct DC_EVSEChargeParameterType_DIN70121			DC_EVSEChargeParameter;
-}; 
-struct ChargeParameterDiscoveryResponse_ISO15118_2014  
-{
-	enum EVSEProcessingType_ISO15118_2014				EVSEProcessing;
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct SAScheduleListType 							SAScheduleList;
-	struct AC_EVSEChargeParameterType					AC_EVSEChargeParameter;
-	struct DC_EVSEChargeParameterType_ISO15118_2014		DC_EVSEChargeParameter;
-}; 
-struct ChargeParameterDiscoveryResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	enum ProcessingType								EVSEProcessing;
-	struct Scheduled_CPDResControlModeType				Scheduled_CPDResControlMode;	//Optional
-	struct AC_CPDResEnergyTransferModeType				AC_CPDResEnergyTransferMode;
-	struct DC_CPDResEnergyTransferModeType				DC_CPDResEnergyTransferMode;
-	struct BPT_AC_CPDResEnergyTransferModeType			BPT_AC_CPDResEnergyTransferMode;
-	struct BPT_DC_CPDResEnergyTransferModeType			BPT_DC_CPDResEnergyTransferMode;
-	struct WPT_CPDResEnergyTransferModeType				WPT_CPDResEnergyTransferMode;
-	struct ACD_CPDResEnergyTransferModeType				ACD_CPDResEnergyTransferMode;
-}; 
-/****PowerDeliveryRequest****/
-struct PowerDeliveryRequest_DIN70121	   
-{
-	BOOL											ReadyToChargeState;
-	struct ChargingProfileType_DIN70121					ChargingProfile;
-	struct DC_EVPowerDeliveryParameterType_DIN70121		DC_EVPowerDeliveryParameter;
-}; 
-struct PowerDeliveryRequest_ISO15118_2014 
-{
-	enum ChargeProgressType_ISO15118_2014				ChargeProgress;
-	short 											SAScheduleTupleID;
-	struct ChargingProfileType_ISO15118_2014 				ChargingProfile;
-	struct DC_EVPowerDeliveryParameterType_ISO15118_2014	DC_EVPowerDeliveryParameter;
-}; 
-struct PowerDeliveryRequest_ISO15118_2018
-{
-	enum ChargeProgressType_ISO15118_2018				ChargeProgress;
-	struct Scheduled_PDReqControlModeType				Scheduled_PDReqControlMode;
-	struct BPT_Scheduled_PDReqControlModeType			BPT_Scheduled_PDReqControlMode;
-}; 
-/****PowerDeliveryResponse****/
-struct PowerDeliveryResponse_DIN70121	    
-{
-	enum ResponseCodeType_DIN70121				ResponseCode;
-	struct DC_EVSEStatusType_DIN70121				DC_EVSEStatus;
-}; 
-struct PowerDeliveryResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct AC_EVSEStatusType							AC_EVSEStatus;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-}; 
-struct PowerDeliveryResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;			//Optional
-}; 
-/****CertificateUpdateRequest****/
-struct CertificateUpdateRequest_ISO15118_2014
-{
-	unsigned char 										Id[32];
-	struct CertificateChainType							ContractSignatureCertChain;
-	unsigned char 										eMAID[16];
-	struct ListOfRootCertificateIDsType						ListOfRootCertificateIDs;
-}; 
-/****CertificateUpdateResponse****/
-struct CertificateUpdateResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct CertificateChainType							SAProvisioningCertificateChain;
-	struct CertificateChainType							ContractSignatureCertChain;
-	struct ContractSignatureEncryptedPrivateKeyType			ContractSignatureEncryptedPrivateKey;
-	struct DiffieHellmanPublickeyType						DHpublickey;
-	unsigned char 										eMAID[16];
-	short 											RetryCounter;							//Optional
-}; 
-/****CertificateInstallationRequest****/
-struct CertificateInstallationRequest_ISO15118_2014
-{
-	unsigned char 										Id[32];
-	unsigned char 										OEMProvisioningCert[800];
-	struct ListOfRootCertificateIDsType						ListOfRootCertificateIDs;
-}; 
-struct CertificateInstallationRequest_ISO15118_2018
-{
-	unsigned char 										Id[32];
-	struct CertificateChainType							OEMProvisioningCertChain;
-	struct ListOfRootCertificateIDsType						ListOfRootCertificateIDs;
-	unsigned short										MaxSupportedCerts;
-}; 
-/****CertificateInstallationResponse****/
-struct CertificateInstallationResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct CertificateChainType							SAProvisioningCertificateChain;
-	struct CertificateChainType							ContractSignatureCertChain;
-	struct ContractSignatureEncryptedPrivateKeyType			ContractSignatureEncryptedPrivateKey;
-	struct DiffieHellmanPublickeyType						DHpublickey;
-	unsigned char 										eMAID[16];
-}; 
-struct CertificateInstallationResponse_ISO15118_2018
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	struct CertificateChainType							SAProvisioningCertificateChain;
-	struct CertificateChainType							ContractCertificateChain;
-	struct ContractCertificateEncryptedPrivateKeyType		ContractEncryptedPrivateKey;
-	struct DiffieHellmanPublickeyType						DHpublickey;
-	enum ProcessingType								EVSEProcessing;
-	unsigned short 									RemainingContractCertificateChains;
-}; 
-/****SystemStatusRequest****/
-struct SystemStatusRequest_ISO15118_2018
-{
-	enum mechanicalChargingDeviceStatusType			EVMechanicalChargingDeviceStatus;
-	struct EVTechnicalStatusType							EVTechnicalStatus;
-	unsigned char 										EV_OEMStatus[800];					//Optional
-};
-/****SystemStatusResponse****/
-struct SystemStatusResponse_ISO15118_2018
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	enum mechanicalChargingDeviceStatusType			EVSEMechanicalChargingDeviceStatus;
-	BOOL											EVSE_ReadyToCharge;
-	enum IsolationStatusType							EVSE_IsolationStatus;
-	BOOL											EVSE_Disabled;
-	BOOL											EVSE_UtilityInterruptEvent;
-	BOOL											EVSE_EmergencyShutdown;
-	BOOL											EVSE_Malfunction;
-	BOOL											EV_InChargePosition;
-	BOOL											EV_AssociationStatus;
-};
-/****SessionStopRequest****/
-struct SessionStopRequest_DIN70121	   
-{
-	//No member in standard
-}; 	
-struct SessionStopRequest_ISO15118_2014 
-{
-	enum ChargingSessionType							ChargingSession;
-}; 	
-struct SessionStopRequest_ISO15118_2018 
-{
-	enum ChargingSessionType							ChargingSession;
-}; 	
-/****SessionStopResponse****/
-struct SessionStopResponse_DIN70121	    
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-}; 
-struct SessionStopResponse_ISO15118_2014	    
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-}; 
-struct SessionStopResponse_ISO15118_2018     
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-}; 
-/****MeteringReceiptRequest****/
-struct MeteringReceiptRequest_ISO15118_2014	  	    
-{
-	unsigned char 										Id[32];						//Optional
-	unsigned char 										SessionID[8];
-	short 											SAScheduleTupleID;				//Optional
-	struct MeterInfoType_ISO15118_2014					MeterInfo;
-}; 
-struct MeteringReceiptRequest_ISO15118_2018	  	    
-{
-	unsigned char 										Id[32];						//Optional
-	unsigned char 										SessionID[8];
-	struct Scheduled_MRReqControlModeType				Schedule_MRReqControlMode;
-	struct MeterInfoType_ISO15118_2018					MeterInfo;								
-}; 
-/****MeteringReceiptResponse****/
-struct MeteringReceiptResponse_ISO15118_2014	  	    
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct AC_EVSEStatusType							AC_EVSEStatus;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-}; 
-struct MeteringReceiptResponse_ISO15118_2018	  	    
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-}; 
-/****ChargingStatusRequest (AC Only)****/
-struct ChargingStatusRequest_ISO15118_2014	  	    
-{
-	//No member in standard
-}; 
-struct ChargingStatusRequest_ISO15118_2018	  	    
-{
-	struct PnC_CLReqIdentificationModeType				PnC_CLReqIdentificationMode;
-	struct Dynamic_CSReqControlModeType				Dynamic_CSReqControlMode;
-	struct Scheduled_CSReqControlModeType				Scheduled_CSReqControlMode;
-	struct DisplayParametersType							DisplayParameters;
-}; 
-/****ChargingStatusResponse (AC Only)****/
-struct ChargingStatusResponse_ISO15118_2014	  	    
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	unsigned char										EVSEID[40];			//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	short 											SAScheduleTupleID;
-	struct PhysicalValueType_ISO15118_2014					EVSEMaxCurrent;		//Optional
-	struct MeterInfoType_ISO15118_2014					MeterInfo;			//Optional
-	BOOL											ReceiptRequired;		//Optional
-	struct AC_EVSEStatusType							AC_EVSEStatus;
-}; 
-struct ChargingStatusResponse_ISO15118_2018	  	    
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	unsigned char										EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	struct PhysicalValueType_ISO15118_2018					EVSETargetFrequency;			//Optional
-	struct PnC_CLResIdentificationModeType				PnC_CLResIdentificationMode;
-	struct Dynamic_CSResControlModeType					Dynamic_CSResControlMode;
-	struct Scheduled_CSReqControlModeType				Scheduled_CSReqControlMode;
-}; 
-/****CableCheckRequest (DC Only)****/
-struct CableCheckRequest_DIN70121	     
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-};
-struct CableCheckRequest_ISO15118_2014 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-};
-struct CableCheckRequest_ISO15118_2018	    
-{
-	//No member in standard
-};
-/****CableCheckResponse (DC Only)****/
-struct CableCheckResponse_DIN70121	    
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	enum EVSEProcessingType_DIN70121					EVSEProcessing;
-}; 
-struct CableCheckResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	enum EVSEProcessingType_ISO15118_2014				EVSEProcessing;
-}; 
-struct CableCheckResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	enum ProcessingType								EVSEProcessing;
-}; 
-/****PreChargeRequest (DC Only)****/
-struct PreChargeRequest_DIN70121	     
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-	struct PhysicalValueType_DIN70121						EVTargetVoltage;
-	struct PhysicalValueType_DIN70121						EVTargetCurrent;
-}; 
-struct PreChargeRequest_ISO15118_2014 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-	struct PhysicalValueType_ISO15118_2014					EVTargetVoltage;
-	struct PhysicalValueType_ISO15118_2014					EVTargetCurrent;
-}; 
-struct PreChargeRequest_ISO15118_2018      
-{
-	struct PhysicalValueType_ISO15118_2018					EVTargetVoltage;
-	struct PhysicalValueType_ISO15118_2018					EVTargetCurrent;
-}; 
-/****PreChargeResponse (DC Only)****/
-struct PreChargeResponse_DIN70121 
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121						EVSEPresentVoltage;
-}; 
-struct PreChargeResponse_ISO15118_2014		
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentVoltage;
-}; 
-struct PreChargeResponse_ISO15118_2018  
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentVoltage;
-}; 
-/****CurrentDemandRequest (DC Only)****/
-struct CurrentDemandRequest_DIN70121 
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-	struct PhysicalValueType_DIN70121						EVTargetCurrent;
-	struct PhysicalValueType_DIN70121						EVMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVMaximumPowerLimit;			//Optional
-	BOOL											BulkChargingComplete;			//Optional
-	BOOL											ChargingComplete;
-	struct PhysicalValueType_DIN70121						RemainingTimeToFullSoC;		//Optional
-	struct PhysicalValueType_DIN70121						RemainingTimeToBulkSoC;		//Optional
-	struct PhysicalValueType_DIN70121						EVTargetVoltage;
-};
-struct CurrentDemandRequest_ISO15118_2014	 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-	struct PhysicalValueType_ISO15118_2014					EVTargetCurrent;
-	struct PhysicalValueType_ISO15118_2014					EVMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVMaximumPowerLimit;			//Optional
-	BOOL											BulkChargingComplete;			//Optional
-	BOOL											ChargingComplete;
-	struct PhysicalValueType_ISO15118_2014					RemainingTimeToFullSoC;		//Optional
-	struct PhysicalValueType_ISO15118_2014					RemainingTimeToBulkSoC;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVTargetVoltage;
-};
-struct CurrentDemandRequest_ISO15118_2018 
-{
-	struct DisplayParametersType							DisplayParameters;				//Optional
-	struct PnC_CLReqIdentificationModeType				PnC_CLReqIdentificationMode;
-	struct Dynamic_CSReqControlModeType				Dynamic_CDReqControlMode;
-	struct Scheduled_CSReqControlModeType				Scheduled_CDReqControlMode;
-};
-/****CurrentDemandResponse (DC Only)****/
-struct CurrentDemandResponse_DIN70121		 
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121						EVSEPresentVoltage;
-	struct PhysicalValueType_DIN70121						EVSEPresentCurrent;
-	BOOL											EVSECurrentLimitAchieved;
-	BOOL											EVSEVoltageLimitAchieved;
-	BOOL											EVSEPowerLimitAchieved;
-	struct PhysicalValueType_DIN70121						EVSEMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVSEMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVSEMaximumPowerLimit;		//Optional
-}; 	
-struct CurrentDemandResponse_ISO15118_2014			 
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentVoltage;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentCurrent;
-	BOOL											EVSECurrentLimitAchieved;
-	BOOL											EVSEVoltageLimitAchieved;
-	BOOL											EVSEPowerLimitAchieved;
-	struct PhysicalValueType_ISO15118_2014					EVSEMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVSEMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVSEMaximumPowerLimit;		//Optional
-	unsigned char										EVSEID[40];			//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	short 											SAScheduleTupleID;
-	struct MeterInfoType_ISO15118_2014					MeterInfo;			//Optional
-	BOOL											ReceiptRequired;		//Optional
-}; 	
-struct CurrentDemandResponse_ISO15118_2018		 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;						//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentVoltage;
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentCurrent;
-	BOOL											EVSECurrentLimitAchieved;
-	BOOL											EVSEVoltageLimitAchieved;
-	BOOL											EVSEPowerLimitAchieved;
-	struct PhysicalValueType_ISO15118_2018					EVSEMaximumChargeVoltage;		//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEMaximumChargeCurrent;		//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEMaximumChargePower;			//Optional
-	unsigned char										EVSEID[40];						//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	struct PnC_CLResIdentificationModeType				PnC_CLResIdentificationMode;
-	struct Scheduled_CDResControlModeType				Scheduled_CDResControlMode;
-}; 	
-/****WeldingDetectionRequest (DC Only)*****/
-struct WeldingDetectionRequest_DIN70121 
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-}; 	
-struct WeldingDetectionRequest_ISO15118_2014 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-}; 	
-struct WeldingDetectionRequest_ISO15118_2018 
-{
-	//No member in Standard
-}; 	
-/****WeldingDetectionResponse (DC Only)****/
-struct WeldingDetectionResponse_DIN70121  
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121						EVSEPresentVoltage;
-}; 	
-struct WeldingDetectionResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentVoltage;
-}; 	
-struct WeldingDetectionResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;						//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentVoltage;
-}; 	
-/****FinePositioningSetupRequest (WPT Only)****/
-struct FinePositioningSetupRequest_ISO15118_2018 
-{
-	struct LFA_EVFinePositioningSetupParametersType			LFA_EVFinePositioningSetupParameters;	//Optional
-};
-/****FinePositioningSetupResponse (WPT Only)****/
-struct FinePositioningSetupResponse_ISO15118_2018 
-{
-	//NOT complete yet,  to be continue.....
-};
-
-
-struct V2GMessageType_DIN70121
-{
-	unsigned char											PresentMsgFlowStatus;
-														/* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
-														    4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
-														    8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
-														    12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
-														    16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
-														    19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
-														    22: ServiceDetailRequest, 23: ServiceDetailResponse
-														    24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
-														    26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
-														     28: AuthorizationRequest, 29: AuthorizationResponse, 
-														    30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
-														    34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
-														    36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
-														    40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
-														    44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse 
-														    48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse, 
-														    52: SessionStopRequest, 53: SessionStopResponse
-														   253: Performance Timeout, 254: Sequence Timeout, 255: Fault 	
-														*/ 		
-	struct SupportedAppProtocolRequest_DIN70121 			SupportedAppProtocolRequest;
-	struct SupportedAppProtocolResponse_DIN70121 			SupportedAppProtocolResponse;
-	struct SessionSetupRequest_DIN70121  					SessionSetupRequest;
-	struct SessionSetupResponse_DIN70121   				SessionSetupResponse;
-	struct ServiceDiscoveryRequest_DIN70121    				ServiceDiscoveryRequest;
-	struct ServiceDiscoveryResponse_DIN70121    				ServiceDiscoveryResponse;
-	struct ServiceAndPaymentSelectionRequest_DIN70121		ServiceAndPaymentSelectionRequest; 
-	struct ServiceAndPaymentSelectionResponse_DIN70121		ServiceAndPaymentSelectionResponse;
-	struct ContractAuthenticationRequest_DIN70121			ContractAuthenticationRequest;
-	struct ContractAuthenticationResponse_DIN70121	 		ContractAuthenticationResponse;
-	struct ChargeParameterDiscoveryRequest_DIN70121		ChargeParameterDiscoveryRequest;
-	struct ChargeParameterDiscoveryResponse_DIN70121		ChargeParameterDiscoveryResponse;
-	struct CableCheckRequest_DIN70121					CableCheckRequest;
-	struct CableCheckResponse_DIN70121					CableCheckResponse;
-	struct PreChargeRequest_DIN70121					PreChargeRequest;
-	struct PreChargeResponse_DIN70121 					PreChargeResponse;
-	struct PowerDeliveryRequest_DIN70121					PowerDeliveryRequest;
-	struct PowerDeliveryResponse_DIN70121	   				PowerDeliveryResponse;
-	struct CurrentDemandRequest_DIN70121 				CurrentDemandRequest;
-	struct CurrentDemandResponse_DIN70121				CurrentDemandResponse;
-	struct WeldingDetectionRequest_DIN70121 				WeldingDetectionRequest;
-	struct WeldingDetectionResponse_DIN70121  			WeldingDetectionResponse;
-	struct SessionStopRequest_DIN70121					SessionStopRequest;
-	struct SessionStopResponse_DIN70121	    				SessionStopResponse;
-};
-
-struct V2GMessageType_ISO15118_2014
-{
-	unsigned char											PresentMsgFlowStatus;
-														/* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
-														    4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
-														    8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
-														    12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
-														    16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
-														    19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
-														    22: ServiceDetailRequest, 23: ServiceDetailResponse
-														    24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
-														    26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
-														     28: AuthorizationRequest, 29: AuthorizationResponse, 
-														    30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
-														    34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
-														    36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
-														    40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
-														    44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse 
-														    48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse, 
-														    52: SessionStopRequest, 53: SessionStopResponse
-														   253: Performance Timeout, 254: Sequence Timeout, 255: Fault 	
-														*/ 		
-	struct SupportedAppProtocolRequest_ISO15118_2014 			SupportedAppProtocolRequest;
-	struct SupportedAppProtocolResponse_ISO15118_2014 			SupportedAppProtocolResponse;
-	struct SessionSetupRequest_ISO15118_2014  					SessionSetupRequest;
-	struct SessionSetupResponse_ISO15118_2014   				SessionSetupResponse;
-	struct ServiceDiscoveryRequest_ISO15118_2014    				ServiceDiscoveryRequest;
-	struct ServiceDiscoveryResponse_ISO15118_2014    				ServiceDiscoveryResponse;
-	struct ServiceDetailRequest_ISO15118_2014 					ServiceDetailRequest;
-	struct ServiceDetailResponse_ISO15118_2014					ServiceDetailResponse;
-	struct ServiceAndPaymentSelectionRequest_ISO15118_2014 		ServiceAndPaymentSelectionRequest;
-	struct ServiceAndPaymentSelectionResponse_ISO15118_2014  	ServiceAndPaymentSelectionResponse;
-	struct PaymentDetailsRequest_ISO15118_2014 				PaymentDetailsRequest;
-	struct PaymentDetailsResponse_ISO15118_2014 				PaymentDetailsResponse;
-	struct AuthorizationRequest_ISO15118_2014					AuthorizationRequest;
-	struct AuthorizationResponse_ISO15118_2014					AuthorizationResponse;
-	struct CertificateUpdateRequest_ISO15118_2014				CertificateUpdateRequest;
-	struct CertificateUpdateResponse_ISO15118_2014				CertificateUpdateResponse;
-	struct CertificateInstallationRequest_ISO15118_2014			CertificateInstallationRequest;
-	struct CertificateInstallationResponse_ISO15118_2014			CertificateInstallationResponse;
-	struct ChargeParameterDiscoveryRequest_ISO15118_2014 		ChargeParameterDiscoveryRequest;
-	struct ChargeParameterDiscoveryResponse_ISO15118_2014  		ChargeParameterDiscoveryResponse;
-	struct CableCheckRequest_ISO15118_2014 					CableCheckRequest;
-	struct CableCheckResponse_ISO15118_2014  					CableCheckResponse;
-	struct PreChargeRequest_ISO15118_2014 					PreChargeRequest;
-	struct PreChargeResponse_ISO15118_2014					PreChargeResponse;
-	struct PowerDeliveryRequest_ISO15118_2014					PowerDeliveryRequest;
-	struct PowerDeliveryResponse_ISO15118_2014					PowerDeliveryResponse;
-	struct ChargingStatusRequest_ISO15118_2014	  				ChargingStatusRequest;	  
-	struct ChargingStatusResponse_ISO15118_2014				ChargingStatusResponse;
-	struct CurrentDemandRequest_ISO15118_2014	 			CurrentDemandRequest;
-	struct CurrentDemandResponse_ISO15118_2014				CurrentDemandResponse;
-	struct MeteringReceiptRequest_ISO15118_2014				MeteringReceiptRequest;  
-	struct MeteringReceiptResponse_ISO15118_2014				MeteringReceiptResponse;
-	struct WeldingDetectionRequest_ISO15118_2014 				WeldingDetectionRequest;
-	struct WeldingDetectionResponse_ISO15118_2014  			WeldingDetectionResponse;
-	struct SessionStopRequest_ISO15118_2014 					SessionStopRequest;
-	struct SessionStopResponse_ISO15118_2014					SessionStopResponse;
-};
-struct V2GMessageType_ISO15118_2018
-{
-	unsigned char										PresentMsgFlowStatus;
-													/* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
-													    4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
-													    8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
-													    12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
-													    16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
-													    19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
-													    22: ServiceDetailRequest, 23: ServiceDetailResponse
-													    24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
-													    26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
-													     28: AuthorizationRequest, 29: AuthorizationResponse, 
-													    30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
-													    34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
-													    36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
-													    40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
-													    44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse 
-													    48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse, 
-													    52: SessionStopRequest, 53: SessionStopResponse
-													   253: Performance Timeout, 254: Sequence Timeout, 255: Fault 	
-													*/ 		
-	struct SupportedAppProtocolRequest_ISO15118_2018			SupportedAppProtocolRequest;
-	struct SupportedAppProtocolResponse_ISO15118_2018 			SupportedAppProtocolResponse;
-	struct SessionSetupRequest_ISO15118_2018					SessionSetupRequest;
-	struct SessionSetupResponse_ISO15118_2018  					SessionSetupResponse;
-	struct ServiceDiscoveryRequest_ISO15118_2018    				ServiceDiscoveryRequest;
-	struct ServiceDiscoveryResponse_ISO15118_2018    				ServiceDiscoveryResponse;
-	struct ServiceDetailRequest_ISO15118_2018 					ServiceDetailRequest;
-	struct ServiceDetailResponse_ISO15118_2018					ServiceDetailResponse;
-	struct ServiceSelectionRequest_ISO15118_2018				ServiceSelectionRequest;
-	struct ServiceSelectionResponse_ISO15118_2018				ServiceSelectionResponse;
-	struct IdentificationDetailsRequest_ISO15118_2018  			IdentificationDetailsRequest;
-	struct IdentificationDetailsResponse_ISO15118_2018  			IdentificationDetailsResponse;
-	struct AuthorizationRequest_ISO15118_2018  					AuthorizationRequest;
-	struct AuthorizationResponse_ISO15118_2018					AuthorizationResponse;
-	struct CertificateInstallationRequest_ISO15118_2018			CertificateInstallationRequest;
-	struct CertificateInstallationResponse_ISO15118_2018			CertificateInstallationResponse;
-	struct ChargeParameterDiscoveryRequest_ISO15118_2018 		ChargeParameterDiscoveryRequest;
-	struct ChargeParameterDiscoveryResponse_ISO15118_2018  		ChargeParameterDiscoveryResponse;
-	struct CableCheckRequest_ISO15118_2018 					CableCheckRequest;
-	struct CableCheckResponse_ISO15118_2018 					CableCheckResponse;
-	struct PreChargeRequest_ISO15118_2018 					PreChargeRequest;
-	struct PreChargeResponse_ISO15118_2018					PreChargeResponse;
-	struct PowerDeliveryRequest_ISO15118_2018					PowerDeliveryRequest;
-	struct PowerDeliveryResponse_ISO15118_2018					PowerDeliveryResponse;
-	struct ChargingStatusRequest_ISO15118_2018	  				ChargingStatusRequest;	  
-	struct ChargingStatusResponse_ISO15118_2018				ChargingStatusResponse;
-	struct CurrentDemandRequest_ISO15118_2018	 			CurrentDemandRequest;
-	struct CurrentDemandResponse_ISO15118_2018				CurrentDemandResponse;
-	struct MeteringReceiptRequest_ISO15118_2018				MeteringReceiptRequest;  
-	struct MeteringReceiptResponse_ISO15118_2018				MeteringReceiptResponse;
-	struct WeldingDetectionRequest_ISO15118_2018 				WeldingDetectionRequest;
-	struct WeldingDetectionResponse_ISO15118_2018  			WeldingDetectionResponse;
-	struct SessionStopRequest_ISO15118_2018 					SessionStopRequest;
-	struct SessionStopResponse_ISO15118_2018					SessionStopResponse;
-};
-
-struct CcsData 
-{
-	unsigned char 							CommProtocol;	// 1: V2GMessage_DIN70121, 2:V2GMessage_ISO15118_2014, 3:V2GMessage_ISO15118_2018
-	struct V2GMessageType_DIN70121			V2GMessage_DIN70121[CCS_QUANTITY];
-	struct V2GMessageType_ISO15118_2014  		V2GMessage_ISO15118_2014[CCS_QUANTITY];
-	struct V2GMessageType_ISO15118_2018  		V2GMessage_ISO15118_2018[CCS_QUANTITY];
-};
-/**************************************************************************************/
-/***************STM32F407 Communication Share memory**************************/
-/**************************************************************************************/
-struct PrimaryMcuData 
-{
-	unsigned char	version[16];									//STM32F407 firmware version
-	unsigned int 	InputVoltage;									//value comes from external meter 
-	unsigned int 	InputCurrent;									//value comes from external meter 
-	union
-	{    
-		unsigned char OutputDrvValue[1];
-		struct
-		{
-			//OutputDrvValue[0]
-		    	unsigned char AcContactorDrv:1;						//bit 0,	H: ON, 		L:OFF
-			unsigned char Button1LedDrv:1;						//bit 1,	H: ON, 		L:OFF
-			unsigned char Button2LedDrv:1; 						//bit 2,	H: ON, 		L:OFF
-			unsigned char SystemLed1Drv:1;						//bit 3,	H: ON, 		L:OFF     
-			unsigned char SystemLed2Drv:1;						//bit 4,	H: ON, 		L:OFF  	  
-			unsigned char SystemLed3Drv:1;						//bit 5,	H: ON, 		L:OFF 		          
-			unsigned char SystemLed4Drv:1;						//bit 6,	H: ON, 		L:OFF  
-			unsigned char:1;									//bit 7 reserved 
-		}bits;
-	}OutputDrv;       
-	union
-	{    
-		unsigned char InputDetValue[2];
-		struct
-		{
-			//InputDetValue[0]
-		    	unsigned char AcContactorDetec:1;					//bit 0,	H: ON, 		L:OFF
-			unsigned char AcMainBreakerDetec:1;					//bit 1,	H: ON, 		L:OFF
-			unsigned char SpdDetec:1; 							//bit 2,	H: ON, 		L:OFF
-			unsigned char DoorOpen:1;							//bit 3,	H: Open,		L:Close		              
-			unsigned char Gfd1:1;								//bit 4,	H: Trigger,		L:Normal 		          
-			unsigned char Gfd2:1;								//bit 5,	H: Trigger,		L:Normal 		            		  
-			unsigned char Button1:1;								//bit 6 ,	H: Push, 		L:Release 
-			unsigned char Button2:1;								//bit 7,	H: Push, 		L:Release 
-			//InputDetValue[1]		
-			unsigned char EmergencyButton:1;						//bit 0,	H: Push, 		L:Release 
-			unsigned char :7;									//bit 1~7,	Reserved    
-		}bits;
-	}InputDet;       
-};
-/**************************************************************************************/
-/*************Fan power module Communication Share memory******************/
-/**************************************************************************************/
-struct FanModuleData 
-{
-	unsigned char	version[16];			//fan power module firmware version
-	unsigned short	PresentFan1Speed;		//RPM
-	unsigned short	PresentFan2Speed;		//RPM
-	unsigned short	PresentFan3Speed;		//RPM
-	unsigned short	PresentFan4Speed;		//RPM
-	unsigned short	SetFan1Speed;			//RPM
-	unsigned short	SetFan2Speed;			//RPM
-	unsigned short	SetFan3Speed;			//RPM
-	unsigned short	SetFan4Speed;			//RPM
-	unsigned char	DiffOfAirPressure;		//pa
-	unsigned char	UpdateFW;			//1:do update
-};
-
-/**************************************************************************************/
-/***********Relay control module Communication Share memory******************/
-/**************************************************************************************/
-struct RelayModuleData 
-{
-	unsigned char	version[16];				//fan power module firmware version
-	unsigned short	InputL1Volt;				//XXXXX.x volt
-	unsigned short	InputL2Volt;				//XXXXX.x volt
-	unsigned short	InputL3Volt;				//XXXXX.x volt
-	unsigned short	Gun1FuseOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun2FuseOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun1RelayOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun2RelayOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun1OutputCurrent;		//XXXXX.x amp
-	unsigned short	Gun2OutputCurrent;		//XXXXX.x amp
-	unsigned char	UpdateFW;				//1:do update
-};
-
-/**************************************************************************************/
-/************************OCPP Share memory***************************************/
-/**************************************************************************************/
-struct StructIdTagInfo
-{
-	unsigned char 	ExpiryDate[28];
-	unsigned char 	ParentIdTag[20];	
-	unsigned char 	Status[16];		//Accepted, Blocked, Expired, Invalid, ConcurrentTx
-};
-struct StructLocalAuthorizationList
-{
-	unsigned char 			IdTag[20];	
-	struct StructIdTagInfo	IdTagInfo;
-};
-struct StructSampledValue
-{
-	unsigned char 			Value[128];
-	unsigned char 			Context[20];//Interruption.Begin, Interruption.End, Sample.Clock, Sample.Periodic, Transaction.Begin, Transaction.End, Trigger, Other
-	unsigned char 			Format[12];//Raw,SignedData
-	unsigned char 			Measurand[32];/*	"Energy.Active.Export.Register",
-										"Energy.Active.Import.Register",
-										"Energy.Reactive.Export.Register",
-										"Energy.Reactive.Import.Register",
-										"Energy.Active.Export.Interval",
-										"Energy.Active.Import.Interval",
-										"Energy.Reactive.Export.Interval",
-										"Energy.Reactive.Import.Interval",
-										"Power.Active.Export",
-										"Power.Active.Import",
-										"Power.Offered",
-										"Power.Reactive.Export",
-										"Power.Reactive.Import",
-										"Power.Factor",
-										"Current.Import",
-										"Current.Export",
-										"Current.Offered",
-										"Voltage",
-										"Frequency",
-										"Temperature",
-										"SoC",
-										"RPM"
-										*/
-										
-	unsigned char 			Phase[8];	/*		"L1",
-										"L2",
-										"L3",
-										"N",
-										"L1-N",
-										"L2-N",
-										"L3-N",
-										"L1-L2",
-										"L2-L3",
-										"L3-L1"
-								*/		
-	
-	unsigned char 			Location[8];		//Cable,EV,Inlet,Outlet,Body
-	unsigned char 			Unit[12];	/*		"Wh",
-										"kWh",
-										"varh",
-										"kvarh",
-										"W",
-										"kW",
-										"VA",
-										"kVA",
-										"var",
-										"kvar",
-										"A",
-										"V",
-										"K",
-										"Celcius",
-										"Fahrenheit",
-										"Percent"
-								*/		
-};
-struct StructMeterValue
-{
-	unsigned char 				TimeStamp[28];
-	struct StructSampledValue	*SampledValue;
-};
-struct StructConfigurationKeyItems
-{
-	unsigned char 	Item[50];
-};
-struct StructConfigurationKey
-{
-	unsigned char 	Key[50];
-	unsigned char 	ReadOnly[8];	//boolean
-	unsigned char 	Value[500];
-};
-struct StructChargingSchedulePeriod
-{
-	int		StartPeriod;
-	float 	Limit;//0.1;
-	int		NumberPhases;
-};
-struct StructChargingSchedule
-{
-	int								Duration;
-	unsigned char 						StartSchedule[28];
-	unsigned char 						ChargingRateUnit[4];		//A, W
-	struct StructChargingSchedulePeriod	*ChargingSchedulePeriod;
-	float 							MinChargingRate;			//0.1;
-};
-struct StructChargingProfile
-{
-	int							ChargingProfileId;
-	int							TransactionId;
-	int							StackLevel;
-	unsigned char 					ChargingProfilePurpose[24];	//ChargePointMaxProfile, TxDefaultProfile, TxProfile
-	unsigned char 					ChargingProfileKind[12];		//Absolute, Recurring, Relative
-	unsigned char 					RecurrencyKind[8];			//Daily, Weekly	
-	unsigned char 					ValidFrom[28];
-	unsigned char 					ValidTo[28];
-	struct StructChargingSchedule	ChargingSchedule;
-};
-
-struct StructBootNotification 
-{
-	unsigned char CpVendor[20];				//chargePointVendor				//mandatory
-	unsigned char CpModel[20];				//chargePointModel				//mandatory
-	unsigned char CpSN[25];					//chargePointSerialNumber
-	unsigned char CbSN[25];					//chargeBoxSerialNumber
-	unsigned char CpFwVersion[50];			//firmwareVersion
-	unsigned char CpIccid[20];				//iccid
-	unsigned char CpImsi[20];				//imsi
-	unsigned char CpMeterType[25];			//meterType
-	unsigned char CpMeterSerialNumber[25];	//meterSerialNumber
-	unsigned char ResponseStatus[16];			//Accepted, Pending, Rejected
-	unsigned char ResponseCurrentTime[28];	//currentTime					//mandatory
-	int 			ResponseHeartbeatInterval;	//interval						//mandatory
-	
-};
-struct StructHeartbeat
-{
-	unsigned char ResponseCurrentTime[28];	
-};
-struct StructAuthorize 
-{
-	unsigned char 			IdTag[20];				
-	struct StructIdTagInfo	ResponseIdTagInfo;						
-};
-struct StructStartTransaction 
-{
-	int ConnectorId;						
-	unsigned char IdTag[20];				
-	int MeterStart;							
-	int ReservationId;						
-	unsigned char Timestamp[28];			
-	struct StructIdTagInfo	ResponseIdTagInfo;				
-	int ResponseTransactionId;				
-};
-struct StructStopTransaction 
-{
-	unsigned char IdTag[20];							
-	int MeterStop;							
-	unsigned char Timestamp[28];			
-	int TransactionId;						
-	unsigned char StopReason;				/*	"EmergencyStop",
-												"EVDisconnected",
-												"HardReset",
-												"Local",
-												"Other",
-												"PowerLoss",
-												"Reboot",
-												"Remote",
-												"SoftReset",
-												"UnlockCommand",
-												"DeAuthorized"
-											*/	
-	struct StructMeterValue	*TransactionData;			
-	struct StructIdTagInfo	ResponseIdTagInfo;					
-};
-
-struct StructStatusNotification
-{
-	int ConnectorId;						
-	unsigned char ErrorCode;				/*	"ConnectorLockFailure",
-								                "EVCommunicationError",
-								                "GroundFailure",
-								                "HighTemperature",
-								                "InternalError",
-								                "LocalListConflict",
-								                "NoError",
-								                "OtherError",
-								                "OverCurrentFailure",
-								                "PowerMeterFailure",
-								                "PowerSwitchFailure",
-								                "ReaderFailure",
-								                "ResetFailure",
-								                "UnderVoltage",
-								                "OverVoltage",
-								                "WeakSignal"
-								            */
-								              
-	unsigned char Info[50];								
-	unsigned char Status;					/*	"Available",
-								                "Preparing",
-								                "Charging",
-								                "SuspendedEVSE",
-								                "SuspendedEV",
-								                "Finishing",
-								                "Reserved",
-								                "Unavailable",
-								                "Faulted"
-								            */
-								                
-	unsigned char Timestamp[28];			
-	unsigned char VendorId[256];							
-	unsigned char VendorErrorCode[50];						
-};
-
-
-struct StructCancelReservation
-{
-	int ReservationId;							
-	unsigned char ResponseStatus[16];		//Accepted, Rejected
-					
-};
-struct StructChangeAvailability
-{
-	int ConnectorId;						
-	unsigned char Type[16];					//Inoperative, Operative
-	unsigned char ResponseStatus[16];		//Accepted, Rejected, Scheduled				
-};
-struct StructChangeConfiguration
-{
-	unsigned char Key[50];					
-	unsigned char Value[500];				
-	unsigned char ResponseStatus[16];		//Accepted, Rejected, RebootRequired, NotSupported			
-};
-struct StructClearCache
-{
-	unsigned char ResponseStatus[16];		//Accepted, Rejected	
-};
-struct StructClearChargingProfile
-{
-	int			 Id;			
-	int			ConnectorId;						
-	unsigned char ChargingProfilePurpose[24];	//ChargePointMaxProfile, TxDefaultProfile, TxProfile	
-	int			 StackLevel;						
-	unsigned char ResponseStatus[16];			//Accepted, Unknown			
-};
-struct StructDataTransfer
-{					
-	unsigned char VendorId[256];		
-	unsigned char MessageId[52];	
-	unsigned char Data[512];					
-	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];						
-};
-struct StructDiagnosticsStatusNotification
-{					
-	unsigned char Status[16];		//Idle,Uploaded,UploadFailed,Uploading					
-};
-struct StructFirmwareStatusNotification
-{					
-	unsigned char Status[20];			//Downloaded,DownloadFailed,Downloading,Idle,InstallationFailed,Installing,Installed					
-};
-struct StructGetCompositeSchedule
-{					
-	int 							ConnectorId;		
-	int 							Duration;				
-	unsigned char					ChargingRateUnit[4];		//A,W				
-	unsigned char 					ResponseStatus[12];			//Accepted,Rejected
-	int 							ResponseConnectorId;		
-	unsigned char					 ResponseScheduleStart[28];		
-	struct StructChargingSchedule	ResponseChargingSchedule;				
-};
-struct StructGetConfiguration
-{									
-	struct StructConfigurationKeyItems 	*Key;
-	struct StructConfigurationKey			 *ResponseConfigurationKey;
-	struct StructConfigurationKeyItems 	*ResponseUnknownKey;
-			
-};
-struct StructGetDiagnostics
-{									
-	unsigned char Location[256];
-	int 			Retries;		
-	int			RetryInterval;		
-	unsigned char StartTime[28];		
-	unsigned char StopTime[28];		
-	unsigned char ResponseFileName[256];						
-};
-struct StructGetLocalListVersion
-{									
-	int ResponseListVersion;							
-};
-struct StructMeterValues
-{									
-	int					 ConnectorId;		
-	int 					TransactionId;				
-	struct StructMeterValue	*MeterValue;			
-};
-struct StructRemoteStartTransaction
-{									
-	int						ConnectorId;		
-	unsigned char 				IdTag[20];		
-	struct StructChargingProfile	ChargingProfile;			
-	unsigned char 				ResponseStatus[10];	//Accepted,	Rejected
-};
-struct StructRemoteStopTransaction
-{									
-	int 			TransactionId;			
-	unsigned char ResponseStatus[10];	//Accepted,	Rejected
-};
-struct StructReserveNow
-{									
-	int			 ConnectorId;		
-	unsigned char ExpiryDate[28];	
-	unsigned char IdTag[20];	
-	unsigned char ParentIdTag[20];	
-	int			ReservationId;
-	unsigned char ResponseStatus[12];		//Accepted, Faulted, Occupied, Rejected, Unavailable		
-};
-struct StructReset
-{												
-	unsigned char Type[8];			//Hard,	Soft
-	unsigned char ResponseStatus[10];	//Accepted,	Rejected
-};
-struct StructSendLocalList
-{						
-	int							ListVersion;						
-	unsigned char 					UpdateType[16];	//Differential,	Full
-	struct StructLocalAuthorizationList	*LocalAuthorizationList;			
-	unsigned char 					ResponseStatus[16];	//Accepted,	Failed, NotSupported, VersionMismatch
-};
-struct StructSetChargingProfile
-{
-	int 						ConnectorId;		
-	struct StructChargingProfile	ChargingProfile;
-	unsigned char				 ResponseStatus[16];	//Accepted,	Rejected, NotSupported
-};
-struct StructTriggerMessage
-{
-	unsigned char RequestedMessage[32];	/*
-											"BootNotification",
-											"DiagnosticsStatusNotification",
-											"FirmwareStatusNotification",
-											"Heartbeat",
-											"MeterValues",
-											"StatusNotification"
-										*/
-	int			ConnectorId;		
-	unsigned char ResponseStatus[16];	//Accepted,	Rejected, NotImplemented										
-};
-struct StructUnlockConnector
-{
-	int			ConnectorId;	
-	unsigned char ResponseStatus[16];	//Unlocked,	UnlockFailed, NotSupported					
-};
-struct StructUpdateFirmware
-{
-	unsigned char Location[256];
-	int			Retries;		
-	unsigned char RetrieveDate[28];
-	int 			RetryInterval;	
-};
-
-struct OCPP16ConfigurationItem
-{
-	unsigned char ItemName[64];
-	unsigned char ItemAccessibility;//0:RO, 1:RW
-	unsigned char ItemData[128];
-};
-
-struct OCPP16ConfigurationTable
-{
-	//please refer to OCPP 1.6 chapter 9
-	struct OCPP16ConfigurationItem CoreProfile[28];
-	struct OCPP16ConfigurationItem LocalAuthListManagementProfile[3];
-	struct OCPP16ConfigurationItem ReservationProfile[1];
-	struct OCPP16ConfigurationItem SmartChargingProfile[5];
-};
-
-struct OCPP16Data
-{
-	unsigned char 							OcppServerURL[512];		//http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"								
-	unsigned char 							ChargeBoxId[128];		
-	unsigned char 							OcppConnStatus;			//0: disconnected, 1: connected	
-	union
-	{    
-		//Operations Initiated by Charge Point 
-		unsigned char CpMsgValue[2];
-		struct
-		{
-			//CpMsgValue[0]
-		    	unsigned char BootNotificationReq:1;					//bit 0,	
-			unsigned char BootNotificationConf:1;					//bit 1,	
-			unsigned char AuthorizeReq:1; 						//bit 2,	
-			unsigned char AuthorizeConf:1;						//bit 3,	
-			unsigned char DataTransferReq:1;						//bit 4,	  
-			unsigned char DataTransferConf:1;						//bit 5,		          
-			unsigned char DiagnosticsStatusNotificationReq:1;		//bit 6,	
-			unsigned char DiagnosticsStatusNotificationConf:1;		//bit 7,  
-			//CpMsgValue[1]
-		    	unsigned char FirmwareStatusNotificationReq:1;			//bit 0,	
-			unsigned char FirmwareStatusNotificationConf:1;			//bit 1,	
-			unsigned char StartTransactionReq:1; 					//bit 2,	
-			unsigned char StartTransactionConf:1;					//bit 3,	
-			unsigned char StopTransactionReq:1;					//bit 4,	  
-			unsigned char StopTransactionConf:1;					//bit 5,		          
-			unsigned char :2;									//bit 6,7 , reserved	
-		}bits;
-	}CpMsg; 
-	union
-	{    
-		//Operations Initiated by Central System
-		unsigned char CsMsgValue[5];
-		struct
-		{
-			//CsMsgValue[0]
-		    	unsigned char CancelReservationReq:1;				//bit 0,	
-			unsigned char CancelReservationConf:1;				//bit 1,	
-			unsigned char ChangeAvailabilityReq:1; 				//bit 2,	
-			unsigned char ChangeAvailabilityConf:1;				//bit 3,	
-			unsigned char ChangeConfigurationReq:1;				//bit 4,	  
-			unsigned char ChangeConfigurationConf:1;				//bit 5,		          
-			unsigned char ClearCacheReq:1;						//bit 6,	
-			unsigned char ClearCacheConf:1;						//bit 7,  
-			//CsMsgValue[1]
-		    	unsigned char ClearChargingProfileReq:1;				//bit 0,	
-			unsigned char ClearChargingProfileConf:1;				//bit 1,	
-			unsigned char DataTransferReq:1; 						//bit 2,	
-			unsigned char DataTransferConf:1;						//bit 3,	
-			unsigned char GetCompositeScheduleReq:1;			//bit 4,	  
-			unsigned char GetCompositeScheduleConf:1;			//bit 5,		          
-			unsigned char GetConfigurationReq:1;					//bit 6,	
-			unsigned char GetConfigurationConf:1;				//bit 7,  
-			//CsMsgValue[2]
-		    	unsigned char GetDiagnosticsReq:1;					//bit 0,	
-			unsigned char GetDiagnosticsConf:1;					//bit 1,	
-			unsigned char GetLocalListVersionReq:1; 				//bit 2,	
-			unsigned char GetLocalListVersionConf:1;				//bit 3,	
-			unsigned char RemoteStartTransactionReq:1;			//bit 4,	  
-			unsigned char RemoteStartTransactionConf:1;			//bit 5,		          
-			unsigned char RemoteStopTransactionReq:1;			//bit 6,	
-			unsigned char RemoteStopTransactionConf:1;			//bit 7,  
-			//CsMsgValue[3]
-		    	unsigned char ReserveNowReq:1;						//bit 0,	
-			unsigned char ReserveNowConf:1;						//bit 1,	
-			unsigned char ResetReq:1; 							//bit 2,	
-			unsigned char ResetConf:1;							//bit 3,	
-			unsigned char SendLocalListReq:1;						//bit 4,	  
-			unsigned char SendLocalListConf:1;					//bit 5,		          
-			unsigned char SetChargingProfileReq:1;					//bit 6,	
-			unsigned char SetChargingProfileConf:1;				//bit 7,  
-			//CsMsgValue[4]
-		    	unsigned char TriggerMessageReq:1;					//bit 0,	
-			unsigned char TriggerMessageConf:1;					//bit 1,	
-			unsigned char UnlockConnectorReq:1; 					//bit 2,	
-			unsigned char UnlockConnectorConf:1;					//bit 3,	
-			unsigned char UpdateFirmwareReq:1;					//bit 4,	  
-			unsigned char UpdateFirmwareConf:1;					//bit 5,		          
-			unsigned char :2;									//bit 6,7	
-		}bits;
-	}CsMsg; 
-	struct StructBootNotification 				BootNotification;
-	struct StructHeartbeat					Heartbeat;
-	struct StructAuthorize		 			Authorize;
-	struct StructStartTransaction				StartTransaction;
-	struct StructStopTransaction				StopTransaction;
-	struct StructStatusNotification				StatusNotification;
-	struct StructCancelReservation			CancelReservation;
-	struct StructChangeAvailability			ChangeAvailability;
-	struct StructChangeConfiguration			ChangeConfiguration;
-	struct StructClearCache					ClearCache;
-	struct StructClearChargingProfile			ClearChargingProfile;
-	struct StructDataTransfer					DataTransfer;
-	struct StructDiagnosticsStatusNotification	DiagnosticsStatusNotification;
-	struct StructFirmwareStatusNotification		FirmwareStatusNotification;
-	struct StructGetCompositeSchedule		GetCompositeSchedule;
-	struct StructGetConfiguration				GetConfiguration;
-	struct StructGetDiagnostics				GetDiagnostics;
-	struct StructGetLocalListVersion			GetLocalListVersion;
-	struct StructMeterValues					MeterValues;
-	struct StructRemoteStartTransaction		RemoteStartTransaction;
-	struct StructRemoteStopTransaction		RemoteStopTransaction;
-	struct StructReserveNow					ReserveNow;
-	struct StructReset						Reset;
-	struct StructSendLocalList				SendLocalList;
-	struct StructSetChargingProfile			SetChargingProfile;
-	struct StructTriggerMessage				TriggerMessage;
-	struct StructUnlockConnector				UnlockConnector;
-	struct StructUpdateFirmware				UpdateFirmware;
-	struct OCPP16ConfigurationTable			ConfigurationTable;
-	struct StructChargingProfile				*CHAdeMOChargingProfile;
-	struct StructChargingProfile				*CcsChargingProfile;
-};
-	
-#endif // DEFINE_H_
-	
-	
-	
-	
-
-

BIN
EVSE/Projects/DS60-210/Apps/main


+ 0 - 659
EVSE/Projects/DS60-210/Apps/main.c

@@ -1,659 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct PsuData 				*ShmPsuData ;
-struct CHAdeMOData			*ShmCHAdeMOData;
-struct CcsData				*ShmCcsData;
-struct PrimaryMcuData			*ShmPrimaryMcuData;
-struct FanModuleData			*ShmFanModuleData;
-struct RelayModuleData			*ShmRelayModuleData;
-struct OCPP16Data				*ShmOCPP16Data;
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-
-/**************************************************************************************/
-/**************************Create all share memory *********************************/
-/**************************************************************************************/
-int CreatShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmSysConfigAndInfo,0,sizeof(struct SysConfigAndInfo));
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmStatusCodeData,0,sizeof(struct StatusCodeData));
-   	 //creat ShmPsuData
-   	 if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmPsuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmPsuData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmPsuData,0,sizeof(struct PsuData));
-   	 //creat ShmCHAdeMOData
-   	 if ((MeterSMId = shmget(ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmCHAdeMOData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmCHAdeMOData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmCHAdeMOData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmCHAdeMOData,0,sizeof(struct CHAdeMOData));
-   	 //creat ShmCcsData
-   	 if ((MeterSMId = shmget(ShmCcsCommKey, sizeof(struct CcsData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmCcsData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmCcsData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmCcsData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmCcsData,0,sizeof(struct CcsData));
-   	//creat ShmPrimaryMcuData
-   	 if ((MeterSMId = shmget(ShmPrimaryMcuKey, sizeof(struct PrimaryMcuData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmPrimaryMcuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPrimaryMcuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmPrimaryMcuData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmPrimaryMcuData,0,sizeof(struct PrimaryMcuData));
-   	 //creat ShmFanModuleData
-   	 if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmFanModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmFanModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
-   	 //creat ShmRelayModuleData
-   	 if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmRelayModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmRelayModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmRelayModuleData,0,sizeof(struct RelayModuleData));
-   	  //creat ShmOCPP16Data
-   	 if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmOCPP16Data NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmOCPP16Data NG");
-		#endif		
-		return 0;
-   	 }
-   	// memset(ShmOCPP16Data,0,sizeof(struct OCPP16Data));
-    	return 1;
-}
-
-/**************************************************************************************/
-/****************Following functions are CSU initialization***************************/
-/**************************************************************************************/
-void InitGPIO()
-{
-	/*****************0~3, 4 bank, bank x 32+ num*********************/
-	/***************************************************************/
-	/*************** GPIO 0 ***************************************/
-	/***************************************************************/
-	/* GPMC_AD8			=> 	GPIO0_22 */	/*ID BD1_1*/
-	system("echo 22 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio22/direction");
-	/* GPMC_AD9			=>	GPIO0_23 */	/*ID BD1_2*/
-	system("echo 23 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio23/direction");
-	/* GPMC_AD10		=>	GPIO0_26 */	/*IO BD1_1*/
-	system("echo 26 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio26/direction");
-	/* GPMC_AD11		=>	GPIO0_27 */	/*IO BD1_2*/
-	system("echo 27 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio27/direction");
-	/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
-	system("echo 29 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio29/direction");
-	/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
-	system("echo 19 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio19/direction");
-	system("echo 0 > /sys/class/gpio/gpio19/value");
-	/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-	system("echo 20 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio20/direction");
-	/***************************************************************/
-	/*************** GPIO 1 ***************************************/
-	/***************************************************************/
-	/* GPMC_AD12	=> 	GPIO1_12 */	/*ID BD2_1*/
-	system("echo 44 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio44/direction");
-	/* GPMC_AD13	=>	GPIO1_13 */	/*ID BD2_2*/
-	system("echo 45 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio45/direction");
-	/* GPMC_AD14	=>	GPIO1_14 */	/*IO BD2_1*/
-	system("echo 46 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio46/direction");
-	/* GPMC_AD15	=>	GPIO1_15 */	/*IO BD2_2*/
-	system("echo 47 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio47/direction");
-	/***************************************************************/
-	/*************** GPIO 2 ***************************************/
-	/***************************************************************/
-	/*LCD_AC_BIAS_EN	=>	GPIO2_25*/	/*RS-485 for module DE control*/
-	system("echo 89 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio89/direction");
-	system("echo 0 > /sys/class/gpio/gpio89/value");
-	/*LCD_HSYNC		=>	GPIO2_23*/	/*RS-485 for module RE control*/
-	system("echo 87 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio87/direction");
-	system("echo 0 > /sys/class/gpio/gpio87/value");
-	/*LCD_PCLK		=>	GPIO2_24*/	/*CCS communication board 1 proximity*/
-	system("echo 88 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio88/direction");
-	/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
-	system("echo 86 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio86/direction");
-	/***************************************************************/
-	/*************** GPIO 3 ***************************************/
-	/***************************************************************/
-	/*MCASP0_FSX		=>	GPIO3_15*/	/*Emergency Stop button detect*/
-	system("echo 111 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio111/direction");
-	/*MCASP0_ACLKR	=>	GPIO3_18*/	/*USB1 OCP detect*/
-	system("echo 114 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio114/direction");
-	/*MCASP0_AHCLKR	=>	GPIO3_17*/	/*Emergency IO for AM3352 and STM32F407*/
-	system("echo 113 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio113/direction");
-	/*MCASP0_ACLKX	=>	GPIO3_14*/	/*Ethernet PHY reset*/
-	system("echo 110 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio110/direction");
-	system("echo 0 > /sys/class/gpio/gpio110/value");
-	/* MCASP0_FSR		=>	GPIO3_19 */	/*SMR Enable control_1*/
-	system("echo 115 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio115/direction");
-	system("echo 0 > /sys/class/gpio/gpio115/value");
-	/* MCASP0_AXR0	=>	GPIO3_16 */	/*CSU board function OK indicator.*/
-	system("echo 112 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio112/direction");
-	system("echo 0 > /sys/class/gpio/gpio112/value");
-	/* MCASP0_AXR1	=>	GPIO3_20 */	/*SMR Enable control_2*/
-	system("echo 116 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio116/direction");
-	system("echo 0 > /sys/class/gpio/gpio116/value");
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]InitGPIO: Initial GPIO OK");
-	#endif	
-
-}
-
-int LoadSysConfigAndInfo(struct SysConfigData *ptr)
-{
-	int fd,wrd;
-	struct SysConfigData *buf;
-	unsigned char *PtrBuf;
-	unsigned int ChkSum,ChkSumOrg;
-	
-	if((buf=malloc(sizeof(struct SysConfigData)))==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo:malloc buffer NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	memset(buf, 0, sizeof(struct SysConfigData));
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		free(buf);
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo:open mtdblock10 NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}
-    	wrd=read(fd, buf,sizeof(struct SysConfigData));
-	close(fd);
-	if(wrd!=(sizeof(struct SysConfigData)))
-	{
-		free(buf);
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo: read SysConfigData data NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	PtrBuf=(unsigned char *)buf;
-	ChkSum=0;
-	for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-	{
-		ChkSum+=PtrBuf[wrd];
-	}
-	ChkSumOrg=buf->Checksum;
-	
-	if(ChkSum!=ChkSumOrg)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo: Primary SysConfigData checksum NG, read backup");
-		#endif	
-		fd = open("/dev/mtdblock11", O_RDWR);
-		if (fd < 0) 
-		{
-			free(buf);
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: open mtdblock11 (backup) NG,rebooting..");
-			#endif	
-			if(ShmStatusCodeData!=NULL)
-			{
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-			}	
-			sleep(5);
-			system("reboot -f");
-			sleep(5);
-			system("reboot -f");
-	    	}
-	    	memset(buf, 0, sizeof(struct SysConfigData));
-   		wrd=read(fd, buf,sizeof(struct SysConfigData));
-    		close(fd);
-		if(wrd!=sizeof(struct SysConfigData))
-		{
-			free(buf);
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: read backup SysConfigData data NG,rebooting..");
-			#endif	
-			if(ShmStatusCodeData!=NULL)
-			{
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-			}	
-			sleep(5);
-			system("reboot -f");
-			sleep(5);
-			system("reboot -f");
-		}	
-		PtrBuf=(unsigned char *)buf;
-		ChkSum=0;
-		for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-		{
-			ChkSum+=PtrBuf[wrd];
-		}
-		ChkSumOrg=buf->Checksum;
-		if(ChkSum!=ChkSumOrg)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: backup SysConfigData checksum NG, read Factory default");
-			#endif	
-			fd = open("/dev/mtdblock12", O_RDWR);
-			if (fd < 0) 
-			{
-				free(buf);
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: open mtdblock12 (Factory default) NG,rebooting..");
-				#endif	
-				if(ShmStatusCodeData!=NULL)
-				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-				}	
-				sleep(5);
-				system("reboot -f");
-				sleep(5);
-				system("reboot -f");
-	    		}
-	    		memset(buf, 0, sizeof(struct SysConfigData));
-   			wrd=read(fd, buf,sizeof(struct SysConfigData));
-    			close(fd);
-			if(wrd!=sizeof(struct SysConfigData))
-			{
-				free(buf);
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: read factory default  SysConfigData data NG,rebooting..");
-				#endif	
-				if(ShmStatusCodeData!=NULL)
-				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-				}	
-				sleep(5);
-				system("reboot -f");
-				sleep(5);
-				system("reboot -f");
-			}	
-			PtrBuf=(unsigned char *)buf;
-			ChkSum=0;
-			for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-			{
-				ChkSum+=PtrBuf[wrd];
-			}
-			ChkSumOrg=buf->Checksum;
-			if(ChkSum!=ChkSumOrg)
-			{
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: factory default  SysConfigData checksum NG, restore factory default");
-				#endif	
-				goto DefaultShm;
-			}	
-		}	
-	}	
-	//load OK
-	memcpy((struct SysConfigData *)ptr,(struct SysConfigData *)buf,sizeof(struct SysConfigData));	
-	free(buf);
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]LoadSysConfigAndInfo: Load SysConfigData OK");
-	#endif	
-	return 1;
-    
-DefaultShm:
-	system("cd /root;./FactoryConfig");
-	system("sync");
-	sleep(5);
-	system("reboot -f");
-	sleep(5);
-	system("reboot -f");
-}
-
-void InitEthernet()
-{
-	char tmpbuf[256];
-	unsigned int address;
-	
-	system("echo 1 > /sys/class/gpio/gpio110/value");//reset PHY
-	sleep(2);
-	//Init Eth0 for internet 
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up",
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
-	system(tmpbuf);
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"route add default gw %s eth0 ",
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
-    	system(tmpbuf);		
-    	
-    	
-    	//Init Eth1 for administrator tool 
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"/sbin/ifconfig eth1 %s netmask %s up",
-	ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,
-	ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
-	system(tmpbuf);
-    	
-    	//Run DHCP client if enabled
-	system("killall udhcpc");
-	system("rm -rf /etc/resolv.conf");	
-	system("echo nameserver 8.8.8.8 > /etc/resolv.conf");		//Google DNS server
-	system("echo nameserver 180.76.76.76 > /etc/resolv.conf");	//Baidu DNS server 
-	if(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0)
-		system("/sbin/udhcpc -i eth0 -s /root/simple.script > /dev/null &");	
-		
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]InitEthernet: Initial Ethernet OK");
-	#endif		
-}	
-
-int Initialization()
-{
-	InitGPIO();
-	LoadSysConfigAndInfo(&ShmSysConfigAndInfo->SysConfig);
-	InitEthernet();
-	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]Initialization: Initialization OK");
-	#endif		
-}
-
-int SpawnTask()
-{
-	system("/root/EventLogging &");
-	system("/root/LcmControl &");
-	system("/root/InternalComm &");
-	system("/root/PrimaryComm &");
-	system("/root/EvComm &");
-	system("/root/OcppBackend &");
-	/*
-	if 4G model 
-		system("/root/4gModem &");
-	else if WiFi model 
-		system("/root/WiFiModem &");
-	*/
-	
-}
-
-
-int StoreUsrConfigData(struct SysConfigData *UsrData)
-{
-	int fd,wrd;
-	unsigned int i,Chk;
-	unsigned char *ptr; 
-	
-	Chk=0;
-	ptr=(unsigned char *)UsrData;
-	for(i=0;i<sizeof(struct SysConfigData)-4;i++)
-	{
-		Chk+=*(ptr+i);
-	}
-	UsrData->Checksum=Chk;
-	
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock10 NG");
-		#endif		
-		return 0;
-	}
-   	wrd=write(fd, UsrData, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock10 NG");
-		#endif	
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock11", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock11(backup) NG");
-		#endif	
-		return 0;
-    	}
-    	wrd=write(fd, UsrData, sizeof(struct SysConfigData));   
-    	close(fd);
-   	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock11(backup) NG");
-		#endif	
-		return 0;
-	}	
-	return 1;
-}
-
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/	
-
-int main(int argc,char *argv[])
-{
-	int Rtn=0;
-	unsigned int StartTime;	
-	struct timeb StartChargingTime,CurrentChargingTime,ChargingLoopTime;
-	float ChargingPower,ChargingEnergy;
-	
-	//Create all share memory
-	if(CreatShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]main:CreatShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	
-	//CSU Initialization 
-	Initialization();
-	
-	//task spawn
-	//SpawnTask();
-
-	/**************************************************************/
-	/************** main Loop********************************/
-	/*****************************************************************/
-	
-	while(1)
-	{
-		sleep(10);
-	}//main while
-}

BIN
EVSE/Projects/DS60-210/Images/MLO


BIN
EVSE/Projects/DS60-210/Images/am335x-evm.dtb


BIN
EVSE/Projects/DS60-210/Images/ramdisk.gz


BIN
EVSE/Projects/DS60-210/Images/u-boot-spl.bin


BIN
EVSE/Projects/DS60-210/Images/u-boot.img


BIN
EVSE/Projects/DS60-210/Images/zImage


BIN
EVSE/Projects/DW25/Apps/4gModem


+ 0 - 467
EVSE/Projects/DW25/Apps/4gModem.c

@@ -1,467 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <netinet/in.h>
-#include <unistd.h>
-#include "define.h"
-
-//#define debug		
-#define CheckModemInterval		30	//sec
-#define CheckSimInterval			10 	//sec
-#define CheckConnectionInterval		5 	//sec
-#define DisconnInterval				60 	//sec
-
-
-
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct FanModuleData			*ShmFanModuleData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	
-    	return 1;
-}
-
-
-int Check4GModem()
-{
-	//return 0: No 4G modem equipped
-	//return 1: Qutel 4G modem equipped
-	//return 2: ublox 4G modem equipped
-	
-	int Rtn1,Rtn2;
-	
-	//check Qutel 4G modem
-	Rtn1=Rtn2=-1;
-	Rtn1=access("/dev/ttyUSB0",R_OK);
-	if(Rtn1==0)
-	{
-		Rtn2=access("/dev/ttyUSB2",R_OK);
-		if(Rtn2==0)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[4gModem]Check4GModem: Qutel 4G modem be found");
-			#endif	
-			return 1;
-		}
-	}	
-	//check ublox 4G modem
-	Rtn1=Rtn2=-1;
-	Rtn1=access("/dev/ttyACM0",R_OK);
-	if(Rtn1==0)
-	{
-		Rtn2=access("/dev/ttyACM2",R_OK);
-		if(Rtn2==0)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[4gModem]Check4GModem: ublox 4G modem be found");
-			#endif	
-			return 2;
-		}
-	}	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[4gModem]Check4GModem: No 4G modem be found");
-	#endif	
-	return 0;	
-}
-
-int InitComPort(unsigned char ModemModel)
-{
-	int UsbFd;
-	struct termios tios;
-	
-	if(ModemModel==1)	//Qutel 4G modem equipped
-		UsbFd = open("/dev/ttyUSB2", O_RDWR|O_NOCTTY);
-	else if(ModemModel==2)	//ublox 4G modem equipped
-		UsbFd = open("/dev/ttyACM2", O_RDWR|O_NOCTTY);
-	else
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitComPort: Unknow ModemModel ");
-		#endif		
-		return -1;
-	}	
-	
-	if(UsbFd<0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]InitComPort:  UsbFd open failed");
-		#endif	
-		return -1;
-	}	
-	ioctl (UsbFd, TCGETS, &tios);
-	tios.c_cflag = B115200 | CS8 | CLOCAL | CREAD;
-	tios.c_lflag = 0;
-	tios.c_iflag = 0;
-	tios.c_oflag = 0;
-  	tios.c_cc[VMIN]=0;   
-	tios.c_cc[VTIME]=100; 
-	tios.c_lflag=0;  
-	tcflush(UsbFd, TCIFLUSH);
-	ioctl (UsbFd, TCSETS, &tios);
-	return UsbFd;
-	
-}
-
-void GetModelName(int Fd, unsigned char *ModelName)
-{
-	//AT command processing
-}
-
-void GetModelVersion(int Fd, unsigned char *ModelVersion)
-{
-	//AT command processing
-}
-
-void GetModelImei(int Fd, unsigned char *ModelImei)
-{
-	//AT command processing
-}
-
-void GetSimImsi(int Fd, unsigned char *SimImsi)
-{
-	//AT command processing
-}
-
-unsigned char GetModemMode(int Fd)
-{
-	int Mode;
-	//AT command processing
-	return Mode;
-}
-
-int GetSignalRssi(int Fd)
-{
-	int RssiValue;
-	//AT command processing
-	return RssiValue;
-}
-
-int GetPPP0Info(unsigned char *IPaddress)
-{
-    	int fd,rd=0;
-	unsigned int address;
-	char buf[128],addr[32],*sptr,*eptr;
-	
-
-    	system("ifconfig ppp0 | grep \"inet addr:\" > /mnt/GetPPP0Info");
-	fd = open("/mnt/GetPPP0Info", O_RDONLY);
-    	if(fd<0)
-   	{
-    		system("rm -f /mnt/GetPPP0Info");
-	        return 0;
-    	}
-    
-    	memset(addr,0,sizeof(addr));
-    	memset(buf,0,sizeof(buf));
-    	rd=read(fd,buf,sizeof(buf));	
-    	if(rd<=0)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-   	}
-    	close(fd);
-    	if((sptr=strstr(buf,"inet addr:"))==NULL)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-    	}
-    	sptr+=strlen("inet addr:");
-    	if((eptr=strstr(buf,"  P-t-P:"))==NULL)
-    	{
-    		close(fd);
-    		system("rm -f /mnt/GetPPP0Info");
-        	return 0;
-    	}
-    	memset(IPaddress,0,strlen(IPaddress));
-    	strncpy(IPaddress,sptr,eptr-sptr);   
-    	#ifdef SystemLogMessage	
-	{
-		unsigned char Buffer[128];
-		memset(Buffer,0,sizeof(Buffer));
-		sprintf(Buffer,"[4gModem]GetPPP0Info: 4G IP Address = %s",IPaddress);
-		StoreLogMsg(Buffer);
-	}
-	#endif		
-    	return 1;
-}
-int  Load4gConfiguration()
-{
-	unsigned char CopyTmp[128];
-	
-	if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn)<=0)
-		return 0;
-	system("cat /dev/null > /root/ppp/auto-apn.conf");
-	system("chmod 777 /root/ppp/auto-apn.conf");  
-	system("cat /dev/null > /etc/ppp/options"); 
-	system("chmod 777 /etc/ppp/options"); 
-	system("cat /dev/null > /etc/ppp/pap-secrets"); 
-	system("chmod 777 /etc/ppp/pap-secrets"); 
-	system("cat /dev/null > /etc/ppp/chap-secrets"); 
-	system("chmod 777 /etc/ppp/chap-secrets"); 
-	memset(CopyTmp,0,sizeof(CopyTmp));
-	sprintf(CopyTmp,"echo \"APN=\"%s\"\" > /root/ppp/auto-apn.conf",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn);
-	system(CopyTmp);
-	system("echo \"ACCOUNT=\" >> /root/ppp/auto-apn.conf");
-	system("echo \"PASSWORD=\" >> /root/ppp/auto-apn.conf");
-	
-	if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId)>0)
-	{	
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"name %s \" > /etc/ppp/options",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId);
-		system(CopyTmp);
-		
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"%s * %s \" > /etc/ppp/pap-secrets",
-		ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,
-		((strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd)>0)?ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : " "));
-		system(CopyTmp);
-
-		memset(CopyTmp,0,sizeof(CopyTmp));
-		sprintf(CopyTmp,"echo \"%s * %s \" > /etc/ppp/chap-secrets",
-		ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapId,
-		((strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd)>0)?ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomChapPapPwd : " "));
-		system(CopyTmp);
-	}	
-	return 1;
-}
-void ResetModem()
-{
-	//power cycle modem by GPIO
-}
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	unsigned char ModuleModel=0;//0: None, 1: Qutel, 2: ublox SARA-U201
-	int UsbFd=-1;
-	unsigned int StartTime,EndTime,Tmp; 
-	unsigned char TmpIpAddr[16];
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[4gModem]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	ResetModem();
-	
-ReCheckModem:    
-	//ResetModem();
-	UsbFd=-1;
-	ModuleModel=0;
-	Load4gConfiguration();
-
-	while(1)
-	{
-		ModuleModel=Check4GModem();
-		if(ModuleModel<=0)
-		{
-			sleep(CheckModemInterval);
-			continue;
-		}	
-		if(UsbFd>0)
-			close(UsbFd);
-		UsbFd=InitComPort(ModuleModel);
-		if(UsbFd<0)
-		{
-			sleep(CheckModemInterval);
-			continue;
-		}
-		/**** Record some modem information and dial up if SIM card ready ****/
-		memset(&ShmSysConfigAndInfo->SysConfig.TelecomInterface,0,sizeof(struct TeleConfigData));
-		while(1)
-		{
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModelName)<=0)
-				GetModelName(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModelName);
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSoftwareVer)<=0)
-				GetModelVersion(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSoftwareVer);	
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei)<=0)
-				GetModelImei(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemImei);		
-			GetSimImsi(UsbFd,ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi);		
-			if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimImsi)<=0)
-			{	
-				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=0;
-				sleep(CheckSimInterval);	
-				if(Check4GModem()<=0)
-					goto ReCheckModem;
-			}
-			else
-			{
-				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomSimStatus=1;
-				if(strlen(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomApn)<=0)
-				{
-					sleep(DisconnInterval);
-					goto ReCheckModem;		
-				}
-				system("killall 4GDetection");	
-				sleep(2);
-				if(ModuleModel==1)
-					system("/root/ppp/4GDetection /dev/ttyUSB0 &");	
-				else if(ModuleModel==2)
-					system("/root/ppp/4GDetection /dev/ttyACM0 &");
-				break;	
-			}			
-		}
-		/***** Periodically check RSSI and connection*****/
-		StartTime=time((time_t*)NULL);
-		EndTime=time((time_t*)NULL);
-		while(1)
-		{
-			if((time((time_t*)NULL)-StartTime)>=CheckConnectionInterval)
-			{	
-				//check IP address 
-				memset(TmpIpAddr,0,sizeof(TmpIpAddr));
-				if(GetPPP0Info(TmpIpAddr)<=0)
-				{
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn=0;
-					if((time((time_t*)NULL)-EndTime)>=DisconnInterval)
-						goto ReCheckModem; 
-				}	
-				else
-				{
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomNetworkConn=1;
-					if(strstr(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr)==NULL)
-					{
-						#ifdef SystemLogMessage	
-						{
-							unsigned char Buffer[128];
-							memset(Buffer,0,sizeof(Buffer));
-							sprintf(Buffer,"[4gModem]main:  4G IP Address changed from %s to %s",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr);
-							StoreLogMsg(Buffer);
-						}
-						#endif		
-						memset(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,0,sizeof(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress));
-						strcpy(ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomIpAddress,TmpIpAddr);
-						system("route del default");
-						system("route add default dev ppp0");
-					}
-					EndTime=time((time_t*)NULL);
-				}	
-				//check RSSI
-				Tmp=GetSignalRssi(UsbFd);
-				if(abs(Tmp-ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi)>=5)
-				{
-					#ifdef SystemLogMessage	
-					{
-						unsigned char Buffer[128];
-						memset(Buffer,0,sizeof(Buffer));
-						sprintf(Buffer,"[4gModem]main: RSSI changed from %d to %d",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi,Tmp);
-						StoreLogMsg(Buffer);
-					}
-					#endif		
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi=Tmp;
-				}	
-				//check Mode
-				Tmp=GetModemMode(UsbFd);
-				if(Tmp!=ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode)
-				{
-					#ifdef SystemLogMessage	
-					{
-						unsigned char Buffer[128];
-						memset(Buffer,0,sizeof(Buffer));
-						sprintf(Buffer,"[4gModem]main: Modem mode changed from %d to %d",ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode,Tmp);
-						StoreLogMsg(Buffer);
-					}
-					#endif
-					ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomModemMode=Tmp;
-				}	
-				StartTime=time((time_t*)NULL);
-			}
-		}
-	}//main while loop
-}
-
-

+ 0 - 218
EVSE/Projects/DW25/Apps/EventLogging.c

@@ -1,218 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int StoreEventLogMsg(unsigned char *EventCodeString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/EventLog/[%04d.%02d]EventLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			EventCodeString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",Buf);
-	#endif
-}		
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-    	return 1;
-}
-
-int main(int argc,char *argv[])
-{
-	int ByteCount,BitCount;
-	unsigned char tmp, EventCodeTmp[7];
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[EventLogging]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	
-	while(1)
-	{
-		//check Fault Status
-		for(ByteCount=0;ByteCount<4;ByteCount++)
-		{
-			if(ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[ByteCount] != ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->FaultCode.FaultEvents.FaultVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,FaultStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->FaultCode.PreviousFaultVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-		//check Alarm Status
-		for(ByteCount=0;ByteCount<8;ByteCount++)
-		{
-			if(ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount] != ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->AlarmCode.AlarmEvents.AlarmVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,AlarmStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->AlarmCode.PreviousAlarmVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-		//check Info Status
-		for(ByteCount=0;ByteCount<8;ByteCount++)
-		{
-			if(ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[ByteCount] != ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount])
-			{
-				tmp=ShmStatusCodeData->InfoCode.InfoEvents.InfoVal[ByteCount]; //prevent be modified during following process
-				for(BitCount=0;BitCount<8;BitCount++)
-				{
-					if(((tmp>>BitCount)&0x01) != ((ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]>>BitCount)&0x01))
-					{
-						memset(EventCodeTmp,0,sizeof(EventCodeTmp));
-						memcpy(EventCodeTmp,InfoStatusCode[ByteCount*8+BitCount],sizeof(EventCodeTmp)-1);
-						if(((tmp>>BitCount)&0x01)==0)//Recovered
-						{	
-							EventCodeTmp[0]=1;
-							ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]&=(0<<BitCount);
-						}
-						else
-							ShmStatusCodeData->InfoCode.PreviousInfoVal[ByteCount]|=(1<<BitCount);
-						StoreEventLogMsg(EventCodeTmp);
-					}
-				}
-			}
-		}
-		
-	}//main while loop 
-}
-
-

+ 0 - 109
EVSE/Projects/DW25/Apps/FWMaker.c

@@ -1,109 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <net/if.h> /*struct ifreq*/
-#include <linux/sockios.h> /*SIOCGIFINDEX*/
-#include <linux/socket.h>
-#include <errno.h> 
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <fcntl.h>
-#include <sys/mman.h>
-
-//./FWMaker 172.16.24.126
-int main(int argc,char *argv[])
-{
-	unsigned char *MemBuf,*MemBuf2,buf[64];
-    int fd,rd=0,wrd=0,tmp=0,rd2=0;
-    unsigned int CheckSum=0;
-
-
-
-	memset(buf,0,64);
-	sprintf(buf,"tftp -gr uImage -l /mnt/uImage %s",argv[1]);   
-	system(buf);
-	memset(buf,0,64);
-	sprintf(buf,"tftp -gr rootfs_nor.img -l /mnt/rootfs_nor.img %s",argv[1]);   
-	system(buf);
-
-	if((MemBuf=malloc(0x100000D))==NULL)
-	{
-		printf("Allocate MemBuf memory error\n");
-		return 0;
-	}	
-	memset(MemBuf, 0xff, 0x100000D);
-	fd = open("/mnt/uImage", O_RDWR);
-	if (fd > 0) 
-	{
-	    if((rd=read(fd,MemBuf,0x100000D))<=0)
-	    {
-			printf("/mnt/uImage read Error\n");
-			free(MemBuf);
-			close(fd);
-			return 0;
-	    }   
-	    close(fd);
-	    for(tmp=0;tmp<rd;tmp++)
-	    	CheckSum+=MemBuf[tmp];
-	    strncpy(MemBuf+rd,"DELTADCOK",9);	
-	   *(MemBuf+rd+9)=CheckSum>>24;
-	    *(MemBuf+rd+10)=CheckSum>>16;
-	    *(MemBuf+rd+11)=CheckSum>>8;
-	     *(MemBuf+rd+12)=CheckSum;
-	   // memcpy(MemBuf+rd+9,&CheckSum,4);	
-	    fd = open("/mnt/DcoKImage", O_CREAT|O_RDWR);
-	    wrd=write(fd, MemBuf, rd+13);
-	    if(wrd!=(rd+13))
-	    	printf("write error wrd=0x%x, rd=0x%x\n",wrd,rd+13);
-	   else 
-	   		printf("/mnt/DcoKImage OK\n"); 	
-	    
-	}
-	else	
-	{	
-		free(MemBuf);
-		printf("/mnt/uImage open Error\n");
-		return 0;
-	}
-	
-	
-	memset(MemBuf, 0xff, 0x100000D);
-	CheckSum=rd=0;
-	fd = open("/mnt/rootfs_nor.img", O_RDWR);
-	if (fd > 0) 
-	{
-	    if((rd=read(fd,MemBuf,0x100000D))<=0)
-	    {
-			printf("/mnt/rootfs_nor.img read Error\n");
-			free(MemBuf);
-			close(fd);
-			return 0;
-	    }   
-	    close(fd);
-	    for(tmp=0;tmp<rd;tmp++)
-	    	CheckSum+=MemBuf[tmp];
-	    strncpy(MemBuf+rd,"DELTADCOF",9);	
-	    *(MemBuf+rd+9)=CheckSum>>24;
-	    *(MemBuf+rd+10)=CheckSum>>16;
-	    *(MemBuf+rd+11)=CheckSum>>8;
-	     *(MemBuf+rd+12)=CheckSum;
-	    //memcpy(MemBuf+rd+9,&CheckSum,4);	
-	    fd = open("/mnt/DcoFImage", O_CREAT|O_RDWR);
-	    wrd=write(fd, MemBuf, rd+13);
-	    if(wrd!=(rd+13))
-	    	printf("write error wrd=0x%x, rd=0x%x\n",wrd,rd+13);
-	   else 
-	   		printf("/mnt/DcoFImage OK\n"); 	
-	    
-	}
-	else	
-	{	
-		free(MemBuf);
-		printf("/mnt/rootfs_nor.img open Error\n");
-		return 0;
-	}
-	
-}

BIN
EVSE/Projects/DW25/Apps/FactoryConfig


+ 0 - 173
EVSE/Projects/DW25/Apps/FactoryConfig.c

@@ -1,173 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-
-/**************************************************************************************/
-/************This task will create Factory default confgiuration file *****************/
- /***********and store it into mtdblock 10,11,12                               ****************/
-/**************************************************************************************/
-
-int main(int argc,char *argv[])
-{
-	struct SysConfigData 	SysConfig;
-	unsigned int i,Chk;
-	unsigned char *ptr; 
-	int fd,wrd;
-	
-	ptr=malloc(sizeof(struct SysConfigData));
-	if(ptr==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: malloc for SysConfigData NG");
-		#endif			
-		return 0;
-	}	
-	memset(ptr,0,sizeof(struct SysConfigData));
-	memset(&SysConfig,0,sizeof(struct SysConfigData));
-	
-	//Set default configuration
-	strcpy(SysConfig.Eth0Interface.EthIpAddress,"192.168.0.10");
-	strcpy(SysConfig.Eth0Interface.EthSubmaskAddress,"255.255.255.0");
-	strcpy(SysConfig.Eth0Interface.EthGatewayAddress,"192.168.0.254");
-	strcpy(SysConfig.Eth1Interface.EthIpAddress,"192.168.1.10");
-	strcpy(SysConfig.Eth1Interface.EthSubmaskAddress,"255.255.255.0");
-	strcpy(SysConfig.Eth1Interface.EthGatewayAddress,"192.168.1.254");
-	SysConfig.BackendConnTimeout=300; //300 seconds
-	
-	//copy default configuration to pointer
-	memcpy(ptr,&SysConfig,sizeof(struct SysConfigData));
-	
-	//calculate CRC
-	Chk=0;
-	for(i=0;i<(sizeof(struct SysConfigData)-4);i++)
-	{
-		Chk+=*(ptr+i);
-	}
-	SysConfig.Checksum=Chk;
-	
-	fd = open("/mnt/FactoryDefaultConfig.bin", O_RDWR|O_CREAT);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /mnt/FactoryDefaultConfig.bin NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}   
-
-	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));
-	close(fd);
-	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /mnt/FactoryDefaultConfig.bin NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}
-	
-	fd = open("/dev/mtdblock12", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock12 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock12 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock11", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock11 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock11 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: open /dev/mtdblock10 NG");
-		#endif	
-		free(ptr);
-		return 0;
-   	 }
-    	wrd=write(fd, &SysConfig, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[FactoryConfig]main: write /dev/mtdblock10 NG");
-		#endif	
-		free(ptr);
-		return 0;
-	}	
-	
-	free(ptr);
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[FactoryConfig]main: FactoryConfig OK");
-	#endif	
-}

+ 0 - 200
EVSE/Projects/DW25/Apps/InternalComm.c

@@ -1,200 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct FanModuleData			*ShmFanModuleData;
-struct RelayModuleData			*ShmRelayModuleData;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-   	//creat ShmFanModuleData
-   	 if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmFanModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmFanModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
-   	 //creat ShmRelayModuleData
-   	 if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmget ShmRelayModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitShareMemory:shmat ShmRelayModuleData NG");
-		#endif		
-		return 0;
-   	 }
-    	return 1;
-}
-
-int InitComPort()
-{
-	int fd;
-	struct termios tios;
-	
-	fd = open("/dev/ttyS4", O_RDWR);
-	if(fd<=0)
-	{ 
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]InitComPort: open /dev/ttyS4 NG");
-		#endif	
-		return -1;
-	}
-	ioctl (fd, TCGETS, &tios);
-	tios.c_cflag = B115200| CS8 | CLOCAL | CREAD; 
-	tios.c_lflag = 0;
-	tios.c_iflag = 0; 
-	tios.c_oflag = 0;
-	tios.c_cc[VMIN]=0;    
-	tios.c_cc[VTIME]=1000; 
-	tios.c_lflag=0;  
-	tcflush(fd, TCIFLUSH);
-	ioctl (fd, TCSETS, &tios);
-	return fd;
-}
-
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	int Uart4Fd;
-
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	Uart4Fd=InitComPort();
-	if(Uart4Fd<0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[InternalComm]main:InitComPort NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	
-	while(1)
-	{
-		//processing
-	}//main while loop
-}
-
-

+ 0 - 70
EVSE/Projects/DW25/Apps/Makefile

@@ -1,70 +0,0 @@
--include ../../../../Rules.make
-export PATH=/bin:/sbin:/usr/bin:$(SDK_PATH_TARGET)/usr/bin:$PATH
-
-#define library variable
-Internal485ProtocolLib = -L ../../../Modularization/Internal485Protocol -lInternal485Protocol
-PsuCommProtocolLib = -L ../../../Modularization/PsuCommProtocol -lPsuCommProtocol
-
-all: CopyFile apps
-#apps: MainTask PsuCommTask InternalCommTask 4gModemTask FactoryConfigTask EvCommTask UpdateRootfsTask LcmControlTask FWMakerTask PrimaryCommTask OcppBackendTask EventLoggingTask
-apps: MainTask FactoryConfigTask
-
-MainTask:
-	rm -f main; $(CC) main.c -lm -o main
-	cp -f main ../Images/root
-	
-PsuCommTask:
-	rm -f PsuComm; $(CC) PsuComm.c ${PsuCommProtocolLib} -lm -o PsuComm
-	cp -f PsuComm ../Images/root	
-	
-InternalCommTask:
-	rm -f InternalComm; $(CC) InternalComm.c ${Internal485ProtocolLib} -lm -o InternalComm	
-	cp -f InternalComm ../Images/root
-
-WiFiModemTask:
-	rm -f WiFiModem; $(CC) WiFiModem.c -o WiFiModem	
-	cp -f WiFiModem ../Images/root
-		
-4gModemTask:
-	rm -f 4gModem; $(CC) 4gModem.c -o 4gModem		
-	cp -f 4gModem ../Images/root
-	
-FactoryConfigTask:
-	rm -f FactoryConfig; $(CC) FactoryConfig.c -o FactoryConfig	
-	cp -f FactoryConfig ../Images/root		
-	
-EvCommTask:
-	rm -f EvComm; $(CC) EvComm.c -lm -o EvComm	
-	cp -f EvComm ../Images/root
-	
-UpdateRootfsTask:
-	rm -f UpdateRootfs; $(CC) UpdateRootfs.c -o UpdateRootfs		 
-	cp -f UpdateRootfs ../Images/root	
-
-LcmControlTask:
-	rm -f LcmControl; $(CC) LcmControl.c -o LcmControl
-	cp -f LcmControl ../Images/root			
-
-PrimaryCommTask:
-	rm -f PrimaryComm; $(CC) PrimaryComm.c -o PrimaryComm
-	cp -f PrimaryComm ../Images/root	
-
-Ocpp16Task:
-	rm -f Ocpp16; $(CC) Ocpp16.c -I ../../../GPL/libwebsockets-v2.1-stable/release/include -L ../../../GPL/libwebsockets-v2.1-stable/release/lib -lwebsockets -o Ocpp16
-	cp -f Ocpp16 ../Images/root
-	
-EventLoggingTask:
-	rm -f EventLogging; $(CC) EventLogging.c -o EventLogging	
-	cp -f EventLogging ../Images/root	
-		
-FWMakerTask:
-	rm -f FWMaker; $(CC) FWMaker.c -o FWMaker	
-	cp -f FWMaker ../Images/root
-	
-CopyFile: 
-	rm -rfv ../Images/root
-	mkdir -p ../Images/root
-
-
-
-	

+ 0 - 333
EVSE/Projects/DW25/Apps/Ocpp16.c

@@ -1,333 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <libwebsockets.h>
-#include <lws_config.h>
-#include "define.h"
-
-#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct OCPP16Data 			*ShmOCPP16Data;
-
-
-struct lws *wsi;
-struct lws_context *context;
-
-unsigned char *SendBuffer;
-int SendBufLen=(1024*3);
-int ConnectionEstablished=0;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmOCPP16Data
-   	 if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmget ShmOCPP16Data NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]InitShareMemory:shmat ShmOCPP16Data NG");
-		#endif		
-		return 0;
-   	 }
-   	memset(ShmOCPP16Data,0,sizeof(struct PsuData));
-    	return 1;
-}
-
-
-int SendData(struct lws *wsi) 
-{
-    int n;
-    int len;
-    unsigned char *out = NULL;
-
-    len = strlen(SendBuffer);
-    out = (char *)malloc(sizeof(char)*(LWS_SEND_BUFFER_PRE_PADDING + len + LWS_SEND_BUFFER_POST_PADDING));
-    memcpy (out + LWS_SEND_BUFFER_PRE_PADDING, SendBuffer, len );
-   
-    n = lws_write(wsi, out + LWS_SEND_BUFFER_PRE_PADDING, len, LWS_WRITE_TEXT);
-   
-    free(out);
-    return n;
-}
-
-static int OCPP16Callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len)
-{	
-
-	#ifdef Debug
-	printf("OCPP16Callback:reason=%d\n",reason);
-	#endif
-	switch (reason) 
-	{
-		case LWS_CALLBACK_CLIENT_ESTABLISHED://3
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLIENT_ESTABLISHED");
-			#endif		
-			//connected
-			ConnectionEstablished=1;
-			break;
-		case LWS_CALLBACK_CLIENT_CONNECTION_ERROR://1
-			#ifdef Debug
-			printf("OCPP16Callback:LWS_CALLBACK_CLIENT_CONNECTION_ERROR:%s\n",in);
-			#endif
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLIENT_CONNECTION_ERROR");
-			#endif		
-			//disconnected
-			ConnectionEstablished=0;
-			break;
-		case LWS_CALLBACK_CLOSED://4
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[Ocpp16]OCPP16Callback:LWS_CALLBACK_CLOSED");
-			#endif
-			//disconnected
-			ConnectionEstablished=0;
-			break;
-		case LWS_CALLBACK_CLIENT_WRITEABLE://10
-			//if(need to send message and its relevant data already store into SendBuffer)
-				SendData(wsi);
-			break;
-		case LWS_CALLBACK_CLIENT_RECEIVE://8
-			((char *)in)[len] = '\0';
-			#ifdef Debug
-			printf("OCPP16Callback:LWS_CALLBACK_CLIENT_RECEIVE : rx %d '%s'\n", (int)len, (char *)in);
-			#endif
-			//parsing received message and do something
-			break;
-		default:
-			break;
-	}
-
-	return 0;
-}
-
-static struct lws_protocols protocols[] = {
-
-	{
-		"ocpp1.6",		
-		OCPP16Callback,
-		10240,	
-		10240,
-	},
-	{
-		"ocpp1.6",		
-		OCPP16Callback,
-		10240,	
-		10240,
-	},
-	{
-		NULL, NULL, 0		/* End of list */
-	}
-};
-
-int ConnectWsServer()
-{	
-	struct lws_context_creation_info ContextInfo;
-	struct lws_client_connect_info ConnInfo;
-	int use_ssl=0;
-	
-	if(context!=NULL)
-		lws_context_destroy(context);
-	memset(&ContextInfo, 0, sizeof(struct lws_context_creation_info));
-	ContextInfo.port=CONTEXT_PORT_NO_LISTEN;
-	ContextInfo.iface=NULL;
-	ContextInfo.ssl_private_key_password=NULL; 
-	ContextInfo.ssl_cert_filepath=NULL; 
-	ContextInfo.ssl_private_key_filepath=NULL; 
-	ContextInfo.ssl_ca_filepath="/root/cacert.pem"; 
-	ContextInfo.ssl_cipher_list=NULL; //use default one
-	ContextInfo.gid=-1;
-	ContextInfo.uid=-1;
-	//if(security connection)
-	//	ContextInfo.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;
-	ContextInfo.protocols=protocols;
-	ContextInfo.timeout_secs= 30;
-	//if(ping pong enabled)
-		//ContextInfo.ws_ping_pong_interval= 15;//0 for none, else interval in seconds 
-	ContextInfo.ws_ping_pong_interval= 0;	
-	context = lws_create_context(&ContextInfo);
-	if (context == NULL) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]ConnectWsServer: lws_create_context NG");
-		#endif	
-		return 0;
-	}
-	memset(&ConnInfo,0,sizeof(struct lws_client_connect_info));
-	ConnInfo.context = context;
-
-	// fill up below information
-	//ConnInfo.address=ServerIpAddress;
-	//ConnInfo.port = ServerSrcPort;
-	//ConnInfo.path=ServerPath;
-	//ConnInfo.host=ServerHost;
-	//ConnInfo.origin=ServerOrigin;
-
-	/* ws://192.168.1.1:9091/greenlots/ocpp*/
-	ConnInfo.address = "192.168.1.1";
-	ConnInfo.port = 9091;
-	ConnInfo.path="/ocpp/T123456789";
-	ConnInfo.host = "192.168.1.1:9091";
-	ConnInfo.origin = "192.168.1.1:9091";	
-
-	use_ssl = LCCSCF_USE_SSL | LCCSCF_ALLOW_SELFSIGNED | LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
-	//if(security connection)
-	//	ConnInfo.ssl_connection = use_ssl;
-	//else
-		ConnInfo.ssl_connection=0;
-
-	ConnInfo.protocol = protocols[1].name;
-	ConnInfo.ietf_version_or_minus_one=-1;
-	wsi=lws_client_connect_via_info(&ConnInfo);						 
-	if (!wsi) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]ConnectWsServer: lws_client_connect_via_info NG");
-		#endif	
-		return 0;
-	}
-	return 1;
-}
-
-int main(int argc,char *argv[])
-{
-	unsigned int StartTime=0;
-	/**************** Initialization **********/		
-	/*if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}*/	
-  	if((SendBuffer=malloc(SendBufLen))==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[Ocpp16]main: malloc(SendBufLen) NG");
-		#endif	
-		sleep(5);
-		return 0;	
-	}	
-	while(ConnectionEstablished==0)
-	{
-		if((time((time_t*)NULL)-StartTime)>=60)
-		{
-			#ifdef debug
-			printf("[OCPP16:]main:Execute ConnectWsServer1\n");
-			#endif
-			ConnectWsServer();
-			StartTime=time((time_t*)NULL);
-		}	
-		lws_service(context, 10000);//timeout_ms	
-	}
-	memset(SendBuffer,0,SendBufLen);
-	sprintf(SendBuffer,"[2,\"%s\",\"%s\",{\"chargePointVendor\":\"%s\",\"chargePointModel\":\"%s\",\"chargePointSerialNumber\":\"%s\",\"chargeBoxSerialNumber\":\"%s\",\"firmwareVersion\":\"%s\",\"imsi\":\"%s\"}]",
-					"11112222",
-					"BootNotification",
-					"CpVendor",
-					"CpModel",
-					"CpSN",
-					"CbSN",
-					"CpFwVersion",
-					"CpImsi");
-	lws_callback_on_writable(wsi);
-	while(1)
-	{
-		//prcessing
-		lws_service(context, 500);//500 timeout_ms 	
-	};
-	
-
-	free(SendBuffer);
-}

+ 0 - 248
EVSE/Projects/DW25/Apps/PsuComm.c

@@ -1,248 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <net/if.h>
-#include <linux/can.h>
-#include <linux/can/raw.h>
-#include <unistd.h>
-#include "define.h"
-
-//#define Debug
-
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct PsuData 				*ShmPsuData ;
-pid_t						CANReceiverPid;
-int 							CanFd;
-
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-	
-/**************************************************************************************/
-/**************************Init all share memory *********************************/
-/**************************************************************************************/
-int InitShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-
-   	 //creat ShmPsuData
-   	 if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData),  0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmget ShmPsuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitShareMemory:shmat ShmPsuData NG");
-		#endif		
-		return 0;
-   	 }
-   	memset(ShmPsuData,0,sizeof(struct PsuData));
-    	return 1;
-}
-
-int InitCanBus()
-{
-	int 					s0,nbytes;
-	struct timeval			tv;
-	struct ifreq 			ifr0;
-	struct sockaddr_can	addr0;
-	
-	system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");				  
-	system("/sbin/ip link set can1 up");
-	
-	s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
-	
-	tv.tv_sec = 0; 
-    	tv.tv_usec = 10000; 
-   	 if (setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct	timeval)) < 0) 
-    	{
-	       	#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVTIMEO NG");
-		#endif		
-    	}
-    	nbytes=40960;
-    	if (setsockopt(s0, SOL_SOCKET,  SO_RCVBUF, &nbytes, sizeof(int)) < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_RCVBUF NG");
-		#endif	
-	}
-    	nbytes=40960;
-    	if (setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0) 
-    	{
-       		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]InitCanBus:Set SO_SNDBUF NG");
-		#endif	
-    	}
-    
-   	strcpy(ifr0.ifr_name, "can1" );
-	ioctl(s0, SIOCGIFINDEX, &ifr0); /* ifr.ifr_ifindex gets filled with that device's index */
-	addr0.can_family = AF_CAN;
-	addr0.can_ifindex = ifr0.ifr_ifindex;
-	bind(s0, (struct sockaddr *)&addr0, sizeof(addr0));
-	return s0;
-}
-
-
-/**************************************************************/
-/************** Receiving Task*******************************/
-/*************************************************************/
-void CANReceiver(int fd)
-{
-	pid_t tmp=0;
-	struct can_frame frame;
-	struct timeb StartTime,EndTime;
-	int nbytes;
-	unsigned char FanspeedGetTime=0;
-	
-	if(CANReceiverPid==0)
-	{
-		tmp=fork();
-		if(tmp>0)
-		{
-			CANReceiverPid=tmp;	
-			{
-				unsigned char buf[64];
-				memset(buf,0,sizeof(buf));
-				sprintf(buf,"renice -20 -p %d",tmp);
-				system(buf);
-			}
-			return;
-		}
-	}
-	
-	while(1)
-	{
-		memset(&frame,0,sizeof(struct can_frame));
-		nbytes = read(fd, &frame, sizeof(struct can_frame));
-		//handle received packet
-	}
-}
-
-/**************************************************************/
-/************** main function***********************************/
-/*************************************************************/
-int main(int argc,char *argv[])
-{
-	int CanFd;
-	struct can_frame frame;
-
-	
-	//Initialization
-	if(InitShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[PsuCOmm]main:InitShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		return 0;
-	}	
-	CanFd=InitCanBus();
-	CANReceiverPid=0;
-	CANReceiver(CanFd);
-
-	//main loop
-	while(1)
-	{
-		//processing
-	}
-	
-EndProcess:	
-	if(CANReceiverPid>0)
-	{
-		char Buf[32];
-		memset(Buf,0,32);
-		sprintf(Buf,"kill %d",CANReceiverPid);
-		system(Buf);
-	}
-	close(CanFd); 
-	system("/sbin/ip link set can1 down");
-	system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");
-	system("/sbin/ip link set can1 up");
-	system("/sbin/ip link set can1 down");
-	system("killall PsuComm");
-}

+ 0 - 69
EVSE/Projects/DW25/Apps/UpdateRootfs.c

@@ -1,69 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include "define.h"
-
-
-int main(int argc,char *argv[])
-{
-	unsigned int MaxLen=25*1024*1024, ImageLen=0;
-	unsigned char *ptr; 
-	int fd,wrd;
-	
-	ptr=malloc(MaxLen);
-	if(ptr==NULL)
-	{
-		printf("UpdateRootfs NG - can not malloc\n");
-		return 0;
-	}	
-	memset(ptr,0xFF,MaxLen);
-	
-	fd = open(argv[1], O_RDONLY);
-	if(fd < 0)
-	{
-		printf("UpdateRootfs NG - can not open rootfs\n");
-		free(ptr);
-		return 0;
-	}
-    	ImageLen=read(fd,ptr,MaxLen);
-	close(fd);	
-	printf("ImageLen=0x%x\n",ImageLen);
-	if(ImageLen<(24*1024*1024))
-	{
-		printf("ImageLen size mismatch\n");
-		free(ptr);
-		return 0;
-	}	
-	fd = open("/dev/mtdblock8", O_RDWR);
-	if (fd < 0) 
-	{
-		printf("UpdateRootfs NG - can not open mtdblock8\n");
-		free(ptr);
-		return 0;
-    	}
-    	wrd=write(fd, ptr, ImageLen);   
-    	close(fd);
-   	if(wrd!=ImageLen)
-	{	
-		printf("UpdateRootfs NG - wrd(0x%x) != ImageLen(0x%x)\n",wrd,ImageLen);
-		free(ptr);
-		return 0;
-	}	
-	free(ptr);
-	printf("UpdateRootfs OK\n");
-}

+ 0 - 2803
EVSE/Projects/DW25/Apps/define.h

@@ -1,2803 +0,0 @@
-#ifndef	DEFINE_H_
-#define	DEFINE_H_
-
-/**************************************************************************************/
-/*********************************NAND Flash mapping *****************************/
-/**************************************************************************************/
-/* 
-  sector size	512 KiB
-  Page size       4096 b
-  OOB size        224 b
-  Erase size    	524288 b
--------------------------------------------------------------------------------------------------------------------------------
-Segment 					Physical address 			Size 
--------------------------------------------------------------------------------------------------------------------------------
-MLO						0x00000000-0x0007FFFF		512 KB
-Primary u-boot 			0x00080000-0x0017FFFF		1 MB
-Environment 				0x00180000-0x001FFFFF		512 KB
-Secondary u-boot	 		0x00200000-0x002FFFFF		1 MB
-Primary dtb				0x00300000-0x0037FFFF		512 KB
-Secondary dtb				0x00380000-0x003FFFFF		512 KB
-Primary kernel				0x00400000-0x00DFFFFF		10 MB
-Secondary Kernel 			0x00E00000-0x017FFFFF		10 MB
-Primary root file system		0x01800000-0x029FFFFF		24 MB
-Secondary root file system	0x03000000-0x047FFFFF		24 MB
-Primary user configuration 	0x04800000-0x004DFFFF		6 MB
-Secondary user configuration	0x04E00000-0x0053FFFF		6 MB
-Factory default configuration	0x05400000-0x0059FFFF		6 MB
-Storage					0x05A00000-0x7FFFFFFF		1958 MB
-*/
-
-/**************************************************************************************/
-/*********************************System Limitation**********************************/
-/**************************************************************************************/
-/*Rating outout power and current*/
-#define RATED_POWER		60		//kW
-#define RATED_CURRENT		350		//Amp, it depend on the capacity of charging connector
-
-/*relevant to Quantity */
-#define MAX_PSU_QUANTITY	62		
-#define CHAdeMO_QUANTITY	1
-#define CCS_QUANTITY		1
-#define GB_QUANTITY		1
-
-
-/*SystemLog message*/
-#define SystemLogMessage			//for engineer to do analysis
-
-/**************************************************************************************/
-/**************************share memory key information***************************/
-/**************************************************************************************/
-#define ShmSysConfigAndInfoKey	1001
-#define ShmPsuKey				1002
-#define ShmCHAdeMOCommKey	1003	
-#define ShmCcsCommKey		1004	
-#define ShmStatusCodeKey		1005	
-#define ShmPrimaryMcuKey		1006
-#define ShmFanBdKey			1007
-#define ShmRelayBdKey			1008
-#define ShmOcppModuleKey		1009
-
-/**************************************************************************************/
-/****structure SysConfigData => shall store the data to NAND flash****************/
-/****structure SysInfoData => shall NOT store the data to NAND flash***************/
-/****according to System Configuration and Information Table.xlsx Rev.0.2 *******/
-/**************************************************************************************/
-
-struct EthConfigData 
-{
-	unsigned char		EthDhcpClient;			//0: enable,1: disable
-	unsigned char		EthMacAddress[18];			//default: Null		
-	unsigned char		EthIpAddress[16];			//Eth0 default:192.168.0.10	,Eth1 default:192.168.1.10				
-	unsigned char		EthSubmaskAddress[16];		//Eth0 default:255.255.255.0	,Eth1 default:255.255.255.0			
-	unsigned char		EthGatewayAddress[16];		//Eth0 default:192.168.0.254	,Eth1 default:192.168.1.254	
-};
-
-struct WifiConfigData 
-{
-	unsigned char		WifiMode;				//0: disable, 1: Infrastructure client, 2: Infrastructure server, 3: Ad-Hoc		
-	unsigned char		WifiSsid[256];				//default: Null		
-	unsigned char		WifiPassword[256];			//default: Null
-	int				WifiRssi;					//dbm		
-	unsigned char		WifiDhcpServer;			//0: enable, 1: disable	
-	unsigned char		WifiDhcpClient;			//0: enable, 1: disable		
-	unsigned char		WifiMacAddress[18];		//default: Null		
-	unsigned char		WifiIpAddress[16];			//default:192.168.2.10		
-	unsigned char		WifiSubmaskAddress[16];		//default:255.255.255.0			
-	unsigned char		WifiGatewayAddress[16];	//default:192.168.2.254	
-	unsigned char 		WifiNetworkConn;			//0: disconnected, 1: connected		
-};
-
-struct TeleConfigData 
-{	
-	unsigned char		TelcomModelName[64];		//default: Null		
-	unsigned char		TelcomSoftwareVer[64];		//default: Null		
-	unsigned char		TelcomApn[256];			//default: Null		
-	int				TelcomRssi;				//dbm	
-	unsigned char		TelcomChapPapId[256];		//default: Null		
-	unsigned char		TelcomChapPapPwd[256];	//default: Null		
-	unsigned char		TelcomModemImei[16];		//default: Null		
-	unsigned char		TelcomSimImsi[16];			//default: Null			
-	unsigned char		TelcomSimStatus;			//0: no SIM card is found, 1: valid SIM card, 2: invalid SIM card	
-	unsigned char		TelcomModemMode;		//0: No services, 1: CDMA, 2: GSM/GPRS, 3: WCDMA, 4: GSM/WCDMA, 5: TD_SCDMA mode, 6: Unknow
-	unsigned char		TelcomIpAddress[16];		//default: Null		
-	unsigned char 		TelcomNetworkConn;		//0: disconnected, 1: connected		
-};
-
-struct SysConfigData 
-{
-	/**************System***************/
-	unsigned char			ModelName[64];			//charger model name
-	unsigned char			SerialNumber[64];			//charger system serial number								
-	unsigned char			SystemId[128];				//charger system ID
-	unsigned char			SystemDateTime[32];		//charger system date and time
-	unsigned char			AuthorisationMode;			//0: Phihong RFID tag,  1: OCPP backend,  2: Phihong backend,  3: free mode
-	unsigned char	   		DefaultLanguage;			//
-	unsigned char   		RfidCardNumEndian;		//0: little endian,  1: big endian	
-	unsigned short			AcPlugInTimes;				//0~65535
-	unsigned short			GbPlugInTimes;			//0~65535
-	unsigned short			Ccs1PlugInTime;			//0~65535
-	unsigned short			Ccs2PlugInTimes;			//0~65535
-	unsigned short			ChademoPlugInTimes;		//0~65535
-	/**************Charging***************/
-	unsigned short	   		MaxChargingEnergy;		//0: no limit,	1 ~ 65535	kWh		
-	unsigned short	   		MaxChargingPower;		//0: rating value, 1 ~ RATING_POWER	kW"		
-	unsigned short	   		MaxChargingCurrent;		//0: rating value, 1 ~ RATING_CURRENT	amp"		
-	unsigned short	   		MaxChargingDuration;		//0: no limit,	1 ~ 65535	minutes		
-	unsigned char   		PhaseLossPolicy;			//0: charging,  1: stop charging
-	unsigned char   		LocalWhiteCard[10][32];		//Max. card quantity is 10
-	unsigned char 			UserId[32];				//the user use this ID to trigger charging event, it can be RFID card number, OCPP IdTag, etc.
-	/**************Network***************/
-	unsigned char 			FtpServer[32];				//the ftp server for Phihong server to do data transimission								
-	struct EthConfigData 	Eth0Interface;
-	struct EthConfigData 	Eth1Interface;
-	struct WifiConfigData 	AthInterface;
-	struct TeleConfigData	TelecomInterface;		
-	/**************Backend***************/	
-	unsigned int 			BackendConnTimeout;		//default : 300s
-	unsigned char   		OfflinePolicy;				//0: local list, 1: Phihong RFID tag, 2: free charging, 3: no charging
-	unsigned short	   		OfflineMaxChargeEnergy;	//0: same as MaxChargingEnergy, 1 ~ 65535 kWh	
-	unsigned short	   		OfflineMaxChargeDuration;	//0: same as MaxChargeDuration, 1 ~ 65535 minutes		
-	unsigned char 			OcppServerURL[512];		//http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"								
-	unsigned char 			ChargeBoxId[128];		
-	unsigned int 			Checksum;			//4 bytes checksum	
-};
-
-struct ChargingInfoData 
-{
-	float				MaximumChargingVoltage;	//0~6553.5 volt
-	float				AvailableChargingCurrent;	//0~6553.5 amp		
-	float				AvailableChargingPower;	//0~6553.5 kW		
-	float				PresentChargingVoltage	;	//0~6553.5 volt
-	float				PresentChargingCurrent;		//0~6553.5 amp		
-	float				PresentChargingPower;		//0~6553.5 kW		
-	float				PresentChargedEnergy;		//0~6553.5 kWh		
-	int				PresentChargedDuration;	// second		
-	int				RemainChargingDuration;	// second		
-	float				EvBatteryMaxVoltage;		// 0~6553.5 volt				
-	float				EvBatterytargetVoltage;		// 0~6553.5 volt				
-	int				EvBatterySoc;				// 0~100%		
-	unsigned char 		ConnectorPlugIn;			//0: unplug, 1: Plug-in	
-	float 			PilotVoltage;				
-	unsigned char 		PilotState;				//1:state A, 2:State B1, 3:State B2, 4:State C, 5:State D, 6:State E, 7:State F, 8: Pilot error
-	unsigned char 		PilotDuty;					// 0~100%		
-};
-
-struct SysInfoData 
-{
-	/**************System***************/
-	unsigned char		SystemStatus;				//0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault		
-	unsigned char		FactoryConfiguration;		//0: normal, 1: trigger, charger will return the configuration to factory default if trigger
-	float 			InputVoltageR;			//0~655.35 volt		
-	float 			InputVoltageS;				//0~655.35 volt		
-	float 			InputVoltageT;				//0~655.35 volt		
-	unsigned int 		SystemFanRotaSpeed;		//0 ~ 65535 RPM		
-	unsigned int 		PsuFanRotaSpeed;			//0 ~ 65535 RPM		
-	unsigned char		AuxPower5V;				//0 ~ 255 volt		
-	unsigned char		AuxPower12V;				//0 ~ 255 volt		
-	unsigned char		AuxPower24V;				//0 ~ 255 volt		
-	unsigned char		AuxPower48V;				//0 ~ 255 volt	
-	unsigned char 		CsuHwRev[32];			//CSU board hardware version	
-	unsigned char 		CsuBootLoadFwRev[32];		//CSU board bootloader firmware version
-	unsigned char 		CsuKernelFwRev[32];		//CSU board OS kernel firmware version								
-	unsigned char 		CsuRootFsFwRev[32];		//CSU board root file system firmware version		
-	unsigned char 		CsuPrimFwRev[32];			//CSU board root file system firmware version								
-	unsigned char 		LcmHwRev[32];			//LCM module hardware version								
-	unsigned char 		LcmFwRev[32];			//LCM module firmware version						
-	unsigned char 		PsuHwRev[32];				//PSU hardware version						
-	unsigned char 		PsuPrimFwRev[32];			//PSU primary firmware version			
-	unsigned char 		PsuSecFwRev[32];			//PSU secondary firmware version	
-	unsigned char 		AuxPwrHwRev[32];			//Aux. power module hardware version	
-	unsigned char 		AuxPwrFwRev[32];			//Aux. power module firmware version	
-	unsigned char 		FanModuleHwRev[32];		//Fan  module hardware version	
-	unsigned char 		FanModuleFwRev[32];		//Fan  module firmware version		
-	unsigned char 		RelayModuleHwRev[32];		//Relay control  module hardware version	
-	unsigned char 		RelayModuleFwRev[32];		//Relay control  module firmware version		
-	unsigned char 		TelcomModemFwRev[32];	//the 3G/4G modem firmware version	
-	int			  	SystemAmbientTemp;		// -40 ~ 215 degree C
-	int			  	SystemCriticalTemp;		// -40 ~ 215 degree C
-	int			  	CcsConnectorTemp;		// -40 ~ 215 degree C
-	int			  	PsuAmbientTemp;			// -40 ~ 215 degree C
-	/**************Charging***************/
-	struct ChargingInfoData 	ChademoChargingData[CHAdeMO_QUANTITY];	
-	struct ChargingInfoData 	CcsChargingData[CCS_QUANTITY];
-	struct ChargingInfoData 	GbChargingData[GB_QUANTITY];
-	/**************Network***************/
-	unsigned char 		InternetConn;				//0: disconnected, 1: connected	
-	/**************Backend***************/	
-	unsigned char 		OcppConnStatus;			//0: disconnected, 1: connected	
-
-};
-
-struct SysConfigAndInfo 
-{
-	struct SysConfigData	SysConfig; 
-	struct SysInfoData		SysInfo; 
-};
-
-/**************************************************************************************/
-/**************************Alarm Share memory**************************************/
-/***************************************************************************************
-	Status Code	A			B				C									D	E	F	
-				0: Issue		1: From EVSE 		1: Fault (unrecoverable)					001 ~ 999 serial number			
-			    								e.g., hardware broken, system latch				
-				1: Recovered	2: From EV		2: Alarm (recoverable)				
-			   								e.g., OTP, OVP				
-							3: From Backend	3: Information 				
-			  								e.g., swipe card to stop charging		
-			  								
-according to XXX.Revxx			  										
-***************************************************************************************/
-/**************************************************************************************/
-char FaultStatusCode[32][6]= 
-{
-	"011001",	//CHAdeMO output fuse blew		
-	"011002",	//CCS output fuse blew		
-	"011003",	//GB output fuse blew		
-	"011004",	//RCD/CCID self-test fail		
-	"011005",	//AC input contactor 1 welding 		
-	"011006",	//AC input contactor 1 driving fault 		
-	"011007",	//AC input contactor 2 welding 		
-	"011008",	//AC input contactor 2 driving fault  		
-	"011009",	//AC output relay welding		
-	"011010",	//AC output relay  driving fault		
-	"011011",	//CHAdeMO output relay welding		
-	"011012",	//CHAdeMO output relay driving fault		
-	"011013",	//CCS output relay welding		
-	"011014",	//CCS output relay driving fault		
-	"011015",	//GB output relay welding		
-	"011016",	//GB output relay driving fault		
-	"011017",	//AC connector temperature sensor broken		
-	"011018",	//CHAdeMO connector temperature sensor broken		
-	"011019",	//CCS connector temperature sensor broken		
-	"011020",	//GB connector temperature sensor broken		
-	"011021",	//WiFi module broken		
-	"011022",	//3G/4G module broken		
-	"011023",	//Aux. power module broken		
-	"011024",	//Relay control module /smart box broken		
-	"011025",	//CHAdeMO connector lock fail		
-	"011026",	//GB connector lock fail		
-	"011027",	//AC connector lock fail		
-	"011028",	//CHAdeMO module broken		
-	"011029",	//CCS module broken		
-	"011030",	//GBT module broken		
-	"011031",	//PSU module broken		
-	"011032"	//Reserved
-};
-
-struct FaultCodeData
-{
-	unsigned char PreviousFaultVal[4];
-	union
-	{
-		unsigned char FaultVal[4];
-		struct
-		{
-			//FaultVal[0]
-		    	unsigned char ChademoOutputFuseBlew:1;				//bit 0 
-			unsigned char CcsOutputFuseBlew:1;					//bit 1
-			unsigned char GbOutputFuseBlew:1;   					//bit 2
-			unsigned char RcdSelfTestFail:1;						//bit 3		              
-			unsigned char AcInputContactor1Welding:1;			//bit 4 		          
-			unsigned char AcInputContactor1DrivingFault:1;			//bit 5  		  
-			unsigned char AcInputContactor2Welding:1;			//bit 6 		          
-			unsigned char AcInputContactor2DrivingFault:1;			//bit 7  
-			//FaultVal[1]		
-			unsigned char AcOutputRelayWelding:1;				//bit 0 
-			unsigned char AcOutputRelayDrivingFault:1;				//bit 1
-			unsigned char ChademoOutputRelayWelding:1;			//bit 2
-			unsigned char ChademoOutputRelayDrivingFault	:1;		//bit 3		              
-			unsigned char CcsOutputRelayWelding:1;				//bit 4 		          
-			unsigned char CcsOutputRelayDrivingFault:1;			//bit 5  		  
-			unsigned char GbOutputRelayWelding:1;				//bit 6 		          
-			unsigned char GbOutputRelayDrivingFault:1;				//bit 7    
-			//FaultVal[2]		
-			unsigned char AcConnectorTempSensorBroken:1;			//bit 0 
-			unsigned char ChademoConnectorTempSensorBroken:1;	//bit 1
-			unsigned char CcsConnectorTempSensorBroken:1;		//bit 2
-			unsigned char GbConnectorTempSensorBroken:1;			//bit 3		              
-			unsigned char WiFiModuleBroken:1;					//bit 4 		          
-			unsigned char Telecom4GModuleBroken:1;				//bit 5  		  
-			unsigned char AuxPowerModuleBroken:1;				//bit 6 		          
-			unsigned char RelayControlModuleBroken :1;			//bit 7 	
-	             	 //FaultVal[3]		
-			unsigned char ChademoConnectorLockFail:1;			//bit 0 
-			unsigned char GbConnectorLockFail:1;					//bit 1
-			unsigned char AcConnectorLockFail:1;					//bit 2
-			unsigned char ChademoModuleBroken:1;				//bit 3		              
-			unsigned char CcsModuleBroken:1;					//bit 4 		          
-			unsigned char GbModuleBroken:1;						//bit 5  		  
-			unsigned char PsuModuleBroken:1;						//bit 6 		          
-			unsigned char :1;									//bit 7		reserved
-		}bits;
-	}FaultEvents;        
-};          
-
-char AlarmStatusCode[64][6]=
-{
-	"012200",	//System L1 input OVP		                            
-	"012201",	//System L2 input OVP		                            
-	"012202",	//System L3 input OVP		                            
-	"012203",	//System L1 input UVP		                            
-	"012204",	//System L2 input UVP		                            
-	"012205",	//System L3 input UVP		                            
-	"012206",	//PSU L1 input OVP		                                
-	"012207",	//PSU L2 input OVP		                                
-	"012208",	//PSU L3 input OVP		                                
-	"012209",	//PSU L1 input UVP		                                
-	"012210",	//PSU L2 input UVP		                                
-	"012211",	//PSU L3 input UVP		                                
-	"012212",	//System L1 input drop		                            
-	"012213",	//System L2 input drop		                            
-	"012214",	//System L3 input drop		                            
-	"012215",	//System AC output OVP		                            
-	"012216",	//System AC output OCP		                            
-	"012217",	//System CHAdeMO output OVP		                        
-	"012218",	//System CHAdeMO output OCP		                        
-	"012219",	//System CCS output OVP		                            
-	"012220",	//System CCS output OCP		                            
-	"012221",	//System GB output OVP		                            
-	"012222",	//System GB output OCP		                            
-	"012223",	//System ambient/inlet OTP		                        
-	"012224",	//System critical point OTP		                        
-	"012225",	//PSU ambient/inlet OTP		                            
-	"012226",	//PSU critical point OTP		                        
-	"012227",	//Aux. power module OTP		                            
-	"012228",	//Relay board/smart box OTP		                        
-	"012229",	//CHAdeMO connector OTP		                            
-	"012230",	//CCS connector OTP		                                
-	"012231",	//GB connector OTP		                                
-	"012232",	//AC connector OTP		                                
-	"012233",	//RCD/CCID trip		                                    
-	"012234",	//CHAdeMO GFD trip		                                
-	"012235",	//CCS GFD trip		                                    
-	"012236",	//GB GFD trip		                                    
-	"012237",	//SPD trip		                                        
-	"012238",	//Main power breaker trip		                        
-	"012239",	//Aux. power breaker trip		                        
-	"012240",	//PSU communication fail		                        
-	"012241",	//WiFi module communication fail		                
-	"012242",	//3G/4G module communication fail		                
-	"012243",	//RFID module communication fail		                
-	"012244",	//Bluetooth module communication fail		            
-	"012245",	//LCM module communication fail		                    
-	"012246",	//Aux. power module communication fail		            
-	"012247",	//Relay control boaed/smart box communication fail		
-	"012248",	//CCS module communication fail		                    
-	"012249",	//CHAdeMO module communication fail		                
-	"012250",	//GBT module communication fail		                    
-	"012251",	//Emergency stop		                                
-	"012252",	//Door open		                                        
-	"012253",	//System fan decay		                                
-	"012254",	//Fail to create share memory 
-	"012255",	//CSU initialization failed
-	"012256",	//Reserved
-	"012257",	//Reserved
-	"012258",	//Reserved
-	"012259",	//Reserved
-	"012260",	//Reserved
-	"012261",	//Reserved
-	"012262",	//Reserved
-	"012263"	//Reserved
-};   
-struct AlarmCodeData
-{
-	unsigned char PreviousAlarmVal[8];
-	union
-	{    
-		unsigned char AlarmVal[8];
-		struct
-		{
-			//AlarmVal[0]
-		    	unsigned char SystemL1InputOVP:1;					//bit 0 
-			unsigned char SystemL2InputOVP:1;					//bit 1
-			unsigned char SystemL3InputOVP:1;   					//bit 2
-			unsigned char SystemL1InputUVP:1;					//bit 3		              
-			unsigned char SystemL2InputUVP:1;					//bit 4 		          
-			unsigned char SystemL3InputUVP:1;					//bit 5  		  
-			unsigned char PsuL1InputOVP:1;						//bit 6 		          
-			unsigned char PsuL2InputOVP:1;						//bit 7  
-			//AlarmVal[1]		
-			unsigned char PsuL3InputOVP:1;						//bit 0 
-			unsigned char PsuL1InputUVP:1;						//bit 1
-			unsigned char PsuL2InputUVP:1;						//bit 2
-			unsigned char PsuL3InputUVP	:1;						//bit 3		              
-			unsigned char SystemL1InputDrop:1;					//bit 4 		          
-			unsigned char SystemL2InputDrop:1;					//bit 5  		  
-			unsigned char SystemL3InputDrop:1;					//bit 6 		          
-			unsigned char SystemAcOutputOVP:1;					//bit 7    
-			//AlarmVal[2]		
-			unsigned char SystemAcOutputOCP:1;					//bit 0 
-			unsigned char SystemChademoOutputOVP:1;			//bit 1
-			unsigned char SystemChademoOutputOCP:1;			//bit 2
-			unsigned char SystemCcsOutputOVP:1;					//bit 3		              
-			unsigned char SystemCcsOutputOCP:1;					//bit 4 		          
-			unsigned char SystemGbOutputOVP:1;					//bit 5  		  
-			unsigned char SystemGbOutputOCP:1;					//bit 6 		          
-			unsigned char SystemAmbientOTP :1;					//bit 7 	
-	             	 //AlarmVal[3]		
-			unsigned char SystemCriticalPointOTP:1;				//bit 0 
-			unsigned char PsuAmbientOTP:1;						//bit 1
-			unsigned char PsuCriticalPointOTP:1;					//bit 2
-			unsigned char AuxPowerModuleOTP:1;					//bit 3		              
-			unsigned char RelayBoardOTP:1;						//bit 4 		          
-			unsigned char ChademoConnectorOTP:1;				//bit 5  		  
-			unsigned char CcsConnectorOTP:1;					//bit 6 		          
-			unsigned char GbConnectorOTP:1;					//bit 7		
-			 //AlarmVal[4]			
-			unsigned char AcConnectorOTP:1;						//bit 0 
-			unsigned char RcdTrip:1;								//bit 1
-			unsigned char ChademoGfdTrip:1;						//bit 2
-			unsigned char CcsGfdTrip:1;							//bit 3		              
-			unsigned char GbGfdTrip:1;							//bit 4 		          
-			unsigned char SpdTrip:1;								//bit 5  		  
-			unsigned char MainPowerBreakerTrip:1;					//bit 6 		          
-			unsigned char AuxPowerBreakerTrip:1;					//bit 7			
-			//AlarmVal[5]			
-			unsigned char PsuCommunicationFail:1;				//bit 0 
-			unsigned char WiFiModuleCommFail:1;					//bit 1
-			unsigned char Telecom4GModuleCommFail:1;			//bit 2
-			unsigned char RfidModuleCommFail:1;					//bit 3		              
-			unsigned char BluetoothModuleCommFail:1;				//bit 4 		          
-			unsigned char LcmModuleCommFail:1;					//bit 5  		  
-			unsigned char AuxPowerModuleCommFail:1;			//bit 6 		          
-			unsigned char RelayBoardCommFail:1;					//bit 7			
-			//AlarmVal[6]			
-			unsigned char CcsModuleCommFail:1;					//bit 0 
-			unsigned char ChademoModuleCommFail:1;			//bit 1
-			unsigned char GbModuleCommFail:1;					//bit 2
-			unsigned char EmergencyStopTrip:1;					//bit 3		              
-			unsigned char DoorOpen:1;							//bit 4 		          
-			unsigned char SystemFanDecay:1;						//bit 5  		  
-			unsigned char FailToCreateShareMemory:1;				//bit 6  		  
-			unsigned char CsuInitFailed:1;							//bit 7  		
-			//AlarmVal[7]			  
-			unsigned char :8;									//reserved				
-		}bits;
-	}AlarmEvents;        
-};          
-
-char InfoStatusCode[64][6]=
-{
-	//Information comes from EVSE 
-	"013600",	//Normal stop charging by user		                
-	"013601",	//Charging Time's up		                        
-	"013602",	//Replace system air filter 		                
-	"013603",	//Reach to CHAdeMO max. plugging times.		        
-	"013604",	//Reach to CCS max. plugging times.		            
-	"013605",	//Reach to GB max. plugging times.		            
-	"013606",	//Reach to AC max. plugging times.		            
-	"013607",	//CSU fimrware update fail		            
-	"013608",	//CHAdeMO Module fimrware update fail	
-	"013609",	//CCS Module fimrware update fail	
-	"013610",	//GB Module fimrware update fail		                
-	"013611",	//Aux. power module fimrware update fail		    
-	"013612",	//Relay control module fimrware update fail		    
-	"013613",	//LCM module fimrware update fail		            
-	"013614",	//Bluetooth module fimrware update fail		        
-	"013615",	//WiFi module fimrware update fail		            
-	"013616",	//3G/4G module fimrware update fail		            
-	"013617",	//SMR fimrware update fail		                    
-	"013618",	//RFID module fimrware update fail		            
-	"013619",	//configured by USB flash drive		                
-	"013620",	//configured by backend		                        
-	"013621",	//configured by webpage		                    
-	"013622",	//disconnected from Internet through Ethernet		
-	"013623",	//disconnected from Internet through WiFi		    
-	"013624",	//disconnected from Internet through 3G/4G		    
-	"013625",	//disconnected from AP through WiFi		            
-	"013626",	//disconnected from APN through 3G/4G		  
-	"013627",	//Reserved
-	"013628",	//Reserved
-	"013629",	//Reserved
-	"013630",	//Reserved
-	"013631",	//Reserved    
-	//Information comes from EV
-	"023700",	//CHAdeMO EV communication Fail		           
-	"023701",	//CCS EV communication Fail		               
-	"023702",	//GB EV communication Fail		               
-	"023703",	//AC: pilot fault		                       
-	"023704",	//CHAdeMO:  battery malfunction		           
-	"023705",	//CHAdeMO:  no charging permission		       
-	"023706",	//CHAdeMO:  battery incompatibility		       
-	"023707",	//CHAdeMO:  battery OVP		                   
-	"023708",	//CHAdeMO:  battery UVP		                   
-	"023709",	//CHAdeMO:  battery OTP		                   
-	"023710",	//CHAdeMO:  battery current difference		   
-	"023711",	//CHAdeMO:  battery voltage difference		   
-	"023712",	//CHAdeMO:  shift position		               
-	"023713",	//CHAdeMO:  battery other fault		           
-	"023714",	//CHAdeMO:  charging system error		       
-	"023715",	//CHAdeMO:  EV normal stop	
-	"023716",	//Reserved
-	"023717",	//Reserved
-	"023718",	//Reserved
-	"023719",	//Reserved
-	"023720",	//Reserved
-	"023721",	//Reserved	
-	"023722",	//Reserved	
-	"023723",	//Reserved	
-	 //Information comes from Backend              
-	"033900",	//disconnected from backend through Ethernet		
-	"033901",	//disconnected from backend through WiFi		    
-	"033902",	//disconnected from backend through 3G/4G		    
-	"033903",	//Remote start charging by backend		            
-	"033904",	//Remote stop charging by backend		            
-	"033905",	//Remote reset by backend		                                   
-	"033906",	//Reserved                      	
-	"033907",	//Reserved                      	                   	
-};   
-struct InfoCodeData
-{
-	unsigned char PreviousInfoVal[8];
-	union
-	{    
-		unsigned char InfoVal[8];
-		struct
-		{
-			//InfoVal[0]
-		    	unsigned char NormalStopChargingByUser:1;				//bit 0 
-			unsigned char ChargingTimesUp:1;						//bit 1
-			unsigned char ReplaceSystemAirFilter:1; 					//bit 2
-			unsigned char ReachChademoMaxPluggingTimes:1;		//bit 3		              
-			unsigned char ReachCcsMaxPluggingTimes:1;			//bit 4 		          
-			unsigned char ReachGbMaxPluggingTimes:1;			//bit 5  		  
-			unsigned char ReachAcMaxPluggingTimes:1;				//bit 6 		          
-			unsigned char CsuFimrwareUpdateFail:1;				//bit 7  
-			//InfoVal[1]		
-			unsigned char ChademoModuleFimrwareUpdateFail:1;	//bit 0 
-			unsigned char CcsModuleFimrwareUpdateFail:1;			//bit 1
-			unsigned char GbModuleFimrwareUpdateFail:1;			//bit 2
-			unsigned char AuxPowerModuleFimrwareUpdateFail:1;		//bit 3		              
-			unsigned char RelayBoardFimrwareUpdateFail:1;			//bit 4 		          
-			unsigned char LcmModuleFimrwareUpdateFail:1;			//bit 5  		  
-			unsigned char BluetoothModuleFimrwareUpdateFail:1;		//bit 6 		          
-			unsigned char WiFiModuleFimrwareUpdateFail:1;			//bit 7    
-			//InfoVal[2]		
-			unsigned char Telocom4GModuleFimrwareUpdateFail:1;	//bit 0 
-			unsigned char PsuFimrwareUpdateFail:1;				//bit 1
-			unsigned char RfidModuleFimrwareUpdateFail:1;			//bit 2
-			unsigned char ConfiguredByUsbFlashDrive:1;				//bit 3		              
-			unsigned char ConfiguredByBackend:1;					//bit 4 		          
-			unsigned char ConfiguredByWebpage:1;				//bit 5  		  
-			unsigned char InternetDisconnectViaEthernet:1;			//bit 6 		          
-			unsigned char InternetDisconnectViaWiFi :1;				//bit 7 	
-	             	 //InfoVal[3]		
-			unsigned char InternetDisconnectVia4Gi:1;				//bit 0 
-			unsigned char ApDisconnectViaWiFi:1;					//bit 1
-			unsigned char ApnDisconnectVia4Gi:1;					//bit 2
-			unsigned char :5;									//bit 3~7 reserved		              
-			 //InfoVal[4]			
-			unsigned char ChademoEvCommFail:1;				//bit 0 
-			unsigned char CcsEvCommFail:1;						//bit 1
-			unsigned char GbEvCommFail:1;						//bit 2
-			unsigned char PilotFault:1;							//bit 3		              
-			unsigned char ChademoBatteryMalfun:1;				//bit 4 		          
-			unsigned char ChademoNoPermission:1;				//bit 5  		  
-			unsigned char ChademoBatteryIncompatibility:1;			//bit 6 		          
-			unsigned char ChademoBatteryOVP:1;					//bit 7			
-			//InfoVal[5]			
-			unsigned char ChademoBatteryUVP:1;					//bit 0 
-			unsigned char ChademoBatteryOTP:1;					//bit 1
-			unsigned char ChademoBatteryCurrentDiff:1;			//bit 2
-			unsigned char ChademoBatteryVoltageDiff:1;			//bit 3		              
-			unsigned char ChademoShiftPosition:1;					//bit 4 		          
-			unsigned char ChademoBatteryOtherFault:1;			//bit 5  		  
-			unsigned char ChademoChargingSystemError:1;			//bit 6 		          
-			unsigned char ChademoEvNormalStop:1;				//bit 7			
-			//InfoVal[6]			 	  
-			unsigned char :8;									//bit 0~7 reserved				
-			//InfoVal[7]			
-			unsigned char BackendDisconnectedViaEthernet:1;		//bit 0 
-			unsigned char BackendDisconnectViaWiFi:1;				//bit 1
-			unsigned char BackendDisconnectVia4G:1;				//bit 2
-			unsigned char BackendRemoteStart:1;					//bit 3		              
-			unsigned char BackendRemoteStop:1;					//bit 4 		          
-			unsigned char BackendRemoteReset:1;					//bit 5  		  
-			unsigned char :2;									//bit 6~7 reserved		
-		}bits;
-	}InfoEvents;        
-};          
-            
-struct StatusCodeData
-{           
-	struct FaultCodeData	FaultCode;	
-	struct AlarmCodeData	AlarmCode;
-	struct InfoCodeData	InfoCode;
-};          
-/**************************************************************************************/
-/**************************PSU Share memory***************************************/
-/**************************************************************************************/
-            
-/*Following are the information for each PSU module*/
-struct PsuModuleData 
-{           
-	unsigned char 		AssignID;	
-	unsigned char 		PhysicalID;		
-	unsigned char 		GroupID;					
-	unsigned char 		FwVersion[12];							
-	unsigned char 		StateMachine;			//0: Identification,  1:Operation,  2: Alarm,  3: Failure,  s4:Upgrade
-	unsigned char 		OutputPowerSwitch;	//0: D.D normal OFF,  1: D.D emergency OFF,  2: D.D ON
-	unsigned short 	FanSpeed;			//RPM
-	unsigned short 	InputVoltageL1;		//abcd=abc.d volt
-	unsigned short 	InputVoltageL2;		//abcd=abc.d volt	
-	unsigned short 	InputVoltageL3;		//abcd=abc.d volt
-	unsigned short 	PresentOutputVoltage;	//abcd=abc.d volt
-	unsigned short 	PresentOutputCurrent;	//abcd=abc.d volt
-	unsigned short 	AvailableCurrent;		//abcd=abc.d Amps
-	unsigned int 		AvailablePower;		//Watt
-	unsigned char 		CriticalTemp1;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		CriticalTemp2;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		CriticalTemp3;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		InletTemp;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned char 		OutletTemp;			//0x00: -60¢XC  ~  0xFE: 194¢XC, resolution: 1¢XC, offset: -60¢XC, 0xFF: invalid
-	unsigned int 		AlarmCode;			//
-	unsigned int 		FaultCode;			//
-};
-
-/*Following are the information for each PSU Group*/
-struct PsuGroupData 
-{
-	unsigned char 			GroupPresentPsuQuantity;
-	unsigned char 			GroupOutputPowerSwitch;		//0: D.D normal OFF,  1: D.D emergency OFF,  2: D.D ON
-	unsigned short 		GroupTargetOutputVoltage;		//abcd=abc.d volt
-	unsigned short 		GroupTargetOutputCurrent;		//abcd=abc.d volt
-	unsigned short 		GroupAvailableCurrent;			//abcd=abc.d Amps
-	unsigned int 			GroupAvailablePower;			//Watt
-	unsigned short 		GroupPresentOutputVoltage; 	//abcd=abc.d volt
-	unsigned short 		GroupPresentOutputCurrent;		//abcd=abc.d Amps
-	struct PsuModuleData 	PsuModule[MAX_PSU_QUANTITY];
-};
-
-/*Following is the information for system all PSU*/
-struct PsuData 
-{
-	unsigned char 			SystemPresentPsuQuantity;
-	struct PsuGroupData 	PsuGroup[4];
-};
-
-/************************************************************************************/
-/**************************CHAdeMO protocol Share memory*********************/
-/**************************************************************************************/
-struct CHAdeMOEvData 
-{
-	unsigned char  SupportDynamicControl;	//110.0				
-										//					bit0=1:supported
-	unsigned char  SupportHighCurrent;		//110.0				
-										//					bit1=1:supported
-	unsigned char  MiniChargeCurrent;		//100.0				0~200(A) (unit:1A)
-										//					0x00: request for current equivalent to 1.5kW
-										//					0x01: no request
-										//					0x02: request of 1A and following are the same rule
-	unsigned short MaxiBatteryVoltage;		//100.5,100.4 			0~600(V) (unit:1V)
-	unsigned short MaxiChargingTime;			//101.2,101.1			10(sec.)~255(min.)	(Unit:sec)
-										//					Set 0xFF to 101.1 (Unit: 10sec) in case 101.2 (Unit: 1min) is used																							
-	unsigned char  EstimatChargingTime;		//101.3				0~254(min.)	(Unit:sec)
-										//					Display Only
-	unsigned short TotalBatteryCapacity;		//101.6,101.5 			0.1~6553.5(kWh)	(unit:0.1 kWh)									
-	unsigned char  ProtocolVersion;			//102.0				0~255	
-										//					0x02: CHAdeMO specification ver.1.2
-	unsigned short TargetBatteryVoltage;		//102.2,102.1 			0~600(V) (unit:1V)								
-	unsigned short  ChargingCurrentRequest;	//102.3				0~200(A) (unit:1A)
-										//110.2,110.1 			0~1023(A) (unit:1A)			
-	unsigned char  BatteryAlarm;				//102.4				>0:alarm
-										//					bit0=1:Battery overvoltage
-										//					bit1=1:Battery undervoltage
-										//					bit2=1:Battery current deviation error
-										//					bit3=1:High battery temperature
-										//					bit4=1:Battery voltage deviation error
-	unsigned char  EvDetection;				//102.5				
-										//					bit0=0:Vehicle charging disabled,	(stop charging)
-										//					bit0=1:Vehicle charging enabled,
-										//					bit1=0:¡§Parking¡¨ position
-										//					bit1=1:other position				(stop charging)
-										//					bit2=0:Charging system normal
-										//					bit2=1:Charging system error		(stop charging)
-										//					bit3=0:EV contactor close or during welding detection
-										//					bit3=1:EV contactor open or termination of welding detection (stop charging)	
-										//					bit4=0:No stop request before charging
-										//					bit4=1:Normal stop request before charging	(stop charging)		
-	unsigned char  SOC;					//102.6				0~100(%) (unit:%)				
-										//					Display Only		
-	unsigned char  Communicating;			//					it is true if receive EV CAN message within every 1500ms  																							
-};	
-
-struct CHAdeMOEvseData 
-{
-	unsigned char  SupportDynamicControl;	//118.0				
-										//					bit0=1:supported
-	unsigned char  SupportHighCurrent;		//118.0				
-										//					bit1=1:supported
-	unsigned short  AvailableOutputVoltage;	//108.2,108.1 			0~600(V) (unit:1V)
-	unsigned short  AvailableOutputCurrent;	//108.3				0~255(A) (unit:1A)
-										//118.2,118.1 			0~1023(A) (unit:1A)
-	unsigned short  ThresholdVoltage;			//108.5,108.4 			0~600(V) (unit:1V)
-	unsigned char   ConnectorTemperatureP;	//108.6				-40~215(degC) (unit:degC) //value 0=-40	[NISSAN customized]
-	unsigned char   ConnectorTemperatureN;	//108.7				-40~215(degC) (unit:degC) //value 0=-40	[NISSAN customized]
-	unsigned char   ProtocolVersion;			//109.0				0~255	
-										//					0x00: CHAdeMO specification 0.9 and earlier
-										//					0x01: CHAdeMO specification 0.9 and 0.9.1
-										//					0x02: CHAdeMO specification 1.0.0, 1.0.1, 1.1 and 1.2
-	unsigned short  PresentOutputVoltage;		//109.2,109.1	 		0~600(V) (unit:1V)
-	unsigned short   PresentOutputCurrent;		//109.3				0~255(A) (unit:1A)
-										//118.4,118.3			0~1023(A) (unit:1A)
-	unsigned char   EvseDetection;			//109.5				
-										//					bit0=0:not charging state now
-										//					bit0=1:charging state now
-										//					bit1=0:EVSE normal
-										//					bit1=1:EVSE error
-										//					bit2=0:Not Energizing state
-										//					bit2=1:Energizing state
-										//					bit3=0:No Battery incompatibility
-										//					bit3=1:Battery incompatibility
-										//					bit4=0:No Charging system error
-										//					bit4=1:Charging system error
-										//					bit5=0:No Charging stop control
-										//					bit5=1:Charging stop control
-	unsigned short RemainChargingTime;		//109.7,109.6			10(sec.)~255(min.)	(Unit:sec)
-										//					Set 0xFF to 109.6 (Unit: 10sec) in case 109.7 (Unit: 1min) is used	
-	unsigned char  HighPowerCondition;		//118.5				
-										//					bit0=0:Present charging current H¡¦118.3,H¡¦118.4¡¨ is less than or equal to rated current of a charging cable
-										//					bit0=1:Present charging current H¡¦118.3,H¡¦118.4¡¨ is exceeds to rated current of a charging cable
-										//					bit1=1:charging cable Cooling function Operating Installed
-										//					bit2=1:charging cable Current limiting function
-										//					bit3=1:charging connector Cooling function Operating
-										//					bit4=1:charging connector Current limiting function Installed
-										//					bit5=1:charging connector Over-temperature protection Installed	
-										//					bit6=1:Functional safety Applied
-	unsigned int 	MaxiGroupPower;			//					XXXXXXXX (Unit:Watt)depend on which group to be used		
-	unsigned int 	MaxiGroupCurrent;			//					XXXXXXXX (unit:1A)depend on which group to be used	
-	unsigned short  ApplyOutputVoltage;		// 					0~600(V) (unit:1V)							
-	unsigned short  ElapseChargingTime;		//					(Unit:sec)	
-	unsigned short  ElapseEnergy;				//					(Unit:10xkWh)																							
-};
-
-struct CHAdeMOData 
-{
-	struct CHAdeMOEvData 		ev[CHAdeMO_QUANTITY];
-	struct CHAdeMOEvseData 	evse[CHAdeMO_QUANTITY];
-};
-
-/************************************************************************************/
-/**************************CCS protocol Share memory***************************/
-/**************************DIN70121: 201412***************************************/
-/**************************ISO15118_2014: 2014************************************/
-/**************************ISO15118_2018: 2018************************************/
-/************************************************************************************/
-typedef enum boolean { FALSE, TRUE } BOOL; 
-enum ResponseCodeType_DIN70121		{ OK_DIN70121 = 0, OK_NewSessionEstablished_DIN70121 = 1, OK_OldSessionJoined_DIN70121 = 2, OK_CertificateExpiresSoon_DIN70121 = 3, 
-									   FAILED_DIN70121 = 4, FAILED_SequenceError_DIN70121 = 5, FAILED_ServiceIDInvalid_DIN70121 = 6, FAILED_UnknownSession_DIN70121 = 7,
-									   FAILED_ServiceSelectionInvalid_DIN70121 = 8, FAILED_PaymentSelectionInvalid_DIN70121 = 9, FAILED_CertificateExpired_DIN70121 = 10,
-									   FAILED_SignatureError_DIN70121 = 11, FAILED_NoCertificateAvailable_DIN70121 = 12, FAILED_CertChainError_DIN70121 = 13, FAILED_ChallengeInvalid_DIN70121 = 14,
-									   FAILED_ContractCanceled_DIN70121 = 15, FAILED_WrongChargeParameter_DIN70121 = 16, FAILED_PowerDeliveryNotApplied_DIN70121 = 17,
-									   FAILED_TariffSelectionInvalid_DIN70121 = 18, FAILED_ChargingProfileInvalid_DIN70121 = 19, FAILED_EVSEPresentVoltageToLow_DIN70121 = 20,
-									   FAILED_MeteringSignatureNotValid_DIN70121 = 21, FAILED_WrongEnergyTransferType_DIN70121 = 22};
-enum ResponseCodeType_ISO15118_2014	{ OK_ISO15118_2014 = 0, OK_NewSessionEstablished_ISO15118_2014 = 1, OK_OldSessionJoined_ISO15118_2014 = 2, OK_CertificateExpiresSoon_ISO15118_2014 = 3, 
-									   FAILED_ISO15118_2014 = 4, FAILED_SequenceError_ISO15118_2014 = 5, FAILED_ServiceIDInvalid_ISO15118_2014 = 6, FAILED_UnknownSession_ISO15118_2014 = 7,
-									   FAILED_ServiceSelectionInvalid_ISO15118_2014 = 8, FAILED_PaymentSelectionInvalid_ISO15118_2014 = 9, FAILED_CertificateExpired_ISO15118_2014 = 10,
-									   FAILED_SignatureError_ISO15118_2014 = 11, FAILED_NoCertificateAvailable_ISO15118_2014 = 12, FAILED_CertChainError_ISO15118_2014 = 13, FAILED_ChallengeInvalid_ISO15118_2014 = 14,
-									   FAILED_ContractCanceled_ISO15118_2014 = 15, FAILED_WrongChargeParameter_ISO15118_2014 = 16, FAILED_PowerDeliveryNotApplied_ISO15118_2014 = 17,
-									   FAILED_TariffSelectionInvalid_ISO15118_2014 = 18, FAILED_ChargingProfileInvalid_ISO15118_2014 = 19, FAILED_MeteringSignatureNotValid_ISO15118_2014 = 20,
-									   FAILED_NoChargeServiceSelected_ISO15118_2014 = 21, FAILED_WrongEnergyTransferMode_ISO15118_2014 = 22, FAILED_ContactorError_ISO15118_2014 = 23,
-									   FAILED_CertificateNotAllowedAtThisEVSE_ISO15118_2014 = 24, FAILED_CertificateRevoked_ISO15118_2014 = 25  };		
-enum ResponseCodeType_ISO15118_2018	{ OK_ISO15118_2018 = 0, OK_NewSessionEstablished_ISO15118_2018 = 1, OK_OldSessionJoined_ISO15118_2018 = 2, OK_CertificateExpiresSoon_ISO15118_2018 = 3, 
-									   OK_IsolationValid_ISO15118_2018 = 4, OK_IsolationWarning_ISO15118_2018 = 5, WARNING_CertificateExpired_ISO15118_2018 = 6, WARNING_NoCertificateAvailable_ISO15118_2018 = 7,
-									   WARNING_CertValidationError_ISO15118_2018 = 8, WARNING_CertVerificationError_ISO15118_2018 = 9, WARNING_ContractCanceled_ISO15118_2018 = 10,
-									   FAILED_ISO15118_2018 = 11, FAILED_SequenceError_ISO15118_2018 = 12, FAILED_ServiceIDInvalid_ISO15118_2018 = 13, FAILED_UnknownSession_ISO15118_2018 = 14,
-									   FAILED_ServiceSelectionInvalid_ISO15118_2018 = 15, FAILED_SignatureError_ISO15118_2018 = 16, FAILED_IdentificationSelectionInvalid_ISO15118_2018 = 17,
-									   FAILED_ChallengeInvalid_ISO15118_2018 = 18, FAILED_WrongChargeParameter_ISO15118_2018 = 19, FAILED_IsolationFault_ISO15118_2018 = 20,
-									   FAILED_PowerDeliveryNotApplied_ISO15118_2018 = 21, FAILED_TariffSelectionInvalid_ISO15118_2018 = 22, FAILED_ChargingProfileInvalid_ISO15118_2018 = 23,
-									   FAILED_MeteringSignatureNotValid_ISO15118_2018 = 24, FAILED_NoChargeServiceSelected_ISO15118_2018 = 25, FAILED_WrongEnergyTransferMode_ISO15118_2018 = 26,  
-									   FAILED_ContactorError_ISO15118_2018 = 27, FAILED_CertificateRevoked_ISO15118_2018 = 28, FAILED_CertificateNotYetValid_ISO15118_2018 = 29 };													   						   
-enum EVSENotificationType		 		{ None = 0, StopCharging = 1, ReNegotiation = 2};		
-enum ServiceCategoryType 				{ EVCharging = 0, Internet = 1, ContractCertificate = 2, OtherCustom = 3};
-enum PaymentOptionType 		      		{ Contract = 0, ExternalPayment = 1};
-/*enum EVSESupportedEnergyTransferType 	{ AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
-									  DC_combo_core = 4, DC_dual = 5, AC_core1p_DC_extended = 6, AC_single_DC_core = 7,
-									  AC_single_phase_three_phase_core_DC_extended = 8, AC_core3p_DC_extended = 9};*/
-enum EnergyTransferModeType			{ AC_single_phase_core = 0, AC_three_phase_core = 1, DC_core = 2, DC_extended = 3,
-									  DC_combo_core = 4, DC_unique = 5};
-//enum identificationOptionType 			{ Contract = 0, ExternalIdentification = 1};						   
-enum unitSymbolType_DIN70121			{ h_DIN70121 = 0, m_DIN70121 = 1, s_DIN70121 = 2, A_DIN70121 = 3, Ah_DIN70121 = 4, V_DIN70121 = 5, VA_DIN70121 = 6, W_DIN70121 = 7, Ws_DIN70121 = 8, Wh_DIN70121 = 9};						   
-enum unitSymbolType_ISO15118_2014		{ h_ISO15118_2014 = 0, m_ISO15118_2014 = 1, s_ISO15118_2014 = 2, A_ISO15118_2014 = 3, V_ISO15118_2014 = 4, W_ISO15118_2014 = 5, Wh_ISO15118_2014 = 6};							   
-enum ProcessingType					{ Finished = 0, Ongoing = 1, Ongoing_WaitingForCustomerInteraction = 2};							   
-enum EVSEProcessingType_DIN70121		{ Finished_DIN70121 = 0, Ongoing_DIN70121 = 1};						   
-enum EVSEProcessingType_ISO15118_2014	{ Finished_ISO15118_2014 = 0, Ongoing_ISO15118_2014 = 1, Ongoing_WaitingForCustomerInteraction_ISO15118_2014=2 };		   
-enum DC_EVErrorCodeType 		  		{ NO_ERROR = 0, FAILED_RESSTemperatureInhibit = 1, FAILED_EVShiftPosition = 2, FAILED_ChargerConnectorLockFault = 3,
-									  FAILED_EVRESSMalfunction = 4, FAILED_ChargingCurrentdifferential = 5, FAILED_ChargingVoltageOutOfRange = 6,
-									  Reserved_A = 7, Reserved_B = 8, Reserved_C = 9, FAILED_ChargingSystemIncompatibility = 10, NoData = 11};
-enum IsolationLevelType_DIN70121 		{ Invalid_DIN70121 = 0, Valid_DIN70121 = 1, Warning_DIN70121 = 2, Fault_DIN70121 = 3};
-enum IsolationLevelType_ISO15118_2014		{ Invalid_ISO15118_2014 = 0, Valid_ISO15118_2014 = 1, Warning_ISO15118_2014 = 2, Fault_ISO15118_2014 = 3, No_IMD_ISO15118_2014	 = 4};
-enum DC_EVSEStatusCodeType			{ EVSE_NotReady = 0, EVSE_Ready = 1, EVSE_Shutdown = 2, EVSE_UtilityInterruptEvent = 3,
-						 			  EVSE_IsolationMonitoringActive = 4, EVSE_EmergencyShutdown = 5, EVSE_Malfunction = 6,
-						 			  Reserved_8 = 7, Reserved_9 = 8};
-enum ScheduleOriginType				{ EV = 0, SA = 1};		
-enum ChargeProgressType_ISO15118_2014	{start_ISO15118_2014 = 0, Stop_ISO15118_2014 = 1, Renegotiate_ISO15118_2014 = 2};		
-enum ChargeProgressType_ISO15118_2018	{start_ISO15118_2018 = 0, Renegotiate_ISO15118_2018 = 1, Standby_ISO15118_2018 = 2, Stop_ISO15118_2018 = 3};		
-enum evOperationType					{Charge = 0, Discharge = 1, Standby = 2};	
-enum mechanicalChargingDeviceStatusType {Home = 0, Moving = 1, EndPosition = 2};	
-enum EV_CP_StatusType					{A = 0, B = 1, C = 2, D = 3, E = 4, F = 5};	
-enum EV_Error_Status_CodeType			{ No_EV_Error = 0, EV_FAILED_EmergencyEvent = 1, EV_FAILED_Breaker = 2, EV_FAILED_RESSTemperatureInhibit = 3,
-						 			  EV_FAILED_RESS = 4, EV_FAILED_ChargingCurrentDifferential = 5, EV_FAILED_ChargingVoltageOutOfRange = 6,
-						 			  Reserved_by_ISO_1 = 7,  Reserved_by_ISO_2 = 8, Reserved_by_ISO_3 = 9, OEM1 = 10,
-						 			  OEM2 = 11,  OEM3 = 12, OEM4 = 13};
-enum IsolationStatusType				{ Invalid = 0, Safe = 1, Warning = 2, Fault = 3};
-enum ChargingSessionType				{ Terminate = 0, Pause = 1};
-enum CostKindType						{ relativePricePercentage = 0, RenewableGenerationPercentage = 1, CarbonDioxideEmission = 2};
-
-
-
-struct PhysicalValueType_DIN70121 				//The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
-{
-	int									Multiplier;			//range: -3..+3
-	enum unitSymbolType_DIN70121			Unit;		
-	short 								Value;
-}; 
-struct PhysicalValueType_ISO15118_2014			//The final physical value is determined by: Value * 10 ^ Multiplier [Unit]
-{
-	int									Multiplier;			//range: -3..+3
-	enum unitSymbolType_ISO15118_2014		Unit;		
-	short 								Value;
-}; 
-struct PhysicalValueType_ISO15118_2018			//The final physical value is determined by: Value * 10 ^ Exponent [Unit]
-{
-	int									Exponent;		//range: -3..+3
-	short 								Value;
-}; 
-struct AppProtocolType 
-{
-	unsigned char	ProtocolNamespace[100];	
-	unsigned int	VersionNumberMajor;		
-	unsigned int	VersionNumberMinor;		
-	unsigned char	SchemaID;				
-	unsigned char	Priority;					//range 1..20
-}; 
-struct ACD_SSEnergyTransferModeType
-{
-	unsigned char	EVID[20];	
-}; 
-struct EVSEStatusType
-{
-	unsigned short				NotificationMaxDelay;	//in seconds
-	enum EVSENotificationType	EVSENotification;
-}; 
-struct ServiceIDListType
-{
-	unsigned short	ServiceID[10];	//refer to chapter 8.6.2.1 Table 192
-}; 
-struct PaymentOptionListType
-{
-	enum PaymentOptionType	PaymentOption[2];
-};
-struct ServiceTagType 
-{
-	unsigned short				ServiceID;
-	unsigned char				ServiceName[32];//Optional Element
-	enum ServiceCategoryType	ServiceCategory;
-	unsigned char				ServiceScope[32];//Optional Element
-}; 
-struct ServiceType_DIN70121 
-{
-	struct ServiceTagType		ServiceTag;
-	BOOL					FreeService;
-}; 
-struct ServiceType_ISO15118_2014
-{
-	unsigned short				ServiceID;
-	unsigned char				ServiceName[32];	//Optional
-	enum ServiceCategoryType	ServiceCategory;
-	unsigned char				ServiceScope[64];	//Optional
-	BOOL					FreeService;
-}; 
-/*struct ServiceType_ISO15118_2018
-{
-	unsigned short				ServiceID;
-	BOOL					FreeService;
-}; */
-struct SupportedEnergyTransferModeType
-{
-	enum EnergyTransferModeType	EnergyTransferMode[6];
-};
-struct ServiceChargeType 
-{
-	struct ServiceType_DIN70121				Services;
-	//enum EVSESupportedEnergyTransferType		EnergyTransferType;
-	enum EnergyTransferModeType			EnergyTransferType;
-}; 
-
-struct ChargeServiceType 
-{
-	struct ServiceType_ISO15118_2014			Services;
-	struct SupportedEnergyTransferModeType	SupportedEnergyTransferMode;
-}; 
-struct ServiceListType
-{
-	struct ServiceType_ISO15118_2014			Service[8];
-}; 
-struct IdentificationOptionListType	
-{
-	enum PaymentOptionType				IdentificationOption[2];
-}; 
-struct ParameterType
-{
-	unsigned char							Name[32];
-	struct PhysicalValueType_ISO15118_2014		PhysicalValue_ISO15118_2014;
-	struct PhysicalValueType_ISO15118_2018		PhysicalValue_ISO15118_2018;
-};
-struct ParameterSetType
-{
-	short 				ParameterSetID;
-	struct ParameterType	Parameter[16];
-};
-struct ServiceParameterListType
-{
-	struct ParameterSetType		ParameterSet[255];
-};
-struct WPT_SDlEnergyTransferModeType
-{
-	struct ServiceParameterListType	ServiceParameterList;
-};
-struct SelectedServiceType
-{
-	unsigned short			ServiceID;
-	short					ParameterSetID;
-};
-struct SelectedServiceListType	
-{
-	struct SelectedServiceType	SelectedService[16];
-};
-
-struct CertificateChainType
-{
-	unsigned char 				Id[32];				//Optional
-	unsigned char 				Certificate[800];		//check size again
-	unsigned char				SubCertificates[4][800];	//Optional, 	check size again
-};
-struct PNC_AReqIdentificationModeType
-{
-	unsigned char 			GenChallenge[16];					//DIN70121=> None,	ISO15118_2014=>None,	ISO15118_2018=>Optional 	
-	unsigned char 			Id[32];							//DIN70121=> None,	ISO15118_2014=>None,	ISO15118_2018=>Optional 	
-};
-struct AC_EVChargeParameterType 
-{
-	unsigned int 								DepartureTime;		//Optional
-	struct PhysicalValueType_ISO15118_2014			EAmount;
-	struct PhysicalValueType_ISO15118_2014			EVMaxVoltage;
-	struct PhysicalValueType_ISO15118_2014			EVMaxCurrent;
-	struct PhysicalValueType_ISO15118_2014			EVMinCurrent;
-}; 
-struct DC_EVStatusType_DIN70121
-{
-	BOOL						EVReady;
-	BOOL						EVCabinConditioning;
-	BOOL						EVRESSConiditioning;
-	enum DC_EVErrorCodeType		EVErrorCode;
-	unsigned char 					EVRESSSOC;		/*0-100 percentage*/	
-}; 
-struct DC_EVChargeParameterType_DIN70121	 
-{
-	struct DC_EVStatusType_DIN70121			DC_EVStatus;
-	struct PhysicalValueType_DIN70121			EVMaximumCurrentLimit;
-	struct PhysicalValueType_DIN70121			EVMaximumPowerLimit;			//Optional
-	struct PhysicalValueType_DIN70121			EVMaximumVoltageLimit;
-	struct PhysicalValueType_DIN70121			EVEnergyCapacity;				//Optional
-	struct PhysicalValueType_DIN70121			EVEnergyRequest;				//Optional
-	unsigned char							FullSOC;/*0-100 percentage*/		//Optional
-	unsigned char							BulkSOC;/*0-100 percentage*/	//Optional
-}; 
-struct DC_EVStatusType_ISO15118_2014 
-{
-	BOOL						EVReady;
-	enum DC_EVErrorCodeType		EVErrorCode;
-	unsigned char 					EVRESSSOC;		/*0-100 percentage*/	
-}; 
-struct DC_EVChargeParameterType_ISO15118_2014 
-{
-	unsigned int 								DepartureTime;				//Optional
-	struct DC_EVStatusType_ISO15118_2014			DC_EVStatus;
-	struct PhysicalValueType_ISO15118_2014 			EVMaximumCurrentLimit;
-	struct PhysicalValueType_ISO15118_2014			EVMaximumPowerLimit;			//Optional
-	struct PhysicalValueType_ISO15118_2014			EVMaximumVoltageLimit;
-	struct PhysicalValueType_ISO15118_2014			EVEnergyCapacity;				//Optional
-	struct PhysicalValueType_ISO15118_2014			EVEnergyRequest;				//Optional
-	unsigned char								FullSOC;/*0-100 percentage*/		//Optional
-	unsigned char								BulkSOC;/*0-100 percentage*/	//Optional
-}; 
-struct Dynamic_CPDReqControlModeType
-{
-	unsigned int 								DepartureTime;				
-};
-struct RelativeTimeIntervalType 
-{
-	unsigned int 	duration;			//Optional
-	unsigned int	start;
-}; 
-struct PMaxScheduleEntryType 
-{
-	struct RelativeTimeIntervalType	RelativeTimeInterval;
-	unsigned short					PMax;
-}; 
-struct PMaxScheduleType 
-{
-	unsigned short					PMaxScheduleID;			//no this itme in ISO15118_2014 
-	struct PMaxScheduleEntryType		PMaxScheduleEntry[1024];
-}; 
-struct CostType
-{
-	unsigned int 					amount;
-	enum CostKindType				costKind;
-	int 							amountMultiplier;		//Optional , range: -3..+3
-};
-struct ConsumptionCostType	
-{
-	struct CostType						Cost[3];
-	struct PhysicalValueType_ISO15118_2014		startValue;
-};
-struct SalesTariffEntryType	
-{
-	struct RelativeTimeIntervalType	RelativeTimeInterval;
-	unsigned char 					EPriceLevel;			//Optional
-	struct ConsumptionCostType		ConsumptionCost[3];	//Optional
-};
-struct SalesTariffType	
-{
-	unsigned char 					Id[32];					//Optional
-	short 						SalesTariffID;
-	unsigned char 					SalesTariffDescription[32];	//Optional
-	unsigned char 					NumEPriceLevels;			//Optional
-	struct SalesTariffEntryType			SalesTariffEntry[1024];
-};
-struct SAScheduleTupleType
-{
-	short 						SAScheduleTupleID;
-	struct PMaxScheduleType			PMaxSchedule;
-	struct SalesTariffType				SalesTariff;				//Optional
-};
-struct ScheduleListType
-{
-	enum ScheduleOriginType					ScheduleOrigin;
-	struct SAScheduleTupleType					ScheduleTuple[3];	
-};
-struct Scheduled_CPDReqControlModeType	
-{
-	enum ProcessingType						EVProcessing;
-	unsigned int 								DepartureTime;		//Optional
-	unsigned short 							MaxSupportingPoints;
-	struct ScheduleListType						ScheduleList;			//Optional
-};
-struct AC_CPDReqEnergyTransferModeType	
-{
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;
-};
-struct DC_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargePower;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			//Optional
-	unsigned char								TargetSOC;						//Optional
-	unsigned char								BulkSOC;							//Optional
-};
-struct BPT_AC_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;		
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;			
-};
-struct BPT_DC_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargePower;		
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMaximumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumDischargeCurrent;				
-	struct PhysicalValueType_ISO15118_2018			EVMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;	
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			
-	unsigned char								TargetSOC;					//Optional
-	unsigned char								BulkSOC;						//Optional
-};	
-struct WPT_CPDReqEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVMaximumPower;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumPower;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;		//Optional
-};
-struct ACD_CPDReqEnergyTransferModeType	
-{
-	//cannot be found in standard
-};
-struct SAScheduleListType
-{
-	struct SAScheduleTupleType		SAScheduleTuple[3];
-};
-struct DC_EVSEStatusType_DIN70121 
-{
-	enum IsolationLevelType_DIN70121			EVSEIsolationStatus;			//Optional
-	enum DC_EVSEStatusCodeType			EVSEStatusCode;
-	unsigned int							NotificationMaxDelay;
-	enum EVSENotificationType				EVSENotification;
-}; 
-struct DC_EVSEChargeParameterType_DIN70121 
-{
-	struct DC_EVSEStatusType_DIN70121		DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121			EVSEMaximumCurrentLimit;
-	struct PhysicalValueType_DIN70121			EVSEMaximumPowerLimit;			//Optional
-	struct PhysicalValueType_DIN70121			EVSEMaximumVoltageLimit;
-	struct PhysicalValueType_DIN70121			EVSEMinimumCurrentLimit;
-	struct PhysicalValueType_DIN70121			EVSEMinimumVoltageLimit;
-	struct PhysicalValueType_DIN70121			EVSECurrentRegulationTolerance;		//Optional
-	struct PhysicalValueType_DIN70121			EVSEPeakCurrentRipple;
-	struct PhysicalValueType_DIN70121			EVSEEnergyToBeDelivered;			//Optional
-}; 
-struct AC_EVSEStatusType	
-{
-	BOOL							  		RCD;
-	unsigned short 							NotificationMaxDelay;
-	enum EVSENotificationType					EVSENotification;		//need to be confirmed
-}; 
-struct AC_EVSEChargeParameterType 
-{
-	struct AC_EVSEStatusType					AC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014			EVSENominalVoltage;
-	struct PhysicalValueType_ISO15118_2014			EVSEMaxCurrent;
-}; 
-struct DC_EVSEStatusType_ISO15118_2014
-{
-	unsigned short								NotificationMaxDelay;
-	enum EVSENotificationType					EVSENotification;
-	enum IsolationLevelType_ISO15118_2014			EVSEIsolationStatus;					//Optional
-	enum DC_EVSEStatusCodeType				DC_EVSEStatusCode;
-};
-struct DC_EVSEChargeParameterType_ISO15118_2014
-{
-	struct DC_EVSEStatusType_ISO15118_2014		DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014			EVSEMaximumCurrentLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSEMaximumPowerLimit;			
-	struct PhysicalValueType_ISO15118_2014			EVSEMaximumVoltageLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSEMinimumCurrentLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSEMinimumVoltageLimit;
-	struct PhysicalValueType_ISO15118_2014			EVSECurrentRegulationTolerance;		//Optional
-	struct PhysicalValueType_ISO15118_2014			EVSEPeakCurrentRipple;
-	struct PhysicalValueType_ISO15118_2014			EVSEEnergyToBeDelivered;			//Optional
-}; 
-struct Scheduled_CPDResControlModeType	
-{
-	struct ScheduleListType						ScheduleList;
-};
-struct AC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent[3];
-	struct PhysicalValueType_ISO15118_2018			EVSENominalVoltage;
-	struct PhysicalValueType_ISO15118_2018			EVSENominalFrequency;
-};
-struct DC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargePower;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumVoltage;				
-};
-struct BPT_AC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent[3];		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumDischargeCurrent[3];			
-	struct PhysicalValueType_ISO15118_2018			EVSENominalVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVSENominalFrequency;			
-};
-struct BPT_DC_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargePower;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumDischargePower;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumDischargeCurrent;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumChargeCurrent;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumDischargeCurrent;		
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumVoltage;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumVoltage;			
-};
-struct WPT_CPDResEnergyTransferModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumPower;			
-	struct PhysicalValueType_ISO15118_2018			EVSEMinimumPower;		
-};
-struct ACD_CPDResEnergyTransferModeType	
-{
-	//not found in ISO15118_2018
-};
-struct ProfileEntryType_DIN70121
-{
-	unsigned int 				ChargingProfileEntryStart;
-	short						ChargingProfileEntryMaxPower;
-};
-struct ChargingProfileType_DIN70121
-{
-	short 							SAScheduleTupleID;
-	struct ProfileEntryType_DIN70121		ProfileEntry[24];
-};
-struct DC_EVPowerDeliveryParameterType_DIN70121 
-{
-	struct DC_EVStatusType_DIN70121			DC_EVStatus;
-	BOOL								BulkChargingComplete;		//Optional
-	BOOL								ChargingComplete;
-}; 
-struct ProfileEntryType_ISO15118_2014 
-{
-	unsigned int 								ChargingProfileEntryStart;
-	struct PhysicalValueType_ISO15118_2018			ChargingProfileEntryMaxPower;
-	unsigned char 								ChargingProfileEntryMaxNumberOfPhasesInUse;	//Optional
-};
-struct ChargingProfileType_ISO15118_2014 
-{
-	struct ProfileEntryType_ISO15118_2014			ProfileEntry[24];
-};
-struct DC_EVPowerDeliveryParameterType_ISO15118_2014  
-{
-	struct DC_EVStatusType_ISO15118_2014 			DC_EVStatus;
-	BOOL									BulkChargingComplete;		//Optional
-	BOOL									ChargingComplete;
-}; 
-struct TimeInterval	
-{
-	unsigned int 								start;
-	unsigned int 								duration;				//Optional
-};
-struct PowerScheduleEntryType
-{
-	struct TimeInterval							TimeInterval;
-	struct PhysicalValueType_ISO15118_2018			Power[3];
-};
-struct EVPowerProfileType
-{
-	struct PowerScheduleEntryType				EVPowerProfileEntry[2048];
-};
-struct Scheduled_PDReqControlModeType
-{
-	unsigned char 								ScheduleTupleID;
-	struct EVPowerProfileType					EVPowerProfile;
-};
-struct BPT_Scheduled_PDReqControlModeType
-{
-	unsigned char 								ScheduleTupleID;
-	struct EVPowerProfileType					EVPowerProfile;			//Optional
-	enum evOperationType						EVOperation;
-};
-struct ListOfRootCertificateIDsType
-{
-	unsigned char 								RootCertificateID[20][40];
-};
-struct ContractSignatureEncryptedPrivateKeyType	
-{
-	unsigned char 								Id[32];
-};
-struct DiffieHellmanPublickeyType
-{
-	unsigned char 								Id[32];
-};
-struct ContractCertificateEncryptedPrivateKeyType
-{
-	unsigned char 								Id[32];
-};
-struct EVTechnicalStatusType
-{
-	BOOL									EV_Status_ReadyToCharge;
-	BOOL									EV_Status_ImmobilizationRequest;		//Optional
-	BOOL									EV_Status_Immobilized;
-	struct PhysicalValueType_ISO15118_2018			EV_Status_WLAN_Strength;
-	enum EV_CP_StatusType						EV_CP_Status;
-	unsigned char								EV_Status_RESSSOC;					//0~100%
-	enum EV_Error_Status_CodeType				EV_Error_Status_Code;	
-	BOOL									EVSE_Timeout;
-};
-struct MeterInfoType_ISO15118_2014		
-{
-	unsigned char								MeterID[32];
-	unsigned long 								MeterReading;						//Optional
-	unsigned char								SigMeterReading[64];				//Optional
-	short 									MeterStatus;						//Optional
-	short 									TMeter;							//Optional
-};
-struct Scheduled_MRReqControlModeType
-{
-	unsigned char 								ScheduleTupleID;
-};
-struct MeterInfoType_ISO15118_2018		
-{
-	unsigned char								MeterID[32];
-	unsigned long 								MeterReadingWhCharged;			//Optional
-	unsigned long 								MeterReadingWhDischarged;			//Optional
-	unsigned long 								MeterReadingVARhLeading;			//Optional
-	unsigned long 								MeterReadingVARhLagging;			//Optional
-	unsigned char								SignatureMeterReading[64];			//Optional
-	short 									MeterStatus;						//Optional
-	short 									TimeStampMeter;					//Optional
-	BOOL									ReceiptRequired;					//Optional
-};
-struct PnC_CLReqIdentificationModeType
-{
-	BOOL									MeteringReceiptRequested;
-};
-struct Dynamic_CSReqControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;
-};
-struct Scheduled_CSReqControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVTargetEnergyRequest;				//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumEnergyRequest;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumEnergyRequest;			//Optional
-	BOOL									Standby;
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargePower;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMaximumChargeCurrent;			//Optional
-	struct PhysicalValueType_ISO15118_2018			EVMinimumChargeCurrent;			//Optional
-};
-struct DisplayParametersType			
-{
-	unsigned short 							CurrentRange;
-	unsigned char	 							CurrentSOC;						//0~100%
-	unsigned char	 							MinimumSOC;						//0~100%
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToMaximumSOC;				
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToTargetSOC;		
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToBulkSOC;			
-	struct PhysicalValueType_ISO15118_2018			RemainingTimeToMinimumSOC;
-	BOOL									ChargingComplete;
-	BOOL									BulkChargingComplete;
-	BOOL									InletHot;			
-};		
-struct PnC_CLResIdentificationModeType
-{
-	struct MeterInfoType_ISO15118_2018			MeterInfo;		
-};
-struct Dynamic_CSResControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSETargetActivePower;
-};
-struct Scheduled_CDResControlModeType
-{
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargePower;		//Optional
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumChargeCurrent;	//Optional
-	struct PhysicalValueType_ISO15118_2018			EVSEMaximumVoltage;			//Optional
-};
-struct LFA_EVFinePositioningSetupParametersType	
-{
-	unsigned char 								NumberOfSensors;
-	//NOT complete yet,  to be continue.....
-};
-
-/****SupportedAppProtocolRequest****/
-struct SupportedAppProtocolRequest_DIN70121 
-{
-	struct AppProtocolType	AppProtocol[20];			
-}; 
-struct SupportedAppProtocolRequest_ISO15118_2014 
-{
-	struct AppProtocolType	AppProtocol[20];			
-}; 
-struct SupportedAppProtocolRequest_ISO15118_2018 
-{
-	struct AppProtocolType	AppProtocol[20];			
-}; 
-/****SupportedAppProtocolResponse****/
-struct SupportedAppProtocolResponse_DIN70121 
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;			
-	unsigned char							SchemaID;				//Optional
-}; 
-struct SupportedAppProtocolResponse_ISO15118_2014 
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;	
-	unsigned char							SchemaID;				//Optional
-}; 
-struct SupportedAppProtocolResponse_ISO15118_2018
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;	
-	unsigned char							SchemaID;					//Optional
-}; 
-/****SessionSetupRequest****/
-struct SessionSetupRequest_DIN70121  
-{
-	unsigned char						EVCCID[8];						//the MAC address of the EVCC in Hex
-}; 
-struct SessionSetupRequest_ISO15118_2014 
-{
-	unsigned char						EVCCID[8];						//the MAC address of the EVCC in Hex
-}; 
-struct SessionSetupRequest_ISO15118_2018 
-{
-	unsigned char						EVCCID[8];						//the MAC address of the EVCC in Hex
-	struct ACD_SSEnergyTransferModeType	ACD_SSEnergyTransferMode;			//For ACD mandatory, optional for rest
-}; 
-/****SessionSetupResponse****/
-struct SessionSetupResponse_DIN70121   
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;		
-	unsigned char							EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	unsigned int							EVSETimeStamp;				//EPOCH format, Optional
-}; 
-struct SessionSetupResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;	
-	unsigned char							EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	unsigned int							EVSETimeStamp;				//EPOCH format, Optional
-}; 
-struct SessionSetupResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;	
-	unsigned char							EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	struct EVSEStatusType					EVSEStatus;					//Optional
-}; 
-/****ServiceDiscoveryRequest****/
-struct ServiceDiscoveryRequest_DIN70121    
-{
-	unsigned char				ServiceScope[32];		//Optional
-	enum ServiceCategoryType	ServiceCategory;		//Optional
-}; 
-struct ServiceDiscoveryRequest_ISO15118_2014 
-{
-	unsigned char				ServiceScope[32];		//Optional
-	enum ServiceCategoryType	ServiceCategory;		//Optional
-}; 
-struct ServiceDiscoveryRequest_ISO15118_2018  
-{
-	struct ServiceIDListType		SupportedServiceIDs;	//Optional
-}; 
-/****ServiceDiscoveryResponse****/
-struct ServiceDiscoveryResponse_DIN70121    
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;
-	struct PaymentOptionListType				PaymentOptions;				
-	struct ServiceChargeType				ChargeService_DIN70121;		
-}; 
-struct ServiceDiscoveryResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	struct PaymentOptionListType				PaymentOptions;				
-	struct ChargeServiceType				ChargeService;				
-	struct ServiceListType					ServiceList;					//Optional
-}; 
-struct ServiceDiscoveryResponse_ISO15118_2018  
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;		
-	struct EVSEStatusType					EVSEStatus;					//Optional
-	struct IdentificationOptionListType			IdentificationOptionList;			
-	struct ServiceListType					EnergyTransferServiceList;			
-	struct ServiceListType					VASList;						//Optional
-}; 
-/****ServiceDetailRequest****/
-//Only in ISO15118_2014 and ISO15118_2018
-struct ServiceDetailRequest_ISO15118_2014 
-{
-	unsigned short						ServiceID;								
-}; 
-struct ServiceDetailRequest_ISO15118_2018 
-{
-	unsigned short						ServiceID;						
-	struct WPT_SDlEnergyTransferModeType	WPT_SDlEnergyTransferMode;			
-}; 
-/****ServiceDetailResponse****/
-struct ServiceDetailResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	unsigned short							ServiceID;						
-	struct ServiceParameterListType 			ServiceParameterList;			
-}; 
-struct ServiceDetailResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	unsigned short							ServiceID;						
-	struct ServiceParameterListType 			ServiceParameterList;			
-	struct EVSEStatusType					EVSEStatus;					//Optional
-}; 
-/****ServiceAndPaymentSelectionRequest / ServiceSelectionRequest****/
-struct ServiceAndPaymentSelectionRequest_DIN70121	 
-{
-	enum PaymentOptionType		SelectedPaymentOption;		
-	struct SelectedServiceListType		SelectedServiceList;				
-}; 
-struct ServiceAndPaymentSelectionRequest_ISO15118_2014 
-{
-	enum PaymentOptionType		SelectedPaymentOption;		
-	struct SelectedServiceListType		SelectedServiceList;				
-}; 
-struct ServiceSelectionRequest_ISO15118_2018 
-{
-	enum PaymentOptionType			SelectedPaymentOption;		
-	struct SelectedServiceType			SelectedEnergyTransferService;	
-	struct SelectedServiceListType			SelectedVASList;				
-	enum ProcessingType				EVProcessing;						
-}; 
-/****ServiceAndPaymentSelectionResponse / ServiceSelectionResponse****/
-struct ServiceAndPaymentSelectionResponse_DIN70121	  
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;
-}; 
-struct ServiceAndPaymentSelectionResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-}; 
-struct ServiceSelectionResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	struct EVSEStatusType					EVSEStatus;					//Optional
-}; 
-/****PaymentDetailsRequest / IdentificationDetailsRequest****/
-struct PaymentDetailsRequest_ISO15118_2014 
-{
-	unsigned char 					eMAID[16];
-	struct CertificateChainType		ContractSignatureCertChain;
-};
-struct IdentificationDetailsRequest_ISO15118_2018  
-{
-	struct CertificateChainType		ContractSignatureCertChain;
-};
-/****PaymentDetailsResponse  / IdentificationDetailsResponse ****/
-struct PaymentDetailsResponse_ISO15118_2014 
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	unsigned char 							GenChallenge[16];
-	long 								EVSETimeStamp;
-};
-struct IdentificationDetailsResponse_ISO15118_2018   
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	struct EVSEStatusType					EVSEStatus;						//Optional
-	unsigned char 							GenChallenge[16];
-	enum ProcessingType					EVSEProcessing;			
-};
-/****ContractAuthenticationRequest / AuthorizationRequest****/
-struct ContractAuthenticationRequest_DIN70121	 
-{
-	//None
-}; 
-struct AuthorizationRequest_ISO15118_2014
-{
-	unsigned char 			GenChallenge[16];					//Optional
-	unsigned char 			Id[32];							//Optional
-}; 
-struct AuthorizationRequest_ISO15118_2018  
-{
-	struct PNC_AReqIdentificationModeType		PNC_AReqIdentificationMode;	//Optional
-};
-/****ContractAuthenticationResponse  / AuthorizationResponse****/
-struct ContractAuthenticationResponse_DIN70121	 
-{
-	enum ResponseCodeType_DIN70121		ResponseCode;
-	enum EVSEProcessingType_DIN70121		EVSEProcessing;
-}; 
-struct AuthorizationResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014	ResponseCode;
-	enum EVSEProcessingType_ISO15118_2014	EVSEProcessing;
-}; 
-struct AuthorizationResponse_ISO15118_2018   
-{
-	enum ResponseCodeType_ISO15118_2018	ResponseCode;
-	enum ProcessingType					EVSEProcessing;
-	struct EVSEStatusType					EVSEStatus;						//Optional
-};
-/****ChargeParameterDiscoveryRequest****/
-struct ChargeParameterDiscoveryRequest_DIN70121	  
-{
-	enum EnergyTransferModeType					EVRequestedEnergyTransferType;			
-	struct DC_EVChargeParameterType_DIN70121		DC_EVChargeParameter;	
-}; 
-struct ChargeParameterDiscoveryRequest_ISO15118_2014 
-{
-	unsigned short										MaxEntriesSAScheduleTuple;			//Optional
-	enum EnergyTransferModeType						RequestedEnergyTransferMode;			
-	struct AC_EVChargeParameterType					AC_EVChargeParameter;			
-	struct DC_EVChargeParameterType_ISO15118_2014		DC_EVChargeParameter;	
-}; 
-struct ChargeParameterDiscoveryRequest_ISO15118_2018 
-{
-	struct Dynamic_CPDReqControlModeType			Dynamic_CPDReqControlMode;
-	struct Scheduled_CPDReqControlModeType			Scheduled_CPDReqControlMode;
-	struct AC_CPDReqEnergyTransferModeType			AC_CPDReqEnergyTransferMode;
-	struct DC_CPDReqEnergyTransferModeType			DC_CPDReqEnergyTransferMode;
-	struct BPT_AC_CPDReqEnergyTransferModeType		BPT_AC_CPDReqEnergyTransferMode;
-	struct BPT_DC_CPDReqEnergyTransferModeType		BPT_DC_CPDReqEnergyTransferMode;
-	struct WPT_CPDReqEnergyTransferModeType			WPT_CPDReqEnergyTransferMode;
-	struct ACD_CPDReqEnergyTransferModeType			ACD_CPDReqEnergyTransferMode;
-}; 
-/****ChargeParameterDiscoveryResponse****/
-struct ChargeParameterDiscoveryResponse_DIN70121	  
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	enum EVSEProcessingType_DIN70121					EVSEProcessing;
-	struct SAScheduleListType 							SAScheduleList;
-	struct DC_EVSEChargeParameterType_DIN70121			DC_EVSEChargeParameter;
-}; 
-struct ChargeParameterDiscoveryResponse_ISO15118_2014  
-{
-	enum EVSEProcessingType_ISO15118_2014				EVSEProcessing;
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct SAScheduleListType 							SAScheduleList;
-	struct AC_EVSEChargeParameterType					AC_EVSEChargeParameter;
-	struct DC_EVSEChargeParameterType_ISO15118_2014		DC_EVSEChargeParameter;
-}; 
-struct ChargeParameterDiscoveryResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	enum ProcessingType								EVSEProcessing;
-	struct Scheduled_CPDResControlModeType				Scheduled_CPDResControlMode;	//Optional
-	struct AC_CPDResEnergyTransferModeType				AC_CPDResEnergyTransferMode;
-	struct DC_CPDResEnergyTransferModeType				DC_CPDResEnergyTransferMode;
-	struct BPT_AC_CPDResEnergyTransferModeType			BPT_AC_CPDResEnergyTransferMode;
-	struct BPT_DC_CPDResEnergyTransferModeType			BPT_DC_CPDResEnergyTransferMode;
-	struct WPT_CPDResEnergyTransferModeType				WPT_CPDResEnergyTransferMode;
-	struct ACD_CPDResEnergyTransferModeType				ACD_CPDResEnergyTransferMode;
-}; 
-/****PowerDeliveryRequest****/
-struct PowerDeliveryRequest_DIN70121	   
-{
-	BOOL											ReadyToChargeState;
-	struct ChargingProfileType_DIN70121					ChargingProfile;
-	struct DC_EVPowerDeliveryParameterType_DIN70121		DC_EVPowerDeliveryParameter;
-}; 
-struct PowerDeliveryRequest_ISO15118_2014 
-{
-	enum ChargeProgressType_ISO15118_2014				ChargeProgress;
-	short 											SAScheduleTupleID;
-	struct ChargingProfileType_ISO15118_2014 				ChargingProfile;
-	struct DC_EVPowerDeliveryParameterType_ISO15118_2014	DC_EVPowerDeliveryParameter;
-}; 
-struct PowerDeliveryRequest_ISO15118_2018
-{
-	enum ChargeProgressType_ISO15118_2018				ChargeProgress;
-	struct Scheduled_PDReqControlModeType				Scheduled_PDReqControlMode;
-	struct BPT_Scheduled_PDReqControlModeType			BPT_Scheduled_PDReqControlMode;
-}; 
-/****PowerDeliveryResponse****/
-struct PowerDeliveryResponse_DIN70121	    
-{
-	enum ResponseCodeType_DIN70121				ResponseCode;
-	struct DC_EVSEStatusType_DIN70121				DC_EVSEStatus;
-}; 
-struct PowerDeliveryResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct AC_EVSEStatusType							AC_EVSEStatus;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-}; 
-struct PowerDeliveryResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;			//Optional
-}; 
-/****CertificateUpdateRequest****/
-struct CertificateUpdateRequest_ISO15118_2014
-{
-	unsigned char 										Id[32];
-	struct CertificateChainType							ContractSignatureCertChain;
-	unsigned char 										eMAID[16];
-	struct ListOfRootCertificateIDsType						ListOfRootCertificateIDs;
-}; 
-/****CertificateUpdateResponse****/
-struct CertificateUpdateResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct CertificateChainType							SAProvisioningCertificateChain;
-	struct CertificateChainType							ContractSignatureCertChain;
-	struct ContractSignatureEncryptedPrivateKeyType			ContractSignatureEncryptedPrivateKey;
-	struct DiffieHellmanPublickeyType						DHpublickey;
-	unsigned char 										eMAID[16];
-	short 											RetryCounter;							//Optional
-}; 
-/****CertificateInstallationRequest****/
-struct CertificateInstallationRequest_ISO15118_2014
-{
-	unsigned char 										Id[32];
-	unsigned char 										OEMProvisioningCert[800];
-	struct ListOfRootCertificateIDsType						ListOfRootCertificateIDs;
-}; 
-struct CertificateInstallationRequest_ISO15118_2018
-{
-	unsigned char 										Id[32];
-	struct CertificateChainType							OEMProvisioningCertChain;
-	struct ListOfRootCertificateIDsType						ListOfRootCertificateIDs;
-	unsigned short										MaxSupportedCerts;
-}; 
-/****CertificateInstallationResponse****/
-struct CertificateInstallationResponse_ISO15118_2014
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct CertificateChainType							SAProvisioningCertificateChain;
-	struct CertificateChainType							ContractSignatureCertChain;
-	struct ContractSignatureEncryptedPrivateKeyType			ContractSignatureEncryptedPrivateKey;
-	struct DiffieHellmanPublickeyType						DHpublickey;
-	unsigned char 										eMAID[16];
-}; 
-struct CertificateInstallationResponse_ISO15118_2018
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	struct CertificateChainType							SAProvisioningCertificateChain;
-	struct CertificateChainType							ContractCertificateChain;
-	struct ContractCertificateEncryptedPrivateKeyType		ContractEncryptedPrivateKey;
-	struct DiffieHellmanPublickeyType						DHpublickey;
-	enum ProcessingType								EVSEProcessing;
-	unsigned short 									RemainingContractCertificateChains;
-}; 
-/****SystemStatusRequest****/
-struct SystemStatusRequest_ISO15118_2018
-{
-	enum mechanicalChargingDeviceStatusType			EVMechanicalChargingDeviceStatus;
-	struct EVTechnicalStatusType							EVTechnicalStatus;
-	unsigned char 										EV_OEMStatus[800];					//Optional
-};
-/****SystemStatusResponse****/
-struct SystemStatusResponse_ISO15118_2018
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	enum mechanicalChargingDeviceStatusType			EVSEMechanicalChargingDeviceStatus;
-	BOOL											EVSE_ReadyToCharge;
-	enum IsolationStatusType							EVSE_IsolationStatus;
-	BOOL											EVSE_Disabled;
-	BOOL											EVSE_UtilityInterruptEvent;
-	BOOL											EVSE_EmergencyShutdown;
-	BOOL											EVSE_Malfunction;
-	BOOL											EV_InChargePosition;
-	BOOL											EV_AssociationStatus;
-};
-/****SessionStopRequest****/
-struct SessionStopRequest_DIN70121	   
-{
-	//No member in standard
-}; 	
-struct SessionStopRequest_ISO15118_2014 
-{
-	enum ChargingSessionType							ChargingSession;
-}; 	
-struct SessionStopRequest_ISO15118_2018 
-{
-	enum ChargingSessionType							ChargingSession;
-}; 	
-/****SessionStopResponse****/
-struct SessionStopResponse_DIN70121	    
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-}; 
-struct SessionStopResponse_ISO15118_2014	    
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-}; 
-struct SessionStopResponse_ISO15118_2018     
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-}; 
-/****MeteringReceiptRequest****/
-struct MeteringReceiptRequest_ISO15118_2014	  	    
-{
-	unsigned char 										Id[32];						//Optional
-	unsigned char 										SessionID[8];
-	short 											SAScheduleTupleID;				//Optional
-	struct MeterInfoType_ISO15118_2014					MeterInfo;
-}; 
-struct MeteringReceiptRequest_ISO15118_2018	  	    
-{
-	unsigned char 										Id[32];						//Optional
-	unsigned char 										SessionID[8];
-	struct Scheduled_MRReqControlModeType				Schedule_MRReqControlMode;
-	struct MeterInfoType_ISO15118_2018					MeterInfo;								
-}; 
-/****MeteringReceiptResponse****/
-struct MeteringReceiptResponse_ISO15118_2014	  	    
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct AC_EVSEStatusType							AC_EVSEStatus;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-}; 
-struct MeteringReceiptResponse_ISO15118_2018	  	    
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-}; 
-/****ChargingStatusRequest (AC Only)****/
-struct ChargingStatusRequest_ISO15118_2014	  	    
-{
-	//No member in standard
-}; 
-struct ChargingStatusRequest_ISO15118_2018	  	    
-{
-	struct PnC_CLReqIdentificationModeType				PnC_CLReqIdentificationMode;
-	struct Dynamic_CSReqControlModeType				Dynamic_CSReqControlMode;
-	struct Scheduled_CSReqControlModeType				Scheduled_CSReqControlMode;
-	struct DisplayParametersType							DisplayParameters;
-}; 
-/****ChargingStatusResponse (AC Only)****/
-struct ChargingStatusResponse_ISO15118_2014	  	    
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	unsigned char										EVSEID[40];			//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	short 											SAScheduleTupleID;
-	struct PhysicalValueType_ISO15118_2014					EVSEMaxCurrent;		//Optional
-	struct MeterInfoType_ISO15118_2014					MeterInfo;			//Optional
-	BOOL											ReceiptRequired;		//Optional
-	struct AC_EVSEStatusType							AC_EVSEStatus;
-}; 
-struct ChargingStatusResponse_ISO15118_2018	  	    
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	unsigned char										EVSEID[40];					//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	struct PhysicalValueType_ISO15118_2018					EVSETargetFrequency;			//Optional
-	struct PnC_CLResIdentificationModeType				PnC_CLResIdentificationMode;
-	struct Dynamic_CSResControlModeType					Dynamic_CSResControlMode;
-	struct Scheduled_CSReqControlModeType				Scheduled_CSReqControlMode;
-}; 
-/****CableCheckRequest (DC Only)****/
-struct CableCheckRequest_DIN70121	     
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-};
-struct CableCheckRequest_ISO15118_2014 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-};
-struct CableCheckRequest_ISO15118_2018	    
-{
-	//No member in standard
-};
-/****CableCheckResponse (DC Only)****/
-struct CableCheckResponse_DIN70121	    
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	enum EVSEProcessingType_DIN70121					EVSEProcessing;
-}; 
-struct CableCheckResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	enum EVSEProcessingType_ISO15118_2014				EVSEProcessing;
-}; 
-struct CableCheckResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	enum ProcessingType								EVSEProcessing;
-}; 
-/****PreChargeRequest (DC Only)****/
-struct PreChargeRequest_DIN70121	     
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-	struct PhysicalValueType_DIN70121						EVTargetVoltage;
-	struct PhysicalValueType_DIN70121						EVTargetCurrent;
-}; 
-struct PreChargeRequest_ISO15118_2014 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-	struct PhysicalValueType_ISO15118_2014					EVTargetVoltage;
-	struct PhysicalValueType_ISO15118_2014					EVTargetCurrent;
-}; 
-struct PreChargeRequest_ISO15118_2018      
-{
-	struct PhysicalValueType_ISO15118_2018					EVTargetVoltage;
-	struct PhysicalValueType_ISO15118_2018					EVTargetCurrent;
-}; 
-/****PreChargeResponse (DC Only)****/
-struct PreChargeResponse_DIN70121 
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121						EVSEPresentVoltage;
-}; 
-struct PreChargeResponse_ISO15118_2014		
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentVoltage;
-}; 
-struct PreChargeResponse_ISO15118_2018  
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;					//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentVoltage;
-}; 
-/****CurrentDemandRequest (DC Only)****/
-struct CurrentDemandRequest_DIN70121 
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-	struct PhysicalValueType_DIN70121						EVTargetCurrent;
-	struct PhysicalValueType_DIN70121						EVMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVMaximumPowerLimit;			//Optional
-	BOOL											BulkChargingComplete;			//Optional
-	BOOL											ChargingComplete;
-	struct PhysicalValueType_DIN70121						RemainingTimeToFullSoC;		//Optional
-	struct PhysicalValueType_DIN70121						RemainingTimeToBulkSoC;		//Optional
-	struct PhysicalValueType_DIN70121						EVTargetVoltage;
-};
-struct CurrentDemandRequest_ISO15118_2014	 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-	struct PhysicalValueType_ISO15118_2014					EVTargetCurrent;
-	struct PhysicalValueType_ISO15118_2014					EVMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVMaximumPowerLimit;			//Optional
-	BOOL											BulkChargingComplete;			//Optional
-	BOOL											ChargingComplete;
-	struct PhysicalValueType_ISO15118_2014					RemainingTimeToFullSoC;		//Optional
-	struct PhysicalValueType_ISO15118_2014					RemainingTimeToBulkSoC;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVTargetVoltage;
-};
-struct CurrentDemandRequest_ISO15118_2018 
-{
-	struct DisplayParametersType							DisplayParameters;				//Optional
-	struct PnC_CLReqIdentificationModeType				PnC_CLReqIdentificationMode;
-	struct Dynamic_CSReqControlModeType				Dynamic_CDReqControlMode;
-	struct Scheduled_CSReqControlModeType				Scheduled_CDReqControlMode;
-};
-/****CurrentDemandResponse (DC Only)****/
-struct CurrentDemandResponse_DIN70121		 
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121						EVSEPresentVoltage;
-	struct PhysicalValueType_DIN70121						EVSEPresentCurrent;
-	BOOL											EVSECurrentLimitAchieved;
-	BOOL											EVSEVoltageLimitAchieved;
-	BOOL											EVSEPowerLimitAchieved;
-	struct PhysicalValueType_DIN70121						EVSEMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVSEMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_DIN70121						EVSEMaximumPowerLimit;		//Optional
-}; 	
-struct CurrentDemandResponse_ISO15118_2014			 
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentVoltage;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentCurrent;
-	BOOL											EVSECurrentLimitAchieved;
-	BOOL											EVSEVoltageLimitAchieved;
-	BOOL											EVSEPowerLimitAchieved;
-	struct PhysicalValueType_ISO15118_2014					EVSEMaximumVoltageLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVSEMaximumCurrentLimit;		//Optional
-	struct PhysicalValueType_ISO15118_2014					EVSEMaximumPowerLimit;		//Optional
-	unsigned char										EVSEID[40];			//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	short 											SAScheduleTupleID;
-	struct MeterInfoType_ISO15118_2014					MeterInfo;			//Optional
-	BOOL											ReceiptRequired;		//Optional
-}; 	
-struct CurrentDemandResponse_ISO15118_2018		 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;						//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentVoltage;
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentCurrent;
-	BOOL											EVSECurrentLimitAchieved;
-	BOOL											EVSEVoltageLimitAchieved;
-	BOOL											EVSEPowerLimitAchieved;
-	struct PhysicalValueType_ISO15118_2018					EVSEMaximumChargeVoltage;		//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEMaximumChargeCurrent;		//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEMaximumChargePower;			//Optional
-	unsigned char										EVSEID[40];						//DIN70121=>Max length:32,	ISO15118=>min length:7, max length:37
-	struct PnC_CLResIdentificationModeType				PnC_CLResIdentificationMode;
-	struct Scheduled_CDResControlModeType				Scheduled_CDResControlMode;
-}; 	
-/****WeldingDetectionRequest (DC Only)*****/
-struct WeldingDetectionRequest_DIN70121 
-{
-	struct DC_EVStatusType_DIN70121						DC_EVStatus;
-}; 	
-struct WeldingDetectionRequest_ISO15118_2014 
-{
-	struct DC_EVStatusType_ISO15118_2014 					DC_EVStatus;
-}; 	
-struct WeldingDetectionRequest_ISO15118_2018 
-{
-	//No member in Standard
-}; 	
-/****WeldingDetectionResponse (DC Only)****/
-struct WeldingDetectionResponse_DIN70121  
-{
-	enum ResponseCodeType_DIN70121					ResponseCode;
-	struct DC_EVSEStatusType_DIN70121					DC_EVSEStatus;
-	struct PhysicalValueType_DIN70121						EVSEPresentVoltage;
-}; 	
-struct WeldingDetectionResponse_ISO15118_2014  
-{
-	enum ResponseCodeType_ISO15118_2014				ResponseCode;
-	struct DC_EVSEStatusType_ISO15118_2014				DC_EVSEStatus;
-	struct PhysicalValueType_ISO15118_2014					EVSEPresentVoltage;
-}; 	
-struct WeldingDetectionResponse_ISO15118_2018 
-{
-	enum ResponseCodeType_ISO15118_2018				ResponseCode;
-	struct EVSEStatusType								EVSEStatus;						//Optional
-	struct PhysicalValueType_ISO15118_2018					EVSEPresentVoltage;
-}; 	
-/****FinePositioningSetupRequest (WPT Only)****/
-struct FinePositioningSetupRequest_ISO15118_2018 
-{
-	struct LFA_EVFinePositioningSetupParametersType			LFA_EVFinePositioningSetupParameters;	//Optional
-};
-/****FinePositioningSetupResponse (WPT Only)****/
-struct FinePositioningSetupResponse_ISO15118_2018 
-{
-	//NOT complete yet,  to be continue.....
-};
-
-
-struct V2GMessageType_DIN70121
-{
-	unsigned char											PresentMsgFlowStatus;
-														/* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
-														    4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
-														    8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
-														    12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
-														    16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
-														    19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
-														    22: ServiceDetailRequest, 23: ServiceDetailResponse
-														    24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
-														    26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
-														     28: AuthorizationRequest, 29: AuthorizationResponse, 
-														    30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
-														    34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
-														    36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
-														    40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
-														    44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse 
-														    48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse, 
-														    52: SessionStopRequest, 53: SessionStopResponse
-														   253: Performance Timeout, 254: Sequence Timeout, 255: Fault 	
-														*/ 		
-	struct SupportedAppProtocolRequest_DIN70121 			SupportedAppProtocolRequest;
-	struct SupportedAppProtocolResponse_DIN70121 			SupportedAppProtocolResponse;
-	struct SessionSetupRequest_DIN70121  					SessionSetupRequest;
-	struct SessionSetupResponse_DIN70121   				SessionSetupResponse;
-	struct ServiceDiscoveryRequest_DIN70121    				ServiceDiscoveryRequest;
-	struct ServiceDiscoveryResponse_DIN70121    				ServiceDiscoveryResponse;
-	struct ServiceAndPaymentSelectionRequest_DIN70121		ServiceAndPaymentSelectionRequest; 
-	struct ServiceAndPaymentSelectionResponse_DIN70121		ServiceAndPaymentSelectionResponse;
-	struct ContractAuthenticationRequest_DIN70121			ContractAuthenticationRequest;
-	struct ContractAuthenticationResponse_DIN70121	 		ContractAuthenticationResponse;
-	struct ChargeParameterDiscoveryRequest_DIN70121		ChargeParameterDiscoveryRequest;
-	struct ChargeParameterDiscoveryResponse_DIN70121		ChargeParameterDiscoveryResponse;
-	struct CableCheckRequest_DIN70121					CableCheckRequest;
-	struct CableCheckResponse_DIN70121					CableCheckResponse;
-	struct PreChargeRequest_DIN70121					PreChargeRequest;
-	struct PreChargeResponse_DIN70121 					PreChargeResponse;
-	struct PowerDeliveryRequest_DIN70121					PowerDeliveryRequest;
-	struct PowerDeliveryResponse_DIN70121	   				PowerDeliveryResponse;
-	struct CurrentDemandRequest_DIN70121 				CurrentDemandRequest;
-	struct CurrentDemandResponse_DIN70121				CurrentDemandResponse;
-	struct WeldingDetectionRequest_DIN70121 				WeldingDetectionRequest;
-	struct WeldingDetectionResponse_DIN70121  			WeldingDetectionResponse;
-	struct SessionStopRequest_DIN70121					SessionStopRequest;
-	struct SessionStopResponse_DIN70121	    				SessionStopResponse;
-};
-
-struct V2GMessageType_ISO15118_2014
-{
-	unsigned char											PresentMsgFlowStatus;
-														/* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
-														    4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
-														    8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
-														    12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
-														    16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
-														    19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
-														    22: ServiceDetailRequest, 23: ServiceDetailResponse
-														    24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
-														    26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
-														     28: AuthorizationRequest, 29: AuthorizationResponse, 
-														    30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
-														    34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
-														    36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
-														    40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
-														    44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse 
-														    48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse, 
-														    52: SessionStopRequest, 53: SessionStopResponse
-														   253: Performance Timeout, 254: Sequence Timeout, 255: Fault 	
-														*/ 		
-	struct SupportedAppProtocolRequest_ISO15118_2014 			SupportedAppProtocolRequest;
-	struct SupportedAppProtocolResponse_ISO15118_2014 			SupportedAppProtocolResponse;
-	struct SessionSetupRequest_ISO15118_2014  					SessionSetupRequest;
-	struct SessionSetupResponse_ISO15118_2014   				SessionSetupResponse;
-	struct ServiceDiscoveryRequest_ISO15118_2014    				ServiceDiscoveryRequest;
-	struct ServiceDiscoveryResponse_ISO15118_2014    				ServiceDiscoveryResponse;
-	struct ServiceDetailRequest_ISO15118_2014 					ServiceDetailRequest;
-	struct ServiceDetailResponse_ISO15118_2014					ServiceDetailResponse;
-	struct ServiceAndPaymentSelectionRequest_ISO15118_2014 		ServiceAndPaymentSelectionRequest;
-	struct ServiceAndPaymentSelectionResponse_ISO15118_2014  	ServiceAndPaymentSelectionResponse;
-	struct PaymentDetailsRequest_ISO15118_2014 				PaymentDetailsRequest;
-	struct PaymentDetailsResponse_ISO15118_2014 				PaymentDetailsResponse;
-	struct AuthorizationRequest_ISO15118_2014					AuthorizationRequest;
-	struct AuthorizationResponse_ISO15118_2014					AuthorizationResponse;
-	struct CertificateUpdateRequest_ISO15118_2014				CertificateUpdateRequest;
-	struct CertificateUpdateResponse_ISO15118_2014				CertificateUpdateResponse;
-	struct CertificateInstallationRequest_ISO15118_2014			CertificateInstallationRequest;
-	struct CertificateInstallationResponse_ISO15118_2014			CertificateInstallationResponse;
-	struct ChargeParameterDiscoveryRequest_ISO15118_2014 		ChargeParameterDiscoveryRequest;
-	struct ChargeParameterDiscoveryResponse_ISO15118_2014  		ChargeParameterDiscoveryResponse;
-	struct CableCheckRequest_ISO15118_2014 					CableCheckRequest;
-	struct CableCheckResponse_ISO15118_2014  					CableCheckResponse;
-	struct PreChargeRequest_ISO15118_2014 					PreChargeRequest;
-	struct PreChargeResponse_ISO15118_2014					PreChargeResponse;
-	struct PowerDeliveryRequest_ISO15118_2014					PowerDeliveryRequest;
-	struct PowerDeliveryResponse_ISO15118_2014					PowerDeliveryResponse;
-	struct ChargingStatusRequest_ISO15118_2014	  				ChargingStatusRequest;	  
-	struct ChargingStatusResponse_ISO15118_2014				ChargingStatusResponse;
-	struct CurrentDemandRequest_ISO15118_2014	 			CurrentDemandRequest;
-	struct CurrentDemandResponse_ISO15118_2014				CurrentDemandResponse;
-	struct MeteringReceiptRequest_ISO15118_2014				MeteringReceiptRequest;  
-	struct MeteringReceiptResponse_ISO15118_2014				MeteringReceiptResponse;
-	struct WeldingDetectionRequest_ISO15118_2014 				WeldingDetectionRequest;
-	struct WeldingDetectionResponse_ISO15118_2014  			WeldingDetectionResponse;
-	struct SessionStopRequest_ISO15118_2014 					SessionStopRequest;
-	struct SessionStopResponse_ISO15118_2014					SessionStopResponse;
-};
-struct V2GMessageType_ISO15118_2018
-{
-	unsigned char										PresentMsgFlowStatus;
-													/* 0: Idle(wait B2 state), 1: CM_SLAC_PARM.REQ, 2: CM_SLAC_PARM.CNF, 3: CM_START_ATTEN_CHAR.IND
-													    4: CM_MNBC_SOUND.IND, 5: CM_ATTEN_CHAR.IND, 6: CM_ATTEN_CHAR.RSP, 7: CM_VALIDATE.REQ
-													    8: CM_VALIDATE.CNF, 9: CM_SLAC_MATCH.REQ, 10: CM_SLAC_MATCH.CNF, 11: CM_AMP_MAP.REQ
-													    12: CM_AMP_MAP.CNF, 13: SLACC/SDP/TCP connection,
-													    16: SupportedAppProtocolRequest, 17: SupportedAppProtocolResponse, 18: SessionSetupRequest
-													    19: SessionSetupResponse, 20: ServiceDiscoveryRequest, 21: ServiceDiscoveryResponse
-													    22: ServiceDetailRequest, 23: ServiceDetailResponse
-													    24: ServiceAndPaymentSelectionRequest/ServiceSelectionRequest, 25: ServiceAndPaymentSelectionResponse/ServiceSelectionResponse
-													    26: PaymentDetailsRequest/IdentificationDetailsRequest;, 27: PaymentDetailsResponse/IdentificationDetailsResponse,
-													     28: AuthorizationRequest, 29: AuthorizationResponse, 
-													    30: CertificateUpdateRequest, 31: CertificateUpdateResponse, 32:CertificateInstallationRequest, 33: CertificateInstallationResponse
-													    34: ChargeParameterDiscoveryRequest, 35: ChargeParameterDiscoveryResponse
-													    36: CableCheckRequest, 37: CableCheckResponse, 38: PreChargeRequest, 39: PreChargeResponse
-													    40: PowerDeliveryRequest start, 41: PowerDeliveryResponse start, 42: ChargingStatusRequest, 43: ChargingStatusResponse
-													    44: CurrentDemandRequest, 45: CurrentDemandResponse, 46: MeteringReceiptRequest, 47: MeteringReceiptResponse 
-													    48: PowerDeliveryRequest end, 49: PowerDeliveryRequest end, 50: WeldingDetectionRequest, 51: WeldingDetectionResponse, 
-													    52: SessionStopRequest, 53: SessionStopResponse
-													   253: Performance Timeout, 254: Sequence Timeout, 255: Fault 	
-													*/ 		
-	struct SupportedAppProtocolRequest_ISO15118_2018			SupportedAppProtocolRequest;
-	struct SupportedAppProtocolResponse_ISO15118_2018 			SupportedAppProtocolResponse;
-	struct SessionSetupRequest_ISO15118_2018					SessionSetupRequest;
-	struct SessionSetupResponse_ISO15118_2018  					SessionSetupResponse;
-	struct ServiceDiscoveryRequest_ISO15118_2018    				ServiceDiscoveryRequest;
-	struct ServiceDiscoveryResponse_ISO15118_2018    				ServiceDiscoveryResponse;
-	struct ServiceDetailRequest_ISO15118_2018 					ServiceDetailRequest;
-	struct ServiceDetailResponse_ISO15118_2018					ServiceDetailResponse;
-	struct ServiceSelectionRequest_ISO15118_2018				ServiceSelectionRequest;
-	struct ServiceSelectionResponse_ISO15118_2018				ServiceSelectionResponse;
-	struct IdentificationDetailsRequest_ISO15118_2018  			IdentificationDetailsRequest;
-	struct IdentificationDetailsResponse_ISO15118_2018  			IdentificationDetailsResponse;
-	struct AuthorizationRequest_ISO15118_2018  					AuthorizationRequest;
-	struct AuthorizationResponse_ISO15118_2018					AuthorizationResponse;
-	struct CertificateInstallationRequest_ISO15118_2018			CertificateInstallationRequest;
-	struct CertificateInstallationResponse_ISO15118_2018			CertificateInstallationResponse;
-	struct ChargeParameterDiscoveryRequest_ISO15118_2018 		ChargeParameterDiscoveryRequest;
-	struct ChargeParameterDiscoveryResponse_ISO15118_2018  		ChargeParameterDiscoveryResponse;
-	struct CableCheckRequest_ISO15118_2018 					CableCheckRequest;
-	struct CableCheckResponse_ISO15118_2018 					CableCheckResponse;
-	struct PreChargeRequest_ISO15118_2018 					PreChargeRequest;
-	struct PreChargeResponse_ISO15118_2018					PreChargeResponse;
-	struct PowerDeliveryRequest_ISO15118_2018					PowerDeliveryRequest;
-	struct PowerDeliveryResponse_ISO15118_2018					PowerDeliveryResponse;
-	struct ChargingStatusRequest_ISO15118_2018	  				ChargingStatusRequest;	  
-	struct ChargingStatusResponse_ISO15118_2018				ChargingStatusResponse;
-	struct CurrentDemandRequest_ISO15118_2018	 			CurrentDemandRequest;
-	struct CurrentDemandResponse_ISO15118_2018				CurrentDemandResponse;
-	struct MeteringReceiptRequest_ISO15118_2018				MeteringReceiptRequest;  
-	struct MeteringReceiptResponse_ISO15118_2018				MeteringReceiptResponse;
-	struct WeldingDetectionRequest_ISO15118_2018 				WeldingDetectionRequest;
-	struct WeldingDetectionResponse_ISO15118_2018  			WeldingDetectionResponse;
-	struct SessionStopRequest_ISO15118_2018 					SessionStopRequest;
-	struct SessionStopResponse_ISO15118_2018					SessionStopResponse;
-};
-
-struct CcsData 
-{
-	unsigned char 							CommProtocol;	// 1: V2GMessage_DIN70121, 2:V2GMessage_ISO15118_2014, 3:V2GMessage_ISO15118_2018
-	struct V2GMessageType_DIN70121			V2GMessage_DIN70121[CCS_QUANTITY];
-	struct V2GMessageType_ISO15118_2014  		V2GMessage_ISO15118_2014[CCS_QUANTITY];
-	struct V2GMessageType_ISO15118_2018  		V2GMessage_ISO15118_2018[CCS_QUANTITY];
-};
-/**************************************************************************************/
-/***************STM32F407 Communication Share memory**************************/
-/**************************************************************************************/
-struct PrimaryMcuData 
-{
-	unsigned char	version[16];									//STM32F407 firmware version
-	unsigned int 	InputVoltage;									//value comes from external meter 
-	unsigned int 	InputCurrent;									//value comes from external meter 
-	union
-	{    
-		unsigned char OutputDrvValue[1];
-		struct
-		{
-			//OutputDrvValue[0]
-		    	unsigned char AcContactorDrv:1;						//bit 0,	H: ON, 		L:OFF
-			unsigned char Button1LedDrv:1;						//bit 1,	H: ON, 		L:OFF
-			unsigned char Button2LedDrv:1; 						//bit 2,	H: ON, 		L:OFF
-			unsigned char SystemLed1Drv:1;						//bit 3,	H: ON, 		L:OFF     
-			unsigned char SystemLed2Drv:1;						//bit 4,	H: ON, 		L:OFF  	  
-			unsigned char SystemLed3Drv:1;						//bit 5,	H: ON, 		L:OFF 		          
-			unsigned char SystemLed4Drv:1;						//bit 6,	H: ON, 		L:OFF  
-			unsigned char:1;									//bit 7 reserved 
-		}bits;
-	}OutputDrv;       
-	union
-	{    
-		unsigned char InputDetValue[2];
-		struct
-		{
-			//InputDetValue[0]
-		    	unsigned char AcContactorDetec:1;					//bit 0,	H: ON, 		L:OFF
-			unsigned char AcMainBreakerDetec:1;					//bit 1,	H: ON, 		L:OFF
-			unsigned char SpdDetec:1; 							//bit 2,	H: ON, 		L:OFF
-			unsigned char DoorOpen:1;							//bit 3,	H: Open,		L:Close		              
-			unsigned char Gfd1:1;								//bit 4,	H: Trigger,		L:Normal 		          
-			unsigned char Gfd2:1;								//bit 5,	H: Trigger,		L:Normal 		            		  
-			unsigned char Button1:1;								//bit 6 ,	H: Push, 		L:Release 
-			unsigned char Button2:1;								//bit 7,	H: Push, 		L:Release 
-			//InputDetValue[1]		
-			unsigned char EmergencyButton:1;						//bit 0,	H: Push, 		L:Release 
-			unsigned char :7;									//bit 1~7,	Reserved    
-		}bits;
-	}InputDet;       
-};
-/**************************************************************************************/
-/*************Fan power module Communication Share memory******************/
-/**************************************************************************************/
-struct FanModuleData 
-{
-	unsigned char	version[16];			//fan power module firmware version
-	unsigned short	PresentFan1Speed;		//RPM
-	unsigned short	PresentFan2Speed;		//RPM
-	unsigned short	PresentFan3Speed;		//RPM
-	unsigned short	PresentFan4Speed;		//RPM
-	unsigned short	SetFan1Speed;			//RPM
-	unsigned short	SetFan2Speed;			//RPM
-	unsigned short	SetFan3Speed;			//RPM
-	unsigned short	SetFan4Speed;			//RPM
-	unsigned char	DiffOfAirPressure;		//pa
-	unsigned char	UpdateFW;			//1:do update
-};
-
-/**************************************************************************************/
-/***********Relay control module Communication Share memory******************/
-/**************************************************************************************/
-struct RelayModuleData 
-{
-	unsigned char	version[16];				//fan power module firmware version
-	unsigned short	InputL1Volt;				//XXXXX.x volt
-	unsigned short	InputL2Volt;				//XXXXX.x volt
-	unsigned short	InputL3Volt;				//XXXXX.x volt
-	unsigned short	Gun1FuseOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun2FuseOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun1RelayOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun2RelayOutputVolt;		//XXXXX.x volt
-	unsigned short	Gun1OutputCurrent;		//XXXXX.x amp
-	unsigned short	Gun2OutputCurrent;		//XXXXX.x amp
-	unsigned char	UpdateFW;				//1:do update
-};
-
-/**************************************************************************************/
-/************************OCPP Share memory***************************************/
-/**************************************************************************************/
-struct StructIdTagInfo
-{
-	unsigned char 	ExpiryDate[28];
-	unsigned char 	ParentIdTag[20];	
-	unsigned char 	Status[16];		//Accepted, Blocked, Expired, Invalid, ConcurrentTx
-};
-struct StructLocalAuthorizationList
-{
-	unsigned char 			IdTag[20];	
-	struct StructIdTagInfo	IdTagInfo;
-};
-struct StructSampledValue
-{
-	unsigned char 			Value[128];
-	unsigned char 			Context[20];//Interruption.Begin, Interruption.End, Sample.Clock, Sample.Periodic, Transaction.Begin, Transaction.End, Trigger, Other
-	unsigned char 			Format[12];//Raw,SignedData
-	unsigned char 			Measurand[32];/*	"Energy.Active.Export.Register",
-										"Energy.Active.Import.Register",
-										"Energy.Reactive.Export.Register",
-										"Energy.Reactive.Import.Register",
-										"Energy.Active.Export.Interval",
-										"Energy.Active.Import.Interval",
-										"Energy.Reactive.Export.Interval",
-										"Energy.Reactive.Import.Interval",
-										"Power.Active.Export",
-										"Power.Active.Import",
-										"Power.Offered",
-										"Power.Reactive.Export",
-										"Power.Reactive.Import",
-										"Power.Factor",
-										"Current.Import",
-										"Current.Export",
-										"Current.Offered",
-										"Voltage",
-										"Frequency",
-										"Temperature",
-										"SoC",
-										"RPM"
-										*/
-										
-	unsigned char 			Phase[8];	/*		"L1",
-										"L2",
-										"L3",
-										"N",
-										"L1-N",
-										"L2-N",
-										"L3-N",
-										"L1-L2",
-										"L2-L3",
-										"L3-L1"
-								*/		
-	
-	unsigned char 			Location[8];		//Cable,EV,Inlet,Outlet,Body
-	unsigned char 			Unit[12];	/*		"Wh",
-										"kWh",
-										"varh",
-										"kvarh",
-										"W",
-										"kW",
-										"VA",
-										"kVA",
-										"var",
-										"kvar",
-										"A",
-										"V",
-										"K",
-										"Celcius",
-										"Fahrenheit",
-										"Percent"
-								*/		
-};
-struct StructMeterValue
-{
-	unsigned char 				TimeStamp[28];
-	struct StructSampledValue	*SampledValue;
-};
-struct StructConfigurationKeyItems
-{
-	unsigned char 	Item[50];
-};
-struct StructConfigurationKey
-{
-	unsigned char 	Key[50];
-	unsigned char 	ReadOnly[8];	//boolean
-	unsigned char 	Value[500];
-};
-struct StructChargingSchedulePeriod
-{
-	int		StartPeriod;
-	float 	Limit;//0.1;
-	int		NumberPhases;
-};
-struct StructChargingSchedule
-{
-	int								Duration;
-	unsigned char 						StartSchedule[28];
-	unsigned char 						ChargingRateUnit[4];		//A, W
-	struct StructChargingSchedulePeriod	*ChargingSchedulePeriod;
-	float 							MinChargingRate;			//0.1;
-};
-struct StructChargingProfile
-{
-	int							ChargingProfileId;
-	int							TransactionId;
-	int							StackLevel;
-	unsigned char 					ChargingProfilePurpose[24];	//ChargePointMaxProfile, TxDefaultProfile, TxProfile
-	unsigned char 					ChargingProfileKind[12];		//Absolute, Recurring, Relative
-	unsigned char 					RecurrencyKind[8];			//Daily, Weekly	
-	unsigned char 					ValidFrom[28];
-	unsigned char 					ValidTo[28];
-	struct StructChargingSchedule	ChargingSchedule;
-};
-
-struct StructBootNotification 
-{
-	unsigned char CpVendor[20];				//chargePointVendor				//mandatory
-	unsigned char CpModel[20];				//chargePointModel				//mandatory
-	unsigned char CpSN[25];					//chargePointSerialNumber
-	unsigned char CbSN[25];					//chargeBoxSerialNumber
-	unsigned char CpFwVersion[50];			//firmwareVersion
-	unsigned char CpIccid[20];				//iccid
-	unsigned char CpImsi[20];				//imsi
-	unsigned char CpMeterType[25];			//meterType
-	unsigned char CpMeterSerialNumber[25];	//meterSerialNumber
-	unsigned char ResponseStatus[16];			//Accepted, Pending, Rejected
-	unsigned char ResponseCurrentTime[28];	//currentTime					//mandatory
-	int 			ResponseHeartbeatInterval;	//interval						//mandatory
-	
-};
-struct StructHeartbeat
-{
-	unsigned char ResponseCurrentTime[28];	
-};
-struct StructAuthorize 
-{
-	unsigned char 			IdTag[20];				
-	struct StructIdTagInfo	ResponseIdTagInfo;						
-};
-struct StructStartTransaction 
-{
-	int ConnectorId;						
-	unsigned char IdTag[20];				
-	int MeterStart;							
-	int ReservationId;						
-	unsigned char Timestamp[28];			
-	struct StructIdTagInfo	ResponseIdTagInfo;				
-	int ResponseTransactionId;				
-};
-struct StructStopTransaction 
-{
-	unsigned char IdTag[20];							
-	int MeterStop;							
-	unsigned char Timestamp[28];			
-	int TransactionId;						
-	unsigned char StopReason;				/*	"EmergencyStop",
-												"EVDisconnected",
-												"HardReset",
-												"Local",
-												"Other",
-												"PowerLoss",
-												"Reboot",
-												"Remote",
-												"SoftReset",
-												"UnlockCommand",
-												"DeAuthorized"
-											*/	
-	struct StructMeterValue	*TransactionData;			
-	struct StructIdTagInfo	ResponseIdTagInfo;					
-};
-
-struct StructStatusNotification
-{
-	int ConnectorId;						
-	unsigned char ErrorCode;				/*	"ConnectorLockFailure",
-								                "EVCommunicationError",
-								                "GroundFailure",
-								                "HighTemperature",
-								                "InternalError",
-								                "LocalListConflict",
-								                "NoError",
-								                "OtherError",
-								                "OverCurrentFailure",
-								                "PowerMeterFailure",
-								                "PowerSwitchFailure",
-								                "ReaderFailure",
-								                "ResetFailure",
-								                "UnderVoltage",
-								                "OverVoltage",
-								                "WeakSignal"
-								            */
-								              
-	unsigned char Info[50];								
-	unsigned char Status;					/*	"Available",
-								                "Preparing",
-								                "Charging",
-								                "SuspendedEVSE",
-								                "SuspendedEV",
-								                "Finishing",
-								                "Reserved",
-								                "Unavailable",
-								                "Faulted"
-								            */
-								                
-	unsigned char Timestamp[28];			
-	unsigned char VendorId[256];							
-	unsigned char VendorErrorCode[50];						
-};
-
-
-struct StructCancelReservation
-{
-	int ReservationId;							
-	unsigned char ResponseStatus[16];		//Accepted, Rejected
-					
-};
-struct StructChangeAvailability
-{
-	int ConnectorId;						
-	unsigned char Type[16];					//Inoperative, Operative
-	unsigned char ResponseStatus[16];		//Accepted, Rejected, Scheduled				
-};
-struct StructChangeConfiguration
-{
-	unsigned char Key[50];					
-	unsigned char Value[500];				
-	unsigned char ResponseStatus[16];		//Accepted, Rejected, RebootRequired, NotSupported			
-};
-struct StructClearCache
-{
-	unsigned char ResponseStatus[16];		//Accepted, Rejected	
-};
-struct StructClearChargingProfile
-{
-	int			 Id;			
-	int			ConnectorId;						
-	unsigned char ChargingProfilePurpose[24];	//ChargePointMaxProfile, TxDefaultProfile, TxProfile	
-	int			 StackLevel;						
-	unsigned char ResponseStatus[16];			//Accepted, Unknown			
-};
-struct StructDataTransfer
-{					
-	unsigned char VendorId[256];		
-	unsigned char MessageId[52];	
-	unsigned char Data[512];					
-	unsigned char ResponseStatus[18];	//Accepted, Rejected,UnknownMessageId,UnknownVendorId
-	unsigned char ResponseData[256];						
-};
-struct StructDiagnosticsStatusNotification
-{					
-	unsigned char Status[16];		//Idle,Uploaded,UploadFailed,Uploading					
-};
-struct StructFirmwareStatusNotification
-{					
-	unsigned char Status[20];			//Downloaded,DownloadFailed,Downloading,Idle,InstallationFailed,Installing,Installed					
-};
-struct StructGetCompositeSchedule
-{					
-	int 							ConnectorId;		
-	int 							Duration;				
-	unsigned char					ChargingRateUnit[4];		//A,W				
-	unsigned char 					ResponseStatus[12];			//Accepted,Rejected
-	int 							ResponseConnectorId;		
-	unsigned char					 ResponseScheduleStart[28];		
-	struct StructChargingSchedule	ResponseChargingSchedule;				
-};
-struct StructGetConfiguration
-{									
-	struct StructConfigurationKeyItems 	*Key;
-	struct StructConfigurationKey			 *ResponseConfigurationKey;
-	struct StructConfigurationKeyItems 	*ResponseUnknownKey;
-			
-};
-struct StructGetDiagnostics
-{									
-	unsigned char Location[256];
-	int 			Retries;		
-	int			RetryInterval;		
-	unsigned char StartTime[28];		
-	unsigned char StopTime[28];		
-	unsigned char ResponseFileName[256];						
-};
-struct StructGetLocalListVersion
-{									
-	int ResponseListVersion;							
-};
-struct StructMeterValues
-{									
-	int					 ConnectorId;		
-	int 					TransactionId;				
-	struct StructMeterValue	*MeterValue;			
-};
-struct StructRemoteStartTransaction
-{									
-	int						ConnectorId;		
-	unsigned char 				IdTag[20];		
-	struct StructChargingProfile	ChargingProfile;			
-	unsigned char 				ResponseStatus[10];	//Accepted,	Rejected
-};
-struct StructRemoteStopTransaction
-{									
-	int 			TransactionId;			
-	unsigned char ResponseStatus[10];	//Accepted,	Rejected
-};
-struct StructReserveNow
-{									
-	int			 ConnectorId;		
-	unsigned char ExpiryDate[28];	
-	unsigned char IdTag[20];	
-	unsigned char ParentIdTag[20];	
-	int			ReservationId;
-	unsigned char ResponseStatus[12];		//Accepted, Faulted, Occupied, Rejected, Unavailable		
-};
-struct StructReset
-{												
-	unsigned char Type[8];			//Hard,	Soft
-	unsigned char ResponseStatus[10];	//Accepted,	Rejected
-};
-struct StructSendLocalList
-{						
-	int							ListVersion;						
-	unsigned char 					UpdateType[16];	//Differential,	Full
-	struct StructLocalAuthorizationList	*LocalAuthorizationList;			
-	unsigned char 					ResponseStatus[16];	//Accepted,	Failed, NotSupported, VersionMismatch
-};
-struct StructSetChargingProfile
-{
-	int 						ConnectorId;		
-	struct StructChargingProfile	ChargingProfile;
-	unsigned char				 ResponseStatus[16];	//Accepted,	Rejected, NotSupported
-};
-struct StructTriggerMessage
-{
-	unsigned char RequestedMessage[32];	/*
-											"BootNotification",
-											"DiagnosticsStatusNotification",
-											"FirmwareStatusNotification",
-											"Heartbeat",
-											"MeterValues",
-											"StatusNotification"
-										*/
-	int			ConnectorId;		
-	unsigned char ResponseStatus[16];	//Accepted,	Rejected, NotImplemented										
-};
-struct StructUnlockConnector
-{
-	int			ConnectorId;	
-	unsigned char ResponseStatus[16];	//Unlocked,	UnlockFailed, NotSupported					
-};
-struct StructUpdateFirmware
-{
-	unsigned char Location[256];
-	int			Retries;		
-	unsigned char RetrieveDate[28];
-	int 			RetryInterval;	
-};
-
-struct OCPP16ConfigurationItem
-{
-	unsigned char ItemName[64];
-	unsigned char ItemAccessibility;//0:RO, 1:RW
-	unsigned char ItemData[128];
-};
-
-struct OCPP16ConfigurationTable
-{
-	//please refer to OCPP 1.6 chapter 9
-	struct OCPP16ConfigurationItem CoreProfile[28];
-	struct OCPP16ConfigurationItem LocalAuthListManagementProfile[3];
-	struct OCPP16ConfigurationItem ReservationProfile[1];
-	struct OCPP16ConfigurationItem SmartChargingProfile[5];
-};
-
-struct OCPP16Data
-{
-	unsigned char 							OcppServerURL[512];		//http: non-secure OCPP 1.5-S, https: secure OCPP 1.5-S, ws: non-secure OCPP 1.6-J, wss: secure OCPP 1.6-J"								
-	unsigned char 							ChargeBoxId[128];		
-	unsigned char 							OcppConnStatus;			//0: disconnected, 1: connected	
-	union
-	{    
-		//Operations Initiated by Charge Point 
-		unsigned char CpMsgValue[2];
-		struct
-		{
-			//CpMsgValue[0]
-		    	unsigned char BootNotificationReq:1;					//bit 0,	
-			unsigned char BootNotificationConf:1;					//bit 1,	
-			unsigned char AuthorizeReq:1; 						//bit 2,	
-			unsigned char AuthorizeConf:1;						//bit 3,	
-			unsigned char DataTransferReq:1;						//bit 4,	  
-			unsigned char DataTransferConf:1;						//bit 5,		          
-			unsigned char DiagnosticsStatusNotificationReq:1;		//bit 6,	
-			unsigned char DiagnosticsStatusNotificationConf:1;		//bit 7,  
-			//CpMsgValue[1]
-		    	unsigned char FirmwareStatusNotificationReq:1;			//bit 0,	
-			unsigned char FirmwareStatusNotificationConf:1;			//bit 1,	
-			unsigned char StartTransactionReq:1; 					//bit 2,	
-			unsigned char StartTransactionConf:1;					//bit 3,	
-			unsigned char StopTransactionReq:1;					//bit 4,	  
-			unsigned char StopTransactionConf:1;					//bit 5,		          
-			unsigned char :2;									//bit 6,7 , reserved	
-		}bits;
-	}CpMsg; 
-	union
-	{    
-		//Operations Initiated by Central System
-		unsigned char CsMsgValue[5];
-		struct
-		{
-			//CsMsgValue[0]
-		    	unsigned char CancelReservationReq:1;				//bit 0,	
-			unsigned char CancelReservationConf:1;				//bit 1,	
-			unsigned char ChangeAvailabilityReq:1; 				//bit 2,	
-			unsigned char ChangeAvailabilityConf:1;				//bit 3,	
-			unsigned char ChangeConfigurationReq:1;				//bit 4,	  
-			unsigned char ChangeConfigurationConf:1;				//bit 5,		          
-			unsigned char ClearCacheReq:1;						//bit 6,	
-			unsigned char ClearCacheConf:1;						//bit 7,  
-			//CsMsgValue[1]
-		    	unsigned char ClearChargingProfileReq:1;				//bit 0,	
-			unsigned char ClearChargingProfileConf:1;				//bit 1,	
-			unsigned char DataTransferReq:1; 						//bit 2,	
-			unsigned char DataTransferConf:1;						//bit 3,	
-			unsigned char GetCompositeScheduleReq:1;			//bit 4,	  
-			unsigned char GetCompositeScheduleConf:1;			//bit 5,		          
-			unsigned char GetConfigurationReq:1;					//bit 6,	
-			unsigned char GetConfigurationConf:1;				//bit 7,  
-			//CsMsgValue[2]
-		    	unsigned char GetDiagnosticsReq:1;					//bit 0,	
-			unsigned char GetDiagnosticsConf:1;					//bit 1,	
-			unsigned char GetLocalListVersionReq:1; 				//bit 2,	
-			unsigned char GetLocalListVersionConf:1;				//bit 3,	
-			unsigned char RemoteStartTransactionReq:1;			//bit 4,	  
-			unsigned char RemoteStartTransactionConf:1;			//bit 5,		          
-			unsigned char RemoteStopTransactionReq:1;			//bit 6,	
-			unsigned char RemoteStopTransactionConf:1;			//bit 7,  
-			//CsMsgValue[3]
-		    	unsigned char ReserveNowReq:1;						//bit 0,	
-			unsigned char ReserveNowConf:1;						//bit 1,	
-			unsigned char ResetReq:1; 							//bit 2,	
-			unsigned char ResetConf:1;							//bit 3,	
-			unsigned char SendLocalListReq:1;						//bit 4,	  
-			unsigned char SendLocalListConf:1;					//bit 5,		          
-			unsigned char SetChargingProfileReq:1;					//bit 6,	
-			unsigned char SetChargingProfileConf:1;				//bit 7,  
-			//CsMsgValue[4]
-		    	unsigned char TriggerMessageReq:1;					//bit 0,	
-			unsigned char TriggerMessageConf:1;					//bit 1,	
-			unsigned char UnlockConnectorReq:1; 					//bit 2,	
-			unsigned char UnlockConnectorConf:1;					//bit 3,	
-			unsigned char UpdateFirmwareReq:1;					//bit 4,	  
-			unsigned char UpdateFirmwareConf:1;					//bit 5,		          
-			unsigned char :2;									//bit 6,7	
-		}bits;
-	}CsMsg; 
-	struct StructBootNotification 				BootNotification;
-	struct StructHeartbeat					Heartbeat;
-	struct StructAuthorize		 			Authorize;
-	struct StructStartTransaction				StartTransaction;
-	struct StructStopTransaction				StopTransaction;
-	struct StructStatusNotification				StatusNotification;
-	struct StructCancelReservation			CancelReservation;
-	struct StructChangeAvailability			ChangeAvailability;
-	struct StructChangeConfiguration			ChangeConfiguration;
-	struct StructClearCache					ClearCache;
-	struct StructClearChargingProfile			ClearChargingProfile;
-	struct StructDataTransfer					DataTransfer;
-	struct StructDiagnosticsStatusNotification	DiagnosticsStatusNotification;
-	struct StructFirmwareStatusNotification		FirmwareStatusNotification;
-	struct StructGetCompositeSchedule		GetCompositeSchedule;
-	struct StructGetConfiguration				GetConfiguration;
-	struct StructGetDiagnostics				GetDiagnostics;
-	struct StructGetLocalListVersion			GetLocalListVersion;
-	struct StructMeterValues					MeterValues;
-	struct StructRemoteStartTransaction		RemoteStartTransaction;
-	struct StructRemoteStopTransaction		RemoteStopTransaction;
-	struct StructReserveNow					ReserveNow;
-	struct StructReset						Reset;
-	struct StructSendLocalList				SendLocalList;
-	struct StructSetChargingProfile			SetChargingProfile;
-	struct StructTriggerMessage				TriggerMessage;
-	struct StructUnlockConnector				UnlockConnector;
-	struct StructUpdateFirmware				UpdateFirmware;
-	struct OCPP16ConfigurationTable			ConfigurationTable;
-	struct StructChargingProfile				*CHAdeMOChargingProfile;
-	struct StructChargingProfile				*CcsChargingProfile;
-};
-	
-#endif // DEFINE_H_
-	
-	
-	
-	
-
-

BIN
EVSE/Projects/DW25/Apps/main


+ 0 - 659
EVSE/Projects/DW25/Apps/main.c

@@ -1,659 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <linux/termios.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <stdlib.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/mman.h>
-#include <linux/sockios.h> 
-#include <linux/socket.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <sys/time.h> 
-#include <sys/timeb.h> 
-#include <math.h>//for pow
-#include <unistd.h>
-#include "define.h"
-
-
-//#define Debug
-
-struct SysConfigAndInfo			*ShmSysConfigAndInfo;
-struct StatusCodeData 			*ShmStatusCodeData;
-struct PsuData 				*ShmPsuData ;
-struct CHAdeMOData			*ShmCHAdeMOData;
-struct CcsData				*ShmCcsData;
-struct PrimaryMcuData			*ShmPrimaryMcuData;
-struct FanModuleData			*ShmFanModuleData;
-struct RelayModuleData			*ShmRelayModuleData;
-struct OCPP16Data				*ShmOCPP16Data;
-
-#ifdef SystemLogMessage
-int StoreLogMsg(unsigned char *DataString)
-{
-	unsigned char Buf[256];
-	time_t CurrentTime;
-	struct tm *tm;
-			
-	memset(Buf,0,sizeof(Buf));
-	CurrentTime = time(NULL);
-	tm=localtime(&CurrentTime);
-	sprintf(Buf,"echo \"%04d.%02d.%02d %02d:%02d:%02d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
-			tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,
-			DataString,
-			tm->tm_year+1900,tm->tm_mon+1);
-	system(Buf);
-	#ifdef Debug
-	printf("%s \n",DataString);
-	#endif
-}		
-#endif
-
-int DiffTimeb(struct timeb ST, struct timeb ET)
-{
-	//return milli-second
-	unsigned int StartTime,StopTime;
-	
-	StartTime=(unsigned int)ST.time;
-	StopTime=(unsigned int)ET.time;
-	return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
-}	
-
-/**************************************************************************************/
-/**************************Create all share memory *********************************/
-/**************************************************************************************/
-int CreatShareMemory()
-{
-	int MeterSMId;
-	
-	//creat ShmSysConfigAndInfo
-	if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmSysConfigAndInfo NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmSysConfigAndInfo NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmSysConfigAndInfo,0,sizeof(struct SysConfigAndInfo));
-   	 //creat ShmStatusCodeData
-   	 if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmStatusCodeData NG");
-		#endif		
-		return 0;	
-	}
-    	else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmStatusCodeData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmStatusCodeData,0,sizeof(struct StatusCodeData));
-   	 //creat ShmPsuData
-   	 if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmPsuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmPsuData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmPsuData,0,sizeof(struct PsuData));
-   	 //creat ShmCHAdeMOData
-   	 if ((MeterSMId = shmget(ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmCHAdeMOData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmCHAdeMOData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmCHAdeMOData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmCHAdeMOData,0,sizeof(struct CHAdeMOData));
-   	 //creat ShmCcsData
-   	 if ((MeterSMId = shmget(ShmCcsCommKey, sizeof(struct CcsData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmCcsData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmCcsData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmCcsData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmCcsData,0,sizeof(struct CcsData));
-   	//creat ShmPrimaryMcuData
-   	 if ((MeterSMId = shmget(ShmPrimaryMcuKey, sizeof(struct PrimaryMcuData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmPrimaryMcuData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmPrimaryMcuData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmPrimaryMcuData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmPrimaryMcuData,0,sizeof(struct PrimaryMcuData));
-   	 //creat ShmFanModuleData
-   	 if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmFanModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmFanModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
-   	 //creat ShmRelayModuleData
-   	 if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmRelayModuleData NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmRelayModuleData NG");
-		#endif		
-		return 0;
-   	 }
-   	 memset(ShmRelayModuleData,0,sizeof(struct RelayModuleData));
-   	  //creat ShmOCPP16Data
-   	 if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data), IPC_CREAT | 0777)) < 0) 
-    	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmget ShmOCPP16Data NG");
-		#endif			
-		return 0;
-	}
-    	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1) 
-    	{
-    		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]CreatShareMemory:shmat ShmOCPP16Data NG");
-		#endif		
-		return 0;
-   	 }
-   	// memset(ShmOCPP16Data,0,sizeof(struct OCPP16Data));
-    	return 1;
-}
-
-/**************************************************************************************/
-/****************Following functions are CSU initialization***************************/
-/**************************************************************************************/
-void InitGPIO()
-{
-	/*****************0~3, 4 bank, bank x 32+ num*********************/
-	/***************************************************************/
-	/*************** GPIO 0 ***************************************/
-	/***************************************************************/
-	/* GPMC_AD8			=> 	GPIO0_22 */	/*ID BD1_1*/
-	system("echo 22 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio22/direction");
-	/* GPMC_AD9			=>	GPIO0_23 */	/*ID BD1_2*/
-	system("echo 23 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio23/direction");
-	/* GPMC_AD10		=>	GPIO0_26 */	/*IO BD1_1*/
-	system("echo 26 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio26/direction");
-	/* GPMC_AD11		=>	GPIO0_27 */	/*IO BD1_2*/
-	system("echo 27 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio27/direction");
-	/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
-	system("echo 29 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio29/direction");
-	/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
-	system("echo 19 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio19/direction");
-	system("echo 0 > /sys/class/gpio/gpio19/value");
-	/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-	system("echo 20 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio20/direction");
-	/***************************************************************/
-	/*************** GPIO 1 ***************************************/
-	/***************************************************************/
-	/* GPMC_AD12	=> 	GPIO1_12 */	/*ID BD2_1*/
-	system("echo 44 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio44/direction");
-	/* GPMC_AD13	=>	GPIO1_13 */	/*ID BD2_2*/
-	system("echo 45 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio45/direction");
-	/* GPMC_AD14	=>	GPIO1_14 */	/*IO BD2_1*/
-	system("echo 46 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio46/direction");
-	/* GPMC_AD15	=>	GPIO1_15 */	/*IO BD2_2*/
-	system("echo 47 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio47/direction");
-	/***************************************************************/
-	/*************** GPIO 2 ***************************************/
-	/***************************************************************/
-	/*LCD_AC_BIAS_EN	=>	GPIO2_25*/	/*RS-485 for module DE control*/
-	system("echo 89 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio89/direction");
-	system("echo 0 > /sys/class/gpio/gpio89/value");
-	/*LCD_HSYNC		=>	GPIO2_23*/	/*RS-485 for module RE control*/
-	system("echo 87 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio87/direction");
-	system("echo 0 > /sys/class/gpio/gpio87/value");
-	/*LCD_PCLK		=>	GPIO2_24*/	/*CCS communication board 1 proximity*/
-	system("echo 88 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio88/direction");
-	/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
-	system("echo 86 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio86/direction");
-	/***************************************************************/
-	/*************** GPIO 3 ***************************************/
-	/***************************************************************/
-	/*MCASP0_FSX		=>	GPIO3_15*/	/*Emergency Stop button detect*/
-	system("echo 111 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio111/direction");
-	/*MCASP0_ACLKR	=>	GPIO3_18*/	/*USB1 OCP detect*/
-	system("echo 114 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio114/direction");
-	/*MCASP0_AHCLKR	=>	GPIO3_17*/	/*Emergency IO for AM3352 and STM32F407*/
-	system("echo 113 > /sys/class/gpio/export");
-	system("echo \"in\" > /sys/class/gpio/gpio113/direction");
-	/*MCASP0_ACLKX	=>	GPIO3_14*/	/*Ethernet PHY reset*/
-	system("echo 110 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio110/direction");
-	system("echo 0 > /sys/class/gpio/gpio110/value");
-	/* MCASP0_FSR		=>	GPIO3_19 */	/*SMR Enable control_1*/
-	system("echo 115 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio115/direction");
-	system("echo 0 > /sys/class/gpio/gpio115/value");
-	/* MCASP0_AXR0	=>	GPIO3_16 */	/*CSU board function OK indicator.*/
-	system("echo 112 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio112/direction");
-	system("echo 0 > /sys/class/gpio/gpio112/value");
-	/* MCASP0_AXR1	=>	GPIO3_20 */	/*SMR Enable control_2*/
-	system("echo 116 > /sys/class/gpio/export");
-	system("echo \"out\" > /sys/class/gpio/gpio116/direction");
-	system("echo 0 > /sys/class/gpio/gpio116/value");
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]InitGPIO: Initial GPIO OK");
-	#endif	
-
-}
-
-int LoadSysConfigAndInfo(struct SysConfigData *ptr)
-{
-	int fd,wrd;
-	struct SysConfigData *buf;
-	unsigned char *PtrBuf;
-	unsigned int ChkSum,ChkSumOrg;
-	
-	if((buf=malloc(sizeof(struct SysConfigData)))==NULL)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo:malloc buffer NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	memset(buf, 0, sizeof(struct SysConfigData));
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		free(buf);
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo:open mtdblock10 NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}
-    	wrd=read(fd, buf,sizeof(struct SysConfigData));
-	close(fd);
-	if(wrd!=(sizeof(struct SysConfigData)))
-	{
-		free(buf);
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo: read SysConfigData data NG,rebooting..");
-		#endif	
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	PtrBuf=(unsigned char *)buf;
-	ChkSum=0;
-	for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-	{
-		ChkSum+=PtrBuf[wrd];
-	}
-	ChkSumOrg=buf->Checksum;
-	
-	if(ChkSum!=ChkSumOrg)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]LoadSysConfigAndInfo: Primary SysConfigData checksum NG, read backup");
-		#endif	
-		fd = open("/dev/mtdblock11", O_RDWR);
-		if (fd < 0) 
-		{
-			free(buf);
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: open mtdblock11 (backup) NG,rebooting..");
-			#endif	
-			if(ShmStatusCodeData!=NULL)
-			{
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-			}	
-			sleep(5);
-			system("reboot -f");
-			sleep(5);
-			system("reboot -f");
-	    	}
-	    	memset(buf, 0, sizeof(struct SysConfigData));
-   		wrd=read(fd, buf,sizeof(struct SysConfigData));
-    		close(fd);
-		if(wrd!=sizeof(struct SysConfigData))
-		{
-			free(buf);
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: read backup SysConfigData data NG,rebooting..");
-			#endif	
-			if(ShmStatusCodeData!=NULL)
-			{
-				ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-			}	
-			sleep(5);
-			system("reboot -f");
-			sleep(5);
-			system("reboot -f");
-		}	
-		PtrBuf=(unsigned char *)buf;
-		ChkSum=0;
-		for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-		{
-			ChkSum+=PtrBuf[wrd];
-		}
-		ChkSumOrg=buf->Checksum;
-		if(ChkSum!=ChkSumOrg)
-		{
-			#ifdef SystemLogMessage	
-			StoreLogMsg("[main]LoadSysConfigAndInfo: backup SysConfigData checksum NG, read Factory default");
-			#endif	
-			fd = open("/dev/mtdblock12", O_RDWR);
-			if (fd < 0) 
-			{
-				free(buf);
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: open mtdblock12 (Factory default) NG,rebooting..");
-				#endif	
-				if(ShmStatusCodeData!=NULL)
-				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-				}	
-				sleep(5);
-				system("reboot -f");
-				sleep(5);
-				system("reboot -f");
-	    		}
-	    		memset(buf, 0, sizeof(struct SysConfigData));
-   			wrd=read(fd, buf,sizeof(struct SysConfigData));
-    			close(fd);
-			if(wrd!=sizeof(struct SysConfigData))
-			{
-				free(buf);
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: read factory default  SysConfigData data NG,rebooting..");
-				#endif	
-				if(ShmStatusCodeData!=NULL)
-				{
-					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CsuInitFailed=1;
-				}	
-				sleep(5);
-				system("reboot -f");
-				sleep(5);
-				system("reboot -f");
-			}	
-			PtrBuf=(unsigned char *)buf;
-			ChkSum=0;
-			for(wrd=0;wrd<(sizeof(struct SysConfigData)-4);wrd++)
-			{
-				ChkSum+=PtrBuf[wrd];
-			}
-			ChkSumOrg=buf->Checksum;
-			if(ChkSum!=ChkSumOrg)
-			{
-				#ifdef SystemLogMessage	
-				StoreLogMsg("[main]LoadSysConfigAndInfo: factory default  SysConfigData checksum NG, restore factory default");
-				#endif	
-				goto DefaultShm;
-			}	
-		}	
-	}	
-	//load OK
-	memcpy((struct SysConfigData *)ptr,(struct SysConfigData *)buf,sizeof(struct SysConfigData));	
-	free(buf);
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]LoadSysConfigAndInfo: Load SysConfigData OK");
-	#endif	
-	return 1;
-    
-DefaultShm:
-	system("cd /root;./FactoryConfig");
-	system("sync");
-	sleep(5);
-	system("reboot -f");
-	sleep(5);
-	system("reboot -f");
-}
-
-void InitEthernet()
-{
-	char tmpbuf[256];
-	unsigned int address;
-	
-	system("echo 1 > /sys/class/gpio/gpio110/value");//reset PHY
-	sleep(2);
-	//Init Eth0 for internet 
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up",
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthIpAddress,
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthSubmaskAddress);
-	system(tmpbuf);
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"route add default gw %s eth0 ",
-	ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthGatewayAddress);
-    	system(tmpbuf);		
-    	
-    	
-    	//Init Eth1 for administrator tool 
-	memset(tmpbuf,0,256);
-	sprintf(tmpbuf,"/sbin/ifconfig eth1 %s netmask %s up",
-	ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthIpAddress,
-	ShmSysConfigAndInfo->SysConfig.Eth1Interface.EthSubmaskAddress);
-	system(tmpbuf);
-    	
-    	//Run DHCP client if enabled
-	system("killall udhcpc");
-	system("rm -rf /etc/resolv.conf");	
-	system("echo nameserver 8.8.8.8 > /etc/resolv.conf");		//Google DNS server
-	system("echo nameserver 180.76.76.76 > /etc/resolv.conf");	//Baidu DNS server 
-	if(ShmSysConfigAndInfo->SysConfig.Eth0Interface.EthDhcpClient==0)
-		system("/sbin/udhcpc -i eth0 -s /root/simple.script > /dev/null &");	
-		
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]InitEthernet: Initial Ethernet OK");
-	#endif		
-}	
-
-int Initialization()
-{
-	InitGPIO();
-	LoadSysConfigAndInfo(&ShmSysConfigAndInfo->SysConfig);
-	InitEthernet();
-	
-	#ifdef SystemLogMessage	
-	StoreLogMsg("[main]Initialization: Initialization OK");
-	#endif		
-}
-
-int SpawnTask()
-{
-	system("/root/EventLogging &");
-	system("/root/LcmControl &");
-	system("/root/InternalComm &");
-	system("/root/PrimaryComm &");
-	system("/root/EvComm &");
-	system("/root/OcppBackend &");
-	/*
-	if 4G model 
-		system("/root/4gModem &");
-	else if WiFi model 
-		system("/root/WiFiModem &");
-	*/
-	
-}
-
-
-int StoreUsrConfigData(struct SysConfigData *UsrData)
-{
-	int fd,wrd;
-	unsigned int i,Chk;
-	unsigned char *ptr; 
-	
-	Chk=0;
-	ptr=(unsigned char *)UsrData;
-	for(i=0;i<sizeof(struct SysConfigData)-4;i++)
-	{
-		Chk+=*(ptr+i);
-	}
-	UsrData->Checksum=Chk;
-	
-	fd = open("/dev/mtdblock10", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock10 NG");
-		#endif		
-		return 0;
-	}
-   	wrd=write(fd, UsrData, sizeof(struct SysConfigData));   
-    	close(fd);
-    	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock10 NG");
-		#endif	
-		return 0;
-	}	
-	
-	fd = open("/dev/mtdblock11", O_RDWR);
-	if (fd < 0) 
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: open /dev/mtdblock11(backup) NG");
-		#endif	
-		return 0;
-    	}
-    	wrd=write(fd, UsrData, sizeof(struct SysConfigData));   
-    	close(fd);
-   	if(wrd!=(sizeof(struct SysConfigData)))
-	{	
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]StoreUsrConfigData: write /dev/mtdblock11(backup) NG");
-		#endif	
-		return 0;
-	}	
-	return 1;
-}
-
-/**************************************************************/
-/************** main function********************************/
-/*************************************************************/	
-
-int main(int argc,char *argv[])
-{
-	int Rtn=0;
-	unsigned int StartTime;	
-	struct timeb StartChargingTime,CurrentChargingTime,ChargingLoopTime;
-	float ChargingPower,ChargingEnergy;
-	
-	//Create all share memory
-	if(CreatShareMemory()==0)
-	{
-		#ifdef SystemLogMessage	
-		StoreLogMsg("[main]main:CreatShareMemory NG");
-		#endif		
-		if(ShmStatusCodeData!=NULL)
-		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
-		}	
-		sleep(5);
-		system("reboot -f");
-		sleep(5);
-		system("reboot -f");
-	}	
-	
-	//CSU Initialization 
-	Initialization();
-	
-	//task spawn
-	//SpawnTask();
-
-	/**************************************************************/
-	/************** main Loop********************************/
-	/*****************************************************************/
-	
-	while(1)
-	{
-		sleep(10);
-	}//main while
-}

BIN
EVSE/Projects/DW25/Images/MLO


BIN
EVSE/Projects/DW25/Images/am335x-evm.dtb


BIN
EVSE/Projects/DW25/Images/ramdisk.gz


BIN
EVSE/Projects/DW25/Images/u-boot.img


BIN
EVSE/Projects/DW25/Images/zImage


+ 0 - 210
Makefile

@@ -154,77 +154,6 @@ CCS-rootfs:
 		
 CCS-all: CCS-uboot CCS-linux CCS-rootfs
 
-DW25-uboot-default: u-boot_clean u-boot
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/DW25/Images/
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/DW25/Images/
-
-DW25-uboot-menuconfig:
-	@echo ===================================
-	@echo    Building U-boot menuconfig
-	@echo ===================================	
-	$(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE) menuconfig
-
-DW25-uboot: 
-	@echo ===================================
-	@echo    Building U-boot
-	@echo ===================================
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[DW25]am335x-evm.dts board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/am335x-evm.dts
-	$(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE)
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/DW25/Images/
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/DW25/Images/
-
-DW25-linux-default: linux_clean linux
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage EVSE/Projects/DW25/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/DW25/Images/
-
-DW25-linux: 
-	@echo =====================================
-	@echo     Building the Linux Kernel DTBs
-	@echo =====================================
-	@rm -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb 
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DW25]am335x-evm.dts board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) am335x-evm.dtb
-	@echo =================================
-	@echo     Building User Linux Kernel
-	@echo =================================
-	@rm -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage 
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) zImage
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage EVSE/Projects/DW25/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/DW25/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/drivers/net/ethernet/qualcomm/qcaspi.ko EVSE/rootfs/lib/
-
-DW25-rootfs:
-	@echo =================================
-	@echo     Building User rootfs
-	@echo =================================
-#	@cd EVSE/GPL;make all
-	@cd EVSE/Modularization;make all
-	@cd EVSE/Projects/DW25/Apps;make all
-	@rm -f EVSE/Projects/DW25/Images/ramdisk.gz
-	@dd if=/dev/zero of=/dev/ram0 bs=1k count=131072
-	@mke2fs -vm0 /dev/ram0 131072
-	@tune2fs -c 0 /dev/ram0
-	@dd if=/dev/ram0 bs=1k count=131072 | gzip -v9 > EVSE/Projects/DW25/Images/ramdisk.gz
-	@mkdir -p EVSE/Projects/DW25/Images/mnt
-	@gunzip EVSE/Projects/DW25/Images/ramdisk.gz
-	@sync
-	@mount -o loop EVSE/Projects/DW25/Images/ramdisk EVSE/Projects/DW25/Images/mnt
-	@cp -rfv EVSE/rootfs/* EVSE/Projects/DW25/Images/mnt/
-	@cp -rfv EVSE/Projects/DW25/Images/root/* EVSE/Projects/DW25/Images/mnt/root
-	@chown www-data:www-data EVSE/Projects/DW25/Images/mnt/var/www -R
-	@chmod 777 EVSE/Projects/DW25/Images/mnt/var/log -R
-	@chmod 777 EVSE/Projects/DW25/Images/mnt/var/run -R
-	@sync
-	@sleep 3
-	@umount EVSE/Projects/DW25/Images/mnt
-	@sync
-	@gzip -v9 EVSE/Projects/DW25/Images/ramdisk
-	@rm -rfv EVSE/Projects/DW25/Images/root
-	@rm -rfv EVSE/Projects/DW25/Images/mnt
-		
-DW25-all: DW25-uboot DW25-linux DW25-rootfs
-
 DM30-uboot-default: u-boot_clean u-boot
 	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/DM30/Images/
 	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/DM30/Images/
@@ -490,77 +419,6 @@ DS60-120-rootfs:
 		
 DS60-120-all: DS60-120-uboot DS60-120-linux DS60-120-rootfs
 
-DS60-210-uboot-default: u-boot_clean u-boot
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/DS60-210/Images/
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/DS60-210/Images/
-
-DS60-210-uboot-menuconfig:
-	@echo ===================================
-	@echo    Building U-boot menuconfig
-	@echo ===================================	
-	$(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE) menuconfig
-
-DS60-210-uboot: 
-	@echo ===================================
-	@echo    Building U-boot
-	@echo ===================================
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[DS60-210]am335x-evm.dts board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/am335x-evm.dts
-	$(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE)
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/DS60-210/Images/
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/DS60-210/Images/
-
-DS60-210-linux-default: linux_clean linux
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage EVSE/Projects/DS60-210/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/DS60-210/Images/
-
-DS60-210-linux: 
-	@echo =====================================
-	@echo     Building the Linux Kernel DTBs
-	@echo =====================================
-	@rm -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb 
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DS60-210]am335x-evm.dts board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) am335x-evm.dtb
-	@echo =================================
-	@echo     Building User Linux Kernel
-	@echo =================================
-	@rm -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage 
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) zImage
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage EVSE/Projects/DS60-210/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/DS60-210/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/drivers/net/ethernet/qualcomm/qcaspi.ko EVSE/rootfs/lib/
-
-DS60-210-rootfs:
-	@echo =================================
-	@echo     Building User rootfs
-	@echo =================================
-#	@cd EVSE/GPL;make all
-	@cd EVSE/Modularization;make Project=DS60210 all
-	@cd EVSE/Projects/DS60-210/Apps;make Project=DS60210 all
-	@rm -f EVSE/Projects/DS60-210/Images/ramdisk.gz
-	@dd if=/dev/zero of=/dev/ram0 bs=1k count=131072
-	@mke2fs -vm0 /dev/ram0 131072
-	@tune2fs -c 0 /dev/ram0
-	@dd if=/dev/ram0 bs=1k count=131072 | gzip -v9 > EVSE/Projects/DS60-210/Images/ramdisk.gz
-	@mkdir -p EVSE/Projects/DS60-210/Images/mnt
-	@gunzip EVSE/Projects/DS60-210/Images/ramdisk.gz
-	@sync
-	@mount -o loop EVSE/Projects/DS60-210/Images/ramdisk EVSE/Projects/DS60-210/Images/mnt
-	@cp -rfv EVSE/rootfs/* EVSE/Projects/DS60-210/Images/mnt/
-	@cp -rfv EVSE/Projects/DS60-210/Images/root/* EVSE/Projects/DS60-210/Images/mnt/root
-	@chown www-data:www-data EVSE/Projects/DS60-210/Images/mnt/var/www -R
-	@chmod 777 EVSE/Projects/DS60-210/Images/mnt/var/log -R
-	@chmod 777 EVSE/Projects/DS60-210/Images/mnt/var/run -R
-	@sync
-	@sleep 3
-	@umount EVSE/Projects/DS60-210/Images/mnt
-	@sync
-	@gzip -v9 EVSE/Projects/DS60-210/Images/ramdisk
-	@rm -rfv EVSE/Projects/DS60-210/Images/root
-	@rm -rfv EVSE/Projects/DS60-210/Images/mnt
-		
-DS60-210-all: DS60-210-uboot DS60-210-linux DS60-210-rootfs
-
 AW-Regular-uboot-default: u-boot_clean u-boot
 	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/AW-Regular/Images/
 	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/AW-Regular/Images/
@@ -632,74 +490,6 @@ AW-Regular-rootfs:
 		
 AW-Regular-all: AW-Regular-uboot AW-Regular-linux AW-Regular-rootfs
 
-AH-Luxury-uboot-default: u-boot_clean u-boot
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/AH-Luxury/Images/
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/AH-Luxury/Images/
-
-AH-Luxury-uboot-menuconfig:
-	@echo ===================================
-	@echo    Building U-boot menuconfig
-	@echo ===================================	
-	$(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE) menuconfig
-
-AH-Luxury-uboot: 
-	@echo ===================================
-	@echo    Building U-boot
-	@echo ===================================
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[AH-Luxury]am335x-evm.dts board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/am335x-evm.dts
-	$(MAKE) -j $(MAKE_JOBS) -C $(TI_SDK_PATH)/board-support/u-boot-* CROSS_COMPILE=$(CROSS_COMPILE)
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/AH-Luxury/Images/
-	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/AH-Luxury/Images/
-
-AH-Luxury-linux-default: linux_clean linux
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage EVSE/Projects/AH-Luxury/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/AH-Luxury/Images/
-
-AH-Luxury-linux: 
-	@echo =====================================
-	@echo     Building the Linux Kernel DTBs
-	@echo =====================================
-	@rm -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb 
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[AH-Luxury]am335x-evm.dts board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dts
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) am335x-evm.dtb
-	@echo =================================
-	@echo     Building User Linux Kernel
-	@echo =================================
-	@rm -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage 
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) zImage
-	$(MAKE) -j $(MAKE_JOBS) -C $(LINUXKERNEL_INSTALL_DIR) ARCH=arm CROSS_COMPILE=$(CROSS_COMPILE) modules
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/zImage EVSE/Projects/AH-Luxury/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/am335x-evm.dtb EVSE/Projects/AH-Luxury/Images/
-	@cp -f board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/drivers/net/ethernet/qualcomm/qcaspi.ko EVSE/rootfs/lib/
-
-AH-Luxury-rootfs:
-	@echo =================================
-	@echo     Building User rootfs
-	@echo =================================
-#	@cd EVSE/GPL;make all
-	@cd EVSE/Modularization;make all
-	@cd EVSE/Projects/AH-Luxury/Apps;make all
-	@rm -f EVSE/Projects/AH-Luxury/Images/ramdisk.gz
-	@dd if=/dev/zero of=/dev/ram0 bs=1k count=131072
-	@mke2fs -vm0 /dev/ram0 131072
-	@tune2fs -c 0 /dev/ram0
-	@dd if=/dev/ram0 bs=1k count=131072 | gzip -v9 > EVSE/Projects/AH-Luxury/Images/ramdisk.gz
-	@mkdir -p EVSE/Projects/AH-Luxury/Images/mnt
-	@gunzip EVSE/Projects/AH-Luxury/Images/ramdisk.gz
-	@sync
-	@mount -o loop EVSE/Projects/AH-Luxury/Images/ramdisk EVSE/Projects/AH-Luxury/Images/mnt
-	@cp -rfv EVSE/rootfs/* EVSE/Projects/AH-Luxury/Images/mnt/
-	@cp -rfv EVSE/Projects/AH-Luxury/Images/root/* EVSE/Projects/AH-Luxury/Images/mnt/root
-	@sync
-	@sleep 3
-	@umount EVSE/Projects/AH-Luxury/Images/mnt
-	@sync
-	@gzip -v9 EVSE/Projects/AH-Luxury/Images/ramdisk
-	@rm -rfv EVSE/Projects/AH-Luxury/Images/root
-	@rm -rfv EVSE/Projects/AH-Luxury/Images/mnt
-		
-AH-Luxury-all: AH-Luxury-uboot AH-Luxury-linux AH-Luxury-rootfs
-
 BYTON-GB-uboot-default: u-boot_clean u-boot
 	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/MLO EVSE/Projects/BYTON-GB/Images/
 	@cp -f board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/u-boot.img EVSE/Projects/BYTON-GB/Images/

+ 0 - 666
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[AH-Luxury]am335x-evm.dts

@@ -1,666 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- 
-#define PIN_OUTPUT		(PULL_DISABLE)
-#define PIN_OUTPUT_PULLUP	(PULL_UP)
-#define PIN_OUTPUT_PULLDOWN	0
-#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
-#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
-#define PIN_INPUT_PULLDOWN	(INPUT_EN)
-
-
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		/*reg = <0x80000000 0x10000000>;*/ /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-	/* +++ vern,ramdisk,20181030 +++*/
-	chosen {  
-		bootargs = "console=ttyS0,115200n8 root=/dev/ram0";  
-	};  
-	/* --- vern,ramdisk ,20181030 ---*/
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-};
-
-/******************** Pin Mux ********************/
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&InitialGPIO>; 
-	pinctrl-1 = <&clkout2_pin>;
-	
-	InitialGPIO: InitialGPIO {
-		pinctrl-single,pins = <
-		
-			/** Offset: 0x800 */
-			/** GPIO 0 */ 
-			0x144 (PIN_INPUT | MUX_MODE7)    			/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
-			0x1B0 (PIN_OUTPUT | MUX_MODE7)			/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
-			0x1B4 (PIN_INPUT | MUX_MODE7)			/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-			/** GPIO 1 */			
-			/** GPIO 2 */
-			0x08C (PIN_OUTPUT | MUX_MODE7)			/*GPMC_CLK	=>	GPIO2_1*/	/*Speaker*/
-			0x0A0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA0	=>	GPIO2_6*/	/*Panel LED control-BB_LEDR1*/
-			0x0A4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA1	=>	GPIO2_7*/	/*Panel LED control-BB_LEDG1*/
-			0x0A8 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA2	=>	GPIO2_8*/	/*Panel LED control-BB_LEDB1*/
-			0x0AC (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA3	=>	GPIO2_9*/	/*Panel LED control-BB_LEDR2*/
-			0x0B0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA4	=>	GPIO2_10*/	/*Panel LED control-BB_LEDG2*/
-			0x0B4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_DATA5	=>	GPIO2_11*/	/*Panel LED control-BB_LEDB2*/
-			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK	=>	GPIO2_24*/	/*communication board proximity*/
-			0x0E0 (PIN_OUTPUT | MUX_MODE7)			/*LCD_VSYNC	=>	GPIO2_22*/	/*Breath LED*/
-			/** GPIO 3 */
-			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*control MCU to output CP PWM*/
-		>;
-	};
-	
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-#if 1
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-#endif
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)		/* uart0_rxd	=>	uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd	=>	uart0_txd */
-		>;
-	};
-	
-	uart1_pins: pinmux_uart1_pins {
-		pinctrl-single,pins = <
-			0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) 		/* uart1_txd	=>	uart1_txd */
-			0x180 (PIN_INPUT_PULLUP | MUX_MODE0)			/* uart1_rxd	=>	uart1_rxd */
-		>;
-	};
-
-	uart2_pins: pinmux_uart2_pins {
-		pinctrl-single,pins = <
-			0x150 (PIN_INPUT_PULLUP | MUX_MODE1)			/* SPI0_SCLK	=>	UART2_RXD */
-			0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)		/* SPI0_D0	=>	UART2_TXD */
-		>;
-	};
-	
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT_PULLUP | MUX_MODE1)		/* SPI0_CS1				=>	uart3_rxd */
-			0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* ECAP0_IN_PWM0_OUT		=>	uart3_txd */
-		>;
-	};
-#if 0
-	uart5_pins: pinmux_uart5_pins {
-		pinctrl-single,pins = <
-			0x0C0 (PIN_INPUT_PULLUP | MUX_MODE4)		/* LCD_DATA8	=>	UART5_RXD*/
-			0x0C4 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)	/* LCD_DATA9	=>	UART5_TXD*/
-		>;
-	};
-#endif	
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_default: nandflash_pins_default {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_31 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	nandflash_pins_sleep: nandflash_pins_sleep {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0xc (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x10 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x18 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x1c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x70 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x74 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x7c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x90 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x94 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x9c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <					
-		
-			/* Slave 1 */
-			//0x108 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_COL.gmii1_col */
-			//0x10C(PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
-			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
-			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
-			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x134 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
-			0x138 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
-			0x13c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
-			0x140 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd0.rgmii1_rd0 */	
-			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txen.mii1_txen */
-			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
-			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
-			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      
-
-		>;
-	};
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-			/* Slave 1 reset value */
-			0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)		
-			
-		>;
-	};
-
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_cmd.mmc0_cmd */
-			0x1AC (PIN_INPUT_PULLUP | MUX_MODE7)	/* MCASP0_AHCLKX.GPIO3_21 */
-		>;
-	};
-
-	dcan0_pins_default: dcan0_pins_default {
-		pinctrl-single,pins = <		
-			0x178 (PIN_OUTPUT_PULLUP | MUX_MODE2)			/* uart1_ctsn	=>	d_can0_tx */
-			0x17C (PIN_INPUT_PULLDOWN | MUX_MODE2)		/* uart1_rtsn	=>	d_can0_rx */
-		>;
-	};
-#if 0	
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x168 (PIN_OUTPUT_PULLUP | MUX_MODE2)		/* UART0_CTSn		=>	d_can1_tx */
-			0x16C (PIN_INPUT_PULLDOWN | MUX_MODE2)	/* UART0_RTSn		=>	d_can1_rx */
-		>;
-	};
-
-	ehrpwm1_pins: ehrpwm1_pins {
-		pinctrl-single,pins = <			
-			0x0C8 (PIN_OUTPUT | MUX_MODE2) /* LCD_DATA10.eHRPWM1A */
-		>;
-	};
-	
-	ehrpwm2_pins: ehrpwm2_pins {
-		pinctrl-single,pins =< 
-			0x0A4 (PIN_OUTPUT | MUX_MODE3)	/* LCD_DATA1.eHRPWM2B */
-		>;                
-    };	
-	 
-#endif  
-};
-
-
-/******************** Peripheral Init ********************/			
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>;
-
-	status = "okay";
-};
-
-&uart2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart2_pins>;
-
-	status = "okay";
-};
-
-&uart3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart3_pins>;
-
-	status = "okay";
-};
-#if 0
-&uart5 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart5_pins>;
-
-	status = "okay";
-};
-#endif
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-
-/*	rtc0: rtc@51 {
-		compatible = "nxp,pcf85063";
-		reg = <0x51>;
-	};*/
-};
-#if 1
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	 rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };
-};
-#endif
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-#if 0
-&epwmss1 {
-	status = "okay";      
-
-	ehrpwm1: pwm@48302200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm1_pins>;
-	};
-};
-
-&epwmss2 {
-	status = "okay";   
-
-	ehrpwm2: pwm@48304200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm2_pins>;
-	};	   
-};
-#endif
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&nandflash_pins_default>;
-	pinctrl-1 = <&nandflash_pins_sleep>;
-	/*ranges = <0 0 0x08000000 0x10000000>;*/	/* CS0: NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		compatible = "ti,omap2-nand";
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		interrupt-parent = <&gpmc>;
-		interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
-                    <1 IRQ_TYPE_NONE>;	/* termcount */
-		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1378000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-	//reset-gpios = <&gpio3 14 GPIO_ACTIVE_LOW>;
-};
-
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
- 	phy-mode = "mii";
-
-};
-#if 0
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <2>;
- 	phy-mode = "mii";
-
-};
-#endif
-
-&tscadc {
-	status = "okay";
-	/*tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-	};*/
-
-	adc {
-		ti,adc-channels = <0 1 2 3 4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&wkup_m3 {
-	ti,scale-data-fw = "am335x-evm-scale-data.bin";
-};
-
-&dcan0 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan0_pins_default>;
-};
-#if 0
-&dcan1 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};
-#endif

+ 0 - 711
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DS60-210]am335x-evm.dts

@@ -1,711 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- 
-#define PIN_OUTPUT		(PULL_DISABLE)
-#define PIN_OUTPUT_PULLUP	(PULL_UP)
-#define PIN_OUTPUT_PULLDOWN	0
-#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
-#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
-#define PIN_INPUT_PULLDOWN	(INPUT_EN)
-
-
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		/*reg = <0x80000000 0x10000000>;*/ /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-	/* +++ vern,ramdisk,20181030 +++*/
-	chosen {  
-		bootargs = "console=ttyS0,115200n8 root=/dev/ram0";  
-	};  
-	/* --- vern,ramdisk ,20181030 ---*/
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-};
-
-/******************** Pin Mux ********************/
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&InitialGPIO>; 
-	pinctrl-1 = <&clkout2_pin>;
-	
-	InitialGPIO: InitialGPIO {
-		pinctrl-single,pins = <
-		
-			/** Offset: 0x800 */
-			/** GPIO 0 */   
-			0x020 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD8			=> 	GPIO0_22 */	/*ID BD1_1*/
-			0x024 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD9			=>	GPIO0_23 */	/*ID BD1_2*/
-			0x028 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD10		=>	GPIO0_26 */	/*IO BD1_1*/
-			0x02C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD11		=>	GPIO0_27 */	/*IO BD1_2*/
-			0x144 (PIN_INPUT | MUX_MODE7)    			/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
-			0x1B0 (PIN_OUTPUT | MUX_MODE7)			/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
-			0x1B4 (PIN_INPUT | MUX_MODE7)			/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-			
-			/** GPIO 1 */
-			0x030 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD12	=> 	GPIO1_12 */	/*ID BD2_1*/
-			0x034 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD13	=>	GPIO1_13 */	/*ID BD2_2*/
-			0x038 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD14	=>	GPIO1_14 */	/*IO BD2_1*/
-			0x03C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD15	=>	GPIO1_15 */	/*IO BD2_2*/
-			
-			/** GPIO 2 */
-			0x0EC (PIN_OUTPUT | MUX_MODE7)			/*LCD_AC_BIAS_EN	=>	GPIO2_25*/	/*RS-485 for module DE control*/
-			0x0E4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_HSYNC		=>	GPIO2_23*/	/*RS-485 for module RE control*/
-			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK		=>	GPIO2_24*/	/*CCS communication board 1 proximity*/
-			0x0E0 (PIN_INPUT | MUX_MODE7)			/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
-			
-			/** GPIO 3 */
-			0x194 (PIN_INPUT | MUX_MODE7)			/*MCASP0_FSX		=>	GPIO3_15*/	/*Emergency Stop button detect*/
-			0x1A0 (PIN_INPUT | MUX_MODE7)			/*MCASP0_ACLKR	=>	GPIO3_18*/	/*USB1 OCP detect*/
-			0x19C (PIN_INPUT | MUX_MODE7)			/*MCASP0_AHCLKR	=>	GPIO3_17*/	/*Emergency IO for AM3352 and STM32F407*/
-			0x190 (PIN_OUTPUT | MUX_MODE7)			/*MCASP0_ACLKX	=>	GPIO3_14*/	/*Ethernet PHY reset*/
-			0x1A4 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_FSR		=>	GPIO3_19 */	/*SMR Enable control_1*/
-			0x198 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR0	=>	GPIO3_16 */	/*CSU board function OK indicator.*/
-			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*SMR Enable control_2*/
-			
-		>;
-	};
-	
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-#if 1
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-#endif
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)		/* uart0_rxd	=>	uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd	=>	uart0_txd */
-		>;
-	};
-	
-	uart1_pins: pinmux_uart1_pins {
-		pinctrl-single,pins = <
-			0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) 		/* uart1_txd	=>	uart1_txd */
-			0x180 (PIN_INPUT_PULLUP | MUX_MODE0)			/* uart1_rxd	=>	uart1_rxd */
-		>;
-	};
-
-	uart2_pins: pinmux_uart2_pins {
-		pinctrl-single,pins = <
-			0x150 (PIN_INPUT_PULLUP | MUX_MODE1)			/* SPI0_SCLK	=>	UART2_RXD */
-			0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)		/* SPI0_D0	=>	UART2_TXD */
-		>;
-	};
-	
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT_PULLUP | MUX_MODE1)		/* SPI0_CS1				=>	uart3_rxd */
-			0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* ECAP0_IN_PWM0_OUT		=>	uart3_txd */
-		>;
-	};
-
-	uart5_pins: pinmux_uart5_pins {
-		pinctrl-single,pins = <
-			0x0C0 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)		/* LCD_DATA8	=>	DUART5_TX*/
-			0x0C4 (PIN_INPUT_PULLUP | MUX_MODE4)			/* LCD_DATA9	=>	UART5_RX*/
-		>;
-	};
-	
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_default: nandflash_pins_default {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_31 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	nandflash_pins_sleep: nandflash_pins_sleep {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0xc (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x10 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x18 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x1c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x70 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x74 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x7c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x90 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x94 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x9c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <					
-		
-			/* Slave 1 */
-			0x108 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_COL.gmii1_col */
-			0x10C(PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
-			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
-			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
-			0x134 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
-			0x138 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
-			0x13c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
-			0x140 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd0.rgmii1_rd0 */	
-			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txen.mii1_txen */
-			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
-			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
-			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      	
-			
-			/* Slave 2 */
-			AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_ben1.mii2_col */
-			AM33XX_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE2)					/* GPMC_CSn3.rmii2_crs_dv*/								
-			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE1)*/					/* gpmc_wpn.mii2_rxerr */
-			AM33XX_IOPAD(0x858, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a6.mii2_txclk */
-			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a7.mii2_rxclk */
-			AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a1.mii2_rxdv */
-			AM33XX_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a8.mii2_rxd3 */
-			AM33XX_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a9.mii2_rxd2 */
-			AM33XX_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a10.mii2_rxd1 */
-			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a11.mii2_rxd0 */
-			AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a0.mii2_txen */
-			AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a2.mii2_txd3 */
-			AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a3.mii2_txd2 */
-			AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a4.mii2_txd1 */
-			AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a5.mii2_txd0 */
-
-		>;
-	};
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-			/* Slave 1 reset value */
-			0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)		
-			
-			/* Slave 2 */
-			AM33XX_IOPAD(0x888, PIN_INPUT_PULLDOWN | MUX_MODE7)					/* GPMC_CSn3.rmii2_crs_dv*/	
-			AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a0.mii2_txen */
-			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a1.mii2_rxdv */
-			AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a2.mii2_txd3 */
-			AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7)			/* gpmc_a3.mii2_txd2 */
-			AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a4.mii2_txd1 */
-			AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a5.mii2_txd0 */
-			AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.mii2_txclk */
-			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a7.mii2_rxclk */
-			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a8.mii2_rxd3 */
-			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.mii2_rxd2 */
-			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.mii2_rxd1 */
-			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.mii2_rxd0 */
-			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE7)*/	/* gpmc_wpn.mii2_rxerr */
-			AM33XX_IOPAD(0x878, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ben1.mii2_col */
-			
-		>;
-	};
-
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_cmd.mmc0_cmd */
-			0x1AC (PIN_INPUT_PULLUP | MUX_MODE7)	/* MCASP0_AHCLKX.GPIO3_21 */
-		>;
-	};
-
-	dcan0_pins_default: dcan0_pins_default {
-		pinctrl-single,pins = <		
-			0x178 (PIN_OUTPUT_PULLUP | MUX_MODE2)			/* uart1_ctsn	=>	d_can0_tx */
-			0x17C (PIN_INPUT_PULLDOWN | MUX_MODE2)		/* uart1_rtsn	=>	d_can0_rx */
-		>;
-	};
-	
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x168 (PIN_OUTPUT_PULLUP | MUX_MODE2)		/* UART0_CTSn		=>	d_can1_tx */
-			0x16C (PIN_INPUT_PULLDOWN | MUX_MODE2)	/* UART0_RTSn		=>	d_can1_rx */
-		>;
-	};
-#if 0
-	ehrpwm1_pins: ehrpwm1_pins {
-		pinctrl-single,pins = <			
-			0x0C8 (PIN_OUTPUT | MUX_MODE2) /* LCD_DATA10.eHRPWM1A */
-		>;
-	};
-	
-	ehrpwm2_pins: ehrpwm2_pins {
-		pinctrl-single,pins =< 
-			0x0A4 (PIN_OUTPUT | MUX_MODE3)	/* LCD_DATA1.eHRPWM2B */
-		>;                
-    };	
-	 
-#endif  
-};
-
-
-/******************** Peripheral Init ********************/			
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>;
-
-	status = "okay";
-};
-
-&uart2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart2_pins>;
-
-	status = "okay";
-};
-
-&uart3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart3_pins>;
-
-	status = "okay";
-};
-
-&uart5 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart5_pins>;
-
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-	
-/*	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };*/	
-};
-#if 1
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };
-};
-#endif
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-#if 0
-&epwmss1 {
-	status = "okay";      
-
-	ehrpwm1: pwm@48302200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm1_pins>;
-	};
-};
-
-&epwmss2 {
-	status = "okay";   
-
-	ehrpwm2: pwm@48304200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm2_pins>;
-	};	   
-};
-#endif
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&nandflash_pins_default>;
-	pinctrl-1 = <&nandflash_pins_sleep>;
-	/*ranges = <0 0 0x08000000 0x10000000>;*/	/* CS0: NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		compatible = "ti,omap2-nand";
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		interrupt-parent = <&gpmc>;
-		interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
-                    <1 IRQ_TYPE_NONE>;	/* termcount */
-		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1378000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	dual_emac = <1>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-};
-
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
- 	phy-mode = "mii";
- 	dual_emac_res_vlan = <1>;
-};
-
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <2>;
- 	phy-mode = "mii";
- 	dual_emac_res_vlan = <2>;
-};
-
-&tscadc {
-	status = "okay";
-	/*tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-	};*/
-
-	adc {
-		ti,adc-channels = <0 1 2 3 4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&wkup_m3 {
-	ti,scale-data-fw = "am335x-evm-scale-data.bin";
-};
-
-&dcan0 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan0_pins_default>;
-};
-
-&dcan1 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};

+ 0 - 712
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[DW25]am335x-evm.dts

@@ -1,712 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- 
-#define PIN_OUTPUT		(PULL_DISABLE)
-#define PIN_OUTPUT_PULLUP	(PULL_UP)
-#define PIN_OUTPUT_PULLDOWN	0
-#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
-#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
-#define PIN_INPUT_PULLDOWN	(INPUT_EN)
-
-
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		/*reg = <0x80000000 0x10000000>;*/ /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-	/* +++ vern,ramdisk,20181030 +++*/
-	chosen {  
-		bootargs = "console=ttyS0,115200n8 root=/dev/ram0";  
-	};  
-	/* --- vern,ramdisk ,20181030 ---*/
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-};
-
-/******************** Pin Mux ********************/
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&InitialGPIO>; 
-	pinctrl-1 = <&clkout2_pin>;
-	
-	InitialGPIO: InitialGPIO {
-		pinctrl-single,pins = <
-		
-			/** Offset: 0x800 */
-			/** GPIO 0 */   
-			0x020 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD8			=> 	GPIO0_22 */	/*ID BD1_1*/
-			0x024 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD9			=>	GPIO0_23 */	/*ID BD1_2*/
-			0x028 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD10		=>	GPIO0_26 */	/*IO BD1_1*/
-			0x02C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD11		=>	GPIO0_27 */	/*IO BD1_2*/
-			0x144 (PIN_INPUT | MUX_MODE7)    			/* RMII1_REF_CLK		=>	GPIO0_29 */	/*USB 0 OCP detection*/
-			0x1B0 (PIN_OUTPUT | MUX_MODE7)			/*XDMA_EVENT_INTR0	=>	GPIO0_19 */	/*AM_RFID_RST*/
-			0x1B4 (PIN_INPUT | MUX_MODE7)			/*XDMA_EVENT_INTR1	=>	GPIO0_20 */	/*AM_RFID_ICC*/
-			
-			/** GPIO 1 */
-			0x030 (PIN_INPUT | MUX_MODE7)			/* GPMC_AD12	=> 	GPIO1_12 */	/*ID BD2_1*/
-			0x034 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD13	=>	GPIO1_13 */	/*ID BD2_2*/
-			0x038 (PIN_INPUT | MUX_MODE7)    			/* GPMC_AD14	=>	GPIO1_14 */	/*IO BD2_1*/
-			0x03C (PIN_INPUT | MUX_MODE7)    		/* GPMC_AD15	=>	GPIO1_15 */	/*IO BD2_2*/
-			
-			/** GPIO 2 */
-			0x0EC (PIN_OUTPUT | MUX_MODE7)			/*LCD_AC_BIAS_EN	=>	GPIO2_25*/	/*RS-485 for module DE control*/
-			0x0E4 (PIN_OUTPUT | MUX_MODE7)			/*LCD_HSYNC		=>	GPIO2_23*/	/*RS-485 for module RE control*/
-			0x0E8 (PIN_INPUT | MUX_MODE7)			/*LCD_PCLK		=>	GPIO2_24*/	/*CCS communication board 1 proximity*/
-			0x0E0 (PIN_INPUT | MUX_MODE7)			/*LCD_VSYNC		=>	GPIO2_22*/	/*CCS communication board 2 proximity*/
-			
-			/** GPIO 3 */
-			0x194 (PIN_INPUT | MUX_MODE7)			/*MCASP0_FSX		=>	GPIO3_15*/	/*Emergency Stop button detect*/
-			0x1A0 (PIN_INPUT | MUX_MODE7)			/*MCASP0_ACLKR	=>	GPIO3_18*/	/*USB1 OCP detect*/
-			0x19C (PIN_INPUT | MUX_MODE7)			/*MCASP0_AHCLKR	=>	GPIO3_17*/	/*Emergency IO for AM3352 and STM32F407*/
-			0x190 (PIN_OUTPUT | MUX_MODE7)			/*MCASP0_ACLKX	=>	GPIO3_14*/	/*Ethernet PHY reset*/
-			0x1A4 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_FSR		=>	GPIO3_19 */	/*SMR Enable control_1*/
-			0x198 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR0	=>	GPIO3_16 */	/*CSU board function OK indicator.*/
-			0x1A8 (PIN_OUTPUT | MUX_MODE7)			/* MCASP0_AXR1	=>	GPIO3_20 */	/*SMR Enable control_2*/
-			
-		>;
-	};
-	
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-#if 1
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-#endif
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)		/* uart0_rxd	=>	uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd	=>	uart0_txd */
-		>;
-	};
-	
-	uart1_pins: pinmux_uart1_pins {
-		pinctrl-single,pins = <
-			0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0) 		/* uart1_txd	=>	uart1_txd */
-			0x180 (PIN_INPUT_PULLUP | MUX_MODE0)			/* uart1_rxd	=>	uart1_rxd */
-		>;
-	};
-
-	uart2_pins: pinmux_uart2_pins {
-		pinctrl-single,pins = <
-			0x150 (PIN_INPUT_PULLUP | MUX_MODE1)			/* SPI0_SCLK	=>	UART2_RXD */
-			0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)		/* SPI0_D0	=>	UART2_TXD */
-		>;
-	};
-	
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT_PULLUP | MUX_MODE1)		/* SPI0_CS1				=>	uart3_rxd */
-			0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* ECAP0_IN_PWM0_OUT		=>	uart3_txd */
-		>;
-	};
-
-	uart5_pins: pinmux_uart5_pins {
-		pinctrl-single,pins = <
-			0x0C0 (PIN_OUTPUT_PULLDOWN | MUX_MODE4)		/* LCD_DATA8	=>	DUART5_TX*/
-			0x0C4 (PIN_INPUT_PULLUP | MUX_MODE4)			/* LCD_DATA9	=>	UART5_RX*/
-		>;
-	};
-	
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_default: nandflash_pins_default {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_31 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	nandflash_pins_sleep: nandflash_pins_sleep {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0xc (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x10 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x18 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x1c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x70 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x74 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x7c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x90 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x94 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x9c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <					
-		
-			/* Slave 1 */
-			0x108 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_COL.gmii1_col */
-			0x10C(PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_CRS.MII1_CRS */
-			0x110 (PIN_INPUT_PULLUP | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x12c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
-			0x130 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x118 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
-			0x134 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
-			0x138 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
-			0x13c (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
-			0x140 (PIN_INPUT_PULLUP | MUX_MODE0)		/* mii1_rxd0.rgmii1_rd0 */	
-			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txen.mii1_txen */
-			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
-			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
-			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      	
-			
-			/* Slave 2 */
-			AM33XX_IOPAD(0x878, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_ben1.mii2_col */
-			AM33XX_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE2)					/* GPMC_CSn3.rmii2_crs_dv*/								
-			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLUP | MUX_MODE1)*/					/* gpmc_wpn.mii2_rxerr */
-			AM33XX_IOPAD(0x858, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a6.mii2_txclk */
-			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a7.mii2_rxclk */
-			AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a1.mii2_rxdv */
-			AM33XX_IOPAD(0x860, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a8.mii2_rxd3 */
-			AM33XX_IOPAD(0x864, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a9.mii2_rxd2 */
-			AM33XX_IOPAD(0x868, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a10.mii2_rxd1 */
-			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLUP | MUX_MODE1)					/* gpmc_a11.mii2_rxd0 */
-			AM33XX_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a0.mii2_txen */
-			AM33XX_IOPAD(0x848, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a2.mii2_txd3 */
-			AM33XX_IOPAD(0x84c, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a3.mii2_txd2 */
-			AM33XX_IOPAD(0x850, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a4.mii2_txd1 */
-			AM33XX_IOPAD(0x854, PIN_OUTPUT_PULLDOWN | MUX_MODE1)				/* gpmc_a5.mii2_txd0 */
-
-		>;
-	};
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-			/* Slave 1 reset value */
-			0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)		
-			
-			/* Slave 2 */
-			AM33XX_IOPAD(0x888, PIN_INPUT_PULLDOWN | MUX_MODE7)					/* GPMC_CSn3.rmii2_crs_dv*/	
-			AM33XX_IOPAD(0x840, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a0.mii2_txen */
-			AM33XX_IOPAD(0x844, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a1.mii2_rxdv */
-			AM33XX_IOPAD(0x848, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a2.mii2_txd3 */
-			AM33XX_IOPAD(0x84c, PIN_INPUT_PULLDOWN | MUX_MODE7)			/* gpmc_a3.mii2_txd2 */
-			AM33XX_IOPAD(0x850, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a4.mii2_txd1 */
-			AM33XX_IOPAD(0x854, PIN_INPUT_PULLDOWN | MUX_MODE7)				/* gpmc_a5.mii2_txd0 */
-			AM33XX_IOPAD(0x858, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.mii2_txclk */
-			AM33XX_IOPAD(0x85c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a7.mii2_rxclk */
-			AM33XX_IOPAD(0x860, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a8.mii2_rxd3 */
-			AM33XX_IOPAD(0x864, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.mii2_rxd2 */
-			AM33XX_IOPAD(0x868, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.mii2_rxd1 */
-			AM33XX_IOPAD(0x86c, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.mii2_rxd0 */
-			/*AM33XX_IOPAD(0x874, PIN_INPUT_PULLDOWN | MUX_MODE7)*/	/* gpmc_wpn.mii2_rxerr */
-			AM33XX_IOPAD(0x878, PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_ben1.mii2_col */
-			
-		>;
-	};
-
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    	/* mmc0_cmd.mmc0_cmd */
-			0x1AC (PIN_INPUT_PULLUP | MUX_MODE7)	/* MCASP0_AHCLKX.GPIO3_21 */
-		>;
-	};
-
-	dcan0_pins_default: dcan0_pins_default {
-		pinctrl-single,pins = <		
-			0x178 (PIN_OUTPUT_PULLUP | MUX_MODE2)			/* uart1_ctsn	=>	d_can0_tx */
-			0x17C (PIN_INPUT_PULLDOWN | MUX_MODE2)		/* uart1_rtsn	=>	d_can0_rx */
-		>;
-	};
-	
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x168 (PIN_OUTPUT_PULLUP | MUX_MODE2)		/* UART0_CTSn		=>	d_can1_tx */
-			0x16C (PIN_INPUT_PULLDOWN | MUX_MODE2)	/* UART0_RTSn		=>	d_can1_rx */
-		>;
-	};
-#if 0
-	ehrpwm1_pins: ehrpwm1_pins {
-		pinctrl-single,pins = <			
-			0x0C8 (PIN_OUTPUT | MUX_MODE2) /* LCD_DATA10.eHRPWM1A */
-		>;
-	};
-	
-	ehrpwm2_pins: ehrpwm2_pins {
-		pinctrl-single,pins =< 
-			0x0A4 (PIN_OUTPUT | MUX_MODE3)	/* LCD_DATA1.eHRPWM2B */
-		>;                
-    };	
-	 
-#endif  
-};
-
-
-/******************** Peripheral Init ********************/			
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>;
-
-	status = "okay";
-};
-
-&uart2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart2_pins>;
-
-	status = "okay";
-};
-
-&uart3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart3_pins>;
-
-	status = "okay";
-};
-
-&uart5 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart5_pins>;
-
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-	
-/*	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };
-*/	
-};
-#if 1
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-	
-	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };
-};
-#endif
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-#if 0
-&epwmss1 {
-	status = "okay";      
-
-	ehrpwm1: pwm@48302200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm1_pins>;
-	};
-};
-
-&epwmss2 {
-	status = "okay";   
-
-	ehrpwm2: pwm@48304200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm2_pins>;
-	};	   
-};
-#endif
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&nandflash_pins_default>;
-	pinctrl-1 = <&nandflash_pins_sleep>;
-	/*ranges = <0 0 0x08000000 0x10000000>;*/	/* CS0: NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		compatible = "ti,omap2-nand";
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		interrupt-parent = <&gpmc>;
-		interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
-                    <1 IRQ_TYPE_NONE>;	/* termcount */
-		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1378000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	dual_emac = <1>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-};
-
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
- 	phy-mode = "mii";
- 	dual_emac_res_vlan = <1>;
-};
-
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <2>;
- 	phy-mode = "mii";
- 	dual_emac_res_vlan = <2>;
-};
-
-&tscadc {
-	status = "okay";
-	/*tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-	};*/
-
-	adc {
-		ti,adc-channels = <0 1 2 3 4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio3 21 GPIO_ACTIVE_LOW>;
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&wkup_m3 {
-	ti,scale-data-fw = "am335x-evm-scale-data.bin";
-};
-
-&dcan0 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan0_pins_default>;
-};
-
-&dcan1 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};

+ 0 - 731
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/arch/arm/boot/dts/[Economic]am335x-evm.dts

@@ -1,731 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- 
-#define PIN_OUTPUT		(PULL_DISABLE)
-#define PIN_OUTPUT_PULLUP	(PULL_UP)
-#define PIN_OUTPUT_PULLDOWN	0
-#define PIN_INPUT		(INPUT_EN | PULL_DISABLE)
-#define PIN_INPUT_PULLUP	(INPUT_EN | PULL_UP)
-#define PIN_INPUT_PULLDOWN	(INPUT_EN)
-
-
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		/*reg = <0x80000000 0x10000000>;*/ /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-	/* +++ vern,ramdisk,20181030 +++*/
-	chosen {  
-		bootargs = "console=ttyS0,115200n8 root=/dev/ram0";  
-	};  
-	/* --- vern,ramdisk ,20181030 ---*/
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-};
-
-/******************** Pin Mux ********************/
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&InitialGPIO>; 
-	pinctrl-1 = <&clkout2_pin>;
-	
-	InitialGPIO: InitialGPIO {
-		pinctrl-single,pins = <
-		
-			/** Offset: 0x800 */
-			/** GPIO 0 */   
-			0x150 (PIN_OUTPUT | MUX_MODE7)	/* SPI0_SCLK.GPIO0_2 */
-			0x154 (PIN_INPUT | MUX_MODE7)	/* SPI0_D0.GPIO0_3 */
-			0x0D0 (PIN_INPUT | MUX_MODE7)	/* LCD_DATA12.GPIO0_8*/
-			0x0D4 (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA13.GPIO0_9*/
-			0x0DC (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA15.GPIO0_11*/
-			0x1B0 (PIN_INPUT | MUX_MODE7)	/* XDMA_EVENT_INTR0.GPIO0_19 */
-			0x1B4 (PIN_INPUT | MUX_MODE7)	/* XDMA_EVENT_INTR1.GPIO0_20 */
-			
-			/** GPIO 1 */
-			0x030 (PIN_INPUT | MUX_MODE7)	/* GPMC_AD12.GPIO1_12*/
-			0x034 (PIN_OUTPUT | MUX_MODE7)	/* GPMC_AD13.GPIO1_13*/
-			0x038 (PIN_INPUT | MUX_MODE7)	/* GPMC_AD14.GPIO1_14*/
-			0x03C (PIN_OUTPUT | MUX_MODE7)	/* GPMC_AD15.GPIO1_15*/
-			0x078 (PIN_INPUT | MUX_MODE7)	/* GPMC_BEn1.GPIO1_28*/
-			
-			/** GPIO 2 */
-			0x088 (PIN_INPUT | MUX_MODE7)	/* GPMC_CSn3.GPIO2_0*/
-			0x0A0 (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA0.GPIO2_6*/
-			0x0AC (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA3.GPIO2_9*/
-			0x0B0 (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA4.GPIO2_10*/
-			0x0B4 (PIN_INPUT | MUX_MODE7)	/* LCD_DATA5.GPIO2_11*/
-			0x0B8 (PIN_INPUT | MUX_MODE7)	/* LCD_DATA6.GPIO2_12*/
-			0x0BC (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA7.GPIO2_13*/
-			0x0C0 (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA8.GPIO2_14*/
-			0x0C4 (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA9.GPIO2_15*/
-			0x0CC (PIN_OUTPUT | MUX_MODE7)	/* LCD_DATA11.GPIO2_17*/
-			0x0E0 (PIN_INPUT | MUX_MODE7)	/* LCD_VSYNC.GPIO2_22*/
-			0x0E4 (PIN_INPUT | MUX_MODE7)	/* LCD_HSYNC.GPIO2_23*/
-			0x0E8 (PIN_INPUT | MUX_MODE7)	/* LCD_PCLK.GPIO2_24*/
-			0x0EC (PIN_INPUT | MUX_MODE7)	/* LCD_AC_BIAS_EN.GPIO2_25*/
-			
-			/** GPIO 3 */
-			0x108 (PIN_OUTPUT | MUX_MODE7)	/* MII1_COL.GPIO3_0 */
-			0x1A0 (PIN_OUTPUT | MUX_MODE7)	/* MCASP0_ACLKR.GPIO3_18 */
-			0x1A4 (PIN_OUTPUT | MUX_MODE7)	/* MCASP0_FSR.GPIO3_19 */
-			0x1A8 (PIN_INPUT | MUX_MODE7)	/* MCASP0_AXR1.GPIO3_20 */
-			0x1AC (PIN_OUTPUT | MUX_MODE7)	/* MCASP0_AHCLKX.GPIO3_21 */
-		>;
-	};
-	
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
-		>;
-	};
-
-	uart2_pins: pinmux_uart2_pins {
-		pinctrl-single,pins = <
-			0x10C (PIN_INPUT_PULLUP | MUX_MODE6)	/* MII1_CRS.AM_UART2_RXD */
-			0x110 (PIN_OUTPUT_PULLDOWN | MUX_MODE6)	/* MII1_RX_ER.AM_UART2_TXD */
-		>;
-	};
-	
-	uart3_pins: pinmux_uart3_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT_PULLUP | MUX_MODE1)	/* SPI0_CS1.uart3_rxd */
-			0x164 (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* ECAP0_IN_PWM0_OUT.uart3_txd */
-		>;
-	};
-	
-	uart4_pins: pinmux_uart4_pins {
-		pinctrl-single,pins = <
-			0x168 (PIN_INPUT_PULLUP | MUX_MODE1)	/* UART0_CTSn.uart4_rxd */
-			0x16C (PIN_OUTPUT_PULLDOWN | MUX_MODE1)	/* UART0_RTSn.uart4_txd */
-		>;
-	};
-	
-	uart5_pins: pinmux_uart5_pins {
-		pinctrl-single,pins = <
-			0x0D8 (PIN_INPUT_PULLUP | MUX_MODE4)	/* LCD_DATA14.UART5_RXD */
-			0x144 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* RMII1_REF_CLK.UART5_TXD*/
-		>;
-	};
-	
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_default: nandflash_pins_default {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	nandflash_pins_sleep: nandflash_pins_sleep {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x4 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x8 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0xc (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x10 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x18 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x1c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x70 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x74 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x7c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x90 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x94 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x98 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x9c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <			
-		
-			0x114 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (J16) gmii1_txen.rgmii1_tctl */
-		    0x118 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (J17) gmii1_rxdv.rgmii1_rctl */
-		    0x12c ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K18) gmii1_txclk.rgmii1_tclk */
-		    0x130 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L18) gmii1_rxclk.rgmii1_rclk */
-		    0x128 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K17) gmii1_txd0.rgmii1_td0 */
-		    0x124 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K16) gmii1_txd1.rgmii1_td1 */
-		    0x120 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K15) gmii1_txd2.rgmii1_td2 */
-		    0x11c ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (J18) gmii1_txd3.rgmii1_td3 */
-		    0x140 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (M16) gmii1_rxd0.rgmii1_rd0 */
-		    0x13c ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L15) gmii1_rxd1.rgmii1_rd1 */
-		    0x138 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L16) gmii1_rxd2.rgmii1_rd2 */
-		    0x134 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L17) gmii1_rxd3.rgmii1_rd3 */
-		    
-		    0x114 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (J16) gmii1_txen.rgmii1_tctl */
-		    0x118 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (J17) gmii1_rxdv.rgmii1_rctl */
-		    0x12c ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K18) gmii1_txclk.rgmii1_tclk */
-		    0x130 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L18) gmii1_rxclk.rgmii1_rclk */
-		    0x128 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K17) gmii1_txd0.rgmii1_td0 */
-		    0x124 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K16) gmii1_txd1.rgmii1_td1 */
-		    0x120 ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (K15) gmii1_txd2.rgmii1_td2 */
-		    0x11c ( PIN_OUTPUT_PULLDOWN | MUX_MODE2 )    /* (J18) gmii1_txd3.rgmii1_td3 */
-		    0x140 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (M16) gmii1_rxd0.rgmii1_rd0 */
-		    0x13c ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L15) gmii1_rxd1.rgmii1_rd1 */
-		    0x138 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L16) gmii1_rxd2.rgmii1_rd2 */
-		    0x134 ( PIN_INPUT_PULLDOWN | MUX_MODE2 )     /* (L17) gmii1_rxd3.rgmii1_rd3 */
-		>;
-	};
-
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-		
-			/* Slave 1 reset value */
-			0x114 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (J16) gmii1_txen.rgmii1_tctl */
-		    0x118 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (J17) gmii1_rxdv.rgmii1_rctl */
-		    0x12c ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (K18) gmii1_txclk.rgmii1_tclk */
-		    0x130 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (L18) gmii1_rxclk.rgmii1_rclk */
-		    0x128 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (K17) gmii1_txd0.rgmii1_td0 */
-		    0x124 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (K16) gmii1_txd1.rgmii1_td1 */
-		    0x120 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (K15) gmii1_txd2.rgmii1_td2 */
-		    0x11c ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (J18) gmii1_txd3.rgmii1_td3 */
-		    0x140 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (M16) gmii1_rxd0.rgmii1_rd0 */
-		    0x13c ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (L15) gmii1_rxd1.rgmii1_rd1 */
-		    0x138 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (L16) gmii1_rxd2.rgmii1_rd2 */
-		    0x134 ( PIN_INPUT_PULLDOWN | MUX_MODE7 )    /* (L17) gmii1_rxd3.rgmii1_rd3 */
-		>;
-	};
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_cmd.mmc0_cmd */
-			0x0A8 (PIN_INPUT | MUX_MODE7)	        /* LCD_DATA2.GPIO2_8 */
-		>;
-	};
-
-	mmc2_pins_default: pinmux_mmc2_pins {
-		pinctrl-single,pins = <
-			0x020 (PIN_INPUT_PULLUP | MUX_MODE2)    /* GPMC_AD8.AM_MMC1_DAT0 */
-			0x024 (PIN_INPUT_PULLUP | MUX_MODE2)    /* GPMC_AD9.AM_MMC1_DAT1 */
-			0x028 (PIN_INPUT_PULLUP | MUX_MODE2)    /* GPMC_AD10.AM_MMC1_DAT2 */
-			0x02C (PIN_INPUT_PULLUP | MUX_MODE2)    /* GPMC_AD11.AM_MMC1_DAT3 */
-			0x080 (PIN_INPUT_PULLUP | MUX_MODE2)    /* GPMC_CSn1.AM_MMC1_CLK */
-			0x084 (PIN_INPUT_PULLUP | MUX_MODE2)    /* GPMC_CSn2.AM_MMC1_CMD */
-			0x08C (PIN_INPUT | MUX_MODE7)	        /* GPMC_CLK.GPIO2_1 */
-		>;
-	};
-
-	dcan0_pins_default: dcan0_pins_default {
-		pinctrl-single,pins = <		
-			0x178 (PIN_OUTPUT_PULLUP | MUX_MODE2)			/* uart1_ctsn.d_can0_tx */
-			0x17C (PIN_INPUT_PULLDOWN | MUX_MODE2)	/* uart1_rtsn.d_can0_rx */
-		>;
-	};
-	
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x180 (PIN_OUTPUT_PULLUP | MUX_MODE2)		/* uart1_rxd.d_can1_tx */
-			0x184 (PIN_INPUT_PULLDOWN | MUX_MODE2) 	/* uart1_txd.d_can1_rx */
-		>;
-	};
-	
-	spi1_pins: spi1_pins {
-		pinctrl-single,pins = <
-			0x190 (PIN_INPUT_PULLUP | MUX_MODE3) /* MCASP0_ACLKX.AM_SPI1_SCLK */
-			0x194 (PIN_INPUT_PULLUP | MUX_MODE3) /* MCASP0_FSX.AM_SPI1_D0 */
-			0x198 (PIN_INPUT_PULLUP | MUX_MODE3) /* MCASP0_AXR0.AM_SPI1_D1 */
-			0x19C (PIN_INPUT_PULLUP | MUX_MODE3) /* MCASP0_AHCLKR.AM_SPI1_CS0 */
-		>;
-	};	
-	
-	ehrpwm1_pins: ehrpwm1_pins {
-		pinctrl-single,pins = <			
-			0x0C8 (PIN_OUTPUT | MUX_MODE2) /* LCD_DATA10.eHRPWM1A */
-		>;
-	};
-	
-	ehrpwm2_pins: ehrpwm2_pins {
-		pinctrl-single,pins =< 
-			0x0A4 (PIN_OUTPUT | MUX_MODE3)	/* LCD_DATA1.eHRPWM2B */
-		>;                
-    };	
-};
-
-
-
-/******************** Peripheral Init ********************/			
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart2 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart2_pins>;
-
-	status = "okay";
-};
-
-&uart3 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart3_pins>;
-
-	status = "okay";
-};
-
-&uart4 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart4_pins>;
-
-	status = "okay";
-};
-
-&uart5 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart5_pins>;
-
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-
-/*	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };*/
-};
-
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	rtc0: rtc@51 {
-                compatible = "nxp,pcf85063";
-                reg = <0x51>;
-        };
-};
-
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-
-&epwmss1 {
-	status = "okay";      
-
-	ehrpwm1: pwm@48302200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm1_pins>;
-	};
-};
-
-&epwmss2 {
-	status = "okay";   
-
-	ehrpwm2: pwm@48304200 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ehrpwm2_pins>;
-	};	   
-};
-
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&nandflash_pins_default>;
-	pinctrl-1 = <&nandflash_pins_sleep>;
-	/*ranges = <0 0 0x08000000 0x10000000>;*/	/* CS0: NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		compatible = "ti,omap2-nand";
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		interrupt-parent = <&gpmc>;
-		interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
-                    <1 IRQ_TYPE_NONE>;	/* termcount */
-		rb-gpios = <&gpmc 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1378000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	active_slave = <0>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-};
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <0>;
- 	phy-mode = "rgmii-txid";
-};
-
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <1>;
- 	phy-mode = "rgmii-txid";
-};
-
-&tscadc {
-	status = "okay";
-	/*tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-	};*/
-
-	adc {
-		ti,adc-channels = <0 1 2 3 4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
-};
-
-&mmc2 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc2_pins_default>;
-	cd-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&wkup_m3 {
-	ti,scale-data-fw = "am335x-evm-scale-data.bin";
-};
-
-&dcan0 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan0_pins_default>;
-};
-
-&dcan1 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};
-
-&spi1 {
-	status = "okay";	
-	pinctrl-names = "default";
-	pinctrl-0 = <&spi1_pins>;
-
-	spidev@1 {
-		spi-max-frequency = <24000000>;
-		reg = <0x0>;
-		compatible = "rohm,dh2228fv";
-	};	
-};

+ 0 - 802
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[AH-Luxury]am335x-evm.dts

@@ -1,802 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	chosen {
-		stdout-path = &uart0;
-		tick-timer = &timer2;
-	};
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		reg = <0x80000000 0x10000000>; /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-
-	wlan_en_reg: fixedregulator@2 {
-		compatible = "regulator-fixed";
-		regulator-name = "wlan-en-regulator";
-		regulator-min-microvolt = <1800000>;
-		regulator-max-microvolt = <1800000>;
-
-		/* WLAN_EN GPIO for this board - Bank1, pin16 */
-		gpio = <&gpio1 16 0>;
-
-		/* WLAN card specific delay */
-		startup-delay-us = <70000>;
-		enable-active-high;
-	};
-
-	matrix_keypad: matrix_keypad@0 {
-		compatible = "gpio-matrix-keypad";
-		debounce-delay-ms = <5>;
-		col-scan-delay-us = <2>;
-
-		row-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH		/* Bank1, pin25 */
-			     &gpio1 26 GPIO_ACTIVE_HIGH		/* Bank1, pin26 */
-			     &gpio1 27 GPIO_ACTIVE_HIGH>;	/* Bank1, pin27 */
-
-		col-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH		/* Bank1, pin21 */
-			     &gpio1 22 GPIO_ACTIVE_HIGH>;	/* Bank1, pin22 */
-
-		linux,keymap = <0x0000008b	/* MENU */
-				0x0100009e	/* BACK */
-				0x02000069	/* LEFT */
-				0x0001006a	/* RIGHT */
-				0x0101001c	/* ENTER */
-				0x0201006c>;	/* DOWN */
-	};
-
-	gpio_keys: volume_keys@0 {
-		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		autorepeat;
-
-		switch@9 {
-			label = "volume-up";
-			linux,code = <115>;
-			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
-			gpio-key,wakeup;
-		};
-
-		switch@10 {
-			label = "volume-down";
-			linux,code = <114>;
-			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
-			gpio-key,wakeup;
-		};
-	};
-
-	backlight {
-		compatible = "pwm-backlight";
-		pwms = <&ecap0 0 50000 0>;
-		brightness-levels = <0 51 53 56 62 75 101 152 255>;
-		default-brightness-level = <8>;
-	};
-
-	panel {
-		compatible = "ti,tilcdc,panel";
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&lcd_pins_s0>;
-		panel-info {
-			ac-bias           = <255>;
-			ac-bias-intrpt    = <0>;
-			dma-burst-sz      = <16>;
-			bpp               = <32>;
-			fdd               = <0x80>;
-			sync-edge         = <0>;
-			sync-ctrl         = <1>;
-			raster-order      = <0>;
-			fifo-th           = <0>;
-		};
-
-		display-timings {
-			800x480p62 {
-				clock-frequency = <30000000>;
-				hactive = <800>;
-				vactive = <480>;
-				hfront-porch = <39>;
-				hback-porch = <39>;
-				hsync-len = <47>;
-				vback-porch = <29>;
-				vfront-porch = <13>;
-				vsync-len = <2>;
-				hsync-active = <1>;
-				vsync-active = <1>;
-			};
-		};
-	};
-
-	sound {
-		compatible = "ti,da830-evm-audio";
-		ti,model = "AM335x-EVM";
-		ti,audio-codec = <&tlv320aic3106>;
-		ti,mcasp-controller = <&mcasp1>;
-		ti,codec-clock-rate = <12000000>;
-		ti,audio-routing =
-			"Headphone Jack",       "HPLOUT",
-			"Headphone Jack",       "HPROUT",
-			"LINE1L",               "Line In",
-			"LINE1R",               "Line In";
-	};
-};
-
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0 &clkout2_pin>;
-
-	matrix_keypad_s0: matrix_keypad_s0 {
-		pinctrl-single,pins = <
-			0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a5.gpio1_21 */
-			0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.gpio1_22 */
-			0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.gpio1_25 */
-			0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.gpio1_26 */
-			0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.gpio1_27 */
-		>;
-	};
-
-	volume_keys_s0: volume_keys_s0 {
-		pinctrl-single,pins = <
-			0x150 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* spi0_sclk.gpio0_2 */
-			0x154 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* spi0_d0.gpio0_3 */
-		>;
-	};
-
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
-		>;
-	};
-
-	uart1_pins: pinmux_uart1_pins {
-		pinctrl-single,pins = <
-			0x178 (PIN_INPUT | MUX_MODE0)		/* uart1_ctsn.uart1_ctsn */
-			0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_rtsn.uart1_rtsn */
-			0x180 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart1_rxd.uart1_rxd */
-			0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_txd.uart1_txd */
-		>;
-	};
-
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_s0: nandflash_pins_s0 {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	ecap0_pins: backlight_pins {
-		pinctrl-single,pins = <
-			0x164 0x0	/* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <
-			/* Slave 1 */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd0.rgmii1_rd0 */	
-			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txen.mii1_txen */
-			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
-			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
-			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      
-		>;
-	};
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-			/* Slave 1 reset value */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)		/* MII1_RX_ER.gmii1_rxerr */
-			//0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7)		/* MII1_COL.gmii1_col */
-			//0x10C (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* MII1_CRS.gmii1_crs */
-			0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	#if 0
-	mmc1_pins: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
-		>;
-	};
-	#endif
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_cmd.mmc0_cmd */
-			/*0x0A8 (PIN_INPUT | MUX_MODE7)*/	        /* LCD_DATA2.GPIO2_8 */
-			0x08C (PIN_INPUT | MUX_MODE7)	        /* GPMC_CLK.GPIO2_1 */
-		>;
-	};
-	mmc3_pins: pinmux_mmc3_pins {
-		pinctrl-single,pins = <
-			0x44 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a1.mmc2_dat0, INPUT_PULLUP | MODE3 */
-			0x48 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a2.mmc2_dat1, INPUT_PULLUP | MODE3 */
-			0x4C (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a3.mmc2_dat2, INPUT_PULLUP | MODE3 */
-			0x78 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_ben1.mmc2_dat3, INPUT_PULLUP | MODE3 */
-			0x88 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_csn3.mmc2_cmd, INPUT_PULLUP | MODE3 */
-			0x8C (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_clk.mmc2_clk, INPUT_PULLUP | MODE3 */
-		>;
-	};
-
-	wlan_pins: pinmux_wlan_pins {
-		pinctrl-single,pins = <
-			0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a0.gpio1_16 */
-			0x19C (PIN_INPUT | MUX_MODE7)		/* mcasp0_ahclkr.gpio3_17 */
-			0x1AC (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* mcasp0_ahclkx.gpio3_21 */
-		>;
-	};
-
-	lcd_pins_s0: lcd_pins_s0 {
-		pinctrl-single,pins = <
-			0x20 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad8.lcd_data23 */
-			0x24 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad9.lcd_data22 */
-			0x28 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad10.lcd_data21 */
-			0x2c (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad11.lcd_data20 */
-			0x30 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad12.lcd_data19 */
-			0x34 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad13.lcd_data18 */
-			0x38 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad14.lcd_data17 */
-			0x3c (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad15.lcd_data16 */
-			0xa0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data0.lcd_data0 */
-			0xa4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data1.lcd_data1 */
-			0xa8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data2.lcd_data2 */
-			0xac (PIN_OUTPUT | MUX_MODE0)		/* lcd_data3.lcd_data3 */
-			0xb0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data4.lcd_data4 */
-			0xb4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data5.lcd_data5 */
-			0xb8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data6.lcd_data6 */
-			0xbc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data7.lcd_data7 */
-			0xc0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data8.lcd_data8 */
-			0xc4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data9.lcd_data9 */
-			0xc8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data10.lcd_data10 */
-			0xcc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data11.lcd_data11 */
-			0xd0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data12.lcd_data12 */
-			0xd4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data13.lcd_data13 */
-			0xd8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data14.lcd_data14 */
-			0xdc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data15.lcd_data15 */
-			0xe0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_vsync.lcd_vsync */
-			0xe4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_hsync.lcd_hsync */
-			0xe8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_pclk.lcd_pclk */
-			0xec (PIN_OUTPUT | MUX_MODE0)		/* lcd_ac_bias_en.lcd_ac_bias_en */
-		>;
-	};
-#if 0
-	am335x_evm_audio_pins: am335x_evm_audio_pins {
-		pinctrl-single,pins = <
-			0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */
-			0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */
-			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
-		>;
-	};
-#endif
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x168 (PIN_OUTPUT | MUX_MODE2) /* uart0_ctsn.d_can1_tx */
-			0x16c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* uart0_rtsn.d_can1_rx */
-		>;
-	};
-};
-
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>;
-
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-};
-
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <100000>;
-
-	lis331dlh: lis331dlh@18 {
-		compatible = "st,lis331dlh", "st,lis3lv02d";
-		reg = <0x18>;
-		Vdd-supply = <&lis3_reg>;
-		Vdd_IO-supply = <&lis3_reg>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-		st,min-limit-x = <120>;
-		st,min-limit-y = <120>;
-		st,min-limit-z = <140>;
-		st,max-limit-x = <550>;
-		st,max-limit-y = <550>;
-		st,max-limit-z = <750>;
-	};
-
-	tsl2550: tsl2550@39 {
-		compatible = "taos,tsl2550";
-		reg = <0x39>;
-	};
-
-	tmp275: tmp275@48 {
-		compatible = "ti,tmp275";
-		reg = <0x48>;
-	};
-
-	tlv320aic3106: tlv320aic3106@1b {
-		compatible = "ti,tlv320aic3106";
-		reg = <0x1b>;
-		status = "okay";
-
-		/* Regulators */
-		AVDD-supply = <&vaux2_reg>;
-		IOVDD-supply = <&vaux2_reg>;
-		DRVDD-supply = <&vaux2_reg>;
-		DVDD-supply = <&vbat>;
-	};
-};
-
-&lcdc {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-
-&epwmss0 {
-	status = "okay";
-
-	ecap0: ecap@48300100 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ecap0_pins>;
-	};
-};
-
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default";
-	pinctrl-0 = <&nandflash_pins_s0>;
-	/*ranges = <0 0 0x08000000 0x1000000>;*/	/* CS0: 16MB for NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-#if 0
-&mcasp1 {
-		pinctrl-names = "default";
-		pinctrl-0 = <&am335x_evm_audio_pins>;
-
-		status = "okay";
-
-		op-mode = <0>;          /* MCASP_IIS_MODE */
-		tdm-slots = <2>;
-		/* 4 serializers */
-		serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
-			0 0 1 2
-		>;
-		tx-num-evt = <32>;
-		rx-num-evt = <32>;
-};
-#endif
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1312500>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-};
-
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
-	phy-mode = "mii";
-};
-
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <2>;
-	phy-mode = "mii";
-};
-
-&tscadc {
-	status = "okay";
-	tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-		ti,charge-delay = <0x400>;
-	};
-
-	adc {
-		ti,adc-channels = <4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
-};
-
-
-&mmc3 {
-	/* these are on the crossbar and are outlined in the
-	   xbar-event-map element */
-	dmas = <&edma 12
-		&edma 13>;
-	dma-names = "tx", "rx";
-	status = "okay";
-	vmmc-supply = <&wlan_en_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc3_pins &wlan_pins>;
-	ti,non-removable;
-	ti,needs-special-hs-handling;
-	cap-power-off-card;
-	keep-power-in-suspend;
-
-	#address-cells = <1>;
-	#size-cells = <0>;
-	wlcore: wlcore@0 {
-		compatible = "ti,wl1835";
-		reg = <2>;
-		interrupt-parent = <&gpio3>;
-		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
-	};
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&dcan1 {
-	status = "disabled";	/* Enable only if Profile 1 is selected */
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};

+ 0 - 802
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[DS60-210]am335x-evm.dts

@@ -1,802 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	chosen {
-		stdout-path = &uart0;
-		tick-timer = &timer2;
-	};
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		reg = <0x80000000 0x10000000>; /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-
-	wlan_en_reg: fixedregulator@2 {
-		compatible = "regulator-fixed";
-		regulator-name = "wlan-en-regulator";
-		regulator-min-microvolt = <1800000>;
-		regulator-max-microvolt = <1800000>;
-
-		/* WLAN_EN GPIO for this board - Bank1, pin16 */
-		gpio = <&gpio1 16 0>;
-
-		/* WLAN card specific delay */
-		startup-delay-us = <70000>;
-		enable-active-high;
-	};
-
-	matrix_keypad: matrix_keypad@0 {
-		compatible = "gpio-matrix-keypad";
-		debounce-delay-ms = <5>;
-		col-scan-delay-us = <2>;
-
-		row-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH		/* Bank1, pin25 */
-			     &gpio1 26 GPIO_ACTIVE_HIGH		/* Bank1, pin26 */
-			     &gpio1 27 GPIO_ACTIVE_HIGH>;	/* Bank1, pin27 */
-
-		col-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH		/* Bank1, pin21 */
-			     &gpio1 22 GPIO_ACTIVE_HIGH>;	/* Bank1, pin22 */
-
-		linux,keymap = <0x0000008b	/* MENU */
-				0x0100009e	/* BACK */
-				0x02000069	/* LEFT */
-				0x0001006a	/* RIGHT */
-				0x0101001c	/* ENTER */
-				0x0201006c>;	/* DOWN */
-	};
-
-	gpio_keys: volume_keys@0 {
-		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		autorepeat;
-
-		switch@9 {
-			label = "volume-up";
-			linux,code = <115>;
-			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
-			gpio-key,wakeup;
-		};
-
-		switch@10 {
-			label = "volume-down";
-			linux,code = <114>;
-			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
-			gpio-key,wakeup;
-		};
-	};
-
-	backlight {
-		compatible = "pwm-backlight";
-		pwms = <&ecap0 0 50000 0>;
-		brightness-levels = <0 51 53 56 62 75 101 152 255>;
-		default-brightness-level = <8>;
-	};
-
-	panel {
-		compatible = "ti,tilcdc,panel";
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&lcd_pins_s0>;
-		panel-info {
-			ac-bias           = <255>;
-			ac-bias-intrpt    = <0>;
-			dma-burst-sz      = <16>;
-			bpp               = <32>;
-			fdd               = <0x80>;
-			sync-edge         = <0>;
-			sync-ctrl         = <1>;
-			raster-order      = <0>;
-			fifo-th           = <0>;
-		};
-
-		display-timings {
-			800x480p62 {
-				clock-frequency = <30000000>;
-				hactive = <800>;
-				vactive = <480>;
-				hfront-porch = <39>;
-				hback-porch = <39>;
-				hsync-len = <47>;
-				vback-porch = <29>;
-				vfront-porch = <13>;
-				vsync-len = <2>;
-				hsync-active = <1>;
-				vsync-active = <1>;
-			};
-		};
-	};
-
-	sound {
-		compatible = "ti,da830-evm-audio";
-		ti,model = "AM335x-EVM";
-		ti,audio-codec = <&tlv320aic3106>;
-		ti,mcasp-controller = <&mcasp1>;
-		ti,codec-clock-rate = <12000000>;
-		ti,audio-routing =
-			"Headphone Jack",       "HPLOUT",
-			"Headphone Jack",       "HPROUT",
-			"LINE1L",               "Line In",
-			"LINE1R",               "Line In";
-	};
-};
-
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0 &clkout2_pin>;
-
-	matrix_keypad_s0: matrix_keypad_s0 {
-		pinctrl-single,pins = <
-			0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a5.gpio1_21 */
-			0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.gpio1_22 */
-			0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.gpio1_25 */
-			0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.gpio1_26 */
-			0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.gpio1_27 */
-		>;
-	};
-
-	volume_keys_s0: volume_keys_s0 {
-		pinctrl-single,pins = <
-			0x150 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* spi0_sclk.gpio0_2 */
-			0x154 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* spi0_d0.gpio0_3 */
-		>;
-	};
-
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
-		>;
-	};
-
-	uart1_pins: pinmux_uart1_pins {
-		pinctrl-single,pins = <
-			0x178 (PIN_INPUT | MUX_MODE0)		/* uart1_ctsn.uart1_ctsn */
-			0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_rtsn.uart1_rtsn */
-			0x180 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart1_rxd.uart1_rxd */
-			0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_txd.uart1_txd */
-		>;
-	};
-
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_s0: nandflash_pins_s0 {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	ecap0_pins: backlight_pins {
-		pinctrl-single,pins = <
-			0x164 0x0	/* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <
-			/* Slave 1 */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd0.rgmii1_rd0 */	
-			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txen.mii1_txen */
-			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
-			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
-			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      
-		>;
-	};
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-			/* Slave 1 reset value */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)		/* MII1_RX_ER.gmii1_rxerr */
-			//0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7)		/* MII1_COL.gmii1_col */
-			//0x10C (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* MII1_CRS.gmii1_crs */
-			0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	#if 0
-	mmc1_pins: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
-		>;
-	};
-	#endif
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_cmd.mmc0_cmd */
-			/*0x0A8 (PIN_INPUT | MUX_MODE7)*/	        /* LCD_DATA2.GPIO2_8 */
-			0x08C (PIN_INPUT | MUX_MODE7)	        /* GPMC_CLK.GPIO2_1 */
-		>;
-	};
-	mmc3_pins: pinmux_mmc3_pins {
-		pinctrl-single,pins = <
-			0x44 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a1.mmc2_dat0, INPUT_PULLUP | MODE3 */
-			0x48 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a2.mmc2_dat1, INPUT_PULLUP | MODE3 */
-			0x4C (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a3.mmc2_dat2, INPUT_PULLUP | MODE3 */
-			0x78 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_ben1.mmc2_dat3, INPUT_PULLUP | MODE3 */
-			0x88 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_csn3.mmc2_cmd, INPUT_PULLUP | MODE3 */
-			0x8C (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_clk.mmc2_clk, INPUT_PULLUP | MODE3 */
-		>;
-	};
-
-	wlan_pins: pinmux_wlan_pins {
-		pinctrl-single,pins = <
-			0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a0.gpio1_16 */
-			0x19C (PIN_INPUT | MUX_MODE7)		/* mcasp0_ahclkr.gpio3_17 */
-			0x1AC (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* mcasp0_ahclkx.gpio3_21 */
-		>;
-	};
-
-	lcd_pins_s0: lcd_pins_s0 {
-		pinctrl-single,pins = <
-			0x20 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad8.lcd_data23 */
-			0x24 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad9.lcd_data22 */
-			0x28 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad10.lcd_data21 */
-			0x2c (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad11.lcd_data20 */
-			0x30 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad12.lcd_data19 */
-			0x34 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad13.lcd_data18 */
-			0x38 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad14.lcd_data17 */
-			0x3c (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad15.lcd_data16 */
-			0xa0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data0.lcd_data0 */
-			0xa4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data1.lcd_data1 */
-			0xa8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data2.lcd_data2 */
-			0xac (PIN_OUTPUT | MUX_MODE0)		/* lcd_data3.lcd_data3 */
-			0xb0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data4.lcd_data4 */
-			0xb4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data5.lcd_data5 */
-			0xb8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data6.lcd_data6 */
-			0xbc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data7.lcd_data7 */
-			0xc0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data8.lcd_data8 */
-			0xc4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data9.lcd_data9 */
-			0xc8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data10.lcd_data10 */
-			0xcc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data11.lcd_data11 */
-			0xd0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data12.lcd_data12 */
-			0xd4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data13.lcd_data13 */
-			0xd8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data14.lcd_data14 */
-			0xdc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data15.lcd_data15 */
-			0xe0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_vsync.lcd_vsync */
-			0xe4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_hsync.lcd_hsync */
-			0xe8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_pclk.lcd_pclk */
-			0xec (PIN_OUTPUT | MUX_MODE0)		/* lcd_ac_bias_en.lcd_ac_bias_en */
-		>;
-	};
-#if 0
-	am335x_evm_audio_pins: am335x_evm_audio_pins {
-		pinctrl-single,pins = <
-			0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */
-			0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */
-			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
-		>;
-	};
-#endif
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x168 (PIN_OUTPUT | MUX_MODE2) /* uart0_ctsn.d_can1_tx */
-			0x16c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* uart0_rtsn.d_can1_rx */
-		>;
-	};
-};
-
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>;
-
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-};
-
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <100000>;
-
-	lis331dlh: lis331dlh@18 {
-		compatible = "st,lis331dlh", "st,lis3lv02d";
-		reg = <0x18>;
-		Vdd-supply = <&lis3_reg>;
-		Vdd_IO-supply = <&lis3_reg>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-		st,min-limit-x = <120>;
-		st,min-limit-y = <120>;
-		st,min-limit-z = <140>;
-		st,max-limit-x = <550>;
-		st,max-limit-y = <550>;
-		st,max-limit-z = <750>;
-	};
-
-	tsl2550: tsl2550@39 {
-		compatible = "taos,tsl2550";
-		reg = <0x39>;
-	};
-
-	tmp275: tmp275@48 {
-		compatible = "ti,tmp275";
-		reg = <0x48>;
-	};
-
-	tlv320aic3106: tlv320aic3106@1b {
-		compatible = "ti,tlv320aic3106";
-		reg = <0x1b>;
-		status = "okay";
-
-		/* Regulators */
-		AVDD-supply = <&vaux2_reg>;
-		IOVDD-supply = <&vaux2_reg>;
-		DRVDD-supply = <&vaux2_reg>;
-		DVDD-supply = <&vbat>;
-	};
-};
-
-&lcdc {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-
-&epwmss0 {
-	status = "okay";
-
-	ecap0: ecap@48300100 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ecap0_pins>;
-	};
-};
-
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default";
-	pinctrl-0 = <&nandflash_pins_s0>;
-	/*ranges = <0 0 0x08000000 0x1000000>;*/	/* CS0: 16MB for NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-#if 0
-&mcasp1 {
-		pinctrl-names = "default";
-		pinctrl-0 = <&am335x_evm_audio_pins>;
-
-		status = "okay";
-
-		op-mode = <0>;          /* MCASP_IIS_MODE */
-		tdm-slots = <2>;
-		/* 4 serializers */
-		serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
-			0 0 1 2
-		>;
-		tx-num-evt = <32>;
-		rx-num-evt = <32>;
-};
-#endif
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1312500>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-};
-
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
-	phy-mode = "mii";
-};
-
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <2>;
-	phy-mode = "mii";
-};
-
-&tscadc {
-	status = "okay";
-	tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-		ti,charge-delay = <0x400>;
-	};
-
-	adc {
-		ti,adc-channels = <4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
-};
-
-
-&mmc3 {
-	/* these are on the crossbar and are outlined in the
-	   xbar-event-map element */
-	dmas = <&edma 12
-		&edma 13>;
-	dma-names = "tx", "rx";
-	status = "okay";
-	vmmc-supply = <&wlan_en_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc3_pins &wlan_pins>;
-	ti,non-removable;
-	ti,needs-special-hs-handling;
-	cap-power-off-card;
-	keep-power-in-suspend;
-
-	#address-cells = <1>;
-	#size-cells = <0>;
-	wlcore: wlcore@0 {
-		compatible = "ti,wl1835";
-		reg = <2>;
-		interrupt-parent = <&gpio3>;
-		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
-	};
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&dcan1 {
-	status = "disabled";	/* Enable only if Profile 1 is selected */
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};

+ 0 - 802
board-support/u-boot-2017.01+gitAUTOINC+340fb36f04-g340fb36f04/arch/arm/dts/[DW25]am335x-evm.dts

@@ -1,802 +0,0 @@
-/*
- * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-/dts-v1/;
-
-#include "am33xx.dtsi"
-#include <dt-bindings/interrupt-controller/irq.h>
-
-/ {
-	model = "TI AM335x EVM";
-	compatible = "ti,am335x-evm", "ti,am33xx";
-
-	chosen {
-		stdout-path = &uart0;
-		tick-timer = &timer2;
-	};
-
-	cpus {
-		cpu@0 {
-			cpu0-supply = <&vdd1_reg>;
-		};
-	};
-
-	memory {
-		device_type = "memory";
-		reg = <0x80000000 0x10000000>; /* 256 MB */
-		reg = <0x80000000 0x20000000>; /* 512 MB */ /* +++ vern,512MB DDR ,20181030 ---*/
-	};
-
-	vbat: fixedregulator@0 {
-		compatible = "regulator-fixed";
-		regulator-name = "vbat";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-boot-on;
-	};
-
-	lis3_reg: fixedregulator@1 {
-		compatible = "regulator-fixed";
-		regulator-name = "lis3_reg";
-		regulator-boot-on;
-	};
-
-	wlan_en_reg: fixedregulator@2 {
-		compatible = "regulator-fixed";
-		regulator-name = "wlan-en-regulator";
-		regulator-min-microvolt = <1800000>;
-		regulator-max-microvolt = <1800000>;
-
-		/* WLAN_EN GPIO for this board - Bank1, pin16 */
-		gpio = <&gpio1 16 0>;
-
-		/* WLAN card specific delay */
-		startup-delay-us = <70000>;
-		enable-active-high;
-	};
-
-	matrix_keypad: matrix_keypad@0 {
-		compatible = "gpio-matrix-keypad";
-		debounce-delay-ms = <5>;
-		col-scan-delay-us = <2>;
-
-		row-gpios = <&gpio1 25 GPIO_ACTIVE_HIGH		/* Bank1, pin25 */
-			     &gpio1 26 GPIO_ACTIVE_HIGH		/* Bank1, pin26 */
-			     &gpio1 27 GPIO_ACTIVE_HIGH>;	/* Bank1, pin27 */
-
-		col-gpios = <&gpio1 21 GPIO_ACTIVE_HIGH		/* Bank1, pin21 */
-			     &gpio1 22 GPIO_ACTIVE_HIGH>;	/* Bank1, pin22 */
-
-		linux,keymap = <0x0000008b	/* MENU */
-				0x0100009e	/* BACK */
-				0x02000069	/* LEFT */
-				0x0001006a	/* RIGHT */
-				0x0101001c	/* ENTER */
-				0x0201006c>;	/* DOWN */
-	};
-
-	gpio_keys: volume_keys@0 {
-		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		autorepeat;
-
-		switch@9 {
-			label = "volume-up";
-			linux,code = <115>;
-			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
-			gpio-key,wakeup;
-		};
-
-		switch@10 {
-			label = "volume-down";
-			linux,code = <114>;
-			gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
-			gpio-key,wakeup;
-		};
-	};
-
-	backlight {
-		compatible = "pwm-backlight";
-		pwms = <&ecap0 0 50000 0>;
-		brightness-levels = <0 51 53 56 62 75 101 152 255>;
-		default-brightness-level = <8>;
-	};
-
-	panel {
-		compatible = "ti,tilcdc,panel";
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&lcd_pins_s0>;
-		panel-info {
-			ac-bias           = <255>;
-			ac-bias-intrpt    = <0>;
-			dma-burst-sz      = <16>;
-			bpp               = <32>;
-			fdd               = <0x80>;
-			sync-edge         = <0>;
-			sync-ctrl         = <1>;
-			raster-order      = <0>;
-			fifo-th           = <0>;
-		};
-
-		display-timings {
-			800x480p62 {
-				clock-frequency = <30000000>;
-				hactive = <800>;
-				vactive = <480>;
-				hfront-porch = <39>;
-				hback-porch = <39>;
-				hsync-len = <47>;
-				vback-porch = <29>;
-				vfront-porch = <13>;
-				vsync-len = <2>;
-				hsync-active = <1>;
-				vsync-active = <1>;
-			};
-		};
-	};
-
-	sound {
-		compatible = "ti,da830-evm-audio";
-		ti,model = "AM335x-EVM";
-		ti,audio-codec = <&tlv320aic3106>;
-		ti,mcasp-controller = <&mcasp1>;
-		ti,codec-clock-rate = <12000000>;
-		ti,audio-routing =
-			"Headphone Jack",       "HPLOUT",
-			"Headphone Jack",       "HPROUT",
-			"LINE1L",               "Line In",
-			"LINE1R",               "Line In";
-	};
-};
-
-&am33xx_pinmux {
-	pinctrl-names = "default";
-	pinctrl-0 = <&matrix_keypad_s0 &volume_keys_s0 &clkout2_pin>;
-
-	matrix_keypad_s0: matrix_keypad_s0 {
-		pinctrl-single,pins = <
-			0x54 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a5.gpio1_21 */
-			0x58 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a6.gpio1_22 */
-			0x64 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a9.gpio1_25 */
-			0x68 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a10.gpio1_26 */
-			0x6c (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a11.gpio1_27 */
-		>;
-	};
-
-	volume_keys_s0: volume_keys_s0 {
-		pinctrl-single,pins = <
-			0x150 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* spi0_sclk.gpio0_2 */
-			0x154 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* spi0_d0.gpio0_3 */
-		>;
-	};
-
-	i2c0_pins: pinmux_i2c0_pins {
-		pinctrl-single,pins = <
-			0x188 (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_sda.i2c0_sda */
-			0x18c (PIN_INPUT_PULLUP | MUX_MODE0)	/* i2c0_scl.i2c0_scl */
-		>;
-	};
-
-	i2c1_pins: pinmux_i2c1_pins {
-		pinctrl-single,pins = <
-			0x158 (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_d1.i2c1_sda */
-			0x15c (PIN_INPUT_PULLUP | MUX_MODE2)	/* spi0_cs0.i2c1_scl */
-		>;
-	};
-
-	uart0_pins: pinmux_uart0_pins {
-		pinctrl-single,pins = <
-			0x170 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart0_rxd.uart0_rxd */
-			0x174 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart0_txd.uart0_txd */
-		>;
-	};
-
-	uart1_pins: pinmux_uart1_pins {
-		pinctrl-single,pins = <
-			0x178 (PIN_INPUT | MUX_MODE0)		/* uart1_ctsn.uart1_ctsn */
-			0x17C (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_rtsn.uart1_rtsn */
-			0x180 (PIN_INPUT_PULLUP | MUX_MODE0)	/* uart1_rxd.uart1_rxd */
-			0x184 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)	/* uart1_txd.uart1_txd */
-		>;
-	};
-
-	clkout2_pin: pinmux_clkout2_pin {
-		pinctrl-single,pins = <
-			0x1b4 (PIN_OUTPUT_PULLDOWN | MUX_MODE3)	/* xdma_event_intr1.clkout2 */
-		>;
-	};
-
-	nandflash_pins_s0: nandflash_pins_s0 {
-		pinctrl-single,pins = <
-			0x0 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad0.gpmc_ad0 */
-			0x4 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad1.gpmc_ad1 */
-			0x8 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad2.gpmc_ad2 */
-			0xc (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad3.gpmc_ad3 */
-			0x10 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad4.gpmc_ad4 */
-			0x14 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad5.gpmc_ad5 */
-			0x18 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad6.gpmc_ad6 */
-			0x1c (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_ad7.gpmc_ad7 */
-			0x70 (PIN_INPUT_PULLUP | MUX_MODE0)	/* gpmc_wait0.gpmc_wait0 */
-			0x74 (PIN_INPUT_PULLUP | MUX_MODE7)	/* gpmc_wpn.gpio0_30 */
-			0x7c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_csn0.gpmc_csn0  */
-			0x90 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_advn_ale.gpmc_advn_ale */
-			0x94 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_oen_ren.gpmc_oen_ren */
-			0x98 (PIN_OUTPUT | MUX_MODE0)		/* gpmc_wen.gpmc_wen */
-			0x9c (PIN_OUTPUT | MUX_MODE0)		/* gpmc_be0n_cle.gpmc_be0n_cle */
-		>;
-	};
-
-	ecap0_pins: backlight_pins {
-		pinctrl-single,pins = <
-			0x164 0x0	/* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */
-		>;
-	};
-
-	cpsw_default: cpsw_default {
-		pinctrl-single,pins = <
-			/* Slave 1 */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* MII1_RX_ER.gmii1_rxerr */
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxdv.mii1_rxdv */
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_txclk.mii1_txclk */
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxclk.mii1_rxclk */
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd3.rgmii1_rd3 */
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd2.rgmii1_rd2 */
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd1.rgmii1_rd1 */
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE0)		/* mii1_rxd0.rgmii1_rd0 */	
-			0x114 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txen.mii1_txen */
-			0x11c (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd3.rgmii1_td3 */
-			0x120 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd2.rgmii1_td2 */
-			0x124 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd1.rgmii1_td1 */
-			0x128 (PIN_OUTPUT_PULLDOWN | MUX_MODE0)		/* mii1_txd0.rgmii1_td0 */      
-		>;
-	};
-
-	cpsw_sleep: cpsw_sleep {
-		pinctrl-single,pins = <
-			/* Slave 1 reset value */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE7)		/* MII1_RX_ER.gmii1_rxerr */
-			//0x108 (PIN_INPUT_PULLDOWN | MUX_MODE7)		/* MII1_COL.gmii1_col */
-			//0x10C (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* MII1_CRS.gmii1_crs */
-			0x114 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x118 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x11c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x120 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x124 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x128 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x12c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x130 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x134 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x138 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x13c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x140 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	davinci_mdio_default: davinci_mdio_default {
-		pinctrl-single,pins = <
-			/* MDIO */
-			0x148 (PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE0)	/* mdio_data.mdio_data */
-			0x14c (PIN_OUTPUT_PULLUP | MUX_MODE0)			/* mdio_clk.mdio_clk */
-		>;
-	};
-
-	davinci_mdio_sleep: davinci_mdio_sleep {
-		pinctrl-single,pins = <
-			/* MDIO reset value */
-			0x148 (PIN_INPUT_PULLDOWN | MUX_MODE7)
-			0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
-		>;
-	};
-
-	#if 0
-	mmc1_pins: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x160 (PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */
-		>;
-	};
-	#endif
-	mmc1_pins_default: pinmux_mmc1_pins {
-		pinctrl-single,pins = <
-			0x0F0 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat3.mmc0_dat3 */
-			0x0F4 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat2.mmc0_dat2 */
-			0x0F8 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat1.mmc0_dat1 */
-			0x0FC (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_dat0.mmc0_dat0 */
-			0x100 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_clk.mmc0_clk */
-			0x104 (PIN_INPUT_PULLUP | MUX_MODE0)    /* mmc0_cmd.mmc0_cmd */
-			/*0x0A8 (PIN_INPUT | MUX_MODE7)*/	        /* LCD_DATA2.GPIO2_8 */
-			0x08C (PIN_INPUT | MUX_MODE7)	        /* GPMC_CLK.GPIO2_1 */
-		>;
-	};
-	mmc3_pins: pinmux_mmc3_pins {
-		pinctrl-single,pins = <
-			0x44 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a1.mmc2_dat0, INPUT_PULLUP | MODE3 */
-			0x48 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a2.mmc2_dat1, INPUT_PULLUP | MODE3 */
-			0x4C (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_a3.mmc2_dat2, INPUT_PULLUP | MODE3 */
-			0x78 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_ben1.mmc2_dat3, INPUT_PULLUP | MODE3 */
-			0x88 (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_csn3.mmc2_cmd, INPUT_PULLUP | MODE3 */
-			0x8C (PIN_INPUT_PULLUP | MUX_MODE3)	/* gpmc_clk.mmc2_clk, INPUT_PULLUP | MODE3 */
-		>;
-	};
-
-	wlan_pins: pinmux_wlan_pins {
-		pinctrl-single,pins = <
-			0x40 (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* gpmc_a0.gpio1_16 */
-			0x19C (PIN_INPUT | MUX_MODE7)		/* mcasp0_ahclkr.gpio3_17 */
-			0x1AC (PIN_OUTPUT_PULLDOWN | MUX_MODE7)	/* mcasp0_ahclkx.gpio3_21 */
-		>;
-	};
-
-	lcd_pins_s0: lcd_pins_s0 {
-		pinctrl-single,pins = <
-			0x20 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad8.lcd_data23 */
-			0x24 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad9.lcd_data22 */
-			0x28 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad10.lcd_data21 */
-			0x2c (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad11.lcd_data20 */
-			0x30 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad12.lcd_data19 */
-			0x34 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad13.lcd_data18 */
-			0x38 (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad14.lcd_data17 */
-			0x3c (PIN_OUTPUT | MUX_MODE1)		/* gpmc_ad15.lcd_data16 */
-			0xa0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data0.lcd_data0 */
-			0xa4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data1.lcd_data1 */
-			0xa8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data2.lcd_data2 */
-			0xac (PIN_OUTPUT | MUX_MODE0)		/* lcd_data3.lcd_data3 */
-			0xb0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data4.lcd_data4 */
-			0xb4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data5.lcd_data5 */
-			0xb8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data6.lcd_data6 */
-			0xbc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data7.lcd_data7 */
-			0xc0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data8.lcd_data8 */
-			0xc4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data9.lcd_data9 */
-			0xc8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data10.lcd_data10 */
-			0xcc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data11.lcd_data11 */
-			0xd0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data12.lcd_data12 */
-			0xd4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data13.lcd_data13 */
-			0xd8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_data14.lcd_data14 */
-			0xdc (PIN_OUTPUT | MUX_MODE0)		/* lcd_data15.lcd_data15 */
-			0xe0 (PIN_OUTPUT | MUX_MODE0)		/* lcd_vsync.lcd_vsync */
-			0xe4 (PIN_OUTPUT | MUX_MODE0)		/* lcd_hsync.lcd_hsync */
-			0xe8 (PIN_OUTPUT | MUX_MODE0)		/* lcd_pclk.lcd_pclk */
-			0xec (PIN_OUTPUT | MUX_MODE0)		/* lcd_ac_bias_en.lcd_ac_bias_en */
-		>;
-	};
-#if 0
-	am335x_evm_audio_pins: am335x_evm_audio_pins {
-		pinctrl-single,pins = <
-			0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */
-			0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */
-			0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */
-			0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */
-		>;
-	};
-#endif
-	dcan1_pins_default: dcan1_pins_default {
-		pinctrl-single,pins = <
-			0x168 (PIN_OUTPUT | MUX_MODE2) /* uart0_ctsn.d_can1_tx */
-			0x16c (PIN_INPUT_PULLDOWN | MUX_MODE2) /* uart0_rtsn.d_can1_rx */
-		>;
-	};
-};
-
-&uart0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart0_pins>;
-
-	status = "okay";
-};
-
-&uart1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart1_pins>;
-
-	status = "okay";
-};
-
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_pins>;
-
-	status = "okay";
-	clock-frequency = <400000>;
-
-	tps: tps@2d {
-		reg = <0x2d>;
-	};
-};
-
-&usb {
-	status = "okay";
-};
-
-&usb_ctrl_mod {
-	status = "okay";
-};
-
-&usb0_phy {
-	status = "okay";
-};
-
-&usb1_phy {
-	status = "okay";
-};
-
-&usb0 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-	dr_mode = "host";
-};
-
-&cppi41dma  {
-	status = "okay";
-};
-
-&i2c1 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c1_pins>;
-
-	status = "okay";
-	clock-frequency = <100000>;
-
-	lis331dlh: lis331dlh@18 {
-		compatible = "st,lis331dlh", "st,lis3lv02d";
-		reg = <0x18>;
-		Vdd-supply = <&lis3_reg>;
-		Vdd_IO-supply = <&lis3_reg>;
-
-		st,click-single-x;
-		st,click-single-y;
-		st,click-single-z;
-		st,click-thresh-x = <10>;
-		st,click-thresh-y = <10>;
-		st,click-thresh-z = <10>;
-		st,irq1-click;
-		st,irq2-click;
-		st,wakeup-x-lo;
-		st,wakeup-x-hi;
-		st,wakeup-y-lo;
-		st,wakeup-y-hi;
-		st,wakeup-z-lo;
-		st,wakeup-z-hi;
-		st,min-limit-x = <120>;
-		st,min-limit-y = <120>;
-		st,min-limit-z = <140>;
-		st,max-limit-x = <550>;
-		st,max-limit-y = <550>;
-		st,max-limit-z = <750>;
-	};
-
-	tsl2550: tsl2550@39 {
-		compatible = "taos,tsl2550";
-		reg = <0x39>;
-	};
-
-	tmp275: tmp275@48 {
-		compatible = "ti,tmp275";
-		reg = <0x48>;
-	};
-
-	tlv320aic3106: tlv320aic3106@1b {
-		compatible = "ti,tlv320aic3106";
-		reg = <0x1b>;
-		status = "okay";
-
-		/* Regulators */
-		AVDD-supply = <&vaux2_reg>;
-		IOVDD-supply = <&vaux2_reg>;
-		DRVDD-supply = <&vaux2_reg>;
-		DVDD-supply = <&vbat>;
-	};
-};
-
-&lcdc {
-	status = "okay";
-};
-
-&elm {
-	status = "okay";
-};
-
-&epwmss0 {
-	status = "okay";
-
-	ecap0: ecap@48300100 {
-		status = "okay";
-		pinctrl-names = "default";
-		pinctrl-0 = <&ecap0_pins>;
-	};
-};
-
-&gpmc {
-	status = "okay";
-	pinctrl-names = "default";
-	pinctrl-0 = <&nandflash_pins_s0>;
-	/*ranges = <0 0 0x08000000 0x1000000>;*/	/* CS0: 16MB for NAND */
-	ranges = <0 0 0x08000000 0x80000000>;	/*+++ vern,NAND,20181030 ---*/
-	nand@0,0 {
-		reg = <0 0 4>; /* CS0, offset 0, IO size 4 */
-		ti,nand-ecc-opt = "bch8";
-		ti,elm-id = <&elm>;
-		nand-bus-width = <8>;
-		gpmc,device-width = <1>;
-		gpmc,sync-clk-ps = <0>;
-		gpmc,cs-on-ns = <0>;
-		gpmc,cs-rd-off-ns = <44>;
-		gpmc,cs-wr-off-ns = <44>;
-		gpmc,adv-on-ns = <6>;
-		gpmc,adv-rd-off-ns = <34>;
-		gpmc,adv-wr-off-ns = <44>;
-		gpmc,we-on-ns = <0>;
-		gpmc,we-off-ns = <40>;
-		gpmc,oe-on-ns = <0>;
-		gpmc,oe-off-ns = <54>;
-		gpmc,access-ns = <64>;
-		gpmc,rd-cycle-ns = <82>;
-		gpmc,wr-cycle-ns = <82>;
-		gpmc,wait-on-read = "true";
-		gpmc,wait-on-write = "true";
-		gpmc,bus-turnaround-ns = <0>;
-		gpmc,cycle2cycle-delay-ns = <0>;
-		gpmc,clk-activation-ns = <0>;
-		gpmc,wait-monitoring-ns = <0>;
-		gpmc,wr-access-ns = <40>;
-		gpmc,wr-data-mux-bus-ns = <0>;
-		/* MTD partition table */
-		/* All SPL-* partitions are sized to minimal length
-		 * which can be independently programmable. For
-		 * NAND flash this is equal to size of erase-block */
-		#address-cells = <1>;
-		#size-cells = <1>;
-		partition@0 {
-			label = "SPL";
-			reg = <0x00000000 0x00080000>;
-		};
-		partition@1 {
-			label = "Primary u-boot";
-			reg = <0x00080000 0x00100000>;
-		};
-		partition@2 {
-			label = "u-boot-env";
-			reg = <0x00180000 0x00080000>;
-		};
-		partition@3 {
-			label = "Secondary u-boot";
-			reg = <0x00200000 0x00100000>;
-		};
-		partition@4 {
-			label = "Primary dtb";
-			reg = <0x00300000 0x00080000>;
-		};
-		partition@5 {
-			label = "Secondary dtb";
-			reg = <0x00380000 0x00080000>;
-		};
-		partition@6 {
-			label = "Primary kernel";
-			reg = <0x00400000 0x00A00000>;
-		};
-		partition@7 {
-			label = "Secondary kernel";
-			reg = <0x00E00000 0x00A00000>;
-		};
-		partition@8 {
-			label = "Primary rootfs";
-			reg = <0x03000000 0x03000000>;
-		};
-		partition@9 {
-			label = "Secondary rootfs";
-			reg = <0x06000000 0x03000000>;
-		};
-		partition@10 {
-			label = "Primary user configuration";
-			reg = <0x09000000 0x00600000>;
-		};
-		partition@11 {
-			label = "Secondary user configuration";
-			reg = <0x09600000 0x00600000>;
-		};
-		partition@12 {
-			label = "Factory default configuration";
-			reg = <0x09C00000 0x00600000>;
-		};
-		partition@13 {
-			label = "Storage";
-			reg = <0x0A200000 0x75E00000>;
-		};
-	};
-};
-
-#include "tps65910.dtsi"
-#if 0
-&mcasp1 {
-		pinctrl-names = "default";
-		pinctrl-0 = <&am335x_evm_audio_pins>;
-
-		status = "okay";
-
-		op-mode = <0>;          /* MCASP_IIS_MODE */
-		tdm-slots = <2>;
-		/* 4 serializers */
-		serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
-			0 0 1 2
-		>;
-		tx-num-evt = <32>;
-		rx-num-evt = <32>;
-};
-#endif
-&tps {
-	vcc1-supply = <&vbat>;
-	vcc2-supply = <&vbat>;
-	vcc3-supply = <&vbat>;
-	vcc4-supply = <&vbat>;
-	vcc5-supply = <&vbat>;
-	vcc6-supply = <&vbat>;
-	vcc7-supply = <&vbat>;
-	vccio-supply = <&vbat>;
-
-	regulators {
-		vrtc_reg: regulator@0 {
-			regulator-always-on;
-		};
-
-		vio_reg: regulator@1 {
-			regulator-always-on;
-		};
-
-		vdd1_reg: regulator@2 {
-			/* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
-			regulator-name = "vdd_mpu";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1312500>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd2_reg: regulator@3 {
-			/* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */
-			regulator-name = "vdd_core";
-			regulator-min-microvolt = <912500>;
-			regulator-max-microvolt = <1150000>;
-			regulator-boot-on;
-			regulator-always-on;
-		};
-
-		vdd3_reg: regulator@4 {
-			regulator-always-on;
-		};
-
-		vdig1_reg: regulator@5 {
-			regulator-always-on;
-		};
-
-		vdig2_reg: regulator@6 {
-			regulator-always-on;
-		};
-
-		vpll_reg: regulator@7 {
-			regulator-always-on;
-		};
-
-		vdac_reg: regulator@8 {
-			regulator-always-on;
-		};
-
-		vaux1_reg: regulator@9 {
-			regulator-always-on;
-		};
-
-		vaux2_reg: regulator@10 {
-			regulator-always-on;
-		};
-
-		vaux33_reg: regulator@11 {
-			regulator-always-on;
-		};
-
-		vmmc_reg: regulator@12 {
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <3300000>;
-			regulator-always-on;
-		};
-	};
-};
-
-&mac {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&cpsw_default>;
-	pinctrl-1 = <&cpsw_sleep>;
-	status = "okay";
-};
-
-&davinci_mdio {
-	pinctrl-names = "default", "sleep";
-	pinctrl-0 = <&davinci_mdio_default>;
-	pinctrl-1 = <&davinci_mdio_sleep>;
-	status = "okay";
-};
-
-&cpsw_emac0 {
-	phy_id = <&davinci_mdio>, <1>;
-	phy-mode = "mii";
-};
-
-&cpsw_emac1 {
-	phy_id = <&davinci_mdio>, <2>;
-	phy-mode = "mii";
-};
-
-&tscadc {
-	status = "okay";
-	tsc {
-		ti,wires = <4>;
-		ti,x-plate-resistance = <200>;
-		ti,coordinate-readouts = <5>;
-		ti,wire-config = <0x00 0x11 0x22 0x33>;
-		ti,charge-delay = <0x400>;
-	};
-
-	adc {
-		ti,adc-channels = <4 5 6 7>;
-	};
-};
-
-&mmc1 {
-	status = "okay";
-	vmmc-supply = <&vmmc_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc1_pins_default>;
-	cd-gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
-};
-
-
-&mmc3 {
-	/* these are on the crossbar and are outlined in the
-	   xbar-event-map element */
-	dmas = <&edma 12
-		&edma 13>;
-	dma-names = "tx", "rx";
-	status = "okay";
-	vmmc-supply = <&wlan_en_reg>;
-	bus-width = <4>;
-	pinctrl-names = "default";
-	pinctrl-0 = <&mmc3_pins &wlan_pins>;
-	ti,non-removable;
-	ti,needs-special-hs-handling;
-	cap-power-off-card;
-	keep-power-in-suspend;
-
-	#address-cells = <1>;
-	#size-cells = <0>;
-	wlcore: wlcore@0 {
-		compatible = "ti,wl1835";
-		reg = <2>;
-		interrupt-parent = <&gpio3>;
-		interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
-	};
-};
-
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
-&sham {
-	status = "okay";
-};
-
-&aes {
-	status = "okay";
-};
-
-&dcan1 {
-	status = "disabled";	/* Enable only if Profile 1 is selected */
-	pinctrl-names = "default";
-	pinctrl-0 = <&dcan1_pins_default>;
-};