Lines Matching refs:time

106 static int32_t HiRtcReadTimeData(struct RtcConfigInfo *rtcInfo, struct RtcTimeReg *regAddr, struct RtcTime *time)
118 if (regAddr == NULL || time == NULL) {
127 time->millisecond = millisecond * MS_OF_ACCURACY;
152 TimestampToRtcTime(time, seconds);
169 HDF_LOGW("low voltage detected, date/time is not reliable");
197 static int32_t HiRtcReadTime(struct RtcHost *host, struct RtcTime *time)
233 return HiRtcReadTimeData(rtcInfo, &regAddr, time);
236 static int32_t HiRtcWriteTimeData(struct RtcConfigInfo *rtcInfo, struct RtcTimeReg *regAddr, const struct RtcTime *time)
243 if (regAddr == NULL || time == NULL) {
248 seconds = RtcTimeToTimestamp(time);
250 millisecond = time->millisecond / MS_OF_ACCURACY;
256 ret = HiRtcSpiWrite(rtcInfo, regAddr->secondAddr, time->second);
260 ret = HiRtcSpiWrite(rtcInfo, regAddr->minuteAddr, time->minute);
264 ret = HiRtcSpiWrite(rtcInfo, regAddr->hourAddr, time->hour);
280 static int32_t HiRtcWriteTime(struct RtcHost *host, const struct RtcTime *time)
301 if (HiRtcWriteTimeData(rtcInfo, &regAddr, time) != HDF_SUCCESS) {
302 HDF_LOGE("HiRtcWriteTime: write time data fail!");
328 static int32_t HiReadAlarm(struct RtcHost *host, enum RtcAlarmIndex alarmIndex, struct RtcTime *time)
351 return HiRtcReadTimeData(rtcInfo, &regAddr, time);
354 static int32_t HiWriteAlarm(struct RtcHost *host, enum RtcAlarmIndex alarmIndex, const struct RtcTime *time)
377 return HiRtcWriteTimeData(rtcInfo, &regAddr, time);
780 HDF_LOGW("HiRtcHwInit: low voltage detected, date/time is not reliable");