Lines Matching defs:count
28 /// Maximum value of (16-bit) count
59 * \brief Set hardware timer mode and count value
65 * \param count Count for oneshot timer, rate for ticker
68 static void timer0_set(uint16_t count, bool periodic)
72 periodic ? "periodic" : "one-shot", count);
81 // Prepare timer 0 to set its count
84 if (count > 0) {
85 // Set the count/rate (LSB, then MSB)
86 lpc_timer_cntacc0_wr(&timer, count & 0xff);
87 lpc_timer_cntacc0_wr(&timer, count >> 8);
103 // 1. Issue read back command to read the status and count of the counter
106 .stat = 0, .count = 0 // latch both status and count
114 // (we must do this even if the status shows an invalid count)
119 status.cnt_stat ? " null count read," : "", val);
122 // the count may be invalid ("null count"), so we repeat the whole rigmarole
210 // convert to timer count value
211 uint64_t count = us * 1000 / TIMER0_PERIOD_NS;
213 // program hardware timer for max(TIMER_MAX_COUNT, count)
214 if (count > TIMER_MAX_COUNT) {
215 timer_remainder = count - TIMER_MAX_COUNT;
216 count = TIMER_MAX_COUNT;
221 timer0_set(count, false);
224 us, count, timer_remainder);