baords: bl5340_dvk: Add MCP4725 dac to bl5340_dvk_cpuapp dts file

MCP4725 is an I2C dac that was added with PR #33481. This can now be
added to the bl5340_dvk device tree.

Signed-off-by: Kieran Mackey <kieran.mackey@lairdconnect.com>
This commit is contained in:
Kieran Mackey 2021-05-13 15:23:51 +01:00 committed by Kumar Gala
commit a41fc5165a
11 changed files with 62 additions and 10 deletions

View file

@ -79,6 +79,13 @@
reg = <0x76>;
label = "BME680";
};
dac0: mcp4725@60 {
compatible = "microchip,mcp4725";
reg = <0x60>;
label = "dac0";
#io-channel-cells = <1>;
};
};
&spi2 {

View file

@ -89,7 +89,7 @@ follows:
DAC output is available on connector J4 pin 11.
Building and Running for BL652
======================================
==============================
The BL652 DVK PCB contains a footprint for a MCP4725 to use as an external
DAC. Note this is not populated by default. The sample can be built and
executed for the :ref:`bl652_dvk` as follows:
@ -103,7 +103,7 @@ executed for the :ref:`bl652_dvk` as follows:
DAC output is available on pin 1 of the MCP4725.
Building and Running for BL653
======================================
==============================
The BL653 DVK PCB contains a footprint for a MCP4725 to use as an external
DAC. Note this is not populated by default. The sample can be built and
executed for the :ref:`bl653_dvk` as follows:
@ -117,7 +117,7 @@ executed for the :ref:`bl653_dvk` as follows:
DAC output is available on pin 1 of the MCP4725.
Building and Running for BL654
======================================
==============================
The BL654 DVK PCB contains a footprint for a MCP4725 to use as an external
DAC. Note this is not populated by default. The sample can be built and
executed for the :ref:`bl654_dvk` as follows:
@ -130,6 +130,19 @@ executed for the :ref:`bl654_dvk` as follows:
DAC output is available on pin 1 of the MCP4725.
Building and Running for BL5340
===============================
The BL5340 DVK PCB contains a MCP4725 to use as a DAC. The sample can be
built and executed for the :ref:`bl5340_dvk` as follows:
.. zephyr-app-commands::
:zephyr-app: samples/drivers/dac
:board: bl5340_dvk_cpuapp
:goals: build flash
:compact:
DAC output is available on pin 1 of the MCP4725.
Sample output
=============

View file

@ -0,0 +1,7 @@
#
# Copyright (c) 2021 Laird Connectivity
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_I2C=y
CONFIG_DAC_MCP4725=y

View file

@ -0,0 +1,7 @@
/ {
zephyr,user {
dac = <&dac0>;
dac-channel-id = <0>;
dac-resolution = <12>;
};
};

View file

@ -6,7 +6,7 @@ tests:
platform_allow: |
arduino_zero frdm_k22f frdm_k64f nucleo_f091rc nucleo_g071rb nucleo_g431rb
nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi nucleo_f429zi bl652_dvk
bl653_dvk bl654_dvk
bl653_dvk bl654_dvk bl5340_dvk_cpuapp
depends_on: dac
harness: console
harness_config:

View file

@ -0,0 +1,7 @@
#
# Copyright (c) 2021 Laird Connectivity
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_I2C=y
CONFIG_DAC_MCP4725=y

View file

@ -39,7 +39,8 @@
#elif defined(CONFIG_BOARD_BL652_DVK) || \
defined(CONFIG_BOARD_BL653_DVK) || \
defined(CONFIG_BOARD_BL654_DVK)
defined(CONFIG_BOARD_BL654_DVK) || \
defined(CONFIG_BOARD_BL5340_DVK_CPUAPP)
/* Note external DAC MCP4725 is not populated on BL652_DVK, BL653_DVK and
* BL654_DVK at factory
*/

View file

@ -4,5 +4,5 @@ tests:
drivers.dac:
platform_allow:
frdm_k22f frdm_k64f nucleo_l073rz nucleo_l152re twr_ke18f nucleo_f767zi
nucleo_f429zi bl652_dvk bl653_dvk bl654_dvk
nucleo_f429zi bl652_dvk bl653_dvk bl654_dvk bl5340_dvk_cpuapp
depends_on: dac

View file

@ -0,0 +1,7 @@
#
# Copyright (c) 2021 Laird Connectivity
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_I2C=y
CONFIG_DAC_MCP4725=y

View file

@ -113,10 +113,12 @@
#elif defined(CONFIG_BOARD_BL652_DVK) || \
defined(CONFIG_BOARD_BL653_DVK) || \
defined(CONFIG_BOARD_BL654_DVK)
defined(CONFIG_BOARD_BL654_DVK) || \
defined(CONFIG_BOARD_BL5340_DVK_CPUAPP)
#include <hal/nrf_saadc.h>
/* DAC output from MCP4725 pin 1
* ADC_1 input read from pin SIO_3
* On BL65x ADC_1 input is read from pin SIO_3
* On BL5340 ADC_1 input is read from pin SIO_5
* Note external DAC MCP4725 is not populated on BL652_DVK, BL653_DVK and
* BL654_DVK at factory
*/
@ -150,7 +152,8 @@ static const struct adc_channel_cfg adc_ch_cfg = {
#if defined(CONFIG_BOARD_BL652_DVK) || \
defined(CONFIG_BOARD_BL653_DVK) || \
defined(CONFIG_BOARD_BL654_DVK)
defined(CONFIG_BOARD_BL654_DVK) || \
defined(CONFIG_BOARD_BL5340_DVK_CPUAPP)
.input_positive = ADC_1ST_CHANNEL_INPUT,
#endif
};

View file

@ -8,4 +8,4 @@ tests:
fixture: dac_adc_loopback
platform_allow: |
frdm_k22f frdm_k64f nucleo_f207zg nucleo_l073rz nucleo_l152re twr_ke18f
bl652_dvk bl653_dvk bl654_dvk
bl652_dvk bl653_dvk bl654_dvk bl5340_dvk_cpuapp