Services

Timer Services

Getting system time using C libraries is an option, but you can also get time directly from "rtc.h". Other than this, there are two more timer services you can use as demonstrated in the code sample below.

#include "lpc_sys.h"
#include "soft_timer.hpp"
void timers()
{
/* You can get the time since the board has been powered */
uint64_t uptime_ms = sys_get_uptime_ms();
uint64_t uptime_us = sys_get_uptime_us();
/* There is also a polling timer available in C++, read "soft_timer.hpp" for more info. */
SoftTimer myTimer(1000);
if (myTimer.expired())
{
/* Do something */
}
}

File I/O

You can read or write files on the SPI Flash or an SD card. You can open a limited amount of files using standard C libraries. First, at your sys_config.h file, please enable ENABLE_C_FILE_IO