Lines Matching refs:buf
18 u8 buf[7]; in sandbox_rtc_get() local
21 ret = dm_i2c_read(dev, REG_SEC, buf, sizeof(buf)); in sandbox_rtc_get()
25 time->tm_sec = buf[REG_SEC - REG_SEC]; in sandbox_rtc_get()
26 time->tm_min = buf[REG_MIN - REG_SEC]; in sandbox_rtc_get()
27 time->tm_hour = buf[REG_HOUR - REG_SEC]; in sandbox_rtc_get()
28 time->tm_mday = buf[REG_MDAY - REG_SEC]; in sandbox_rtc_get()
29 time->tm_mon = buf[REG_MON - REG_SEC]; in sandbox_rtc_get()
30 time->tm_year = buf[REG_YEAR - REG_SEC] + 1900; in sandbox_rtc_get()
31 time->tm_wday = buf[REG_WDAY - REG_SEC]; in sandbox_rtc_get()
38 u8 buf[7]; in sandbox_rtc_set() local
41 buf[REG_SEC - REG_SEC] = time->tm_sec; in sandbox_rtc_set()
42 buf[REG_MIN - REG_SEC] = time->tm_min; in sandbox_rtc_set()
43 buf[REG_HOUR - REG_SEC] = time->tm_hour; in sandbox_rtc_set()
44 buf[REG_MDAY - REG_SEC] = time->tm_mday; in sandbox_rtc_set()
45 buf[REG_MON - REG_SEC] = time->tm_mon; in sandbox_rtc_set()
46 buf[REG_YEAR - REG_SEC] = time->tm_year - 1900; in sandbox_rtc_set()
47 buf[REG_WDAY - REG_SEC] = time->tm_wday; in sandbox_rtc_set()
49 ret = dm_i2c_write(dev, REG_SEC, buf, sizeof(buf)); in sandbox_rtc_set()