I2Cdevlib

I2C device library collection for AVR/Arduino or other C++-based MCUs

Public Member Functions
DS1307 Class Reference

Public Member Functions

  DS1307 ()
  DS1307 (uint8_t address)
void  initialize ()
bool  testConnection ()
bool  getClockRunning ()
void  setClockRunning (bool running)
uint8_t  getSeconds ()
void  setSeconds (uint8_t seconds)
uint8_t  getMinutes ()
void  setMinutes (uint8_t minutes)
uint8_t  getMode ()
void  setMode (uint8_t mode)
uint8_t  getAMPM ()
void  setAMPM (uint8_t ampm)
uint8_t  getHours12 ()
void  setHours12 (uint8_t hours, uint8_t ampm)
uint8_t  getHours24 ()
void  setHours24 (uint8_t hours)
uint8_t  getDayOfWeek ()
void  setDayOfWeek (uint8_t dow)
uint8_t  getDay ()
void  setDay (uint8_t day)
uint8_t  getMonth ()
void  setMonth (uint8_t month)
uint16_t  getYear ()
void  setYear (uint16_t year)
bool  getFixedOutputLevel ()
void  setFixedOutputLevel (bool level)
bool  getSquareWaveEnabled ()
void  setSquareWaveEnabled (bool enabled)
uint8_t  getSquareWaveRate ()
void  setSquareWaveRate (uint8_t rate)
uint8_t  getMemoryByte (uint8_t offset)
void  setMemoryByte (uint8_t offset, uint8_t value)
void  getDate (uint16_t *year, uint8_t *month, uint8_t *day)
void  setDate (uint16_t year, uint8_t month, uint8_t day)
void  getTime12 (uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint8_t *ampm)
void  setTime12 (uint8_t hours, uint8_t minutes, uint8_t seconds, uint8_t ampm)
void  getTime24 (uint8_t *hours, uint8_t *minutes, uint8_t *seconds)
void  setTime24 (uint8_t hours, uint8_t minutes, uint8_t seconds)
void  getDateTime12 (uint16_t *year, uint8_t *month, uint8_t *day, uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint8_t *ampm)
void  setDateTime12 (uint16_t year, uint8_t month, uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds, uint8_t ampm)
void  getDateTime24 (uint16_t *year, uint8_t *month, uint8_t *day, uint8_t *hours, uint8_t *minutes, uint8_t *seconds)
void  setDateTime24 (uint16_t year, uint8_t month, uint8_t day, uint8_t hours, uint8_t minutes, uint8_t seconds)
DateTime  getDateTime ()
void  setDateTime (DateTime dt)

Constructor & Destructor Documentation

DS1307::DS1307 ( )

Default constructor, uses default I2C address.

See also:
DS1307_DEFAULT_ADDRESS
DS1307::DS1307 ( uint8_t  address )

Specific address constructor.

Parameters:
address I2C address
See also:
DS1307_DEFAULT_ADDRESS
DS1307_ADDRESS

Member Function Documentation

void DS1307::initialize ( )

Power on and prepare for general usage. This method reads the current 12/24-hour mode setting into the locally stored variable so that it isn't accidentally changed by the setHour*() methods.

bool DS1307::testConnection ( )

Verify the I2C connection. Make sure the device is connected and responds as expected.

Returns:
True if connection is valid, false otherwise

The documentation for this class was generated from the following files:
[フレーム]

Generated on Sun Nov 13 2011 21:37:27 for I2Cdevlib by doxygen 1.7.4

AltStyle によって変換されたページ (->オリジナル) /