Lines Matching refs:date
461 uint8_t date[7]; in rv3028_set_time() local
478 date[0] = bin2bcd(timeptr->tm_sec) & RV3028_SECONDS_MASK; in rv3028_set_time()
479 date[1] = bin2bcd(timeptr->tm_min) & RV3028_MINUTES_MASK; in rv3028_set_time()
480 date[2] = bin2bcd(timeptr->tm_hour) & RV3028_HOURS_24H_MASK; in rv3028_set_time()
481 date[3] = timeptr->tm_wday & RV3028_WEEKDAY_MASK; in rv3028_set_time()
482 date[4] = bin2bcd(timeptr->tm_mday) & RV3028_DATE_MASK; in rv3028_set_time()
483 date[5] = bin2bcd(timeptr->tm_mon + RV3028_MONTH_OFFSET) & RV3028_MONTH_MASK; in rv3028_set_time()
484 date[6] = bin2bcd(timeptr->tm_year - RV3028_YEAR_OFFSET) & RV3028_YEAR_MASK; in rv3028_set_time()
486 err = rv3028_write_regs(dev, RV3028_REG_SECONDS, &date, sizeof(date)); in rv3028_set_time()
503 uint8_t date[7]; in rv3028_get_time() local
520 err = rv3028_read_regs(dev, RV3028_REG_SECONDS, date, sizeof(date)); in rv3028_get_time()
526 timeptr->tm_sec = bcd2bin(date[0] & RV3028_SECONDS_MASK); in rv3028_get_time()
527 timeptr->tm_min = bcd2bin(date[1] & RV3028_MINUTES_MASK); in rv3028_get_time()
528 timeptr->tm_hour = bcd2bin(date[2] & RV3028_HOURS_24H_MASK); in rv3028_get_time()
529 timeptr->tm_wday = date[3] & RV3028_WEEKDAY_MASK; in rv3028_get_time()
530 timeptr->tm_mday = bcd2bin(date[4] & RV3028_DATE_MASK); in rv3028_get_time()
531 timeptr->tm_mon = bcd2bin(date[5] & RV3028_MONTH_MASK) - RV3028_MONTH_OFFSET; in rv3028_get_time()
532 timeptr->tm_year = bcd2bin(date[6] & RV3028_YEAR_MASK) + RV3028_YEAR_OFFSET; in rv3028_get_time()