Skip to content

[nrf fromtree] drivers: Add analog pins for nRF54L20 #2847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion drivers/adc/adc_nrfx_saadc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
[NRF_SAADC_AIN12] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 9),
[NRF_SAADC_AIN13] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 9),
};
#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX)
#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15)
static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = {
[NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
[NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
Expand All @@ -54,6 +54,20 @@
[NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD,
[NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD,
};
#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX)
static const uint32_t saadc_psels[NRF_SAADC_DVDD + 1] = {
[NRF_SAADC_AIN0] = NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1),
[NRF_SAADC_AIN1] = NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1),
[NRF_SAADC_AIN2] = NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1),
[NRF_SAADC_AIN3] = NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1),
[NRF_SAADC_AIN4] = NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
[NRF_SAADC_AIN5] = NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
[NRF_SAADC_AIN6] = NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
[NRF_SAADC_AIN7] = NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
[NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD,
[NRF_SAADC_AVDD] = NRF_SAADC_INPUT_AVDD,

Check notice on line 68 in drivers/adc/adc_nrfx_saadc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/adc/adc_nrfx_saadc.c:68 - [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, + [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD,

Check notice on line 68 in drivers/adc/adc_nrfx_saadc.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/adc/adc_nrfx_saadc.c:68 - [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD, + [NRF_SAADC_VDD] = NRF_SAADC_INPUT_VDD,
[NRF_SAADC_DVDD] = NRF_SAADC_INPUT_DVDD,
};
#endif

#else
Expand Down
44 changes: 44 additions & 0 deletions drivers/comparator/comparator_nrf_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
* SPDX-License-Identifier: Apache-2.0
*/

#ifndef ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_
#define ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_

#include <nrfx.h>

#if (NRF_COMP_HAS_AIN_AS_PIN || NRF_LPCOMP_HAS_AIN_AS_PIN)
static const uint32_t shim_nrf_comp_ain_map[] = {
#if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280)
NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1),
#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15)
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1),
#elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX)
NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
#endif

Check notice on line 40 in drivers/comparator/comparator_nrf_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/comparator/comparator_nrf_common.h:40 - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), #elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15) - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), #elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),

Check notice on line 40 in drivers/comparator/comparator_nrf_common.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/comparator/comparator_nrf_common.h:40 - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), #elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15) - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1), #elif defined(CONFIG_SOC_COMPATIBLE_NRF54LX) - NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), - NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(31U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(30U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(29U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1), + NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1), NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
};
#endif

#endif /* ZEPHYR_DRIVERS_COMPARATOR_NRF_COMMON_H_ */
25 changes: 1 addition & 24 deletions drivers/comparator/comparator_nrf_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zephyr/drivers/comparator/nrf_comp.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/device.h>
#include "comparator_nrf_common.h"

#define DT_DRV_COMPAT nordic_nrf_comp

Expand Down Expand Up @@ -67,30 +68,6 @@ struct shim_nrf_comp_data {
void *user_data;
};

#if (NRF_COMP_HAS_AIN_AS_PIN)
static const uint32_t shim_nrf_comp_ain_map[] = {
#if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280)
NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1),
#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15)
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1),
#endif
};
#endif

#if SHIM_NRF_COMP_DT_INST_MAIN_MODE_IS_SE(0)
BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_DOWN(0) < 64);
BUILD_ASSERT(SHIM_NRF_COMP_DT_INST_TH_UP(0) < 64);
Expand Down
33 changes: 5 additions & 28 deletions drivers/comparator/comparator_nrf_lpcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <zephyr/drivers/comparator/nrf_lpcomp.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/device.h>
#include "comparator_nrf_common.h"

#include <string.h>

Expand Down Expand Up @@ -38,30 +39,6 @@ struct shim_nrf_lpcomp_data {
void *user_data;
};

#if (NRF_LPCOMP_HAS_AIN_AS_PIN)
static const uint32_t shim_nrf_lpcomp_ain_map[] = {
#if defined(CONFIG_SOC_NRF54H20) || defined(CONFIG_SOC_NRF9280)
NRF_PIN_PORT_TO_PIN_NUMBER(0U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(1U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(2U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(3U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1),
#elif defined(CONFIG_SOC_NRF54L05) || defined(CONFIG_SOC_NRF54L10) || defined(CONFIG_SOC_NRF54L15)
NRF_PIN_PORT_TO_PIN_NUMBER(4U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(5U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(6U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(7U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(11U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(12U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(13U, 1),
NRF_PIN_PORT_TO_PIN_NUMBER(14U, 1),
#endif
};
#endif

#if (NRF_LPCOMP_HAS_AIN_AS_PIN)
BUILD_ASSERT(COMP_NRF_LPCOMP_PSEL_AIN0 == 0);
BUILD_ASSERT(COMP_NRF_LPCOMP_PSEL_AIN7 == 7);
Expand Down Expand Up @@ -152,11 +129,11 @@ static int shim_nrf_lpcomp_pm_callback(const struct device *dev, enum pm_device_
static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim,
nrf_lpcomp_input_t *nrf)
{
if (shim >= ARRAY_SIZE(shim_nrf_lpcomp_ain_map)) {
if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) {
return -EINVAL;
}

*nrf = shim_nrf_lpcomp_ain_map[(uint32_t)shim];
*nrf = shim_nrf_comp_ain_map[(uint32_t)shim];
return 0;
}
#else
Expand Down Expand Up @@ -208,11 +185,11 @@ static int shim_nrf_lpcomp_psel_to_nrf(enum comp_nrf_lpcomp_psel shim,
static int shim_nrf_lpcomp_extrefsel_to_nrf(enum comp_nrf_lpcomp_extrefsel shim,
nrf_lpcomp_ext_ref_t *nrf)
{
if (shim >= ARRAY_SIZE(shim_nrf_lpcomp_ain_map)) {
if (shim >= ARRAY_SIZE(shim_nrf_comp_ain_map)) {
return -EINVAL;
}

*nrf = shim_nrf_lpcomp_ain_map[shim];
*nrf = shim_nrf_comp_ain_map[shim];
return 0;
}
#else
Expand Down
20 changes: 20 additions & 0 deletions tests/boards/nrf/comp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config TEST_COMP_SE_PSEL_AIN_INDEX
int "Index of analog input for SE psel."
default 5

config TEST_COMP_SE_EXTREFSEL_AIN_INDEX
int "Index of analog input for SE extrefsel."
default 1

config TEST_COMP_DIFF_PSEL_AIN_INDEX
int "Index of analog input for DIFF psel."
default 4

config TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX
int "Index of analog input for DIFF extrefsel."
default 5

source "Kconfig.zephyr"
16 changes: 12 additions & 4 deletions tests/boards/nrf/comp/src/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,30 @@
static const struct gpio_dt_spec test_pin_1 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), first_gpios);
static const struct gpio_dt_spec test_pin_2 = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), second_gpios);

#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \
CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX)
#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \
CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX)
#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \
CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX)
#define TEST_COMP_DIFF_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \
CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX)

Check notice on line 24 in tests/boards/nrf/comp/src/test.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

tests/boards/nrf/comp/src/test.c:24 -#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ - CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) -#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ - CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) -#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ - CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) -#define TEST_COMP_DIFF_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ - CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) +#define TEST_COMP_SE_EXTREFSEL_AIN \ + _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_DIFF_PSEL_AIN \ + _CONCAT(COMP_NRF_COMP_PSEL_AIN, CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) +#define TEST_COMP_DIFF_EXTREFSEL_AIN \ + _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX)

Check notice on line 24 in tests/boards/nrf/comp/src/test.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

tests/boards/nrf/comp/src/test.c:24 -#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ - CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) -#define TEST_COMP_SE_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ - CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) -#define TEST_COMP_DIFF_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, \ - CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) -#define TEST_COMP_DIFF_EXTREFSEL_AIN _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, \ - CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_SE_PSEL_AIN _CONCAT(COMP_NRF_COMP_PSEL_AIN, CONFIG_TEST_COMP_SE_PSEL_AIN_INDEX) +#define TEST_COMP_SE_EXTREFSEL_AIN \ + _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, CONFIG_TEST_COMP_SE_EXTREFSEL_AIN_INDEX) +#define TEST_COMP_DIFF_PSEL_AIN \ + _CONCAT(COMP_NRF_COMP_PSEL_AIN, CONFIG_TEST_COMP_DIFF_PSEL_AIN_INDEX) +#define TEST_COMP_DIFF_EXTREFSEL_AIN \ + _CONCAT(COMP_NRF_COMP_EXTREFSEL_AIN, CONFIG_TEST_COMP_DIFF_EXTREFSEL_AIN_INDEX)
struct comp_nrf_comp_se_config comp_se_config = {
.psel = COMP_NRF_COMP_PSEL_AIN5,
.psel = TEST_COMP_SE_PSEL_AIN,
.sp_mode = COMP_NRF_COMP_SP_MODE_HIGH,
.isource = COMP_NRF_COMP_ISOURCE_DISABLED,
.refsel = COMP_NRF_COMP_REFSEL_AREF,
.extrefsel = COMP_NRF_COMP_EXTREFSEL_AIN1,
.extrefsel = TEST_COMP_SE_EXTREFSEL_AIN,
.th_up = 32,
.th_down = 32,
};

struct comp_nrf_comp_diff_config comp_diff_config = {
.psel = COMP_NRF_COMP_PSEL_AIN4,
.psel = TEST_COMP_DIFF_PSEL_AIN,
.sp_mode = COMP_NRF_COMP_SP_MODE_LOW,
.isource = COMP_NRF_COMP_ISOURCE_DISABLED,
.extrefsel = COMP_NRF_COMP_EXTREFSEL_AIN5,
.extrefsel = TEST_COMP_DIFF_EXTREFSEL_AIN,
.enable_hyst = true,
};

Expand Down
Loading