In SPI sample there are setup SPI as the follwing:
SPCR |= ( (1<<SPE) | (1<<MSTR) ); // enable SPI as master
In Atmega168, the SPCR is a SPI control Register, the SPE is bit7 & the MSTR is bit4 of that register. The above code is set the SPCR bit 7 & bit4 to 1 … but I am a straight FW code, I would like to know why the SPE & MSTR only shift LEFT once, I guess there is some definitions some where to set/mask the bit to match the above code
I could not find anywhere telling about this matter … can someone help? :-?