Skip to content
Permalink
Browse files

boards: arm: twr_ke18f: add ADC support

Add support for reading the onboard potentiometer (ADC0 channel
12) and thermistor (ADC0 channels 0 and 1).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information...
henrikbrixandersen authored and MaureenHelm committed May 16, 2019
1 parent ca38f0a commit ac4294216b9098a879787a0a6c356f9e3b4b56dc
@@ -75,4 +75,11 @@ config GPIO_MCUX_PORTE

endif # GPIO_MCUX

if ADC

config ADC_0
default y

endif # ADC

endif # BOARD_TWR_KE18F
@@ -76,6 +76,8 @@ features:
+-----------+------------+-------------------------------------+
| SPI(M) | on-chip | spi |
+-----------+------------+-------------------------------------+
| ADC | on-chip | adc |
+-----------+------------+-------------------------------------+

The default configuration can be found in the defconfig file:
``boards/arm/twr_ke18f/twr_ke18f_defconfig``.
@@ -111,6 +111,14 @@ static int twr_ke18f_pinmux_init(struct device *dev)
#endif
pinmux_pin_set(portc, 15, PORT_PCR_MUX(kPORT_MuxAsGpio));

#ifdef CONFIG_ADC_0
/* Thermistor A, B */
pinmux_pin_set(porta, 0, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog));
pinmux_pin_set(porta, 1, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog));
/* Potentiometer */
pinmux_pin_set(portc, 14, PORT_PCR_MUX(kPORT_PinDisabledOrAnalog));
#endif

return 0;
}

@@ -141,6 +141,11 @@
status = "ok";
};

&adc0 {
status = "ok";
sample-time = <12>;
};

&flash0 {
/*
* For more information, see:
@@ -14,3 +14,4 @@ supported:
- i2c
- hwinfo
- spi
- adc

0 comments on commit ac42942

Please sign in to comment.
You can’t perform that action at this time.