Hi Guys
Just finished going through Peter Oakes excellent MCP23S17 driver and after some careful internet trawling I now understand 95% of what he is doing. There is just one element left to understand and I hope someone can explain it to me.
The WriteRegister8 method has the following line
writeBuffer3[0] = (BaseAddW | (Address << 1));
I know that this is the first of three bytes to be sent (Address, Register and Value). I also know that the BaseAddress is 0x40 but I don't understand the use of the " | (Address<<1)"
I guess I have 2 questions
1. Why is the OR necessary?, and;
2. What does this OR statement do in bit terms?
Thanks in advance for your help
Regards
Ian Carson






