samples: drivers: dac: add support for twr_ke18f board
Add support for the NXP TWR-KE18F development board to the DAC driver sample. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
parent
e53ae4d41a
commit
280e3fa999
3 changed files with 33 additions and 2 deletions
|
@ -13,7 +13,30 @@ Building and Running
|
|||
|
||||
The DAC output is defined in the board's devicetree and pinmux file.
|
||||
|
||||
Only board nucleo_l073rz is supported for now.
|
||||
Building and Running for ST Nucleo L073RZ
|
||||
=========================================
|
||||
The sample can be built and executed for the
|
||||
:ref:`nucleo_l073rz_board` as follows:
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/drivers/dac
|
||||
:board: nucleo_l073rz
|
||||
:goals: build flash
|
||||
:compact:
|
||||
|
||||
Building and Running for NXP TWR-KE18F
|
||||
======================================
|
||||
The sample can be built and executed for the :ref:`twr_ke18f` as
|
||||
follows:
|
||||
|
||||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/drivers/dac
|
||||
:board: twr_ke18f
|
||||
:goals: build flash
|
||||
:compact:
|
||||
|
||||
DAC output is available on pin A32 of the primary TWR elevator
|
||||
connector.
|
||||
|
||||
Sample output
|
||||
=============
|
||||
|
@ -26,7 +49,6 @@ The following output is printed:
|
|||
|
||||
.. code-block:: console
|
||||
|
||||
DAC internal reference voltage: 3300 mV
|
||||
Generating sawtooth signal at DAC channel 1.
|
||||
|
||||
.. note:: If the DAC is not supported, the output will be an error message.
|
||||
|
|
|
@ -3,6 +3,7 @@ sample:
|
|||
tests:
|
||||
sample.drivers.dac:
|
||||
tags: DAC
|
||||
platform_whitelist: nucleo_l073rz twr_ke18f
|
||||
depends_on: dac
|
||||
harness: console
|
||||
harness_config:
|
||||
|
|
|
@ -8,9 +8,17 @@
|
|||
#include <sys/printk.h>
|
||||
#include <drivers/dac.h>
|
||||
|
||||
#if defined(CONFIG_BOARD_NUCLEO_L073RZ)
|
||||
#define DAC_DEVICE_NAME DT_LABEL(DT_ALIAS(dac1))
|
||||
#define DAC_CHANNEL_ID 1
|
||||
#define DAC_RESOLUTION 12
|
||||
#elif defined(CONFIG_BOARD_TWR_KE18F)
|
||||
#define DAC_DEVICE_NAME DT_LABEL(DT_NODELABEL(dac0))
|
||||
#define DAC_CHANNEL_ID 0
|
||||
#define DAC_RESOLUTION 12
|
||||
#else
|
||||
#error "Unsupported board."
|
||||
#endif
|
||||
|
||||
static const struct dac_channel_cfg dac_ch_cfg = {
|
||||
.channel_id = DAC_CHANNEL_ID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue