Lines Matching full:interval

46 /* sensor_later_config including arbitrate/set interval/sensitivity
52 uint32_t interval; in arbitrate_interval() local
54 /* search from all clients, arbitrate the interval */ in arbitrate_interval()
56 LOG_INF("arbitrate interval, sensor:%s for each conn:%p, interval:%d(us)", in arbitrate_interval()
57 sensor->dev->name, conn, conn->interval); in arbitrate_interval()
61 if (conn->interval < min_interval) { in arbitrate_interval()
62 min_interval = conn->interval; in arbitrate_interval()
66 * then interval should be 0 in arbitrate_interval()
68 interval = (min_interval == UINT32_MAX ? 0 : min_interval); in arbitrate_interval()
70 LOG_DBG("arbitrate interval, sensor:%s, interval:%d(us)", in arbitrate_interval()
71 sensor->dev->name, interval); in arbitrate_interval()
73 return interval; in arbitrate_interval()
76 static int set_arbitrate_interval(struct sensing_sensor *sensor, uint32_t interval) in set_arbitrate_interval() argument
82 __ASSERT(sensor && sensor->dev, "set arbitrate interval, sensor or sensor device is NULL"); in set_arbitrate_interval()
84 LOG_INF("set arbitrate interval:%d, sensor:%s, is_streaming:%d", in set_arbitrate_interval()
85 interval, sensor->dev->name, config->is_streaming); in set_arbitrate_interval()
87 if (interval) { in set_arbitrate_interval()
88 odr.val1 = USEC_PER_SEC / interval; in set_arbitrate_interval()
89 odr.val2 = (uint64_t)USEC_PER_SEC * 1000000 / interval % 1000000; in set_arbitrate_interval()
99 if (sensor->interval) { in set_arbitrate_interval()
107 if (interval) { in set_arbitrate_interval()
112 k_timer_start(&sensor->timer, K_USEC(interval), in set_arbitrate_interval()
113 K_USEC(interval)); in set_arbitrate_interval()
117 sensor->interval = interval; in set_arbitrate_interval()
124 uint32_t interval = arbitrate_interval(sensor); in config_interval() local
126 LOG_INF("config interval, sensor:%s, interval:%d", sensor->dev->name, interval); in config_interval()
128 return set_arbitrate_interval(sensor, interval); in config_interval()
191 LOG_WRN("sensor:%s config interval error", sensor->dev->name); in config_sensor()
276 conn->interval = 0; in init_connection()
410 int set_interval(struct sensing_connection *conn, uint32_t interval) in set_interval() argument
412 LOG_INF("set interval, sensor:%s, interval:%u(us)", conn->source->dev->name, interval); in set_interval()
414 __ASSERT(conn && conn->source, "set interval, connection or reporter not be NULL"); in set_interval()
416 if (interval > 0 && interval < conn->source->info->minimal_interval) { in set_interval()
417 LOG_ERR("interval:%d(us) should no less than min interval:%d(us)", in set_interval()
418 interval, conn->source->info->minimal_interval); in set_interval()
422 conn->interval = interval; in set_interval()
425 LOG_INF("set interval, sensor:%s, conn:%p, interval:%d", in set_interval()
426 conn->source->dev->name, conn, interval); in set_interval()
433 int get_interval(struct sensing_connection *conn, uint32_t *interval) in get_interval() argument
435 __ASSERT(conn, "get interval, connection not be NULL"); in get_interval()
436 *interval = conn->interval; in get_interval()
438 LOG_INF("get interval, sensor:%s, interval:%u(us)", conn->source->dev->name, *interval); in get_interval()