Skip to content

Commit

Permalink
drivers: nfc: NFC-driver structure + nRF-NFC and nt3h2x11 support
Browse files Browse the repository at this point in the history
NFC driver structure to support multiple NFC driver with the same API

Signed-off-by: Hessel van der Molen <[email protected]>
  • Loading branch information
HesselM committed Mar 7, 2024
1 parent c53c4e3 commit f4db241
Show file tree
Hide file tree
Showing 17 changed files with 3,013 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ add_subdirectory_ifdef(CONFIG_MM_DRV mm)
add_subdirectory_ifdef(CONFIG_MODEM modem)
add_subdirectory_ifdef(CONFIG_NET_DRIVERS net)
add_subdirectory_ifdef(CONFIG_NET_L2_ETHERNET ethernet)
add_subdirectory_ifdef(CONFIG_NFC nfc)
add_subdirectory_ifdef(CONFIG_PECI peci)
add_subdirectory_ifdef(CONFIG_PINCTRL pinctrl)
add_subdirectory_ifdef(CONFIG_PM_CPU_OPS pm_cpu_ops)
Expand Down
1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ source "drivers/misc/Kconfig"
source "drivers/mm/Kconfig"
source "drivers/modem/Kconfig"
source "drivers/net/Kconfig"
source "drivers/nfc/Kconfig"
source "drivers/pcie/Kconfig"
source "drivers/peci/Kconfig"
source "drivers/pinctrl/Kconfig"
Expand Down
13 changes: 13 additions & 0 deletions drivers/nfc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2023 Sendrato
#
# SPDX-License-Identifier: Apache-2.0
#

if (CONFIG_NFC_NT3H2X11)
zephyr_sources(nt3h2x11.c)
endif()

if (CONFIG_NFC_NRFX)
zephyr_sources(nrfxnfc.c)
endif()
15 changes: 15 additions & 0 deletions drivers/nfc/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#
# Copyright (c) 2023 Sendrato
#
# SPDX-License-Identifier: Apache-2.0
#

menuconfig NFC
bool "NFC drivers"

if NFC

rsource "Kconfig.nt3h2x11"
rsource "Kconfig.nrfxnfc"

endif # NFC
38 changes: 38 additions & 0 deletions drivers/nfc/Kconfig.nrfxnfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# Copyright (c) 2023 Sendrato
#
# SPDX-License-Identifier: Apache-2.0
#

config NFC_NRFX
bool "nRFx-NFC driver"
default n
select NRFX_NFCT
help
Enable nRFx NFC driver.

if NFC_NRFX

config NFC_NRFX_DRV_NAME
string "Device Tree name of nRFx-NFC driver"
default "nRFxNFC"
help
Device Tree name of nRFx-NFC driver.

config NFC_NRFX_INIT_PRIORITY
int "NFC_NRFX NFC driver init priority"
default 75

config NFC_NRFX_MAX_PAYLOAD_SIZE
int "Max payload in bytes"
default 988

# KConfig used by nrfxlib-sdk too
config NFC_T2T_NRFXLIB
bool "NFC Type 2 Tag library"

# KConfig used by nrfxlib-sdk too
config NFC_T4T_NRFXLIB
bool "NFC Type 4 Tag library"

endif # NFC_NRFX
36 changes: 36 additions & 0 deletions drivers/nfc/Kconfig.nt3h2x11
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2023 Sendrato
#
# SPDX-License-Identifier: Apache-2.0
#

config NFC_NT3H2X11
bool "NT3H2X11 NFC driver"
default n
depends on I2C
help
Enable I2C-based driver for NT3H2X11 led driver.

if NFC_NT3H2X11

config NFC_NT3H2X11_2K
bool "Use 2k memory map instead of 1k"
default n
help
Use 2k memory map instead of 1k

config NFC_NT3H2X11_MAX_WRITE_DELAY
int "delay in ms"
default 10
help
Max I2C write delay in ms for when writing EEPROM

config NFC_NT3H2X11_INIT_PRIORITY
int "NT3H2X11 NFC driver init priority"
default 75

module = NT3H2X11
module-str = nt3h2x11
source "${ZEPHYR_BASE}/subsys/logging/Kconfig.template.log_config"

endif # NFC_NT3H2X11
Loading

0 comments on commit f4db241

Please sign in to comment.