Skip to content

Commit 78b4fed

Browse files
ZhaoxiangJincfriedt
authored andcommitted
tests: drivers: comparator: Enable nxp cmp test
Enable nxp cmp test. Signed-off-by: Zhaoxiang Jin <[email protected]>
1 parent 25ede2d commit 78b4fed

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&cmp {
8+
positive-mux-input = "IN0"; /* PTC6 */
9+
negative-mux-input = "IN7"; /* DAC */
10+
dac-vref-source = "VIN2";
11+
dac-value = <31>;
12+
filter-count = <0x3>;
13+
filter-period = <0xF>;
14+
hysteresis-mode = "LEVEL2";
15+
enable-high-speed-mode;
16+
invert-output;
17+
enable-pin-out;
18+
};

tests/drivers/build_all/comparator/testcase.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,8 @@ tests:
119119
- DTC_OVERLAY_FILE="mcux_acmp/mke15z7_mux_mux.dts"
120120
platform_allow:
121121
- frdm_ke15z
122+
drivers.build_all.comparator.nxp_cmp.frdm_mcxc242:
123+
extra_args:
124+
- DTC_OVERLAY_FILE="nxp_cmp/frdm_mcxc242.dts"
125+
platform_allow:
126+
- frdm_mcxc242
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/gpio/gpio.h>
8+
9+
/ {
10+
aliases {
11+
test-comp = &cmp;
12+
};
13+
14+
zephyr,user {
15+
/* PTC4 output connect to PTC6. */
16+
test-gpios = <&gpioc 4 GPIO_ACTIVE_HIGH>;
17+
};
18+
};
19+
20+
&cmp {
21+
positive-mux-input = "IN0"; /* PTC6, FRDM-MCXC242 J2-8 */
22+
negative-mux-input = "IN7"; /* DAC output => 1.65V */
23+
dac-vref-source = "VIN2";
24+
dac-value = <31>;
25+
};

0 commit comments

Comments
 (0)