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: mbed
You are viewing an older revision! See the latest version
Task Init
- Task_Init: Integrieren Sie die Funktion rtc_init() als Methode in die Klasse RTC8563, sodass Sie die aktuelle Datum/Zeitbasis einstellen können.
void rtc_init()
{
pc.printf("Setting up RTC\n");
// Formatierung
// 2015/01/24
// 10:32:00
week_val = 0x04; // SAT
rtc_write(CONTROL1, 0x20); //stop
rtc_write(CONTROL2, 0x00);
rtc_write(YEARS, (0x15));
rtc_write(MONTHS, (0x03));
rtc_write(DAYS, (0x13));
rtc_write(HOURS, (0x14));
rtc_write(MINUTES, (0x47));
rtc_write(SECONDS, (0x00));
rtc_write(WEEKDAYS, week_val);
rtc_write(CLOCKOUT_FREQ, 0x00); // 0x83 = TE on & 1Hz
rtc_write(TIMER_CINTROL, 0x00);
rtc_write(CONTROL1, 0x00); //start
}