Lines Matching refs:data
147 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_test_alarms() local
150 for (uint16_t i = 0; i < data->alarms_count; i++) { in rtc_emul_test_alarms()
151 alarm = &data->alarms[i]; in rtc_emul_test_alarms()
158 (alarm->datetime.tm_sec != data->datetime.tm_sec)) { in rtc_emul_test_alarms()
163 (alarm->datetime.tm_min != data->datetime.tm_min)) { in rtc_emul_test_alarms()
168 (alarm->datetime.tm_hour != data->datetime.tm_hour)) { in rtc_emul_test_alarms()
173 (alarm->datetime.tm_mday != data->datetime.tm_mday)) { in rtc_emul_test_alarms()
178 (alarm->datetime.tm_mon != data->datetime.tm_mon)) { in rtc_emul_test_alarms()
183 (alarm->datetime.tm_wday != data->datetime.tm_wday)) { in rtc_emul_test_alarms()
203 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_invoke_update_callback() local
205 if (data->update_callback == NULL) { in rtc_emul_invoke_update_callback()
209 data->update_callback(dev, data->update_callback_user_data); in rtc_emul_invoke_update_callback()
217 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_update() local
221 K_SPINLOCK(&data->lock) { in rtc_emul_update()
222 rtc_emul_increment_tm(&data->datetime); in rtc_emul_update()
236 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_set_time() local
243 K_SPINLOCK(&data->lock) in rtc_emul_set_time()
245 data->datetime = *timeptr; in rtc_emul_set_time()
246 data->datetime.tm_isdst = -1; in rtc_emul_set_time()
247 data->datetime.tm_nsec = 0; in rtc_emul_set_time()
249 data->datetime_set = true; in rtc_emul_set_time()
257 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_get_time() local
265 K_SPINLOCK(&data->lock) in rtc_emul_get_time()
268 if (data->datetime_set == false) { in rtc_emul_get_time()
274 *timeptr = data->datetime; in rtc_emul_get_time()
284 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_alarm_get_supported_fields() local
286 if (data->alarms_count <= id) { in rtc_emul_alarm_get_supported_fields()
303 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_alarm_set_time() local
305 if (data->alarms_count <= id) { in rtc_emul_alarm_set_time()
319 K_SPINLOCK(&data->lock) in rtc_emul_alarm_set_time()
321 data->alarms[id].mask = mask; in rtc_emul_alarm_set_time()
324 data->alarms[id].datetime = *timeptr; in rtc_emul_alarm_set_time()
334 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_alarm_get_time() local
336 if (data->alarms_count <= id) { in rtc_emul_alarm_get_time()
340 K_SPINLOCK(&data->lock) in rtc_emul_alarm_get_time()
342 *timeptr = data->alarms[id].datetime; in rtc_emul_alarm_get_time()
343 *mask = data->alarms[id].mask; in rtc_emul_alarm_get_time()
351 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_alarm_is_pending() local
354 if (data->alarms_count <= id) { in rtc_emul_alarm_is_pending()
358 K_SPINLOCK(&data->lock) in rtc_emul_alarm_is_pending()
360 ret = (data->alarms[id].pending == true) ? 1 : 0; in rtc_emul_alarm_is_pending()
362 data->alarms[id].pending = false; in rtc_emul_alarm_is_pending()
371 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_alarm_set_callback() local
373 if (data->alarms_count <= id) { in rtc_emul_alarm_set_callback()
377 K_SPINLOCK(&data->lock) in rtc_emul_alarm_set_callback()
379 data->alarms[id].callback = callback; in rtc_emul_alarm_set_callback()
380 data->alarms[id].user_data = user_data; in rtc_emul_alarm_set_callback()
391 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_update_set_callback() local
393 K_SPINLOCK(&data->lock) in rtc_emul_update_set_callback()
395 data->update_callback = callback; in rtc_emul_update_set_callback()
396 data->update_callback_user_data = user_data; in rtc_emul_update_set_callback()
406 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_set_calibration() local
408 K_SPINLOCK(&data->lock) in rtc_emul_set_calibration()
410 data->calibration = calibration; in rtc_emul_set_calibration()
418 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_get_calibration() local
420 K_SPINLOCK(&data->lock) in rtc_emul_get_calibration()
422 *calibration = data->calibration; in rtc_emul_get_calibration()
450 struct rtc_emul_data *data = (struct rtc_emul_data *)dev->data; in rtc_emul_init() local
452 data->dwork.dev = dev; in rtc_emul_init()
453 k_work_init_delayable(&data->dwork.dwork, rtc_emul_update); in rtc_emul_init()
455 k_work_schedule(&data->dwork.dwork, K_MSEC(1000)); in rtc_emul_init()