From 0617bd306a39cdb2c68912ab525905e40dab17f0 Mon Sep 17 00:00:00 2001 From: Bjarki Arge Andreasen Date: Fri, 6 Dec 2024 17:56:58 +0100 Subject: [PATCH] tests: drivers: i2c: target api: add nrf5340 cpuapp Extend i2c_target_api test suite with the nrf5340 cpuapp, using the new TWIS device driver. Signed-off-by: Bjarki Arge Andreasen --- .../boards/nrf5340dk_nrf5340_cpuapp.conf | 7 +++ .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 50 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.conf create mode 100644 tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.overlay diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.conf b/tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.conf new file mode 100644 index 00000000000..935827e4233 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.conf @@ -0,0 +1,7 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +CONFIG_I2C_VIRTUAL=n +CONFIG_BOOT_BANNER=n +CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 +CONFIG_I2C_TARGET=y diff --git a/tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.overlay b/tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.overlay new file mode 100644 index 00000000000..42bd62733b3 --- /dev/null +++ b/tests/drivers/i2c/i2c_target_api/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&pinctrl { + i2c2_default: i2c2_default { + group1 { + psels = , + ; + bias-pull-up; + }; + }; + + i2c2_sleep: i2c2_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c2 { + compatible = "nordic,nrf-twis"; + pinctrl-0 = <&i2c2_default>; + pinctrl-1 = <&i2c2_sleep>; + pinctrl-names = "default", "sleep"; + status = "okay"; + + eeprom0: eeprom@54 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x54>; + address-width = <8>; + size = <256>; + }; +}; + +&i2c1 { + zephyr,concat-buf-size = <256>; + status = "okay"; + + eeprom1: eeprom@56 { + compatible = "zephyr,i2c-target-eeprom"; + reg = <0x56>; + address-width = <8>; + size = <256>; + }; +};