Lines Matching full:data
67 struct counter_esp32_data *data = dev->data; in counter_esp32_init() local
78 timer_hal_init(&data->hal_ctx, cfg->group, cfg->index); in counter_esp32_init()
79 data->alarm_cfg.callback = NULL; in counter_esp32_init()
80 timer_ll_enable_intr(data->hal_ctx.dev, TIMER_LL_EVENT_ALARM(data->hal_ctx.timer_id), in counter_esp32_init()
82 timer_ll_clear_intr_status(data->hal_ctx.dev, TIMER_LL_EVENT_ALARM(data->hal_ctx.timer_id)); in counter_esp32_init()
83 timer_ll_enable_auto_reload(data->hal_ctx.dev, data->hal_ctx.timer_id, in counter_esp32_init()
85 timer_ll_set_clock_source(data->hal_ctx.dev, data->hal_ctx.timer_id, in counter_esp32_init()
87 timer_ll_set_clock_prescale(data->hal_ctx.dev, data->hal_ctx.timer_id, cfg->config.divider); in counter_esp32_init()
88 timer_ll_set_count_direction(data->hal_ctx.dev, data->hal_ctx.timer_id, in counter_esp32_init()
90 timer_ll_enable_alarm(data->hal_ctx.dev, data->hal_ctx.timer_id, cfg->config.alarm_en); in counter_esp32_init()
91 timer_ll_set_reload_value(data->hal_ctx.dev, data->hal_ctx.timer_id, 0); in counter_esp32_init()
92 timer_ll_enable_counter(data->hal_ctx.dev, data->hal_ctx.timer_id, cfg->config.counter_en); in counter_esp32_init()
95 ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED, &data->clock_src_hz); in counter_esp32_init()
111 struct counter_esp32_data *data = dev->data; in counter_esp32_start() local
113 timer_ll_enable_counter(data->hal_ctx.dev, data->hal_ctx.timer_id, TIMER_START); in counter_esp32_start()
120 struct counter_esp32_data *data = dev->data; in counter_esp32_stop() local
122 timer_ll_enable_counter(data->hal_ctx.dev, data->hal_ctx.timer_id, TIMER_PAUSE); in counter_esp32_stop()
129 struct counter_esp32_data *data = dev->data; in counter_esp32_get_value() local
131 timer_ll_trigger_soft_capture(data->hal_ctx.dev, data->hal_ctx.timer_id); in counter_esp32_get_value()
132 *ticks = (uint32_t)timer_ll_get_counter_value(data->hal_ctx.dev, data->hal_ctx.timer_id); in counter_esp32_get_value()
139 struct counter_esp32_data *data = dev->data; in counter_esp32_get_value_64() local
141 timer_ll_trigger_soft_capture(data->hal_ctx.dev, data->hal_ctx.timer_id); in counter_esp32_get_value_64()
142 *ticks = timer_ll_get_counter_value(data->hal_ctx.dev, data->hal_ctx.timer_id); in counter_esp32_get_value_64()
151 struct counter_esp32_data *data = dev->data; in counter_esp32_set_alarm() local
157 timer_ll_set_alarm_value(data->hal_ctx.dev, data->hal_ctx.timer_id, in counter_esp32_set_alarm()
160 timer_ll_set_alarm_value(data->hal_ctx.dev, data->hal_ctx.timer_id, in counter_esp32_set_alarm()
164 timer_ll_enable_intr(data->hal_ctx.dev, TIMER_LL_EVENT_ALARM(data->hal_ctx.timer_id), true); in counter_esp32_set_alarm()
165 timer_ll_enable_alarm(data->hal_ctx.dev, data->hal_ctx.timer_id, TIMER_ALARM_EN); in counter_esp32_set_alarm()
166 data->alarm_cfg.callback = alarm_cfg->callback; in counter_esp32_set_alarm()
167 data->alarm_cfg.user_data = alarm_cfg->user_data; in counter_esp32_set_alarm()
175 struct counter_esp32_data *data = dev->data; in counter_esp32_cancel_alarm() local
177 timer_ll_enable_intr(data->hal_ctx.dev, TIMER_LL_EVENT_ALARM(data->hal_ctx.timer_id), in counter_esp32_cancel_alarm()
179 timer_ll_enable_alarm(data->hal_ctx.dev, data->hal_ctx.timer_id, TIMER_ALARM_DIS); in counter_esp32_cancel_alarm()
197 struct counter_esp32_data *data = dev->data; in counter_esp32_get_pending_int() local
199 return timer_ll_get_intr_status(data->hal_ctx.dev); in counter_esp32_get_pending_int()
212 struct counter_esp32_data *data = dev->data; in counter_esp32_get_freq() local
214 return data->clock_src_hz / config->config.divider; in counter_esp32_get_freq()
233 struct counter_esp32_data *data = dev->data; in counter_esp32_isr() local
239 if (data->alarm_cfg.callback) { in counter_esp32_isr()
240 data->alarm_cfg.callback(dev, 0, now, data->alarm_cfg.user_data); in counter_esp32_isr()
243 timer_ll_clear_intr_status(data->hal_ctx.dev, TIMER_LL_EVENT_ALARM(data->hal_ctx.timer_id)); in counter_esp32_isr()