Skip to content

Commit ba84491

Browse files
[nrf fromtree] samples: drivers: i2c: rtio_loopback: add nrf boards
Add nRF boards to the rtio_loopback sample. Signed-off-by: Bjarki Arge Andreasen <[email protected]> (cherry picked from commit 7d5a912)
1 parent 89542d1 commit ba84491

File tree

5 files changed

+120
-0
lines changed

5 files changed

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

samples/drivers/i2c/rtio_loopback/sample.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ tests:
77
- i2c_target
88
platform_allow:
99
- b_u585i_iot02a
10+
- nrf5340dk/nrf5340/cpuapp
11+
- nrf54l15dk/nrf54l15/cpuapp

0 commit comments

Comments
 (0)