The following takes two 8bit integers and combines them to generate a 14bit integer.
public static int CombineBytes(int LSB, int MSB)
{
int _14bit;
_14bit = MSB;
_14bit <<= 7;
_14bit |= LSB;
return(_14bit);
}
What would be the opposite process to this function?
For example if I supplied a function with a 14bit integer I would get two 8bit integers in the form of the most significant byte and the least significant byte?
Assuming you mean two 7 bit integers, you can get the high 7 bits by shifting 7 to the right
high = combined >> 7and the low 7 bits by masking with binary andlow = combined & 0x7F.