2018-05-23 15:26:53 +08:00
|
|
|
# Kconfig - nrfx I2C support
|
|
|
|
#
|
|
|
|
# Copyright (c) 2018, Nordic Semiconductor ASA
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
|
|
|
|
menuconfig I2C_NRFX
|
|
|
|
bool "nRF TWI nrfx drivers"
|
2018-12-11 21:22:57 +08:00
|
|
|
default y
|
2018-05-23 15:26:53 +08:00
|
|
|
depends on SOC_FAMILY_NRF
|
2018-06-30 07:04:59 +08:00
|
|
|
select HAS_DTS_I2C
|
2018-05-23 15:26:53 +08:00
|
|
|
help
|
|
|
|
Enable support for nrfx TWI drivers for nRF MCU series.
|
|
|
|
Peripherals with the same instance ID cannot be used together,
|
|
|
|
e.g. I2C_0 and SPI_0. You may need to disable SPI_0 or SPI_1.
|
|
|
|
|
|
|
|
if I2C_NRFX
|
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
# In most Nordic SoCs, SPI and TWI peripherals with the same instance number
|
|
|
|
# share certain resources and therefore cannot be used at the same time
|
|
|
|
# (in nRF91 Series this limitation concerns UART peripherals as well).
|
|
|
|
# In nRF52810 though, there are only single instances of these peripherals
|
|
|
|
# and they are arranged in a different way, so this limitation does not apply.
|
|
|
|
if I2C_0 && (SOC_NRF52810 || \
|
|
|
|
(!SPI_0 && !(SOC_SERIES_NRF91X && UART_0_NRF_UARTE)))
|
2018-05-23 15:26:53 +08:00
|
|
|
|
|
|
|
choice I2C_0_NRF_TYPE
|
|
|
|
prompt "I2C Port 0 Driver type"
|
|
|
|
|
|
|
|
config I2C_0_NRF_TWI
|
|
|
|
bool "nRF TWI 0"
|
2018-08-02 20:47:39 +08:00
|
|
|
depends on HAS_HW_NRF_TWI0
|
2018-05-23 15:26:53 +08:00
|
|
|
select NRFX_TWI
|
|
|
|
help
|
|
|
|
Enable nRF TWI Master without EasyDMA on port 0.
|
|
|
|
|
|
|
|
config I2C_0_NRF_TWIM
|
|
|
|
bool "nRF TWIM 0"
|
2018-08-02 20:47:39 +08:00
|
|
|
depends on HAS_HW_NRF_TWIM0
|
2018-05-23 15:26:53 +08:00
|
|
|
select NRFX_TWIM
|
|
|
|
help
|
|
|
|
Enable nRF TWI Master with EasyDMA on port 0.
|
|
|
|
This peripheral accepts transfers from RAM only,
|
|
|
|
if provided buffer is placed in flash, transfer will fail.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
endif # I2C_0 && (SOC_NRF52810 || ...
|
2018-05-23 15:26:53 +08:00
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
# In Nordic SoCs, SPI and TWI peripherals with the same instance number
|
|
|
|
# share certain resources and therefore cannot be used at the same time
|
|
|
|
# (in nRF91 Series this limitation concerns UART peripherals as well).
|
|
|
|
if I2C_1 && !SPI_1 && !(SOC_SERIES_NRF91X && UART_1_NRF_UARTE)
|
2018-05-23 15:26:53 +08:00
|
|
|
|
|
|
|
choice I2C_1_NRF_TYPE
|
|
|
|
prompt "I2C Port 1 Driver type"
|
|
|
|
|
|
|
|
config I2C_1_NRF_TWI
|
|
|
|
bool "nRF TWI 1"
|
2018-08-02 20:47:39 +08:00
|
|
|
depends on HAS_HW_NRF_TWI1
|
2018-05-23 15:26:53 +08:00
|
|
|
select NRFX_TWI
|
|
|
|
help
|
|
|
|
Enable nRF TWI Master without EasyDMA on port 1.
|
|
|
|
|
|
|
|
config I2C_1_NRF_TWIM
|
|
|
|
bool "nRF TWIM 1"
|
2018-08-02 20:47:39 +08:00
|
|
|
depends on HAS_HW_NRF_TWIM1
|
2018-05-23 15:26:53 +08:00
|
|
|
select NRFX_TWIM
|
|
|
|
help
|
|
|
|
Enable nRF TWI Master with EasyDMA on port 1.
|
|
|
|
This peripheral accepts transfers from RAM only,
|
|
|
|
if provided buffer is placed in flash, transfer will fail.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
endif # I2C_1 && !SPI_1 && !(SOC_SERIES_NRF91X && UART_1_NRF_UARTE)
|
2018-05-23 15:26:53 +08:00
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
# In Nordic SoCs, SPI and TWI peripherals with the same instance number
|
|
|
|
# share certain resources and therefore cannot be used at the same time
|
|
|
|
# (in nRF91 Series this limitation concerns UART peripherals as well).
|
|
|
|
if I2C_2 && !SPI_2 && !(SOC_SERIES_NRF91X && UART_2_NRF_UARTE)
|
2019-01-15 19:47:53 +08:00
|
|
|
|
|
|
|
choice I2C_2_NRF_TYPE
|
|
|
|
prompt "I2C Port 2 Driver type"
|
|
|
|
|
|
|
|
config I2C_2_NRF_TWIM
|
|
|
|
bool "nRF TWIM 2"
|
|
|
|
depends on HAS_HW_NRF_TWIM2
|
|
|
|
select NRFX_TWIM
|
|
|
|
help
|
|
|
|
Enable nRF TWI Master with EasyDMA on port 2.
|
|
|
|
This peripheral accepts transfers from RAM only,
|
|
|
|
if provided buffer is placed in flash, transfer will fail.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
endif # I2C_2 && !SPI_2 && !(SOC_SERIES_NRF91X && UART_2_NRF_UARTE)
|
2019-01-15 19:47:53 +08:00
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
# In Nordic SoCs, SPI and TWI peripherals with the same instance number
|
|
|
|
# share certain resources and therefore cannot be used at the same time
|
|
|
|
# (in nRF91 Series SoCs this limitation concerns UART peripherals as well).
|
|
|
|
if I2C_3 && !SPI_3 && !(SOC_SERIES_NRF91X && UART_3_NRF_UARTE)
|
2018-05-23 15:26:53 +08:00
|
|
|
|
2019-01-15 19:47:53 +08:00
|
|
|
choice I2C_3_NRF_TYPE
|
|
|
|
prompt "I2C Port 3 Driver type"
|
|
|
|
|
|
|
|
config I2C_3_NRF_TWIM
|
|
|
|
bool "nRF TWIM 3"
|
|
|
|
depends on HAS_HW_NRF_TWIM3
|
|
|
|
select NRFX_TWIM
|
|
|
|
help
|
|
|
|
Enable nRF TWI Master with EasyDMA on port 3.
|
|
|
|
This peripheral accepts transfers from RAM only,
|
|
|
|
if provided buffer is placed in flash, transfer will fail.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
2019-03-01 18:33:52 +08:00
|
|
|
endif # I2C_3 && !SPI_3 && !(SOC_SERIES_NRF91X && UART_3_NRF_UARTE)
|
2019-01-15 19:47:53 +08:00
|
|
|
|
|
|
|
endif #I2C_NRFX
|