Lines Matching full:count

162 /* Returns the number of nanoseconds to count the given number of cycles. */
163 static int64_t tim_calculate_step(uint32_t count, uint32_t prescale) in tim_calculate_step() argument
165 return (1000000000LL / TIM_REF_HZ) * count * (prescale + 1); in tim_calculate_step()
225 /* Enable the timer with zero initial count, then disable it again. */ in test_oneshot_enable_then_disable()
240 unsigned int count = 256; in test_oneshot_ps5() local
245 tim_write_ticr(td, count); in test_oneshot_ps5()
248 g_assert_cmpuint(tim_read_tdr(td), ==, count); in test_oneshot_ps5()
250 clock_step(tim_calculate_step(count, ps) - 1); in test_oneshot_ps5()
253 g_assert_cmpuint(tim_read_tdr(td), <, count); in test_oneshot_ps5()
259 g_assert_cmpuint(tim_read_tdr(td), ==, count); in test_oneshot_ps5()
269 clock_step(2 * tim_calculate_step(count, ps)); in test_oneshot_ps5()
278 unsigned int count = 1; in test_oneshot_ps0() local
283 tim_write_ticr(td, count); in test_oneshot_ps0()
286 g_assert_cmpuint(tim_read_tdr(td), ==, count); in test_oneshot_ps0()
288 clock_step(tim_calculate_step(count, ps) - 1); in test_oneshot_ps0()
291 g_assert_cmpuint(tim_read_tdr(td), <, count); in test_oneshot_ps0()
297 g_assert_cmpuint(tim_read_tdr(td), ==, count); in test_oneshot_ps0()
306 unsigned int count = (1U << 24) - 1; in test_oneshot_ps255() local
311 tim_write_ticr(td, count); in test_oneshot_ps255()
314 g_assert_cmpuint(tim_read_tdr(td), ==, count); in test_oneshot_ps255()
316 clock_step(tim_calculate_step(count, ps) - 1); in test_oneshot_ps255()
319 g_assert_cmpuint(tim_read_tdr(td), <, count); in test_oneshot_ps255()
325 g_assert_cmpuint(tim_read_tdr(td), ==, count); in test_oneshot_ps255()
334 unsigned int count = 256; in test_oneshot_interrupt() local
339 tim_write_ticr(td, count); in test_oneshot_interrupt()
355 unsigned int count = 256; in test_pause_resume() local
360 tim_write_ticr(td, count); in test_pause_resume()
364 clock_step(tim_calculate_step(count / 2, ps)); in test_pause_resume()
366 g_assert_cmpuint(tim_read_tdr(td), ==, count / 2); in test_pause_resume()
369 clock_step(2 * tim_calculate_step(count, ps)); in test_pause_resume()
370 g_assert_cmpuint(tim_read_tdr(td), ==, count / 2); in test_pause_resume()
376 clock_step(tim_calculate_step(count / 2, ps) - 1); in test_pause_resume()
377 g_assert_cmpuint(tim_read_tdr(td), <, count); in test_pause_resume()
391 unsigned int count = 256; in test_prescaler_change() local
396 tim_write_ticr(td, count); in test_prescaler_change()
400 clock_step(tim_calculate_step(count / 4, ps)); in test_prescaler_change()
401 g_assert_cmpuint(tim_read_tdr(td), ==, 3 * count / 4); in test_prescaler_change()
405 g_assert_cmpuint(tim_read_tdr(td), ==, 3 * count / 4); in test_prescaler_change()
408 clock_step(tim_calculate_step(count / 4, ps)); in test_prescaler_change()
409 g_assert_cmpuint(tim_read_tdr(td), ==, count / 2); in test_prescaler_change()
413 g_assert_cmpuint(tim_read_tdr(td), ==, count / 2); in test_prescaler_change()
416 clock_step(tim_calculate_step(count / 4, ps)); in test_prescaler_change()
417 g_assert_cmpuint(tim_read_tdr(td), ==, count / 4); in test_prescaler_change()
421 g_assert_cmpuint(tim_read_tdr(td), ==, count / 4); in test_prescaler_change()
424 clock_step(tim_calculate_step(count / 4, ps) - 1); in test_prescaler_change()
425 g_assert_cmpuint(tim_read_tdr(td), <, count); in test_prescaler_change()
437 unsigned int count = 2; in test_periodic_no_interrupt() local
443 tim_write_ticr(td, count); in test_periodic_no_interrupt()
463 unsigned int count = 65535; in test_periodic_interrupt() local
469 tim_write_ticr(td, count); in test_periodic_interrupt()
492 unsigned int count = 8; in test_disable_on_expiration() local
497 tim_write_ticr(td, count); in test_disable_on_expiration()
500 clock_step(tim_calculate_step(count, ps) - 1); in test_disable_on_expiration()