Skip to content

Commit 7111b2a

Browse files
nordic-krchmasz-nordic
authored andcommitted
tests: drivers: i2c: i2c_latency: Align to changes in nrfx_twis
CONFIG_NRFX_TWIXxx options has been removed. Aligning test to not use those. Signed-off-by: Krzysztof Chruściński <[email protected]>
1 parent 9a97c5a commit 7111b2a

File tree

6 files changed

+6
-19
lines changed

6 files changed

+6
-19
lines changed

tests/drivers/i2c/i2c_latency/boards/nrf52840dk_nrf52840.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/drivers/i2c/i2c_latency/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/drivers/i2c/i2c_latency/boards/nrf54h20dk_nrf54h20_cpuapp.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/drivers/i2c/i2c_latency/boards/nrf54l15dk_nrf54l15_cpuapp.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/drivers/i2c/i2c_latency/prj.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CONFIG_I2C=y
2+
CONFIG_NRFX_TWIS=y
23

34
CONFIG_ZTEST=y
45
CONFIG_DK_LIBRARY=y

tests/drivers/i2c/i2c_latency/src/main.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@
1818

1919
#include <zephyr/ztest.h>
2020

21-
#if CONFIG_NRFX_TWIS1
22-
#define I2C_S_INSTANCE 1
23-
#elif CONFIG_NRFX_TWIS2
24-
#define I2C_S_INSTANCE 2
25-
#elif CONFIG_NRFX_TWIS22
26-
#define I2C_S_INSTANCE 22
27-
#elif CONFIG_NRFX_TWIS131
28-
#define I2C_S_INSTANCE 131
29-
#else
30-
#error "TWIS instance not enabled or not supported"
31-
#endif
32-
3321
#define NODE_TWIM DT_NODELABEL(sensor)
3422
#define NODE_TWIS DT_ALIAS(i2c_slave)
3523
#define MEASUREMENT_REPEATS 10
@@ -42,7 +30,9 @@
4230

4331
#define TEST_TIMER_COUNT_TIME_LIMIT_MS 500
4432
#define MAX_TEST_DATA_SIZE 255
45-
static const nrfx_twis_t twis = NRFX_TWIS_INSTANCE(I2C_S_INSTANCE);
33+
static nrfx_twis_t twis = {
34+
.p_reg = (NRF_TWIS_Type *)DT_REG_ADDR(NODE_TWIS)
35+
};
4636
const struct device *const tst_timer_dev = DEVICE_DT_GET(DT_ALIAS(tst_timer));
4737

4838
static uint8_t i2c_slave_buffer[MAX_TEST_DATA_SIZE] TWIS_MEMORY_SECTION;
@@ -143,7 +133,7 @@ static void assess_measurement_result(uint64_t timer_value_us,
143133
"Measured call latency is over the specified limit");
144134
}
145135

146-
static void i2s_slave_handler(nrfx_twis_evt_t const *p_event)
136+
static void i2s_slave_handler(nrfx_twis_event_t const *p_event)
147137
{
148138
switch (p_event->type) {
149139
case NRFX_TWIS_EVT_READ_REQ:
@@ -182,7 +172,7 @@ static void *test_setup(void)
182172
zassert_ok(ret);
183173

184174
IRQ_CONNECT(DT_IRQN(NODE_TWIS), DT_IRQ(NODE_TWIS, priority),
185-
NRFX_TWIS_INST_HANDLER_GET(I2C_S_INSTANCE), NULL, 0);
175+
nrfx_twis_irq_handler, &twis, 0);
186176

187177
nrfx_twis_enable(&twis);
188178

0 commit comments

Comments
 (0)