Lines Matching refs:index
842 #define PWM(index) DT_INST_PARENT(index) argument
845 #define IRQ_CONNECT_AND_ENABLE_BY_NAME(index, name) \ argument
847 IRQ_CONNECT(DT_IRQ_BY_NAME(PWM(index), name, irq), \
848 DT_IRQ_BY_NAME(PWM(index), name, priority), \
849 pwm_stm32_isr, DEVICE_DT_INST_GET(index), 0); \
850 irq_enable(DT_IRQ_BY_NAME(PWM(index), name, irq)); \
853 #define IRQ_CONNECT_AND_ENABLE_DEFAULT(index) \ argument
855 IRQ_CONNECT(DT_IRQN(PWM(index)), \
856 DT_IRQ(PWM(index), priority), \
857 pwm_stm32_isr, DEVICE_DT_INST_GET(index), 0); \
858 irq_enable(DT_IRQN(PWM(index))); \
861 #define IRQ_CONFIG_FUNC(index) \ argument
862 static void pwm_stm32_irq_config_func_##index(const struct device *dev) \
864 COND_CODE_1(DT_IRQ_HAS_NAME(PWM(index), cc), \
865 (IRQ_CONNECT_AND_ENABLE_BY_NAME(index, cc)), \
866 (IRQ_CONNECT_AND_ENABLE_DEFAULT(index)) \
869 #define CAPTURE_INIT(index) \ argument
870 .irq_config_func = pwm_stm32_irq_config_func_##index, \
871 .four_channel_capture_support = DT_INST_PROP(index, four_channel_capture_support)
873 #define IRQ_CONFIG_FUNC(index) argument
874 #define CAPTURE_INIT(index) argument
877 #define DT_INST_CLK(index, inst) \ argument
879 .bus = DT_CLOCKS_CELL(PWM(index), bus), \
880 .enr = DT_CLOCKS_CELL(PWM(index), bits) \
884 #define PWM_DEVICE_INIT(index) \ argument
885 static struct pwm_stm32_data pwm_stm32_data_##index = { \
886 .reset = RESET_DT_SPEC_GET(PWM(index)), \
889 IRQ_CONFIG_FUNC(index) \
891 PINCTRL_DT_INST_DEFINE(index); \
893 static const struct pwm_stm32_config pwm_stm32_config_##index = { \
894 .timer = (TIM_TypeDef *)DT_REG_ADDR(PWM(index)), \
895 .prescaler = DT_PROP(PWM(index), st_prescaler), \
896 .countermode = DT_PROP(PWM(index), st_countermode), \
897 .pclken = DT_INST_CLK(index, timer), \
898 .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(index), \
899 CAPTURE_INIT(index) \
902 DEVICE_DT_INST_DEFINE(index, &pwm_stm32_init, NULL, \
903 &pwm_stm32_data_##index, \
904 &pwm_stm32_config_##index, POST_KERNEL, \