#ifndef _HELPER_H
#define _HELPER_H
#include "sys.h"

typedef union 
{
	u32 u32_Data;
	u8 bytes[4];
}u32Byte4;

typedef union
{
	struct
	{
		u8 d4[4];
		u16 len;
	}packHeader;
	u8 data[6];
}Usart_Header;

extern void Helper_CRC32_Init(void);
 
extern uint16_t Helper_Sum16(uint8_t *buffer, uint32_t length);
extern uint32_t Helper_CRC_CalcBlockCRC8(uint8_t pBuffer[], uint32_t BufferLength);
extern uint32_t Helper_CRC_CalcFlashBlockCRC8(u32 flashStartAddr, uint32_t bytesLength);
extern u8 Helper_CheckInvertBytesIsRegist(u8 * pData,u16 totalLength);
extern void Helper_ConvertInvert(u8 * pData,u16 sourceBytes);
extern u8 Helper_CheckRightRecvedData(u8 *pData,u16 dataLength,u16 exceptLength,u8 bIsContentBitInverted_Recv);
#endif
