Hi
I am trying to calculate the 16bit arithmetic sum of a structure data type to obtain checksum of data header of a data packet.
structure is defines as follows:
struct
{
u16bit synchWord
u16bit chID
u32bit dataLendth
u32bit packetLenght
u8bit version
u8bit sequence
u8bit flag
u8bit type
u8bit time[6]
}dataHeader
I am having trouble with 8bit data types. How can i concatnate those to get 16bit words to add them up? Also with 8bit array needs to be calculated with 16bit words at time.
any help will be appreciated.
Thanks