boards: arm: document and enable the DAC for the Arduino Zero

The previous commits added the SAM0 DAC driver.  Now document and
enable it, including enabling it in the DAC sample.

Signed-off-by: Michael Hope <mlhx@google.com>
This commit is contained in:
Michael Hope 2020-07-04 15:32:19 +02:00 committed by Maureen Helm
commit d5e1753eb6
6 changed files with 22 additions and 1 deletions

View file

@ -89,6 +89,10 @@
#pwm-cells = <1>;
};
&dac0 {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";

View file

@ -11,6 +11,7 @@ toolchain:
supported:
- adc
- counter
- dac
- dma
- gpio
- hwinfo

View file

@ -53,6 +53,8 @@ features:
+-----------+------------+------------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+------------------------------------------+
| DAC | on-chip | Digital to analogue converter |
+-----------+------------+------------------------------------------+
Other hardware features are not currently supported by Zephyr.
@ -101,6 +103,12 @@ with a host PC. See the :ref:`usb-samples` sample applications for
more, such as the :ref:`usb_cdc-acm` sample which sets up a virtual
serial port that echos characters back to the host PC.
DAC
===
The SAMD21 MCU has a single channel DAC with 10 bits of resolution. On the
Arduino Zero, the DAC is available on pin A0.
Programming and Debugging
*************************

View file

@ -75,6 +75,10 @@ static int board_pinmux_init(struct device *dev)
pinmux_pin_set(muxa, 24, PINMUX_FUNC_G);
#endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(dac0), okay) && defined(CONFIG_DAC_SAM0)
/* DAC on PA02 */
pinmux_pin_set(muxa, 2, PINMUX_FUNC_B);
#endif
return 0;
}

View file

@ -3,7 +3,7 @@ sample:
tests:
sample.drivers.dac:
tags: DAC
platform_whitelist: frdm_k64f nucleo_l073rz nucleo_l152re twr_ke18f
platform_whitelist: arduino_zero frdm_k64f nucleo_l073rz nucleo_l152re twr_ke18f
depends_on: dac
harness: console
harness_config:

View file

@ -21,6 +21,10 @@
#define DAC_DEVICE_NAME DT_LABEL(DT_NODELABEL(dac0))
#define DAC_CHANNEL_ID 0
#define DAC_RESOLUTION 12
#elif defined(CONFIG_BOARD_ARDUINO_ZERO)
#define DAC_DEVICE_NAME DT_LABEL(DT_NODELABEL(dac0))
#define DAC_CHANNEL_ID 0
#define DAC_RESOLUTION 10
#else
#error "Unsupported board."
#endif