#include "CommandsDefine.h"
#include "ProjectConfig.h"
#include "AnalogChannelCtrl_2d5g_base.h"
#include "Helper.h"

void CMD0x43_Request_CtrlChannel4094_process(u8 *pData,u16 dataLen,u8 bIsContentBitInverted_Recv,u8 bIsContentBitInverted_SendBack)
{
#ifdef RUNNING_WHERE_AT_BOOT	
	Command_SendbackErrorMessage(Error0x02_CannotRunAtBoot);
#else
	
	if (!Helper_CheckRightRecvedData(pData,dataLen,6,bIsContentBitInverted_Recv))
	{
		Command_SendbackErrorMessage(Error0x05_CMD_ParaLentghError,1);
		return;
	}
		
	u32 CD4094_CMD1=(pData[0]<<8)+pData[1];
	u32 CD4094_CMD2 =0;
	for(u8 i=2; i<6; i++)
			CD4094_CMD2=(CD4094_CMD2<<8)+pData[i];// get ShiftReg(4094) command code
	TRIG_ShiftReg_CMD_temp=CD4094_CMD1;
	CH_ShiftReg_CMD_temp=CD4094_CMD2;
	
	CD_4094(CD4094_CMD1,1); 
	CD_4094(CD4094_CMD2,4);  
#endif	
}
