Add wrapper to write complete register

This commit is contained in:
BlackMark 2020-05-17 18:59:38 +02:00
parent c3f9aa6a13
commit 3029c3cfe0

View File

@ -262,6 +262,12 @@ class DS3231 {
i2c_t::stop();
}
template <typename Register>
static void writeRegister(const Register &reg)
{
writePartialRegister<0, sizeof(Register) - 1>(reg);
}
static uint8_t calcDayOfWeek(uint16_t year, uint8_t month, uint16_t day)
{
day += month < 3 ? year-- : year - 2;