Lines Matching refs:_idx
156 #define VIPM_DEVICE_1(_idx) \ argument
157 static int vipm_nrf_##_idx##_send(const struct device *dev, int wait, \
160 if (!IS_ENABLED(CONFIG_IPM_MSG_CH_##_idx##_TX)) { \
161 LOG_ERR("IPM_" #_idx " is RX message channel"); \
179 gipm_send(_idx); \
183 static void vipm_nrf_##_idx##_register_callback(const struct device *dev, \
187 if (IS_ENABLED(CONFIG_IPM_MSG_CH_##_idx##_RX)) { \
188 nrfx_vipm_data.callback[_idx] = cb; \
189 nrfx_vipm_data.user_data[_idx] = user_data; \
190 nrfx_vipm_data.ipm_device[_idx] = dev; \
193 "for TX channel IPM_" #_idx); \
197 static int vipm_nrf_##_idx##_set_enabled(const struct device *dev, int enable)\
199 if (!IS_ENABLED(CONFIG_IPM_MSG_CH_##_idx##_RX)) { \
200 LOG_ERR("IPM_" #_idx " is TX message channel"); \
204 nrfx_ipc_receive_event_enable(_idx); \
206 nrfx_ipc_receive_event_disable(_idx); \
211 static DEVICE_API(ipm, vipm_nrf_##_idx##_driver_api) = { \
212 .send = vipm_nrf_##_idx##_send, \
213 .register_callback = vipm_nrf_##_idx##_register_callback, \
216 .set_enabled = vipm_nrf_##_idx##_set_enabled \
219 DEVICE_DEFINE(vipm_nrf_##_idx, "IPM_"#_idx, \
222 &vipm_nrf_##_idx##_driver_api)
224 #define VIPM_DEVICE(_idx, _) \ argument
225 IF_ENABLED(CONFIG_IPM_MSG_CH_##_idx##_ENABLE, (VIPM_DEVICE_1(_idx)))