I need help with finding the correct bit mask. 0xbc61 has to be 0xbcaa, but I am not sure how to create the bit mask to affect only the part I have to change. I also tried splitting the value but wasn't sure how to "glue" them with the new one...
unsigned short int left, right;
unsigned short int temp = 0xbc61;
unsigned short int newValue = 0xaa;
right= temp & 0xff; // split
left= (temp >> 8) // split
// temp needs to be 0xbcaa
// and I also need it the other way round, so 0xbc61 -> 0xaa61