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.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
src/Drivers/rtc.h@59:c68c5bc9d077, 2016-09-14 (annotated)
- Committer:
- davidjhoward
- Date:
- Wed Sep 14 22:26:43 2016 +0000
- Revision:
- 59:c68c5bc9d077
added RTC driver
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
davidjhoward | 59:c68c5bc9d077 | 1 | #ifndef _RTC_H_ |
davidjhoward | 59:c68c5bc9d077 | 2 | #define _RTC_H_ |
davidjhoward | 59:c68c5bc9d077 | 3 | |
davidjhoward | 59:c68c5bc9d077 | 4 | // ------------------------------------------------------------------------------------------------- |
davidjhoward | 59:c68c5bc9d077 | 5 | // globals |
davidjhoward | 59:c68c5bc9d077 | 6 | |
davidjhoward | 59:c68c5bc9d077 | 7 | #define RTC_ADDR 0xDE // control byte: 0b1101111(R/W) -> U9 MCP7940N |
davidjhoward | 59:c68c5bc9d077 | 8 | |
davidjhoward | 59:c68c5bc9d077 | 9 | extern int rtc_verbose; |
davidjhoward | 59:c68c5bc9d077 | 10 | |
davidjhoward | 59:c68c5bc9d077 | 11 | // ------------------------------------------------------------------------------------------------- |
davidjhoward | 59:c68c5bc9d077 | 12 | // function prototypes |
davidjhoward | 59:c68c5bc9d077 | 13 | |
davidjhoward | 59:c68c5bc9d077 | 14 | void rtc_init(void); |
davidjhoward | 59:c68c5bc9d077 | 15 | void rtc_regs(void); |
davidjhoward | 59:c68c5bc9d077 | 16 | |
davidjhoward | 59:c68c5bc9d077 | 17 | void rtc_print(void); |
davidjhoward | 59:c68c5bc9d077 | 18 | |
davidjhoward | 59:c68c5bc9d077 | 19 | void rtc_get_time(int* iyr, int* imo, int* idy, int* ihr, int* imn, int* isc); |
davidjhoward | 59:c68c5bc9d077 | 20 | void rtc_set_time(int iyr, int imo, int idy, int ihr, int imn, int isc); |
davidjhoward | 59:c68c5bc9d077 | 21 | |
davidjhoward | 59:c68c5bc9d077 | 22 | void rtc_set(const char* s); |
davidjhoward | 59:c68c5bc9d077 | 23 | |
davidjhoward | 59:c68c5bc9d077 | 24 | // ------------------------------------------------------------------------------------------------- |
davidjhoward | 59:c68c5bc9d077 | 25 | |
davidjhoward | 59:c68c5bc9d077 | 26 | #endif // _RTC_H_ |