Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nrf51_rtc by
nrf51_rtc.h
- Committer:
- fxschumacher
- Date:
- 2015-02-08
- Revision:
- 0:3677a016109b
- Child:
- 1:5917157d58c6
File content as of revision 0:3677a016109b:
#ifndef NRF51_RTC_H
#define NRF51_RTC_H
#include "mbed.h"
static class nrf51_rtc {
// class to create equivalent of time() and set_time()
// ...depends upon RTC1 to be running and to never stop -- a byproduct of instantiation of mbed library's "ticker"
public:
nrf51_rtc();
time_t time();
int set_time(time_t rawtime);
// these should be private
private:
time_t time_base;
unsigned int rtc_previous;
unsigned int ticks_per_second, counter_size_in_seconds;
void update_rtc(); // similar to "time" but doesn't return the value, just updates underlying variables
} rtc;
#endif
