Skip to content
Open
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
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@
/tests/zephyr/drivers/flash/negative_tests_nrf7120/ @nrfconnect/ncs-code-owners @rob-robinson-14 @Hi-Im-David @travis3630
/tests/zephyr/drivers/gpio/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/i2c/i2c_bme688/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/i2c/i2c_nrfx_twim/ @nrfconnect/ncs-low-level-test @rob-robinson-14 @Hi-Im-David @travis3630
/tests/zephyr/drivers/i2c/i2c_target_api/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/i2s/ @nrfconnect/ncs-low-level-test
/tests/zephyr/drivers/mspi/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/*
* SDA = P1.8 and P1.9
* SCL = P1.14 and P1.15
*/

/ {
aliases {
i2c-controller = &i2c21;
i2c-controller-target = &i2c22;
};
};

&pinctrl {
i2c21_default: i2c21_default {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
<NRF_PSEL(TWIS_SCL, 1, 14)>;
bias-pull-up;
};
};

i2c21_sleep: i2c21_sleep {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
<NRF_PSEL(TWIS_SCL, 1, 14)>;
low-power-enable;
};
};

i2c22_default: i2c22_default {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
<NRF_PSEL(TWIS_SCL, 1, 15)>;
bias-pull-up;
};
};

i2c22_sleep: i2c22_sleep {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
<NRF_PSEL(TWIS_SCL, 1, 15)>;
low-power-enable;
};
};
};

&i2c21 {
pinctrl-0 = <&i2c21_default>;
pinctrl-1 = <&i2c21_sleep>;
pinctrl-names = "default", "sleep";
zephyr,concat-buf-size = <256>;
status = "okay";
};

&i2c22 {
compatible = "nordic,nrf-twis";
pinctrl-0 = <&i2c22_default>;
pinctrl-1 = <&i2c22_sleep>;
pinctrl-names = "default", "sleep";
status = "okay";
};
2 changes: 2 additions & 0 deletions samples/zephyr/drivers/i2c/rtio_loopback/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ tests:
- [email protected]/nrf54ls05b/cpuapp
- nrf54lv10dk/nrf54lv10a/cpuapp
- [email protected]/nrf54lv10a/cpuapp
- nrf7120pdk/nrf7120/cpuapp
integration_platforms:
- nrf54ls05dk/nrf54ls05b/cpuapp
- nrf54lv10dk/nrf54lv10a/cpuapp
- nrf7120pdk/nrf7120/cpuapp
5 changes: 5 additions & 0 deletions scripts/ci/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,11 @@ ci_tests_zephyr_drivers_i2c_i2c_bme688:
- nrf/tests/zephyr/drivers/i2c/i2c_bme688/
- zephyr/tests/drivers/i2c/i2c_bme688/

ci_tests_zephyr_drivers_i2c_i2c_nrfx_twim:
files:
- nrf/tests/zephyr/drivers/i2c/i2c_nrfx_twim/
- zephyr/tests/drivers/i2c/i2c_nrfx_twim/

ci_tests_zephyr_drivers_spi:
files:
- nrf/tests/zephyr/drivers/spi/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CONFIG_NRFX_TWIS22=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/ {
aliases {
i2c-slave = &i2c22;
};
};

&pinctrl {
i2c21_default_alt: i2c21_default_alt {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 8)>,
<NRF_PSEL(TWIM_SCL, 1, 14)>;
};
};

i2c21_sleep_alt: i2c21_sleep_alt {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 8)>,
<NRF_PSEL(TWIM_SCL, 1, 14)>;
low-power-enable;
};
};

i2c22_default_alt: i2c22_default_alt {
group1 {
/* Temporary workaround as it is currently not possible
* to configure pins for TWIS with pinctrl.
*/
psels = <NRF_PSEL(TWIM_SDA, 1, 9)>,
<NRF_PSEL(TWIM_SCL, 1, 15)>;
bias-pull-up;
};
};

i2c22_sleep_alt: i2c22_sleep_alt {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 9)>,
<NRF_PSEL(TWIM_SCL, 1, 15)>;
low-power-enable;
};
};
};

dut_twim: &i2c21 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c21_default_alt>;
pinctrl-1 = <&i2c21_sleep_alt>;
pinctrl-names = "default", "sleep";
clock-frequency = <I2C_BITRATE_STANDARD>;
sensor: sensor@54 {
reg = <0x54>;
};
};

&i2c22 {
compatible = "nordic,nrf-twis";
status = "okay";
pinctrl-0 = <&i2c22_default_alt>;
pinctrl-1 = <&i2c22_sleep_alt>;
pinctrl-names = "default", "sleep";
};
2 changes: 2 additions & 0 deletions tests/zephyr/boards/nrf/i2c/i2c_slave/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ tests:
- nrf54ls05dk/nrf54ls05b/cpuapp
- nrf54lv10dk/nrf54lv10a/cpuapp
- [email protected]/nrf54lv10a/cpuapp
- nrf7120pdk/nrf7120/cpuapp
integration_platforms:
- nrf54ls05dk/nrf54ls05b/cpuapp
- nrf54lv10dk/nrf54lv10a/cpuapp
- nrf7120pdk/nrf7120/cpuapp
12 changes: 12 additions & 0 deletions tests/zephyr/drivers/i2c/i2c_nrfx_twim/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Copyright (c) 2025 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(i2c_api)

FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/i2c/i2c_nrfx_twim/src/*.c)
target_sources(app PRIVATE ${app_sources})
4 changes: 4 additions & 0 deletions tests/zephyr/drivers/i2c/i2c_nrfx_twim/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This sample extends the same-named Zephyr sample to verify it
with Nordic development kits.

Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/i2c/i2c_nrfx_twim.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/*
* SDA = P1.8 and P1.9
* SCL = P1.14 and P1.15
*/

/ {
aliases {
i2c-controller = &i2c21;
i2c-controller-target = &i2c22;
};
};

&pinctrl {
i2c21_default: i2c21_default {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
<NRF_PSEL(TWIS_SCL, 1, 14)>;
bias-pull-up;
};
};

i2c21_sleep: i2c21_sleep {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
<NRF_PSEL(TWIS_SCL, 1, 14)>;
low-power-enable;
};
};

i2c22_default: i2c22_default {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
<NRF_PSEL(TWIS_SCL, 1, 15)>;
bias-pull-up;
};
};

i2c22_sleep: i2c22_sleep {
group1 {
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
<NRF_PSEL(TWIS_SCL, 1, 15)>;
low-power-enable;
};
};
};

&i2c21 {
compatible = "nordic,nrf-twim";
pinctrl-0 = <&i2c21_default>;
pinctrl-1 = <&i2c21_sleep>;
pinctrl-names = "default", "sleep";
zephyr,concat-buf-size = <256>;
status = "okay";
};

&i2c22 {
compatible = "nordic,nrf-twis";
pinctrl-0 = <&i2c22_default>;
pinctrl-1 = <&i2c22_sleep>;
pinctrl-names = "default", "sleep";
status = "okay";
};
11 changes: 11 additions & 0 deletions tests/zephyr/drivers/i2c/i2c_nrfx_twim/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CONFIG_ZTEST=y
CONFIG_BOOT_BANNER=n

CONFIG_LOG=y
CONFIG_I2C_LOG_LEVEL_INF=y
CONFIG_I2C=y
CONFIG_I2C_TARGET=y
CONFIG_I2C_TARGET_BUFFER_MODE=y
CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256

CONFIG_ZERO_LATENCY_IRQS=y
16 changes: 16 additions & 0 deletions tests/zephyr/drivers/i2c/i2c_nrfx_twim/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
common:
depends_on: i2c
tags:
- drivers
- i2c
- ci_tests_zephyr_drivers_i2c_i2c_nrfx_twim
harness: ztest
harness_config:
fixture: i2c_bus_short

tests:
drivers.i2c.nrfx_twim_async_api.extended:
platform_allow:
- nrf7120pdk/nrf7120/cpuapp
integration_platforms:
- nrf7120pdk/nrf7120/cpuapp
Loading