Lines Matching refs:idx
216 #define CONCAT_BUF_SIZE(idx) \ argument
217 COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_concat_buf_size), \
218 (DT_PROP(I2C(idx), zephyr_concat_buf_size)), (0))
219 #define FLASH_BUF_MAX_SIZE(idx) \ argument
220 COND_CODE_1(DT_NODE_HAS_PROP(I2C(idx), zephyr_flash_buf_max_size), \
221 (DT_PROP(I2C(idx), zephyr_flash_buf_max_size)), (0))
223 #define USES_MSG_BUF(idx) \ argument
224 COND_CODE_0(CONCAT_BUF_SIZE(idx), \
225 (COND_CODE_0(FLASH_BUF_MAX_SIZE(idx), (0), (1))), \
227 #define MSG_BUF_SIZE(idx) MAX(CONCAT_BUF_SIZE(idx), FLASH_BUF_MAX_SIZE(idx)) argument
229 #define I2C_NRFX_TWIM_DEVICE(idx) \ argument
230 NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \
231 BUILD_ASSERT(I2C_FREQUENCY(idx) != \
233 "Wrong I2C " #idx " frequency setting in dts"); \
234 static void irq_connect##idx(void) \
236 IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \
237 nrfx_isr, nrfx_twim_##idx##_irq_handler, 0); \
239 IF_ENABLED(USES_MSG_BUF(idx), \
240 (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \
241 I2C_MEMORY_SECTION(idx);)) \
242 static struct i2c_nrfx_twim_data twim_##idx##_data; \
243 PINCTRL_DT_DEFINE(I2C(idx)); \
245 struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \
246 .twim = NRFX_TWIM_INSTANCE(idx), \
250 .frequency = I2C_FREQUENCY(idx), \
253 .msg_buf_size = MSG_BUF_SIZE(idx), \
254 .irq_connect = irq_connect##idx, \
255 .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \
256 IF_ENABLED(USES_MSG_BUF(idx), \
257 (.msg_buf = twim_##idx##_msg_buf,)) \
259 DT_PROP(I2C(idx), easydma_maxcnt_bits)), \
261 PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \
263 I2C_DEVICE_DT_DEFINE(I2C(idx), \
265 PM_DEVICE_DT_GET(I2C(idx)), \
266 &twim_##idx##_data, \
267 &twim_##idx##z_config, \
272 #define I2C_MEMORY_SECTION(idx) \ argument
273 COND_CODE_1(I2C_HAS_PROP(idx, memory_regions), \
275 DT_PHANDLE(I2C(idx), memory_regions)))))), \