Lines Matching refs:tod
126 uint8_t tod[8];
134 rc = octrtc_read(&tod[0], 1); /* ia read */
141 rc = octrtc_read(&tod[i], 0); /* current address */
146 DPRINTF(("%#X ", tod[i]));
155 if ((check & 0xf) == (tod[0] & 0xf))
161 ((tod[5] & 0x80) ? 2000 : 1900) + FROMBCD(tod[6]), /* year */
162 FROMBCD(tod[5] & 0x1f), /* month */
163 FROMBCD(tod[4] & 0x3f), /* day */
164 (tod[3] & 0x7), /* day of the week */
165 FROMBCD(tod[2] & 0x3f), /* hour */
166 FROMBCD(tod[1] & 0x7f), /* minute */
167 FROMBCD(tod[0] & 0x7f))); /* second */
169 dt.dt_year = ((tod[5] & 0x80) ? 2000 : 1900) + FROMBCD(tod[6]);
170 dt.dt_mon = FROMBCD(tod[5] & 0x1f);
171 dt.dt_day = FROMBCD(tod[4] & 0x3f);
172 dt.dt_hour = FROMBCD(tod[2] & 0x3f);
173 if ((tod[2] & 0x40) && (tod[2] & 0x20)) /* adjust AM/PM format */
175 dt.dt_min = FROMBCD(tod[1] & 0x7f);
176 dt.dt_sec = FROMBCD(tod[0] & 0x7f);
243 uint8_t tod[8];
252 tod[0] = TOBCD(dt.dt_sec);
253 tod[1] = TOBCD(dt.dt_min);
254 tod[2] = TOBCD(dt.dt_hour);
255 tod[3] = TOBCD(dt.dt_wday + 1);
256 tod[4] = TOBCD(dt.dt_day);
257 tod[5] = TOBCD(dt.dt_mon);
259 tod[5] |= 0x80;
260 tod[6] = TOBCD(dt.dt_year % 100);
264 rc = octrtc_write(tod[i]);
277 if ((check & 0xf) == (tod[0] & 0xf))