Hi,
I am doing 8-bit microcontroller programming in C. I can send only 8-bit data at one time. I am getting input as union. After sending 16-bits, I have to insert a delay. Total 64-bit needs to be sent. How to use for loop efficiently. Here is the general code :
Code:
typedef union{
uint16_t data0;
uint16_t data0;
uint16_t data0;
uint16_t data0;
}data_u;
void get_data(data_u data)
{
//here i have to get all members of union and get the 8-bit(1 byte) //of each into below for loop inserting delay after each 16-bit transfer(2 byte).
for()
{
exchange8bit(union_data);
//delay after 2-byte transfer
}
// loop should transfer total 6-bits means 8 bytes.
}
void exchange8bit(uint8_t data)
{
}
I am confused how to achieve it. Please help and send me the correct code.
--David