Skip to content

Commit 7645fac

Browse files
Hi-Im-Davidnordic-piks
authored andcommitted
tests: drivers: i2c: i2c_target_api: add from zephyr, support nrf7120
Support of zephyr i2c tests from ncs repo. Signed-off-by: David Jewsbury <[email protected]>
1 parent d81c1d4 commit 7645fac

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-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: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* SDA = P1.8 and P1.9
3+
* SCL = P1.14 and P1.15
4+
*/
5+
6+
&pinctrl {
7+
i2c21_default: i2c21_default {
8+
group1 {
9+
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
10+
<NRF_PSEL(TWIS_SCL, 1, 14)>;
11+
bias-pull-up;
12+
};
13+
};
14+
15+
i2c21_sleep: i2c21_sleep {
16+
group1 {
17+
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>,
18+
<NRF_PSEL(TWIS_SCL, 1, 14)>;
19+
low-power-enable;
20+
};
21+
};
22+
23+
i2c22_default: i2c22_default {
24+
group1 {
25+
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
26+
<NRF_PSEL(TWIS_SCL, 1, 15)>;
27+
bias-pull-up;
28+
};
29+
};
30+
31+
i2c22_sleep: i2c22_sleep {
32+
group1 {
33+
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>,
34+
<NRF_PSEL(TWIS_SCL, 1, 15)>;
35+
low-power-enable;
36+
};
37+
};
38+
};
39+
40+
&i2c21 {
41+
pinctrl-0 = <&i2c21_default>;
42+
pinctrl-1 = <&i2c21_sleep>;
43+
pinctrl-names = "default", "sleep";
44+
zephyr,concat-buf-size = <256>;
45+
status = "okay";
46+
47+
eeprom1: eeprom@56 {
48+
compatible = "zephyr,i2c-target-eeprom";
49+
reg = <0x56>;
50+
address-width = <8>;
51+
size = <256>;
52+
};
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+
62+
eeprom0: eeprom@54 {
63+
compatible = "zephyr,i2c-target-eeprom";
64+
reg = <0x54>;
65+
address-width = <8>;
66+
size = <256>;
67+
};
68+
};

tests/zephyr/drivers/i2c/i2c_target_api/testcase.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ tests:
1414
- nrf54l20pdk/nrf54l20/cpuapp
1515
integration_platforms:
1616
- nrf54l20pdk/nrf54l20/cpuapp
17+
nrf.extended.drivers.i2c.target_api.single_role.7120:
18+
platform_allow:
19+
- nrf7120pdk/nrf7120/cpuapp
20+
integration_platforms:
21+
- nrf7120pdk/nrf7120/cpuapp
1722
nrf.extended.drivers.i2c.target_api.single_role.l09:
1823
platform_allow:
1924
- nrf54l09pdk/nrf54l09/cpuapp

0 commit comments

Comments
 (0)