A feature complete driver for the ISL1208 real time clock from Intersil.
Dependents: ISL1208_HelloWorld
Revision 6:c0635401a37f, committed 2014-05-02
- Comitter:
- neilt6
- Date:
- Fri May 02 17:27:38 2014 +0000
- Parent:
- 5:d67ac8351c76
- Commit message:
- Added an I2C frequency argument to the constructor
Changed in this revision
ISL1208.cpp | Show annotated file Show diff for this revision Revisions of this file |
ISL1208.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r d67ac8351c76 -r c0635401a37f ISL1208.cpp --- a/ISL1208.cpp Tue Nov 12 21:42:44 2013 +0000 +++ b/ISL1208.cpp Fri May 02 17:27:38 2014 +0000 @@ -18,10 +18,10 @@ const int ISL1208::m_ADDR = (0x6F << 1); -ISL1208::ISL1208(PinName sda, PinName scl) : m_I2C(sda, scl) +ISL1208::ISL1208(PinName sda, PinName scl, int hz) : m_I2C(sda, scl) { - //Set the I2C bus frequency to 400kHz - m_I2C.frequency(400000); + //Set the I2C bus frequency + m_I2C.frequency(hz); } bool ISL1208::open()
diff -r d67ac8351c76 -r c0635401a37f ISL1208.h --- a/ISL1208.h Tue Nov 12 21:42:44 2013 +0000 +++ b/ISL1208.h Fri May 02 17:27:38 2014 +0000 @@ -138,8 +138,9 @@ * * @param sda The I2C data pin. * @param scl The I2C clock pin. + * @param hz The I2C bus frequency (defaults to 400kHz). */ - ISL1208(PinName sda, PinName scl); + ISL1208(PinName sda, PinName scl, int hz = 400000); /** Probe for the ISL1208 and configure auto reset if present *