Lines Matching +full:zephyr +full:- +full:base
2 * Copyright (c) 2018-2019 NXP
4 * SPDX-License-Identifier: Apache-2.0
8 #include <zephyr/drivers/counter.h>
9 #include <zephyr/device.h>
10 #include <zephyr/irq.h>
18 EPIT_Type *base; member
29 return CONTAINER_OF(dev->config, struct imx_epit_config, in get_epit_config()
35 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_isr() local
36 struct imx_epit_data *driver_data = dev->data; in imx_epit_isr()
38 EPIT_ClearStatusFlag(base); in imx_epit_isr()
40 if (driver_data->callback != NULL) { in imx_epit_isr()
41 driver_data->callback(dev, (void *)driver_data->user_data); in imx_epit_isr()
49 EPIT_Type *base = config->base; in imx_epit_init() local
59 config->info.freq = get_epit_clock_freq(base)/(config->prescaler + 1U); in imx_epit_init()
61 EPIT_Init(base, &epit_config); in imx_epit_init()
66 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_start() local
69 EPIT_SetClockSource(base, epitClockSourcePeriph); in imx_epit_start()
72 EPIT_SetPrescaler(base, get_epit_config(dev)->prescaler); in imx_epit_start()
75 EPIT_Enable(base); in imx_epit_start()
82 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_stop() local
85 EPIT_Disable(base); in imx_epit_stop()
92 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_get_value() local
94 *ticks = EPIT_GetCounterLoadValue(base) - EPIT_ReadCounter(base); in imx_epit_get_value()
102 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_set_top_value() local
103 struct imx_epit_data *driver_data = dev->data; in imx_epit_set_top_value()
106 EPIT_SetIntCmd(base, false); in imx_epit_set_top_value()
108 driver_data->callback = cfg->callback; in imx_epit_set_top_value()
109 driver_data->user_data = cfg->user_data; in imx_epit_set_top_value()
112 EPIT_SetOverwriteCounter(base, in imx_epit_set_top_value()
113 !(cfg->flags & COUNTER_TOP_CFG_DONT_RESET)); in imx_epit_set_top_value()
114 EPIT_SetCounterLoadValue(base, cfg->ticks); in imx_epit_set_top_value()
116 if (cfg->callback != NULL) { in imx_epit_set_top_value()
118 EPIT_SetIntCmd(base, true); in imx_epit_set_top_value()
126 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_get_pending_int() local
128 return EPIT_GetStatusFlag(base) ? 1U : 0U; in imx_epit_get_pending_int()
133 EPIT_Type *base = get_epit_config(dev)->base; in imx_epit_get_top_value() local
135 return EPIT_GetCounterLoadValue(base); in imx_epit_get_top_value()
156 .base = (EPIT_Type *)DT_INST_REG_ADDR(idx), \