Hello,In the code bellow:
regarding arr[0] if we shift its binary 24 then in hex each letter is 4 bites so 02F003E7 will be 00,00,00,02 then we do bitwise and with FF
which keep the number as 0x02
regarding arr[1] if we shift it 16 places the in hex we shift it 4 letters so Tx_PP will be 000002F0 doing bit wise and with FF will keep F0
etc..
My question is how can we implement it int * & representation, i want to jump uint8 and take 8bits,how can i do it using & *?
Thanks.
regarding arr[0] if we shift its binary 24 then in hex each letter is 4 bites so 02F003E7 will be 00,00,00,02 then we do bitwise and with FF
which keep the number as 0x02
regarding arr[1] if we shift it 16 places the in hex we shift it 4 letters so Tx_PP will be 000002F0 doing bit wise and with FF will keep F0
etc..
My question is how can we implement it int * & representation, i want to jump uint8 and take 8bits,how can i do it using & *?
Thanks.
Code:
uint8_t arr[4];
uint32_t Tx_PP= 0x02F003E7;
arr[0]=(Tx_PP >> 24) & 0xFF;
arr[1]=(Tx_PP >> 16) & 0xFF;
arr[2]=(Tx_PP >> 8) & 0xFF;
arr[3]=(Tx_PP) & 0xFF;
SPI_transfer(USART1,arr);