1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Add missing docs for DS3231RTC

This commit is contained in:
Rhys Weatherley 2015-03-29 08:28:01 +10:00
parent 4e14286e04
commit 591a344abc
2 changed files with 49 additions and 0 deletions

View File

@ -153,6 +153,11 @@ DS3231RTC::DS3231RTC(I2CMaster &bus, uint8_t oneHzPin)
} }
} }
/**
* \fn bool DS3231RTC::isRealTime() const
* \brief Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
*/
/** /**
* \fn bool DS3231RTC::hasUpdates() * \fn bool DS3231RTC::hasUpdates()
* \brief Returns true if there are updates * \brief Returns true if there are updates
@ -391,6 +396,15 @@ void DS3231RTC::clearAlarm(uint8_t alarmNum) {
} }
} }
/**
* \brief Sets the alarm with index \a alarmNum from \a value.
*
* The \a alarmNum parameter must be between 0 and \ref ALARM_COUNT - 1.
*
* \return Returns true if the alarm was set; false otherwise.
*
* \sa writeAlarm()
*/
bool DS3231RTC::setAlarm(uint8_t alarmNum, const RTCAlarm* value) { bool DS3231RTC::setAlarm(uint8_t alarmNum, const RTCAlarm* value) {
if ( _isRealTime ) { if ( _isRealTime ) {
uint8_t alarm_mask_bits = value->flags; uint8_t alarm_mask_bits = value->flags;
@ -582,6 +596,13 @@ bool DS3231RTC::writeRegister(uint8_t reg, uint8_t value) {
return _bus->endWrite(); return _bus->endWrite();
} }
/**
* \brief Enables a specific alarm.
*
* \param alarmNum The alarm to enable.
*
* \sa disableAlarm()
*/
void DS3231RTC::enableAlarm(uint8_t alarmNum) { void DS3231RTC::enableAlarm(uint8_t alarmNum) {
uint8_t value = readRegister(DS3231_CONTROL); uint8_t value = readRegister(DS3231_CONTROL);
@ -594,6 +615,13 @@ void DS3231RTC::enableAlarm(uint8_t alarmNum) {
writeRegister(DS3231_CONTROL, value); writeRegister(DS3231_CONTROL, value);
} }
/**
* \brief Disables a specific alarm.
*
* \param alarmNum The alarm to disable.
*
* \sa enableAlarm()
*/
void DS3231RTC::disableAlarm(uint8_t alarmNum) { void DS3231RTC::disableAlarm(uint8_t alarmNum) {
uint8_t value = readRegister(DS3231_CONTROL); uint8_t value = readRegister(DS3231_CONTROL);

View File

@ -460,6 +460,20 @@ RTC::DayOfWeek RTC::dayOfWeek(const RTCDate *date)
* \sa RTCTime, RTCDate, RTC * \sa RTCTime, RTCDate, RTC
*/ */
/**
* \var RTCAlarm::day
* \brief Day of the month for the alarm if not zero.
*
* \note Currently this field only works with the DS3231RTC class.
*/
/**
* \var RTCAlarm::dow
* \brief Day of the week for the alarm if not zero.
*
* \note Currently this field only works with the DS3231RTC class.
*/
/** /**
* \var RTCAlarm::hour * \var RTCAlarm::hour
* \brief Hour of the day for the alarm (0-23). * \brief Hour of the day for the alarm (0-23).
@ -470,6 +484,13 @@ RTC::DayOfWeek RTC::dayOfWeek(const RTCDate *date)
* \brief Minute of the hour for the alarm (0-59). * \brief Minute of the hour for the alarm (0-59).
*/ */
/**
* \var RTCAlarm::second
* \brief Second of the minute for the alarm (0-59).
*
* \note Currently this field only works with the DS3231RTC class.
*/
/** /**
* \var RTCAlarm::flags * \var RTCAlarm::flags
* \brief Additional flags for the alarm. * \brief Additional flags for the alarm.