A feature complete driver for the ISL1208 real time clock from Intersil.
Dependents: ISL1208_HelloWorld
Diff: ISL1208.h
- Revision:
- 4:42dc07f9ffb3
- Parent:
- 2:f33dbb2535a3
- Child:
- 5:d67ac8351c76
--- a/ISL1208.h Thu Nov 07 18:21:19 2013 +0000 +++ b/ISL1208.h Tue Nov 12 17:15:20 2013 +0000 @@ -32,9 +32,12 @@ * int main() * { * //Try to open the ISL1208 - * if (rtc.open(ISL1208::OSCILLATOR_CRYSTAL)) { + * if (rtc.open()) { * printf("Device detected!\n"); * + * //Configure the oscillator for a 32.768kHz crystal + * rtc.oscillatorMode(ISL1208::OSCILLATOR_CRYSTAL); + * * //Check if we need to reset the time * if (rtc.powerFailed()) { * //The time has been lost due to a power complete power failure @@ -138,14 +141,13 @@ */ ISL1208(PinName sda, PinName scl); - /** Probe for the ISL1208 and configures the oscillator mode if present + /** Probe for the ISL1208 and configure auto reset if present * - * @param mode The oscillator mode. * @returns * 'true' if the device exists on the bus, * 'false' if the device doesn't exist on the bus. */ - bool open(OscillatorMode mode); + bool open(); /** Get the current time from the ISL1208 * @@ -185,6 +187,18 @@ */ void clearAlarmFlag(); + /** Get the current oscillator mode of the ISL1208 + * + * @returns The current oscillator mode as a OscillatorMode enum. + */ + ISL1208::OscillatorMode oscillatorMode(); + + /** Set the oscillator mode of the ISL1208 + * + * @param mode The new oscillator mode as a OscillatorMode enum. + */ + void oscillatorMode(OscillatorMode mode); + /** Get the current output frequency on the IRQ/fOUT pin * * @returns The current output frequency.