Skip to content

Commit 74ffb99

Browse files
danieldegrassecarlescufi
authored andcommitted
boards: arm: mixmrt1170_evkb: add support for ADC
Add support for ADC sample and API test on RT1170 EVKB. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 11bc9b8 commit 74ffb99

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

boards/arm/mimxrt1170_evk/doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ RT1170 EVKB (`mimxrt1170_evkb_cm7/cm4`)
110110
+-----------+------------+-------------------------------------+-----------------+-----------------+
111111
| PWM | on-chip | pwm | Supported | Supported |
112112
+-----------+------------+-------------------------------------+-----------------+-----------------+
113-
| ADC | on-chip | adc | Supported (M7) | No support |
113+
| ADC | on-chip | adc | Supported (M7) | Supported (M7) |
114114
+-----------+------------+-------------------------------------+-----------------+-----------------+
115115
| UART | on-chip | serial port-polling; | Supported | Supported |
116116
| | | serial port-interrupt; | | |

boards/arm/mimxrt1170_evk/mimxrt1170_evkb_cm7.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ toolchain:
1515
ram: 65536
1616
flash: 65536
1717
supported:
18+
- adc
1819
- counter
1920
- can
2021
- gpio
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright 2023 NXP
5+
*/
6+
7+
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
8+
9+
/ {
10+
zephyr,user {
11+
/* adjust channel number according to pinmux in board.dts */
12+
io-channels = <&lpadc0 0>;
13+
};
14+
};
15+
16+
&lpadc0 {
17+
#address-cells = <1>;
18+
#size-cells = <0>;
19+
20+
/*
21+
* To use this sample:
22+
* - Connect LPADC0 CH0 signal to voltage between 0~1.8V (J9 pin 10)
23+
*/
24+
25+
channel@0 {
26+
reg = <0>;
27+
zephyr,gain = "ADC_GAIN_1";
28+
zephyr,reference = "ADC_REF_EXTERNAL0";
29+
zephyr,vref-mv = <1800>;
30+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
31+
zephyr,resolution = <12>;
32+
zephyr,input-positive = <MCUX_LPADC_CH0A>;
33+
};
34+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright 2023 NXP
5+
*/
6+
7+
#include <zephyr/dt-bindings/adc/mcux-lpadc.h>
8+
9+
/ {
10+
zephyr,user {
11+
io-channels = <&lpadc0 0>, <&lpadc0 1>;
12+
};
13+
};
14+
15+
&lpadc0 {
16+
#address-cells = <1>;
17+
#size-cells = <0>;
18+
19+
channel@0 {
20+
reg = <0>;
21+
zephyr,gain = "ADC_GAIN_1";
22+
zephyr,reference = "ADC_REF_EXTERNAL0";
23+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
24+
zephyr,resolution = <12>;
25+
zephyr,input-positive = <MCUX_LPADC_CH0A>;
26+
};
27+
28+
channel@1 {
29+
reg = <1>;
30+
zephyr,gain = "ADC_GAIN_1";
31+
zephyr,reference = "ADC_REF_EXTERNAL0";
32+
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
33+
zephyr,resolution = <12>;
34+
zephyr,input-positive = <MCUX_LPADC_CH1A>;
35+
};
36+
};

0 commit comments

Comments
 (0)