Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/i2c/i2c_nrfx_twim.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
DT_PROP(I2C(idx), easydma_maxcnt_bits)), \
}; \
PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \
PM_DEVICE_ISR_SAFE); \
I2C_PM_ISR_SAFE(idx)); \
I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \
i2c_nrfx_twim_init, \
i2c_nrfx_twim_deinit, \
Expand All @@ -295,7 +295,7 @@
POST_KERNEL, \
CONFIG_I2C_INIT_PRIORITY, \
&i2c_nrfx_twim_driver_api)

Check notice on line 298 in drivers/i2c/i2c_nrfx_twim.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim.c:298 -#define I2C_NRFX_TWIM_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ - BUILD_ASSERT(I2C_FREQUENCY(idx) != \ - I2C_NRFX_TWIM_INVALID_FREQUENCY, \ - "Wrong I2C " #idx " frequency setting in dts"); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), \ - nrfx_isr, nrfx_twim_##idx##_irq_handler, 0); \ - } \ +#define I2C_NRFX_TWIM_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(I2C(idx)); \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(I2C(idx)); \ + BUILD_ASSERT(I2C_FREQUENCY(idx) != I2C_NRFX_TWIM_INVALID_FREQUENCY, \ + "Wrong I2C " #idx " frequency setting in dts"); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(I2C(idx)), DT_IRQ(I2C(idx), priority), nrfx_isr, \ + nrfx_twim_##idx##_irq_handler, 0); \ + } \ IF_ENABLED(USES_MSG_BUF(idx), \ (static uint8_t twim_##idx##_msg_buf[MSG_BUF_SIZE(idx)] \ - I2C_MEMORY_SECTION(idx);)) \ - static struct i2c_nrfx_twim_data twim_##idx##_data; \ - PINCTRL_DT_DEFINE(I2C(idx)); \ - static const \ - struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + I2C_MEMORY_SECTION(idx);)) \ + static struct i2c_nrfx_twim_data twim_##idx##_data; \ + PINCTRL_DT_DEFINE(I2C(idx)); \ + static const struct i2c_nrfx_twim_common_config twim_##idx##z_config = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ IF_ENABLED(USES_MSG_BUF(idx), \ - (.msg_buf = twim_##idx##_msg_buf,)) \ - .max_transfer_size = BIT_MASK( \ - DT_PROP(I2C(idx), easydma_maxcnt_bits)), \ - }; \ - PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, \ - I2C_PM_ISR_SAFE(idx)); \ - I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), \ - i2c_nrfx_twim_init, \ - i2c_nrfx_twim_deinit, \ - PM_DEV
#define I2C_MEMORY_SECTION(idx) \
COND_CODE_1(I2C_HAS_PROP(idx, memory_regions), \
(__attribute__((__section__(LINKER_DT_NODE_REGION_NAME( \
Expand Down
20 changes: 20 additions & 0 deletions drivers/i2c/i2c_nrfx_twim_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,26 @@
#define I2C_FREQUENCY(idx) I2C_NRFX_TWIM_FREQUENCY(DT_PROP_OR(I2C(idx), clock_frequency, \
I2C_BITRATE_STANDARD))

/* Macro determines PM actions interrupt safety level.
*
* Requesting/releasing TWIM device may be ISR safe, but it cannot be reliably known whether
* managing its power domain is. It is then assumed that if power domains are used, device is
* no longer ISR safe. This macro let's us check if we will be requesting/releasing
* power domains and determines PM device ISR safety value.
*/
#define I2C_PM_ISR_SAFE(idx) \
COND_CODE_1( \

Check notice on line 42 in drivers/i2c/i2c_nrfx_twim_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim_common.h:42 -#define I2C_PM_ISR_SAFE(idx) \ +#define I2C_PM_ISR_SAFE(idx) \
UTIL_AND( \
IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \
UTIL_AND( \
DT_NODE_HAS_PROP(I2C(idx), power_domains), \
DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(I2C(idx), power_domains)) \
) \
), \
(0), \
(PM_DEVICE_ISR_SAFE) \
)

struct i2c_nrfx_twim_common_config {
nrfx_twim_t twim;
nrfx_twim_config_t twim_config;
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/i2c_nrfx_twim_rtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@
}, \
.ctx = &_i2c##idx##_twim_rtio, \
}; \
PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \
PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \
I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \
PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \
&twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
&i2c_nrfx_twim_driver_api);

Check notice on line 295 in drivers/i2c/i2c_nrfx_twim_rtio.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/i2c/i2c_nrfx_twim_rtio.c:295 - IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ + IF_ENABLED(USES_MSG_BUF(idx), (MSG_BUF_DEFINE(idx);)) \ I2C_RTIO_DEFINE(_i2c##idx##_twim_rtio, \ DT_INST_PROP_OR(n, sq_size, CONFIG_I2C_RTIO_SQ_SIZE), \ DT_INST_PROP_OR(n, cq_size, CONFIG_I2C_RTIO_CQ_SIZE)); \ PINCTRL_DT_DEFINE(I2C(idx)); \ static struct i2c_nrfx_twim_rtio_data twim_##idx##z_data; \ static const struct i2c_nrfx_twim_rtio_config twim_##idx##z_config = { \ - .common = \ - { \ - .twim = NRFX_TWIM_INSTANCE(idx), \ - .twim_config = \ - { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .frequency = I2C_FREQUENCY(idx), \ - }, \ - .event_handler = event_handler, \ - .msg_buf_size = MSG_BUF_SIZE(idx), \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ - IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) \ - .max_transfer_size = MAX_TRANSFER_SIZE(idx), \ - }, \ - .ctx = &_i2c##idx##_twim_rtio, \ + .common = { \ + .twim = NRFX_TWIM_INSTANCE(idx), \ + .twim_config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .frequency = I2C_FREQUENCY(idx), \ + }, \ + .event_handler = event_handler, \ + .msg_buf_size = MSG_BUF_SIZE(idx), \ + .irq_connect = irq_connect##idx, \ + .pcfg = PINCTRL_DT_DEV_CONFIG_GET(I2C(idx)), \ + IF_ENABLED(USES_MSG_BUF(idx), (.msg_buf = MSG_BUF_SYM(idx),)) .max_transfer_size = \ + MAX_TRANSFER_SIZE(idx), \ + }, \ + .ctx = &_i2c##idx##_twim_rtio, \ }; \ PM_DEVICE_DT_DEFINE(I2C(idx), twim_nrfx_pm_action, I2C_PM_ISR_SAFE(idx)); \ I2C_DEVICE_DT_DEINIT_DEFINE(I2C(idx), i2c_nrfx_twim_rtio_init, i2c_nrfx_twim_rtio_deinit, \ - PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ - &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ - &i2c_nrfx_twim_driver_api); + PM_DEVICE_DT_GET(I2C(idx)), &twim_##idx##z_data, \ + &twim_##idx##z_config, POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \ + &i2c_nrfx_twim_driver_api);
#ifdef CONFIG_HAS_HW_NRF_TWIM0
I2C_NRFX_TWIM_RTIO_DEVICE(0);
#endif
Expand Down
22 changes: 21 additions & 1 deletion drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,26 @@
#define QDEC(idx) DT_NODELABEL(qdec##idx)
#define QDEC_PROP(idx, prop) DT_PROP(QDEC(idx), prop)

/* Macro determines PM actions interrupt safety level.
*
* Requesting/releasing QDEC device may be ISR safe, but it cannot be reliably known whether
* managing its power domain is. It is then assumed that if power domains are used, device is
* no longer ISR safe. This macro let's us check if we will be requesting/releasing
* power domains and determines PM device ISR safety value.
*/
#define QDEC_PM_ISR_SAFE(idx) \
COND_CODE_1( \

Check notice on line 283 in drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c:283 -#define QDEC_PM_ISR_SAFE(idx) \ +#define QDEC_PM_ISR_SAFE(idx) \
UTIL_AND( \
IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \
UTIL_AND( \
DT_NODE_HAS_PROP(QDEC(idx), power_domains), \
DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(QDEC(idx), power_domains)) \
) \
), \
(0), \
(PM_DEVICE_ISR_SAFE) \
)

#define SENSOR_NRFX_QDEC_DEVICE(idx) \
NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \
BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \
Expand Down Expand Up @@ -301,7 +321,7 @@
.enable_pin = DT_PROP_OR(QDEC(idx), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \
.steps = QDEC_PROP(idx, steps), \
}; \
PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, PM_DEVICE_ISR_SAFE); \
PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(idx)); \
SENSOR_DEVICE_DT_DEFINE(QDEC(idx), \
qdec_nrfx_init, \
PM_DEVICE_DT_GET(QDEC(idx)), \
Expand All @@ -310,7 +330,7 @@
POST_KERNEL, \
CONFIG_SENSOR_INIT_PRIORITY, \
&qdec_nrfx_driver_api)

Check notice on line 333 in drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/sensor/nordic/qdec_nrfx/qdec_nrfx.c:333 -#define SENSOR_NRFX_QDEC_DEVICE(idx) \ - NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \ - BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \ - "Wrong QDEC"#idx" steps setting in dts. Only positive number valid"); \ - BUILD_ASSERT(QDEC_PROP(idx, steps) <= 2048, \ - "Wrong QDEC"#idx" steps setting in dts. Overflow possible"); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(QDEC(idx)), DT_IRQ(QDEC(idx), priority), \ - nrfx_isr, nrfx_qdec_##idx##_irq_handler, 0); \ - } \ - static struct qdec_nrfx_data qdec_##idx##_data; \ - PINCTRL_DT_DEFINE(QDEC(idx)); \ - static struct qdec_nrfx_config qdec_##idx##_config = { \ - .qdec = NRFX_QDEC_INSTANCE(idx), \ - .config = { \ - .reportper = NRF_QDEC_REPORTPER_40, \ - .sampleper = DT_STRING_TOKEN(QDEC(idx), nordic_period), \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .ledpre = QDEC_PROP(idx, led_pre), \ - .ledpol = NRF_QDEC_LEPOL_ACTIVE_HIGH, \ - .reportper_inten = true, \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(QDEC(idx)), \ - .enable_pin = DT_PROP_OR(QDEC(idx), enable_pin, NRF_QDEC_PIN_NOT_CONNECTED), \ - .steps = QDEC_PROP(idx, steps), \ - }; \ - PM_DEVICE_DT_DEFINE(QDEC(idx), qdec_nrfx_pm_action, QDEC_PM_ISR_SAFE(idx)); \ - SENSOR_DEVICE_DT_DEFINE(QDEC(idx), \ - qdec_nrfx_init, \ - PM_DEVICE_DT_GET(QDEC(idx)), \ - &qdec_##idx##_data, \ - &qdec_##idx##_config, \ - POST_KERNEL, \ - CONFIG_SENSOR_INIT_PRIORITY, \ - &qdec_nrfx_driver_api) +#define SENSOR_NRFX_QDEC_DEVICE(idx) \ + NRF_DT_CHECK_NODE_HAS_PINCTRL_SLEEP(QDEC(idx)); \ + BUILD_ASSERT(QDEC_PROP(idx, steps) > 0, \ + "Wrong QDEC" #idx " steps setting in dts. Only positive number valid"); \ + BUILD_ASSERT(QDEC_PROP(idx, steps) <= 2048, \ + "Wrong QDEC" #idx " steps setting in dts. Overflow possible"); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(QDEC(idx)), DT_IRQ(QDEC(idx), priority), nrfx_isr, \ + nrfx_qdec_##idx##_irq_handler, 0); \ + } \ + static struct qdec_nrfx_data qdec_##idx##_data; \ + PINCTRL_DT_DEFINE(QDEC(idx)); \ + static struct qdec_nrfx_config qdec_##idx##_config = { \ + .qdec = NRFX_QDEC_INSTANCE(idx), \ + .config = \ + { \ + .reportper = NRF_QDEC_REPORTPER_40, \ + .sampleper = DT_STRING_TOKEN(QDEC(idx), nordic_period), \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .ledpre = QDEC_PROP(idx, led_pre), \ + .ledpol = NRF_QDEC_LEPOL_ACTIVE_HIGH, \ + .reportper_inten = true, \ + }, \ + .irq_connect = irq_conn
#ifdef CONFIG_HAS_HW_NRF_QDEC0
SENSOR_NRFX_QDEC_DEVICE(0);
#endif
Expand Down
29 changes: 27 additions & 2 deletions drivers/spi/spi_nrfx_spis.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,32 @@
return pm_device_driver_init(dev, spi_nrfx_pm_action);
}

/* Macro determines PM actions interrupt safety level.
*
* Requesting/releasing SPIS device may be ISR safe, but it cannot be reliably known whether
* managing its power domain is. It is then assumed that if power domains are used, device is
* no longer ISR safe. This macro let's us check if we will be requesting/releasing
* power domains and determines PM device ISR safety value.
*
* Additionally, fast SPIS devices are not ISR safe.
*/
#define SPIS_PM_ISR_SAFE(idx) \
COND_CODE_1( \

Check notice on line 564 in drivers/spi/spi_nrfx_spis.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/spi/spi_nrfx_spis.c:564 -#define SPIS_PM_ISR_SAFE(idx) \ +#define SPIS_PM_ISR_SAFE(idx) \
UTIL_AND( \
IS_ENABLED(CONFIG_PM_DEVICE_POWER_DOMAIN), \
UTIL_AND( \
DT_NODE_HAS_PROP(SPIS(idx), power_domains), \
DT_NODE_HAS_STATUS_OKAY(DT_PHANDLE(SPIS(idx), power_domains)) \
) \
), \
(0), \
(COND_CODE_1( \
SPIS_IS_FAST(idx), \
(0), \
(PM_DEVICE_ISR_SAFE) \
)) \
)

#define SPI_NRFX_SPIS_DEFINE(idx) \
NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \
static void irq_connect##idx(void) \
Expand Down Expand Up @@ -597,8 +623,7 @@
!(DT_GPIO_FLAGS(SPIS(idx), wake_gpios) & GPIO_ACTIVE_LOW),\
"WAKE line must be configured as active high"); \
PM_DEVICE_DT_DEFINE(SPIS(idx), spi_nrfx_pm_action, \
COND_CODE_1(SPIS_IS_FAST(idx), (0), \
(PM_DEVICE_ISR_SAFE))); \
SPIS_PM_ISR_SAFE(idx)); \
SPI_DEVICE_DT_DEFINE(SPIS(idx), \
spi_nrfx_init, \
PM_DEVICE_DT_GET(SPIS(idx)), \
Expand All @@ -607,7 +632,7 @@
POST_KERNEL, \
CONFIG_SPI_INIT_PRIORITY, \
&spi_nrfx_driver_api)

Check notice on line 635 in drivers/spi/spi_nrfx_spis.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/spi/spi_nrfx_spis.c:635 -#define SPI_NRFX_SPIS_DEFINE(idx) \ - NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ - static void irq_connect##idx(void) \ - { \ - IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), \ - nrfx_isr, nrfx_spis_##idx##_irq_handler, 0); \ - } \ - static struct spi_nrfx_data spi_##idx##_data = { \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ - IF_ENABLED(CONFIG_MULTITHREADING, \ - (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) \ - .dev = DEVICE_DT_GET(SPIS(idx)), \ - IF_ENABLED(CONFIG_MULTITHREADING, \ +#define SPI_NRFX_SPIS_DEFINE(idx) \ + NRF_DT_CHECK_NODE_HAS_REQUIRED_MEMORY_REGIONS(SPIS(idx)); \ + static void irq_connect##idx(void) \ + { \ + IRQ_CONNECT(DT_IRQN(SPIS(idx)), DT_IRQ(SPIS(idx), priority), nrfx_isr, \ + nrfx_spis_##idx##_irq_handler, 0); \ + } \ + static struct spi_nrfx_data spi_##idx##_data = {IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_LOCK(spi_##idx##_data, ctx),)) \ + IF_ENABLED(CONFIG_MULTITHREADING, \ + (SPI_CONTEXT_INIT_SYNC(spi_##idx##_data, ctx),)) .dev = \ + DEVICE_DT_GET(SPIS(idx)), \ + IF_ENABLED(CONFIG_MULTITHREADING, \ (.wake_sem = Z_SEM_INITIALIZER( \ - spi_##idx##_data.wake_sem, 0, 1),)) \ - }; \ - PINCTRL_DT_DEFINE(SPIS(idx)); \ - static const struct spi_nrfx_config spi_##idx##z_config = { \ - .spis = { \ - .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ - .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ - }, \ - .config = { \ - .skip_gpio_cfg = true, \ - .skip_psel_cfg = true, \ - .mode = NRF_SPIS_MODE_0, \ - .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ - .orc = SPIS_PROP(idx, overrun_character), \ - .def = SPIS_PROP(idx, def_char), \ - }, \ - .irq_connect = irq_connect##idx, \ - .pcfg = PINCTRL_DT_DEV_CONFIG_GET(SPIS(idx)), \ - .max_buf_len = BIT_MASK(SPIS_PROP(idx, easydma_maxcnt_bits)), \ - .wake_gpio = GPIO_DT_SPEC_GET_OR(SPIS(idx), wake_gpios, {0}), \ - .mem_reg = DMM_DEV_TO_REG(SPIS(idx)), \ + spi_##idx##_data.wake_sem, 0, 1),)) }; \ + PINCTRL_DT_DEFINE(SPIS(idx)); \ + static const struct spi_nrfx_config spi_##idx##z_config = { \ + .spis = \ + { \ + .p_reg = (NRF_SPIS_Type *)DT_REG_ADDR(SPIS(idx)), \ + .drv_inst_idx = NRFX_SPIS##idx##_INST_IDX, \ + }, \ + .config = \ + { \ + .skip_gpio_cfg = true, \ + .skip_psel_cfg = true, \ + .mode = NRF_SPIS_MODE_0, \ + .bit_order = NRF_SPIS_BIT_ORDER_MSB_FIRST, \ + .orc = SPIS_PROP(idx, overrun_character), \ + .def = SPIS_PROP(idx, def_char),
/* Macro creates device instance if it is enabled in devicetree. */
#define SPIS_DEVICE(periph, prefix, id, _) \
IF_ENABLED(CONFIG_HAS_HW_NRF_SPIS##prefix##id, (SPI_NRFX_SPIS_DEFINE(prefix##id);))
Expand Down
Loading