Essentially what I want to do, is read PB0-3, compare them to a stored value, and if they match set a status flag true.
I'll admit I'm pretty hopeless at Bitwise things mainly due to not really having to use them much, however I'm not entirely sure that is the solution to this problem.
In the past in Arduino, I would of used something like if(readdata & xxxx1111b), however CoIDE gives an error because of the x's and just doesn't seem to accept binary with any form of suffix/prefix.
Swapping to hex or decimal compiles without error, but returns true on 3, 6 or 7.
Can somebody point me in the direction I need, as my google skills just aren't throwing up anything helpful?
For reference, the full details are I'm using a STM32 Discovery board (STMF100RB), with PB0-7 connected to another controllers 8bit databus, along with Start and Clock pulses on PA1&2. When Start is asserted by the controller, it places an address on PB0-3, along with a command on PB4-7.
I need to read the address, and compare it with the programmed address in the STM32.
The command part is not implemented at the moment, so I can ignore that for now (I'm interfacing to somebody elses design, so I have no control over that), however it will probably be implemented at some point in the future and I will also need the ability to read and handle that.
I'm just currently struggling with how to split the 16bit integer port read into 4 bit pieces.