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
Task Alarm
- Task_Init: Integrieren Sie die Funktion rtc_alarm() als Methode in die Klasse RTC8563, sodass Sie denAlarm einstellen können (siehe Projekt RTC)
void rtc_alarm()
{
//pc.printf("Setting up RTC\n");
// Formatierung
// 2015/01/24
// 17:02:00 MON
week_val = 0x05; // SAT
rtc_write(CONTROL1, 0x20); //stop
rtc_write(CONTROL2, 0x02); // alarm AF alarm flag bit
rtc_write(DAY_ALARM, (0x80) );
rtc_write(HOUR_ALARM, (0x97));
rtc_write(MINUTE_ALARM, (0x02));
rtc_write(WEEKDAY_ALARM, (0x80));
rtc_write(CONTROL1, 0x00); //start
}
Ausgabe in main():
//Alarm-Zeit Ausgabe
pc.printf("ALARM RTC8563 CLOCK\n" );
pc.printf("%x%x:%x%x %s\n",
((hour_a >> 4) & 0x03), (hour_a & 0x0F),
(minute_a >> 4 & 0x03), (minute_a & 0x0F),
week_chr[week_a & 0x07]);