Commit ac429421 authored by Henrik Brix Andersen's avatar Henrik Brix Andersen Committed by Maureen Helm
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: default avatarHenrik Brix Andersen <hebad@vestas.com>
parent ca38f0a2
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -75,4 +75,11 @@ config GPIO_MCUX_PORTE

endif # GPIO_MCUX

if ADC

config ADC_0
	default y

endif # ADC

endif # BOARD_TWR_KE18F
+2 −0
Original line number Diff line number Diff line
@@ -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``.
+8 −0
Original line number Diff line number Diff line
@@ -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;
}

+5 −0
Original line number Diff line number Diff line
@@ -141,6 +141,11 @@
	status = "ok";
};

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

&flash0 {
	/*
	 * For more information, see:
+1 −0
Original line number Diff line number Diff line
@@ -14,3 +14,4 @@ supported:
  - i2c
  - hwinfo
  - spi
  - adc