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
Klasse Date von RTC8563 ableiten
Das UML Diagramm zeigt die Ableitung der Klasse Date von der Basisklasse RTC8563
Die Klasse Date erbt alle Membervariable (i2c) und Methoden (rtc_read, ...) von der Basisklasse RTC8563:
Die Klassendeklaration erfolgt in Date.h:
class Date : public RTC8563 { private: uint8_t bcdToUint(uint8_t const nybbles); // Methode public: Date() {} // Standardkonstruktor uint8_t GetDay(); // Methode };
Die Definition der Methoden in der Klasse Date.cpp:
uint8_t Date::bcdToUint(uint8_t const nybbles) // Wandelt BCD-Wert in Integer um { uint8_t result; result = (nybbles >> 4) * 10 + (nybbles & 0x0F); return result; } uint8_t Date :: GetDay() { uint8_t s = rtc_read(DAYS); return bcdToUint(s&0x3F); }