Lines Matching full:inst

82 #define MCUX_ACMP_DT_INST_ENUM(inst, name, prop) \  argument
83 MCUX_ACMP_ENUM(name, DT_INST_STRING_TOKEN(inst, prop))
85 #define MCUX_ACMP_DT_INST_ENUM_OR(inst, name, prop, or) \ argument
86 COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, prop), \
87 (MCUX_ACMP_DT_INST_ENUM(inst, name, prop)), \
90 #define MCUX_ACMP_DT_INST_OFFSET_MODE(inst) \ argument
91 MCUX_ACMP_DT_INST_ENUM_OR(inst, OFFSET_MODE, offset_mode, LEVEL0)
93 #define MCUX_ACMP_DT_INST_HYST_MODE(inst) \ argument
94 MCUX_ACMP_DT_INST_ENUM_OR(inst, HYSTERESIS_MODE, hysteresis_mode, LEVEL0)
96 #define MCUX_ACMP_DT_INST_EN_HS_MODE(inst) \ argument
97 DT_INST_PROP(inst, enable_high_speed_mode)
99 #define MCUX_ACMP_DT_INST_INV_OUT(inst) \ argument
100 DT_INST_PROP(inst, invert_output)
102 #define MCUX_ACMP_DT_INST_USE_UNFILTERED_OUT(inst) \ argument
103 DT_INST_PROP(inst, use_unfiltered_output)
105 #define MCUX_ACMP_DT_INST_EN_PIN_OUT(inst) \ argument
106 DT_INST_PROP(inst, enable_pin_out)
108 #define MCUX_ACMP_DT_INST_MODE_CONFIG_INIT(inst) \ argument
110 .offset_mode = MCUX_ACMP_DT_INST_OFFSET_MODE(inst), \
111 .hysteresis_mode = MCUX_ACMP_DT_INST_HYST_MODE(inst), \
112 .enable_high_speed_mode = MCUX_ACMP_DT_INST_EN_HS_MODE(inst), \
113 .invert_output = MCUX_ACMP_DT_INST_INV_OUT(inst), \
114 .use_unfiltered_output = MCUX_ACMP_DT_INST_USE_UNFILTERED_OUT(inst), \
115 .enable_pin_output = MCUX_ACMP_DT_INST_EN_PIN_OUT(inst), \
118 #define MCUX_ACMP_DT_INST_P_MUX_IN(inst) \ argument
119 MCUX_ACMP_DT_INST_ENUM(inst, MUX_INPUT, positive_mux_input)
121 #define MCUX_ACMP_DT_INST_N_MUX_IN(inst) \ argument
122 MCUX_ACMP_DT_INST_ENUM(inst, MUX_INPUT, negative_mux_input)
124 #define MCUX_ACMP_DT_INST_P_PORT_IN(inst) \ argument
125 MCUX_ACMP_DT_INST_ENUM_OR(inst, PORT_INPUT, positive_port_input, MUX)
127 #define MCUX_ACMP_DT_INST_N_PORT_IN(inst) \ argument
128 MCUX_ACMP_DT_INST_ENUM_OR(inst, PORT_INPUT, negative_port_input, MUX)
130 #define MCUX_ACMP_DT_INST_INPUT_CONFIG_INIT(inst) \ argument
132 .positive_mux_input = MCUX_ACMP_DT_INST_P_MUX_IN(inst), \
133 .negative_mux_input = MCUX_ACMP_DT_INST_N_MUX_IN(inst), \
134 .positive_port_input = MCUX_ACMP_DT_INST_P_PORT_IN(inst), \
135 .negative_port_input = MCUX_ACMP_DT_INST_N_PORT_IN(inst), \
138 #define MCUX_ACMP_DT_INST_FILTER_EN_SAMPLE(inst) \ argument
139 DT_INST_PROP(inst, filter_enable_sample)
141 #define MCUX_ACMP_DT_INST_FILTER_COUNT(inst) \ argument
142 DT_INST_PROP_OR(inst, filter_count, 0)
144 #define MCUX_ACMP_DT_INST_FILTER_PERIOD(inst) \ argument
145 DT_INST_PROP_OR(inst, filter_period, 0)
147 #define MCUX_ACMP_DT_INST_FILTER_CONFIG_INIT(inst) \ argument
149 .enable_sample = MCUX_ACMP_DT_INST_FILTER_EN_SAMPLE(inst), \
150 .filter_count = MCUX_ACMP_DT_INST_FILTER_COUNT(inst), \
151 .filter_period = MCUX_ACMP_DT_INST_FILTER_PERIOD(inst), \
154 #define MCUX_ACMP_DT_INST_DAC_VREF_SOURCE(inst) \ argument
155 MCUX_ACMP_DT_INST_ENUM_OR(inst, DAC_VREF_SOURCE, dac_vref_source, VIN1)
157 #define MCUX_ACMP_DT_INST_DAC_VALUE(inst) \ argument
158 DT_INST_PROP_OR(inst, dac_value, 0)
160 #define MCUX_ACMP_DT_INST_DAC_EN(inst) \ argument
161 DT_INST_PROP(inst, dac_enable)
163 #define MCUX_ACMP_DT_INST_DAC_EN_HS(inst) \ argument
164 DT_INST_PROP(inst, dac_enable_high_speed)
166 #define MCUX_ACMP_DT_INST_DAC_CONFIG_INIT(inst) \ argument
168 .vref_source = MCUX_ACMP_DT_INST_DAC_VREF_SOURCE(inst), \
169 .value = MCUX_ACMP_DT_INST_DAC_VALUE(inst), \
170 .enable_output = MCUX_ACMP_DT_INST_DAC_EN(inst), \
171 .enable_high_speed_mode = MCUX_ACMP_DT_INST_DAC_EN_HS(inst), \
174 #define MCUX_ACMP_DT_INST_DM_EN_P_CH(inst) \ argument
175 DT_INST_PROP(inst, discrete_mode_enable_positive_channel)
177 #define MCUX_ACMP_DT_INST_DM_EN_N_CH(inst) \ argument
178 DT_INST_PROP(inst, discrete_mode_enable_negative_channel)
180 #define MCUX_ACMP_DT_INST_DM_EN_RES_DIV(inst) \ argument
181 DT_INST_PROP(inst, discrete_mode_enable_resistor_divider)
183 #define MCUX_ACMP_DT_INST_DM_CLOCK_SOURCE(inst) \ argument
184 MCUX_ACMP_DT_INST_ENUM_OR(inst, DM_CLOCK, discrete_mode_clock_source, SLOW)
186 #define MCUX_ACMP_DT_INST_DM_SAMPLE_TIME(inst) \ argument
187 MCUX_ACMP_DT_INST_ENUM_OR(inst, DM_SAMPLE_TIME, discrete_mode_sample_time, T1)
189 #define MCUX_ACMP_DT_INST_DM_PHASE1_TIME(inst) \ argument
190 MCUX_ACMP_DT_INST_ENUM_OR(inst, DM_PHASE_TIME, discrete_mode_phase1_time, ALT0)
192 #define MCUX_ACMP_DT_INST_DM_PHASE2_TIME(inst) \ argument
193 MCUX_ACMP_DT_INST_ENUM_OR(inst, DM_PHASE_TIME, discrete_mode_phase2_time, ALT0)
195 #define MCUX_ACMP_DT_INST_DM_CONFIG_INIT(inst) \ argument
197 .enable_positive_channel = MCUX_ACMP_DT_INST_DM_EN_P_CH(inst), \
198 .enable_negative_channel = MCUX_ACMP_DT_INST_DM_EN_N_CH(inst), \
199 .enable_resistor_divider = MCUX_ACMP_DT_INST_DM_EN_RES_DIV(inst), \
200 .clock_source = MCUX_ACMP_DT_INST_DM_CLOCK_SOURCE(inst), \
201 .sample_time = MCUX_ACMP_DT_INST_DM_SAMPLE_TIME(inst), \
202 .phase1_time = MCUX_ACMP_DT_INST_DM_PHASE1_TIME(inst), \
203 .phase2_time = MCUX_ACMP_DT_INST_DM_PHASE2_TIME(inst), \
206 #define MCUX_ACMP_DT_INST_EN_WINDOW_MODE(inst) \ argument
207 DT_INST_PROP(inst, enable_window_mode)
604 #define MCUX_ACMP_IRQ_HANDLER_SYM(inst) \ argument
605 _CONCAT(mcux_acmp_irq_init, inst)
607 #define MCUX_ACMP_IRQ_HANDLER_DEFINE(inst) \ argument
608 static void MCUX_ACMP_IRQ_HANDLER_SYM(inst)(void) \
610 IRQ_CONNECT(DT_INST_IRQN(inst), \
611 DT_INST_IRQ(inst, priority), \
613 DEVICE_DT_INST_GET(inst), \
616 irq_enable(DT_INST_IRQN(inst)); \
619 #define MCUX_ACMP_DEVICE(inst) \ argument
620 PINCTRL_DT_INST_DEFINE(inst); \
622 static struct mcux_acmp_data _CONCAT(data, inst); \
624 MCUX_ACMP_IRQ_HANDLER_DEFINE(inst) \
626 static const struct mcux_acmp_config _CONCAT(config, inst) = { \
627 .base = (CMP_Type *)DT_INST_REG_ADDR(inst), \
628 .pincfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
629 .irq_init = MCUX_ACMP_IRQ_HANDLER_SYM(inst), \
630 .mode_config = MCUX_ACMP_DT_INST_MODE_CONFIG_INIT(inst), \
631 .input_config = MCUX_ACMP_DT_INST_INPUT_CONFIG_INIT(inst), \
632 .filter_config = MCUX_ACMP_DT_INST_FILTER_CONFIG_INIT(inst), \
633 .dac_config = MCUX_ACMP_DT_INST_DAC_CONFIG_INIT(inst), \
635 (.dm_config = MCUX_ACMP_DT_INST_DM_CONFIG_INIT(inst),)) \
637 (.enable_window_mode = MCUX_ACMP_DT_INST_EN_WINDOW_MODE(inst),)) \
640 PM_DEVICE_DT_INST_DEFINE(inst, mcux_acmp_pm_callback); \
642 DEVICE_DT_INST_DEFINE(inst, \
644 PM_DEVICE_DT_INST_GET(inst), \
645 &_CONCAT(data, inst), \
646 &_CONCAT(config, inst), \