Go to the source code of this file.
Classes |
| struct | mhv_timestamp |
| struct | mhv_time |
| struct | mhv_alarm |
| class | MHV_AlarmListener |
| class | MHV_RTC |
Defines |
| #define | MHV_RTC_CREATE_TZ(_mhvObjectName, _mhvEventCount, _mhvTimezone) |
| #define | MHV_RTC_CREATE(_mhvObjectName, _mhvEventCount) |
Typedefs |
| typedef struct mhv_timestamp | MHV_TIMESTAMP |
| typedef enum mhv_weekday | MHV_WEEKDAY |
| typedef enum mhv_month | MHV_MONTH |
| typedef struct mhv_time | MHV_TIME |
| typedef struct mhv_alarm | MHV_ALARM |
Enumerations |
| enum | mhv_weekday {
MHV_SUNDAY,
MHV_MONDAY,
MHV_TUESDAY,
MHV_WEDNESDAY,
MHV_THURSDAY,
MHV_FRIDAY,
MHV_SATURDAY
} |
| enum | mhv_month {
MHV_JANUARY = 1,
MHV_FEBRUARY = 2,
MHV_MARCH = 3,
MHV_APRIL = 4,
MHV_MAY = 5,
MHV_JUNE = 6,
MHV_JULY = 7,
MHV_AUGUST = 8,
MHV_SEPTEMBER = 9,
MHV_OCTOBER = 10,
MHV_NOVEMBER = 11,
MHV_DECEMBER = 12
} |
Functions |
| void | mhv_timestampIncrement (MHV_TIMESTAMP *timestamp, uint32_t seconds, uint16_t milliseconds) |
| void | mhv_timestampIncrement (MHV_TIMESTAMP *timestamp, MHV_TIMESTAMP *timestamp2) |
| bool | mhv_isLeapYear (uint16_t year) |
| bool | mhv_timestampGreaterThanOrEqual (MHV_TIMESTAMP *first, MHV_TIMESTAMP *second) |
| bool | mhv_timestampLessThan (MHV_TIMESTAMP *first, MHV_TIMESTAMP *second) |
| uint8_t | mhv_daysInMonth (MHV_MONTH month, uint16_t year) |
Define Documentation
| #define MHV_RTC_CREATE |
( |
|
_mhvObjectName, |
|
|
|
_mhvEventCount |
|
) |
| |
Value:MHV_ALARM _mhvObjectName ## Alarms[_mhvEventCount]; \
MHV_RTC _mhvObjectName(_mhvObjectName ## Alarms, _mhvEventCount);
Create a new RTC
- Parameters:
-
| _mhvObjectName | the name of the RTC to create |
| _mhvEventCount | the number of events |
Definition at line 117 of file MHV_RTC.h.
| #define MHV_RTC_CREATE_TZ |
( |
|
_mhvObjectName, |
|
|
|
_mhvEventCount, |
|
|
|
_mhvTimezone |
|
) |
| |
Value:MHV_ALARM _mhvObjectName ## Alarms[_mhvEventCount]; \
MHV_RTC _mhvObjectName(_mhvObjectName ## Alarms, _mhvEventCount,_mhvTimezone);
Create a new RTC
- Parameters:
-
| _mhvObjectName | the name of the RTC to create |
| _mhvEventCount | the number of events |
| _mhvTimezone | the timezone |
Definition at line 108 of file MHV_RTC.h.
Typedef Documentation
Enumeration Type Documentation
- Enumerator:
| MHV_JANUARY |
|
| MHV_FEBRUARY |
|
| MHV_MARCH |
|
| MHV_APRIL |
|
| MHV_MAY |
|
| MHV_JUNE |
|
| MHV_JULY |
|
| MHV_AUGUST |
|
| MHV_SEPTEMBER |
|
| MHV_OCTOBER |
|
| MHV_NOVEMBER |
|
| MHV_DECEMBER |
|
Definition at line 50 of file MHV_RTC.h.
- Enumerator:
| MHV_SUNDAY |
|
| MHV_MONDAY |
|
| MHV_TUESDAY |
|
| MHV_WEDNESDAY |
|
| MHV_THURSDAY |
|
| MHV_FRIDAY |
|
| MHV_SATURDAY |
|
Definition at line 39 of file MHV_RTC.h.
Function Documentation
| uint8_t mhv_daysInMonth |
( |
MHV_MONTH |
month, |
|
|
uint16_t |
year |
|
) |
| |
Get the number of days in a month
- Parameters:
-
| month | the month |
| year | the year |
- Returns:
- the number of days
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.
Compare 2 timestamps
- Parameters:
-
| first | the first timestamp |
| second | the second timestamp |
- Returns:
- true if the first timestamp is greater than or equal to the second
Definition at line 72 of file MHV_RTC.cpp.
| void mhv_timestampIncrement |
( |
MHV_TIMESTAMP * |
timestamp, |
|
|
uint32_t |
seconds, |
|
|
uint16_t |
milliseconds |
|
) |
| |
Increment a timestamp
- Parameters:
-
| 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.
Increment a timestamp
- Parameters:
-
| timestamp | the timestamp to increment |
| timestamp2 | the timestamp to increment by |
Definition at line 118 of file MHV_RTC.cpp.
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
- Parameters:
-
| first | the first timestamp |
| second | the second timestamp |
- Returns:
- true if the first timestamp is less than the second
Definition at line 52 of file MHV_RTC.cpp.