ok, so when you want to use particular functions in ANY libraries that you include in your project, the library definition you include will set these up for you.
Taking the first bit of code you posed as an example:
#include "samd11.h"
#include "hal_gpio.h"
#include "i2c_master.h"
#include "ISL29029.h"
#include "ISL29029_regs.h"
#include "MCP79410.h"
if(MCP79410_IsRunning()) //If clock is already running stop it
{
MCP79410_DisableOscillator();
}
MCP79410_Initialize();
See all those lines that start with "#include"? well what your doing there, is asking the compiler to go and fetch, then set up it's libraries that it has by those names.
That will then make the functions available in those libraries, available for you to call in your own code, and use the tasks that they perform.
Some of these libraries need help for m you to know what to do, and they need this help because the C language cannot always know the differences in the systems that it's running on.
When the libraries that you include, need some help, they usually want your help using something called, call backs.
A call back is similar to you, calling a function in a library, but it works the other way, and it's the library that calls YOUR CODE to get the tasks it needs doing, performed.
In your case, it appears that the libraries your using, want YOU to create a function called "_gettimeofday" so that it can get the actual time from your RTC (Or in fact anywhere you decide to get it from) and then feed it into it's own library code, so that you can then further make use of it with the other functions it provides.
Now the problem I/WE on the forum have with your request for help, is we do not know the exact library and/or functions that you are including that are making the request for this call back, so we are unable to provide much help.
What I will say however, is you'll find the answer in the documentation for the time library your using.
If the time library is the generic Linux/Gnu library, then do some googling for "The Linux Documentation Project" aka (TLDP)
The LDP, contains docs for just about every GNU C/C++ standard function (Most of it derived from the man pages available)
The bottom line however is this:
One of the libraries your using wants you to define a function for it to use in order to read the time source, and since that source is dependent on your project on the hardware your using, it cannot know in advance what the source is, and thus requires your help to define it.
Shawty