MHVLib
20111011
An efficiency oriented runtime library for AVR microcontrollers
|
Go to the source code of this file.
Functions | |
bool | mhv_timestampLessThan (MHV_TIMESTAMP *first, MHV_TIMESTAMP *second) |
bool | mhv_timestampGreaterThanOrEqual (MHV_TIMESTAMP *first, MHV_TIMESTAMP *second) |
bool | mhv_isLeapYear (uint16_t year) |
void | mhv_timestampIncrement (MHV_TIMESTAMP *timestamp, uint32_t seconds, uint16_t milliseconds) |
void | mhv_timestampIncrement (MHV_TIMESTAMP *timestamp, MHV_TIMESTAMP *timestamp2) |
uint8_t | mhv_daysInMonth (MHV_MONTH month, uint16_t year) |
Variables | |
const uint8_t mhv_daysInMonthArray[] | PROGMEM |
uint8_t mhv_daysInMonth | ( | MHV_MONTH | month, |
uint16_t | year | ||
) |
Get the number of days in a month
month | the month |
year | the year |
Definition at line 151 of file MHV_RTC.cpp.
bool mhv_isLeapYear | ( | uint16_t | year | ) |
Determine if a year is a leap year
Definition at line 89 of file MHV_RTC.cpp.
bool mhv_timestampGreaterThanOrEqual | ( | MHV_TIMESTAMP * | first, |
MHV_TIMESTAMP * | second | ||
) |
Compare 2 timestamps
first | the first timestamp |
second | the second timestamp |
Definition at line 72 of file MHV_RTC.cpp.
void mhv_timestampIncrement | ( | MHV_TIMESTAMP * | timestamp, |
uint32_t | seconds, | ||
uint16_t | milliseconds | ||
) |
Increment a timestamp
timestamp | the timestamp to increment |
seconds | the number of seconds to increment by |
milliseconds | the number of milliseconds to increment by |
Definition at line 102 of file MHV_RTC.cpp.
void mhv_timestampIncrement | ( | MHV_TIMESTAMP * | timestamp, |
MHV_TIMESTAMP * | timestamp2 | ||
) |
Increment a timestamp
timestamp | the timestamp to increment |
timestamp2 | the timestamp to increment by |
Definition at line 118 of file MHV_RTC.cpp.
bool mhv_timestampLessThan | ( | MHV_TIMESTAMP * | first, |
MHV_TIMESTAMP * | second | ||
) |
A Realtime clock
Takes a trigger from a timer, and keeps time.
Recommended values: Clock Prescaler Top Ticks/ms 16MHz 64 249 1 Compare 2 timestamps
first | the first timestamp |
second | the second timestamp |
Definition at line 52 of file MHV_RTC.cpp.
const uint32_t mhv_secondsFromYearStart [] PROGMEM |
{ 31, 28, 31, 30, 31, 30, 31, 30, 30, 31, 30, 31 }
Definition at line 130 of file MHV_RTC.cpp.