Lines Matching refs:chan_id

45 	uint8_t chan_id;  member
81 alarm_data->dev, alarm_data->chan_id, count, in alarm_callback()
176 static int counter_gecko_set_alarm(const struct device *dev, uint8_t chan_id, in counter_gecko_set_alarm() argument
189 if (chan_id >= STIMER_ALARM_NUM) { in counter_gecko_set_alarm()
194 error_code = sl_sleeptimer_is_timer_running(&alarm_timer[chan_id], &is_alarm_timer_running); in counter_gecko_set_alarm()
196 sl_sleeptimer_stop_timer(&alarm_timer[chan_id]); in counter_gecko_set_alarm()
203 dev_data->alarm[chan_id].ticks = top_val + (alarm_cfg->ticks - now_ticks); in counter_gecko_set_alarm()
205 dev_data->alarm[chan_id].ticks = in counter_gecko_set_alarm()
211 dev_data->alarm[chan_id].ticks = alarm_cfg->ticks; in counter_gecko_set_alarm()
214 dev_data->alarm[chan_id].callback = alarm_cfg->callback; in counter_gecko_set_alarm()
215 dev_data->alarm[chan_id].chan_id = chan_id; in counter_gecko_set_alarm()
216 dev_data->alarm[chan_id].dev = (struct device *)dev; in counter_gecko_set_alarm()
217 dev_data->alarm[chan_id].user_data = (struct counter_alarm_cfg *)alarm_cfg; in counter_gecko_set_alarm()
220 sl_sleeptimer_start_timer(&alarm_timer[chan_id], dev_data->alarm[chan_id].ticks, in counter_gecko_set_alarm()
221 alarm_callback, (void *)&dev_data->alarm[chan_id], 0, 0); in counter_gecko_set_alarm()
226 static int counter_gecko_cancel_alarm(const struct device *dev, uint8_t chan_id) in counter_gecko_cancel_alarm() argument
230 if (chan_id >= STIMER_ALARM_NUM) { in counter_gecko_cancel_alarm()
235 sl_sleeptimer_stop_timer(&alarm_timer[chan_id]); in counter_gecko_cancel_alarm()
237 dev_data->alarm[chan_id].callback = NULL; in counter_gecko_cancel_alarm()
238 dev_data->alarm[chan_id].user_data = NULL; in counter_gecko_cancel_alarm()
240 LOG_DBG("cancel alarm: channel %u", chan_id); in counter_gecko_cancel_alarm()