Skip to content

Commit 02bf44d

Browse files
bjarki-andreasenkartben
authored andcommitted
drivers: i2c: add nrf twis suppport
Add nrf twis (I2C controller supporting I2C peripheral role and EasyDMA) support, including updating the existing twis dt binding to match the hardware with proper examples. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 4103c82 commit 02bf44d

File tree

4 files changed

+465
-33
lines changed

4 files changed

+465
-33
lines changed

drivers/i2c/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ else()
6767
i2c_nrfx_twim_common.c
6868
)
6969
endif()
70+
zephyr_library_sources_ifdef(CONFIG_I2C_NRFX_TWIS i2c_nrfx_twis.c)
7071
zephyr_library_sources_ifdef(CONFIG_I2C_NUMAKER i2c_numaker.c)
7172
zephyr_library_sources_ifdef(CONFIG_I2C_SAM_TWI i2c_sam_twi.c)
7273
if(CONFIG_I2C_RTIO)

drivers/i2c/Kconfig.nrfx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,33 @@ config I2C_NRFX_TRANSFER_TIMEOUT
4949
0 means that the driver should use the K_FOREVER value,
5050
i.e. it should wait as long as necessary.
5151

52+
config I2C_NRFX_TWIS
53+
def_bool y
54+
depends on DT_HAS_NORDIC_NRF_TWIS_ENABLED
55+
depends on I2C_TARGET
56+
depends on I2C_TARGET_BUFFER_MODE
57+
select NRFX_TWIS0 if HAS_HW_NRF_TWIS0
58+
select NRFX_TWIS1 if HAS_HW_NRF_TWIS1
59+
select NRFX_TWIS2 if HAS_HW_NRF_TWIS2
60+
select NRFX_TWIS3 if HAS_HW_NRF_TWIS3
61+
select NRFX_TWIS20 if HAS_HW_NRF_TWIS20
62+
select NRFX_TWIS21 if HAS_HW_NRF_TWIS21
63+
select NRFX_TWIS22 if HAS_HW_NRF_TWIS22
64+
select NRFX_TWIS30 if HAS_HW_NRF_TWIS30
65+
select NRFX_TWIS130 if HAS_HW_NRF_TWIS130
66+
select NRFX_TWIS131 if HAS_HW_NRF_TWIS131
67+
select NRFX_TWIS133 if HAS_HW_NRF_TWIS133
68+
select NRFX_TWIS134 if HAS_HW_NRF_TWIS134
69+
select NRFX_TWIS135 if HAS_HW_NRF_TWIS135
70+
select NRFX_TWIS136 if HAS_HW_NRF_TWIS136
71+
select NRFX_TWIS137 if HAS_HW_NRF_TWIS137
72+
73+
if I2C_NRFX_TWIS
74+
75+
config I2C_NRFX_TWIS_BUF_SIZE
76+
int "DMA buffer size in bytes"
77+
default 64
78+
79+
endif # I2C_NRFX_TWIS
80+
5281
endif # I2C_NRFX

0 commit comments

Comments
 (0)