Tool/software: Code Composer Studio
Hello,
I have a uint64_t (64 bit) number that I need to send over via 8 bit UART, how would i do that?
So for example:
uint64_t x = 4626624930238680606;
and I have a code (below) that stores the user input before sending over to Raspberry Pi via UART, but instead of storing user input I want to sent "x" instead.
uint8_t Message[] = {'h', 'e', 'l', 'l', 'o', 'w', 'o', 'r', 'l', 'd', '1', '2', '3', '4', '5', '6'};
uint8_t Data[16];
// Write a line of text to the terminal
//myUart_writeBuf( CHANNEL_1, (unsigned char *)val, NULL, 0 );
__delay_cycles(10000000);
__enable_interrupt();
unsigned int size = sizeof(Message);
unsigned int sizeMod16 = size%16;
if(sizeMod16!=0)
{
for (i=0;i<sizeMod16;i++)
{
Data[i]=Message[i];
}
for (i=0;i<16-sizeMod16;i++)
{
Data[sizeMod16+i]=0x00;
}
}
else if(size == 16){
for (i=0;i<16;i++)
{
Data[i]=Message[i];
}
}
How do I do that?
-Shawn