I have a 72 bit unsigned variable and I am only interested in 24 bits. The variable is split into the 34 bits / 24 bits / 14 bits. The bit mask works fine but I would like to dump the 34 zero's at the front and the 14 zero's at the back and store the result into a new variable.
I apologise for what may seem a very easy problem for most, I am only new to programming and have been thrown into a very very deep end. The project specifics Im dealing with are communicating an Anaren Radio module with the STM32F4Discovery Board. I have the peripherals on the STM board up and running with an SPI transfer function between the two devices. I am setting up the receive function to take the result from the radio module and isolate these specific bits. Then I'm sure there will be more and more questions but at the moment this is the wall Im beating my head against.
I sincerely thank everyone for their time and patience :) Sincerely, Hearny
EDIT: 1 Thanks all - usless info = never again. both vaiables are defined at beginning of the program, thought they would be irrelevant for the purpose of my question. After the & operation the result will give me the 24bits im interested in and 14 trailing zero's which I DONT WANT. How can I just drop them?
Code:
anaren_packet=SPI1_send(0x00); //send dummy packet to receive data
packet_lap = anaren_packet & 3FFFFFC000; // Bitmask for middle-ish 24bits