Skip to content

Commit ac174d3

Browse files
danieldegrassecarlescufi
authored andcommitted
boards: mimxrt1015_evk: Enable ADC on RT1015
Enables ADC on RT1015 evaluation board. Channels 1 and 13 are exposed as pins 2 and 1 of J18 on the EVK. Signed-off-by: Daniel DeGrasse <[email protected]>
1 parent 4e6ac93 commit ac174d3

File tree

6 files changed

+38
-1
lines changed

6 files changed

+38
-1
lines changed

boards/arm/mimxrt1015_evk/doc/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ features:
7676
+-----------+------------+-------------------------------------+
7777
| USB | on-chip | USB device |
7878
+-----------+------------+-------------------------------------+
79+
| ADC | on-chip | ADC |
80+
+-----------+------------+-------------------------------------+
7981

8082
The default configuration can be found in the defconfig file:
8183
``boards/arm/mimxrt1015_evk/mimxrt1015_evk_defconfig``
@@ -114,6 +116,10 @@ The MIMXRT1015 SoC has five pairs of pinmux/gpio controllers.
114116
+---------------+-----------------+---------------------------+
115117
| GPIO_AD_B0_13 | LPSPI1_SDI | SPI |
116118
+---------------+-----------------+---------------------------+
119+
| GPIO_AD_B0_14 | ADC | ADC1 Channel 1 |
120+
+---------------+-----------------+---------------------------+
121+
| GPIO_AD_B1_13 | ADC | ADC1 Channel 13 |
122+
+---------------+-----------------+---------------------------+
117123

118124
System Clock
119125
============

boards/arm/mimxrt1015_evk/mimxrt1015_evk.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ arduino_serial: &lpuart4 {};
101101
zephyr_udc0: &usb1 {
102102
status = "okay";
103103
};
104+
105+
&adc1 {
106+
status = "okay";
107+
};

boards/arm/mimxrt1015_evk/mimxrt1015_evk.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ supported:
2222
- i2c
2323
- usb_device
2424
- spi
25+
- adc

boards/arm/mimxrt1015_evk/pinmux.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ static int mimxrt1015_evk_init(const struct device *dev)
106106
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
107107
#endif
108108

109+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(adc1), okay) & CONFIG_ADC
110+
/* ADC1 Channels 1 and 13 exposed as pins 2 and 1 on J18 of eval board */
111+
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_14_GPIO1_IO14, 0U);
112+
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_13_GPIO1_IO29, 0U);
113+
114+
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_14_GPIO1_IO14,
115+
IOMUXC_SW_PAD_CTL_PAD_SPEED(2) |
116+
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
117+
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_13_GPIO1_IO29,
118+
IOMUXC_SW_PAD_CTL_PAD_SPEED(2) |
119+
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
120+
#endif
121+
109122
return 0;
110123
}
111124

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* Copyright (c) 2021 NXP
5+
*/
6+
7+
/ {
8+
zephyr,user {
9+
/* adjust channel number according to pinmux in board.dts */
10+
io-channels = <&adc1 13>;
11+
};
12+
};

tests/drivers/adc/adc_api/src/test_adc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@
300300
defined(CONFIG_BOARD_MIMXRT1064_EVK) || \
301301
defined(CONFIG_BOARD_MIMXRT1060_EVK) || \
302302
defined(CONFIG_BOARD_MIMXRT1024_EVK) || \
303-
defined(CONFIG_BOARD_MIMXRT1010_EVK)
303+
defined(CONFIG_BOARD_MIMXRT1010_EVK) || \
304+
defined(CONFIG_BOARD_MIMXRT1015_EVK)
304305
#define ADC_DEVICE_NAME DT_LABEL(DT_INST(0, nxp_mcux_12b1msps_sar))
305306
#define ADC_RESOLUTION 12
306307
#define ADC_GAIN ADC_GAIN_1

0 commit comments

Comments
 (0)