A feature complete driver for the ISL1208 real time clock from Intersil.

Dependents:   ISL1208_HelloWorld

Revision:
2:f33dbb2535a3
Parent:
0:697ca602e934
Child:
3:115e4dacfe07
--- a/ISL1208.cpp	Mon Sep 16 22:06:51 2013 +0000
+++ b/ISL1208.cpp	Thu Nov 07 17:58:43 2013 +0000
@@ -18,7 +18,8 @@
 
 ISL1208::ISL1208(PinName sda, PinName scl) : m_I2C(sda, scl)
 {
-    //Nothing else to initialize
+    //Set the I2C bus frequency to 400kHz
+    m_I2C.frequency(400000);
 }
 
 bool ISL1208::open(OscillatorMode mode)
@@ -48,7 +49,7 @@
     }
 }
 
-time_t ISL1208::time(void)
+time_t ISL1208::time()
 {
     //Setup a tm structure based on the RTC
     struct tm timeinfo;
@@ -110,7 +111,7 @@
     write8(REG_CTL_SR, sr);
 }
 
-bool ISL1208::powerFailed(void)
+bool ISL1208::powerFailed()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_SR);
@@ -122,7 +123,7 @@
         return false;
 }
 
-bool ISL1208::batteryFlag(void)
+bool ISL1208::batteryFlag()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_SR);
@@ -134,7 +135,7 @@
         return false;
 }
 
-void ISL1208::clearBatteryFlag(void)
+void ISL1208::clearBatteryFlag()
 {
     //Read the current 8-bit register value
     char value = read8(REG_CTL_SR);
@@ -146,7 +147,7 @@
     write8(REG_CTL_SR, value);
 }
 
-bool ISL1208::alarmFlag(void)
+bool ISL1208::alarmFlag()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_SR);
@@ -158,7 +159,7 @@
         return false;
 }
 
-void ISL1208::clearAlarmFlag(void)
+void ISL1208::clearAlarmFlag()
 {
     //Read the current 8-bit register value
     char value = read8(REG_CTL_SR);
@@ -170,7 +171,7 @@
     write8(REG_CTL_SR, value);
 }
 
-ISL1208::OutputFrequency ISL1208::foutFrequency(void)
+ISL1208::OutputFrequency ISL1208::foutFrequency()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_INT);
@@ -194,7 +195,7 @@
     write8(REG_CTL_INT, value);
 }
 
-bool ISL1208::outputOnBattery(void)
+bool ISL1208::outputOnBattery()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_INT);
@@ -221,7 +222,7 @@
     write8(REG_CTL_INT, value);
 }
 
-ISL1208::PowerMode ISL1208::powerMode(void)
+ISL1208::PowerMode ISL1208::powerMode()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_INT);
@@ -248,7 +249,7 @@
     write8(REG_CTL_INT, value);
 }
 
-ISL1208::AlarmMode ISL1208::alarmMode(void)
+ISL1208::AlarmMode ISL1208::alarmMode()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_INT);
@@ -282,7 +283,7 @@
     write8(REG_CTL_INT, value);
 }
 
-float ISL1208::analogTrim(void)
+float ISL1208::analogTrim()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_ATR);
@@ -330,7 +331,7 @@
     write8(REG_CTL_ATR, reg);
 }
 
-ISL1208::BatteryModeATR ISL1208::batteryModeATR(void)
+ISL1208::BatteryModeATR ISL1208::batteryModeATR()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_ATR);
@@ -357,7 +358,7 @@
     write8(REG_CTL_ATR, value);
 }
 
-ISL1208::DigitalTrim ISL1208::digitalTrim(void)
+ISL1208::DigitalTrim ISL1208::digitalTrim()
 {
     //Read the 8-bit register value
     char value = read8(REG_CTL_DTR);
@@ -384,7 +385,7 @@
     write8(REG_CTL_DTR, value);
 }
 
-time_t ISL1208::alarmTime(void)
+time_t ISL1208::alarmTime()
 {
     //Setup a tm structure based on the RTC
     struct tm timeinfo;
@@ -436,7 +437,7 @@
         write8(REG_ALM_DWA, 0x0);
 }
 
-unsigned short ISL1208::sram(void)
+unsigned short ISL1208::sram()
 {
     //Return the complete contents of the SRAM
     return read16(REG_USR_USR1);