Skip to content

Commit 7044c44

Browse files
committed
tests: zephyr: drivers: i2c: enable for LM20 and LV10
Tests and samples for i2c. Signed-off-by: Piotr Kosycarz <[email protected]>
1 parent f4de094 commit 7044c44

17 files changed

+389
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* SDA = P1.8 and P1.9
3+
* SCL = P1.14 and P1.15
4+
*/
5+
6+
/ {
7+
aliases {
8+
i2c-controller = &i2c21;
9+
i2c-controller-target = &i2c22;
10+
};
11+
};
12+
13+
&pinctrl {
14+
i2c21_default: i2c21_default {
15+
group1 {
16+
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
17+
<NRF_PSEL(TWIS_SCL, 1, 14)>;
18+
bias-pull-up;
19+
};
20+
};
21+
22+
i2c21_sleep: i2c21_sleep {
23+
group1 {
24+
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
25+
<NRF_PSEL(TWIS_SCL, 1, 14)>;
26+
low-power-enable;
27+
};
28+
};
29+
30+
i2c22_default: i2c22_default {
31+
group1 {
32+
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
33+
<NRF_PSEL(TWIS_SCL, 1, 15)>;
34+
bias-pull-up;
35+
};
36+
};
37+
38+
i2c22_sleep: i2c22_sleep {
39+
group1 {
40+
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
41+
<NRF_PSEL(TWIS_SCL, 1, 15)>;
42+
low-power-enable;
43+
};
44+
};
45+
};
46+
47+
&i2c21 {
48+
pinctrl-0 = <&i2c21_default>;
49+
pinctrl-1 = <&i2c21_sleep>;
50+
pinctrl-names = "default", "sleep";
51+
zephyr,concat-buf-size = <256>;
52+
status = "okay";
53+
};
54+
55+
&i2c22 {
56+
compatible = "nordic,nrf-twis";
57+
pinctrl-0 = <&i2c22_default>;
58+
pinctrl-1 = <&i2c22_sleep>;
59+
pinctrl-names = "default", "sleep";
60+
status = "okay";
61+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* SDA = P1.8 and P1.9
3+
* SCL = P1.14 and P1.15
4+
*/
5+
6+
/ {
7+
aliases {
8+
i2c-controller = &i2c20;
9+
i2c-controller-target = &i2c21;
10+
};
11+
};
12+
13+
&pinctrl {
14+
i2c20_default: i2c20_default {
15+
group1 {
16+
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
17+
<NRF_PSEL(TWIS_SCL, 1, 14)>;
18+
bias-pull-up;
19+
};
20+
};
21+
22+
i2c20_sleep: i2c20_sleep {
23+
group1 {
24+
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
25+
<NRF_PSEL(TWIS_SCL, 1, 14)>;
26+
low-power-enable;
27+
};
28+
};
29+
30+
i2c21_default: i2c21_default {
31+
group1 {
32+
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
33+
<NRF_PSEL(TWIS_SCL, 1, 15)>;
34+
bias-pull-up;
35+
};
36+
};
37+
38+
i2c21_sleep: i2c21_sleep {
39+
group1 {
40+
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
41+
<NRF_PSEL(TWIS_SCL, 1, 15)>;
42+
low-power-enable;
43+
};
44+
};
45+
};
46+
47+
&i2c20 {
48+
pinctrl-0 = <&i2c20_default>;
49+
pinctrl-1 = <&i2c20_sleep>;
50+
pinctrl-names = "default", "sleep";
51+
zephyr,concat-buf-size = <256>;
52+
status = "okay";
53+
};
54+
55+
&i2c21 {
56+
compatible = "nordic,nrf-twis";
57+
pinctrl-0 = <&i2c21_default>;
58+
pinctrl-1 = <&i2c21_sleep>;
59+
pinctrl-names = "default", "sleep";
60+
status = "okay";
61+
};

samples/zephyr/drivers/i2c/rtio_loopback/sample.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ tests:
1818
- nrf54l20pdk/nrf54l20/cpuapp
1919
integration_platforms:
2020
- nrf54l20pdk/nrf54l20/cpuapp
21+
nrf.extended.sample.drivers.i2c.rtio_loopback.lm20:
22+
platform_allow:
23+
- nrf54lm20apdk/nrf54lm20a/cpuapp
24+
integration_platforms:
25+
- nrf54lm20apdk/nrf54lm20a/cpuapp
2126
nrf.extended.sample.drivers.i2c.rtio_loopback.l09:
2227
platform_allow:
2328
- nrf54l09pdk/nrf54l09/cpuapp
@@ -27,3 +32,12 @@ tests:
2732
- SNIPPET=nrf54l09-switch-uart
2833
tags:
2934
- nrf54l09-switch-uart
35+
nrf.extended.sample.drivers.i2c.rtio_loopback.lv10:
36+
platform_allow:
37+
- nrf54lv10apdk/nrf54lv10a/cpuapp
38+
integration_platforms:
39+
- nrf54lv10apdk/nrf54lv10a/cpuapp
40+
extra_args:
41+
- SNIPPET=nrf54lv10-switch-uart
42+
tags:
43+
- nrf54lv10-switch-uart

scripts/ci/tags.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,3 +1524,8 @@ ci_tests_zephyr_kernel_timer_timer_behavior:
15241524
files:
15251525
- nrf/tests/zephyr/kernel/timer/timer_behavior/
15261526
- tests/zephyr/kernel/timer/timer_behavior/
1527+
1528+
ci_tests_zephyr_boards_nrf_i2c:
1529+
files:
1530+
- nrf/tests/zephyr/boards/nrf/i2c/
1531+
- zephyr/tests/boards/nrf/i2c/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#
2+
# Copyright (c) 2025 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
cmake_minimum_required(VERSION 3.20.0)
8+
9+
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
10+
project(i2c_slave)
11+
12+
FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/boards/nrf/i2c/i2c_slave/src/*.c)
13+
target_sources(app PRIVATE ${app_sources})
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
This sample extends the same-named Zephyr sample to verify it
2+
with Nordic development kits.
3+
4+
Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/baords/nrf/i2c/i2c_slave.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_NRFX_TWIS22=y
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/ {
2+
aliases {
3+
i2c-slave = &i2c22;
4+
};
5+
};
6+
7+
&pinctrl {
8+
i2c21_default_alt: i2c21_default_alt {
9+
group1 {
10+
psels = <NRF_PSEL(TWIM_SDA, 1, 8)>,
11+
<NRF_PSEL(TWIM_SCL, 1, 14)>;
12+
};
13+
};
14+
15+
i2c21_sleep_alt: i2c21_sleep_alt {
16+
group1 {
17+
psels = <NRF_PSEL(TWIM_SDA, 1, 8)>,
18+
<NRF_PSEL(TWIM_SCL, 1, 14)>;
19+
low-power-enable;
20+
};
21+
};
22+
23+
i2c22_default_alt: i2c22_default_alt {
24+
group1 {
25+
/* Temporary workaround as it is currently not possible
26+
* to configure pins for TWIS with pinctrl.
27+
*/
28+
psels = <NRF_PSEL(TWIM_SDA, 1, 9)>,
29+
<NRF_PSEL(TWIM_SCL, 1, 15)>;
30+
bias-pull-up;
31+
};
32+
};
33+
34+
i2c22_sleep_alt: i2c22_sleep_alt {
35+
group1 {
36+
psels = <NRF_PSEL(TWIM_SDA, 1, 9)>,
37+
<NRF_PSEL(TWIM_SCL, 1, 15)>;
38+
low-power-enable;
39+
};
40+
};
41+
};
42+
43+
&i2c21 {
44+
compatible = "nordic,nrf-twim";
45+
status = "okay";
46+
pinctrl-0 = <&i2c21_default_alt>;
47+
pinctrl-1 = <&i2c21_sleep_alt>;
48+
pinctrl-names = "default", "sleep";
49+
sensor: sensor@54 {
50+
reg = <0x54>;
51+
};
52+
};
53+
54+
&i2c22 {
55+
compatible = "nordic,nrf-twis";
56+
status = "okay";
57+
pinctrl-0 = <&i2c22_default_alt>;
58+
pinctrl-1 = <&i2c22_sleep_alt>;
59+
pinctrl-names = "default", "sleep";
60+
};

0 commit comments

Comments
 (0)