Hi Friends,
I need help in C coding. I have to send a sequence of commands in a 8-bit microcontroller. Each command is 64- bit data.
Code:
typedef struct{
uint16_t data0;
uint16_t data1;
uint16_t data2;
uint16_t data3;
} command_data_t;
Now, there are 5-6 commands, each having different data0, data1, data2, data3.
Code:
typedef struct{ //all made of different data0, data1, data2, data3.
COMMAND1;
COMMAND2;
COMMAND3;
COMMAND4;
COMMAND5;
} command_t;
Above commands are made of command_data_t type.
I don't know how to write a C code so that I can send these commands one by one. Like once a command is send, send next command. Once all commands are sent start sending from the first command again.
I need to write a function, which takes element of command_t, send it, then next one...Please provide me code if possible.
Please help.
Thanks,
David.