![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
RTC Lib & Output
Dependencies: LM75B RTC8563 mbed
Date.cpp@2:101ad0c50fe1, 2015-04-16 (annotated)
- Committer:
- EmilMcDuck
- Date:
- Thu Apr 16 11:24:40 2015 +0000
- Revision:
- 2:101ad0c50fe1
- Child:
- 3:08812f743fea
Backup
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EmilMcDuck | 2:101ad0c50fe1 | 1 | #include "Date.h" |
EmilMcDuck | 2:101ad0c50fe1 | 2 | #include "const.h" |
EmilMcDuck | 2:101ad0c50fe1 | 3 | #include "mbed.h" |
EmilMcDuck | 2:101ad0c50fe1 | 4 | |
EmilMcDuck | 2:101ad0c50fe1 | 5 | // Date |
EmilMcDuck | 2:101ad0c50fe1 | 6 | uint8_t Date::getDay() |
EmilMcDuck | 2:101ad0c50fe1 | 7 | { |
EmilMcDuck | 2:101ad0c50fe1 | 8 | return read(DAYS); |
EmilMcDuck | 2:101ad0c50fe1 | 9 | } |
EmilMcDuck | 2:101ad0c50fe1 | 10 | uint8_t Date::getMonth() |
EmilMcDuck | 2:101ad0c50fe1 | 11 | { |
EmilMcDuck | 2:101ad0c50fe1 | 12 | return read(MONTHS); |
EmilMcDuck | 2:101ad0c50fe1 | 13 | } |
EmilMcDuck | 2:101ad0c50fe1 | 14 | uint8_t Date::getYear() |
EmilMcDuck | 2:101ad0c50fe1 | 15 | { |
EmilMcDuck | 2:101ad0c50fe1 | 16 | return read(YEARS); |
EmilMcDuck | 2:101ad0c50fe1 | 17 | } |
EmilMcDuck | 2:101ad0c50fe1 | 18 | |
EmilMcDuck | 2:101ad0c50fe1 | 19 | // Time |
EmilMcDuck | 2:101ad0c50fe1 | 20 | uint8_t Date::getHours() |
EmilMcDuck | 2:101ad0c50fe1 | 21 | { |
EmilMcDuck | 2:101ad0c50fe1 | 22 | return read(HOURS); |
EmilMcDuck | 2:101ad0c50fe1 | 23 | } |
EmilMcDuck | 2:101ad0c50fe1 | 24 | uint8_t Date::getMinutes() |
EmilMcDuck | 2:101ad0c50fe1 | 25 | { |
EmilMcDuck | 2:101ad0c50fe1 | 26 | return read(MINUTES); |
EmilMcDuck | 2:101ad0c50fe1 | 27 | } |
EmilMcDuck | 2:101ad0c50fe1 | 28 | uint8_t Date::getSeconds() |
EmilMcDuck | 2:101ad0c50fe1 | 29 | { |
EmilMcDuck | 2:101ad0c50fe1 | 30 | return read(SECONDS); |
EmilMcDuck | 2:101ad0c50fe1 | 31 | } |