/* Convert an rtc_time from BCD to binary. * time: The destination buffer. * bcd_time: The source buffer. */ void rtc_time_from_bcd(struct rtc_time *time, const struct rtc_time *bcd_time) { time->second = bcd_to_byte(bcd_time->second); time->minute = bcd_to_byte(bcd_time->minute); time->hour = bcd_to_byte(bcd_time->hour); time->day = bcd_to_byte(bcd_time->day); time->month = bcd_to_byte(bcd_time->month); time->year = bcd_to_byte(bcd_time->year); time->day_of_week = bcd_time->day_of_week; }
unsigned char rtc_gettimereg(unsigned char r) { return bcd_to_byte(rtc_readreg(r)); }